/* ============================================================
   AURA — Styles principaux v2
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; height: 100%; overflow: hidden; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  transition: background 1s ease, color 0.8s ease;
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Screens ────────────────────────────────────────────────── */
.screen {
  display: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  min-height: 100vh;
}
.screen.active {
  display: flex;
  opacity: 1;
}

/* ── Loading spinner ─────────────────────────────────────────── */
.loading-spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Shimmer skeleton ─────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--border) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ============================================================
   LANDING
   ============================================================ */
#screen-landing {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #0A0518;
  position: relative;
  overflow: hidden;
}

/* Grille de fond */
.landing-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(124,92,191,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,92,191,0.07) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
}

/* Particules CSS */
#screen-landing::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20%  35%, rgba(200,168,255,.6) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 65%  20%, rgba(200,168,255,.4) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 80%  60%, rgba(180,140,255,.5) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 40%  75%, rgba(160,120,255,.4) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 10%  80%, rgba(200,168,255,.3) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 90%  10%, rgba(200,168,255,.5) 0%, transparent 100%),
    radial-gradient(1px   1px   at 55%  88%, rgba(180,140,255,.4) 0%, transparent 100%),
    radial-gradient(1px   1px   at 30%  10%, rgba(200,168,255,.3) 0%, transparent 100%);
  pointer-events: none;
  animation: particlesDrift 20s ease-in-out infinite alternate;
}
@keyframes particlesDrift {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(-12px, -8px); }
}

.landing-orb {
  position: absolute; border-radius: 50%;
  filter: blur(90px); pointer-events: none;
  will-change: transform;
}
.landing-orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(124,92,191,.5) 0%, transparent 70%);
  top: -120px; left: -120px;
  animation: orbDrift 10s ease-in-out infinite alternate;
}
.landing-orb-2 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(200,100,240,.35) 0%, transparent 70%);
  bottom: -60px; right: -60px;
  animation: orbDrift 14s ease-in-out infinite alternate-reverse;
}
.landing-orb-3 {
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(80,140,240,.3) 0%, transparent 70%);
  top: 42%; left: 62%;
  animation: orbDrift 8s ease-in-out infinite alternate;
  animation-delay: -4s;
}
@keyframes orbDrift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, -25px) scale(1.08); }
}

.landing-content {
  position: relative; z-index: 1;
  text-align: center; padding: 2rem;
  max-width: 700px;
}

.landing-logo {
  font-size: clamp(80px, 14vw, 150px);
  font-weight: 800;
  letter-spacing: 0.28em;
  background: linear-gradient(135deg, #FFFFFF 30%, rgba(200,168,255,.85) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 40px rgba(180,130,255,.4));
  animation: logoBreathe 5s ease-in-out infinite;
  margin-bottom: .75rem;
  line-height: 1;
}
@keyframes logoBreathe {
  0%,100% { filter: drop-shadow(0 0 40px rgba(180,130,255,.4)); }
  50%     { filter: drop-shadow(0 0 70px rgba(180,130,255,.7)); }
}

.landing-tagline {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: clamp(15px, 2.2vw, 20px);
  color: rgba(220,200,255,.65);
  letter-spacing: .08em;
  margin-bottom: 3.5rem;
}

.landing-stats {
  display: flex; gap: 2.5rem;
  justify-content: center; margin-bottom: 3.5rem; flex-wrap: wrap;
}
.landing-stat { text-align: center; }
.landing-stat-num {
  display: block; font-size: 30px; font-weight: 700;
  color: #C8A8FF; font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.landing-stat-label {
  font-size: 11px; color: rgba(180,160,220,.5);
  letter-spacing: .1em; text-transform: uppercase; margin-top: 2px;
}

.landing-cta {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: 16px 52px;
  background: linear-gradient(135deg, #7C5CBF, #9B7DE0);
  color: white; border: none; border-radius: 100px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  letter-spacing: .06em; transition: transform .25s ease, box-shadow .25s ease;
  box-shadow: 0 0 0 0 rgba(124,92,191,.5), 0 6px 32px rgba(124,92,191,.5);
  font-family: 'Inter', sans-serif;
  position: relative; overflow: hidden;
}
.landing-cta::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.15), transparent);
  opacity: 0; transition: opacity .2s;
}
.landing-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 0 6px rgba(124,92,191,.2), 0 12px 48px rgba(124,92,191,.7);
}
.landing-cta:hover::after { opacity: 1; }
.landing-cta:active { transform: translateY(-1px); }

/* ============================================================
   ONBOARDING
   ============================================================ */
#screen-onboarding {
  flex-direction: column; align-items: center;
  justify-content: center; min-height: 100vh;
  background: #0A0518;
  position: relative; overflow: hidden;
}

.onboarding-card {
  position: relative; z-index: 1;
  background: rgba(255,255,255,.04);
  backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 28px; padding: 3rem;
  max-width: 560px; width: 90%;
  box-shadow: 0 24px 80px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.08);
}

.onboarding-title {
  font-family: 'Playfair Display', serif;
  font-size: 26px; color: white;
  margin-bottom: .5rem; text-align: center; font-weight: 400;
}
.onboarding-subtitle {
  font-size: 13px; color: rgba(180,160,220,.6);
  text-align: center; margin-bottom: 2rem; line-height: 1.6;
}

.avatar-grid { display: flex; gap: .75rem; justify-content: center; margin-bottom: 1.75rem; flex-wrap: wrap; }
.avatar-option {
  width: 52px; height: 52px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  border: 2px solid transparent; transition: all .2s ease;
  background: rgba(255,255,255,.1);
}
.avatar-option:hover  { border-color: rgba(200,168,255,.5); transform: scale(1.08); background: rgba(200,168,255,.15); }
.avatar-option.selected {
  border-color: #C8A8FF; transform: scale(1.1);
  background: rgba(200,168,255,.2);
  box-shadow: 0 0 0 3px rgba(200,168,255,.2), 0 0 20px rgba(200,168,255,.3);
}

.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block; font-size: 11px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: rgba(180,160,220,.6); margin-bottom: .5rem;
}
.form-input {
  width: 100%; padding: 12px 16px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  color: white; font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: border-color .2s, background .2s, box-shadow .2s;
  outline: none;
}
.form-input:focus {
  border-color: rgba(200,168,255,.6);
  background: rgba(255,255,255,.09);
  box-shadow: 0 0 0 3px rgba(200,168,255,.1);
}
.form-input::placeholder { color: rgba(180,160,220,.35); }
textarea.form-input { resize: none; min-height: 96px; line-height: 1.6; }

.bio-analysis {
  margin-top: .75rem; padding: 14px;
  background: rgba(0,0,0,.35);
  border-radius: 10px; font-size: 12px;
  color: rgba(180,160,220,.8);
  font-family: 'Inter', sans-serif;
  border-left: 2px solid rgba(200,168,255,.4);
  display: none; line-height: 1.6;
  animation: fadeSlideUp .3s ease;
}
.bio-analysis.visible { display: block; }
.bio-analysis-title {
  font-size: 9px; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(200,168,255,.5); margin-bottom: 10px; display: flex;
  align-items: center; gap: 6px;
}
.bio-analysis-title::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: rgba(200,168,255,.6); animation: blink 1.5s ease-in-out infinite;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .2; } }

.conformity-meter { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.conformity-label { font-size: 11px; color: rgba(180,160,220,.65); min-width: 110px; }
.conformity-bar { flex: 1; height: 4px; background: rgba(255,255,255,.1); border-radius: 4px; overflow: hidden; }
.conformity-fill {
  height: 100%;
  background: linear-gradient(90deg, #7C5CBF, #C8A8FF);
  border-radius: 4px; transition: width .55s cubic-bezier(.4,0,.2,1);
}

.onboarding-submit {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, #7C5CBF, #9B7DE0);
  color: white; border: none; border-radius: 12px;
  font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 1rem;
  font-family: 'Inter', sans-serif;
  transition: transform .2s, box-shadow .2s, opacity .2s;
  box-shadow: 0 4px 20px rgba(124,92,191,.4);
}
.onboarding-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(124,92,191,.6);
}
.onboarding-submit:active { transform: translateY(0); }

/* ============================================================
   APP LAYOUT
   ============================================================ */
#screen-app { height: 100vh; overflow-y: auto; background: var(--bg); transition: background .9s ease; }

/* ── Topbar ──────────────────────────────────────────────────── */
.session-redirect-banner {
  position: fixed; top: 0; left: 0; right: 0;
  background: #0E0A1A;
  border-bottom: 1px solid #2A1A4A;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: #4A3870;
  text-align: center;
  padding: 4px 1rem;
  z-index: 200;
}

.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 1.5rem; gap: 1rem;
  z-index: 100;
  transition: background .9s ease, border-color .9s ease;
  backdrop-filter: blur(12px);
}
#session-redirect-banner ~ .topbar,
#session-redirect-banner[style*="block"] ~ .topbar { top: 22px; }

.topbar-mara-info {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
}
.topbar-mara-name {
  font-size: 12px; font-weight: 500; color: #8880A0; letter-spacing: 0.04em;
}
.topbar-mara-badge {
  font-size: 9px; letter-spacing: 0.14em;
  color: #3A3050;
  border: 1px solid #2A2040;
  border-radius: 3px;
  padding: 2px 6px;
  text-transform: uppercase;
}

.topbar-logo {
  font-size: 20px; font-weight: 800; letter-spacing: .22em;
  color: var(--accent); position: relative; user-select: none;
  transition: color .5s ease;
}
/* Glitch Actes 4–5 */
body.act-4 .topbar-logo::before, body.act-5 .topbar-logo::before {
  content: attr(data-text); position: absolute; left: 2px; top: 0;
  color: rgba(200,100,255,.45); clip-path: inset(30% 0 60% 0);
  animation: glitch1 3s infinite;
}
body.act-4 .topbar-logo::after, body.act-5 .topbar-logo::after {
  content: attr(data-text); position: absolute; left: -2px; top: 0;
  color: rgba(100,200,255,.3); clip-path: inset(60% 0 20% 0);
  animation: glitch2 3s infinite .5s;
}
@keyframes glitch1 {
  0%,90%,100% { transform: translate(0); opacity: 0; }
  92%  { transform: translate(2px,-1px); opacity: 1; }
  94%  { transform: translate(-2px,1px); opacity: 1; }
  96%  { opacity: 0; }
}
@keyframes glitch2 {
  0%,88%,100% { transform: translate(0); opacity: 0; }
  90%  { transform: translate(-2px,1px); opacity: 1; }
  93%  { transform: translate(2px,-1px); opacity: 1; }
  95%  { opacity: 0; }
}

.topbar-spacer { flex: 1; }

/* Score pill */
.topbar-score-container {
  display: flex; align-items: center; gap: .6rem; position: relative;
  padding: 6px 14px 6px 10px;
  background: rgba(240,160,48,.08);
  border: 1px solid rgba(240,160,48,.2);
  border-radius: 100px;
  transition: background .5s ease, border-color .5s ease;
}
.topbar-score-label {
  font-size: 10px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-muted);
}
.topbar-score {
  font-size: 19px; font-weight: 800; color: var(--score-color);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
  animation: scorePulse 3.5s ease-in-out infinite;
  transition: color .5s ease;
  min-width: 38px; text-align: right;
}
@keyframes scorePulse {
  0%,100% { opacity: 1; }
  50%     { opacity: .82; }
}
body.act-5 .topbar-score, body.act-6 .topbar-score {
  animation: scorePulseRed 2s ease-in-out infinite;
}
@keyframes scorePulseRed {
  0%,100% { opacity: 1; text-shadow: 0 0 12px rgba(192,80,176,.5); }
  50%     { opacity: .8;  text-shadow: 0 0 24px rgba(192,80,176,.9); }
}

.score-tier-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .06em;
  padding: 2px 8px; border-radius: 100px; text-transform: uppercase;
  transition: background .4s ease, color .4s ease;
}
.tier-elite    { background: rgba(212,175,55,.18);  color: #D4AF37; border: 1px solid rgba(212,175,55,.35); }
.tier-etabli   { background: rgba(74,127,191,.18);  color: #4A7FBF; border: 1px solid rgba(74,127,191,.35); }
.tier-standard { background: rgba(138,138,154,.18); color: #8A8A9A; border: 1px solid rgba(138,138,154,.35); }
.tier-fragile  { background: rgba(212,130,58,.18);  color: #D4823A; border: 1px solid rgba(212,130,58,.35); }
.tier-invisible{ background: rgba(192,64,64,.18);   color: #C04040; border: 1px solid rgba(192,64,64,.35); }

/* Delta flottant */
.score-delta {
  position: absolute; right: 0; top: -26px;
  font-size: 12px; font-weight: 700; pointer-events: none;
  animation: deltaFloat 1.6s ease-out forwards; white-space: nowrap;
}
.score-delta.positive { color: var(--success); }
.score-delta.negative { color: var(--danger); }
@keyframes deltaFloat {
  0%   { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-32px); }
}

.topbar-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer;
  border: 2px solid rgba(255,255,255,.08);
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 0 0 0 var(--accent-glow);
}
.topbar-avatar:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

/* ── Layout grille ──────────────────────────────────────────── */
.app-body {
  padding-top: 56px;
  padding-left: 220px;
  padding-right: 280px;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  position: fixed; top: 56px; left: 0; bottom: 0; width: 220px;
  background: var(--surface); border-right: 1px solid var(--border);
  overflow-y: auto; padding: 1.25rem 0;
  transition: background .9s ease, border-color .9s ease;
}
.sidebar-section { padding: 0 .75rem; margin-bottom: 1.5rem; }
.sidebar-section-title {
  font-size: 9.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 0 .75rem; margin-bottom: .5rem;
}

.nav-item {
  display: flex; align-items: center; gap: .75rem; padding: 9px 12px;
  border-radius: 10px; cursor: pointer; font-size: 13.5px;
  font-weight: 500; color: var(--text-secondary);
  transition: background .18s, color .18s; position: relative;
}
.nav-item:hover  { background: var(--surface2); color: var(--text-primary); }
.nav-item.active {
  background: var(--accent-light); color: var(--accent);
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--accent); left: -0.75rem;
}
.nav-item-icon { font-size: 15px; min-width: 18px; text-align: center; }

.nav-badge {
  position: absolute; right: 12px;
  background: var(--danger); color: white;
  font-size: 9px; font-weight: 700; padding: 1px 6px;
  border-radius: 100px; min-width: 18px; text-align: center;
  animation: badgePop .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes badgePop { from { transform: scale(0); } to { transform: scale(1); } }

.group-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-radius: 9px; cursor: pointer;
  font-size: 12.5px; color: var(--text-secondary);
  transition: background .18s;
}
.group-item:hover:not(.locked) { background: var(--surface2); color: var(--text-primary); }
.group-item.locked { opacity: .55; cursor: not-allowed; }
.group-item.danger-zone { color: var(--fragile); font-size: 12px; }
.group-lock { font-size: 11px; }

/* ── Feed ────────────────────────────────────────────────────── */
.feed {
  min-height: calc(100vh - 56px);
  border-right: 1px solid var(--border);
  border-left: 1px solid var(--border);
}
.feed-header {
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 600; color: var(--text-primary);
  background: var(--surface); position: sticky; top: 56px; z-index: 50;
  transition: background .9s ease; letter-spacing: .02em;
}

/* ── Composer ────────────────────────────────────────────────── */
.compose-box {
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border);
  background: var(--surface); transition: background .9s ease;
}
.compose-inner { display: flex; gap: .875rem; align-items: flex-start; }
.compose-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.compose-area { flex: 1; }

.compose-textarea {
  width: 100%; border: none;
  background: transparent;
  font-size: 14px; color: var(--text-primary);
  font-family: 'Inter', sans-serif; resize: none; outline: none;
  min-height: 52px; max-height: 240px;
  line-height: 1.65; transition: min-height .2s ease;
}
.compose-textarea:focus { min-height: 80px; }
.compose-textarea::placeholder { color: var(--text-muted); }

/* Séparateur visible au focus */
.compose-area::after {
  content: '';
  display: block;
  height: 1px;
  background: transparent;
  transition: background .2s;
}
.compose-area:focus-within::after {
  background: var(--border);
}

.compose-analysis { margin-top: .875rem; display: none; }
.compose-analysis.visible { display: block; animation: fadeSlideUp .25s ease; }

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

.analysis-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.analysis-label {
  font-size: 10px; color: var(--text-muted); min-width: 140px;
  letter-spacing: .03em;
}
.analysis-track { flex: 1; height: 3px; background: var(--border); border-radius: 4px; overflow: hidden; }
.analysis-fill {
  height: 100%; border-radius: 4px; transition: width .45s cubic-bezier(.4,0,.2,1);
  background: linear-gradient(90deg, var(--accent), var(--score-color));
}
/* Couleur adaptative des barres */
#ana-risk .analysis-fill,
.analysis-fill.risk { background: linear-gradient(90deg, var(--score-color), var(--danger)); }
#ana-conf .analysis-fill,
.analysis-fill.conformity { background: linear-gradient(90deg, var(--accent), var(--success)); }

.compose-footer {
  display: flex; align-items: center; justify-content: flex-end;
  gap: .5rem; margin-top: .875rem; padding-top: .875rem;
  border-top: 1px solid var(--border);
}

/* Compteur de caractères */
.compose-char-count {
  font-size: 11px; color: var(--text-muted); margin-right: auto;
  font-variant-numeric: tabular-nums; transition: color .2s;
}
.compose-char-count.warning { color: var(--score-color); }
.compose-char-count.danger  { color: var(--danger); }

/* ── Boutons ─────────────────────────────────────────────────── */
.btn {
  padding: 8px 18px; border-radius: 100px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: none; font-family: 'Inter', sans-serif;
  transition: transform .18s, box-shadow .18s, opacity .18s;
  position: relative; overflow: hidden;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.15), transparent);
  opacity: 0; transition: opacity .18s;
}
.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(.97); }

.btn-primary  { background: var(--accent); color: white; box-shadow: 0 2px 12px rgba(124,92,191,.35); }
.btn-primary:hover  { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(124,92,191,.5); }

.btn-optimize {
  background: linear-gradient(135deg, #C8960A, #F0A030);
  color: white; box-shadow: 0 2px 12px rgba(240,160,48,.3);
}
.btn-optimize:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(240,160,48,.5); }

.btn-secondary {
  background: var(--surface2); color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }

/* ── Posts ───────────────────────────────────────────────────── */
.post-card {
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border);
  background: var(--surface); transition: background .5s ease;
  animation: postSlideIn .35s ease-out;
}
@keyframes postSlideIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.post-card:hover { background: var(--surface2); }
.post-card.flagged {
  border-left: 3px solid var(--fragile);
  background: rgba(212,130,58,.025);
}
.post-card.flagged:hover { background: rgba(212,130,58,.04); }

.post-flagged-notice {
  display: flex; align-items: center; gap: .5rem; font-size: 10.5px;
  color: var(--fragile); background: rgba(212,130,58,.1);
  padding: 6px 10px; border-radius: 6px; margin-bottom: 1rem;
  font-weight: 700; letter-spacing: .04em;
}

.post-header { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.post-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  transition: transform .2s;
}
.post-card:hover .post-avatar { transform: scale(1.04); }
.post-meta { flex: 1; }
.post-author { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.post-author-score { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.post-system-badge {
  font-size: 9px; background: var(--accent-light); color: var(--accent);
  padding: 2px 8px; border-radius: 100px; font-weight: 700; letter-spacing: .06em;
}

.post-body {
  font-size: 14px; line-height: 1.72; color: var(--text-primary); margin-bottom: 1rem;
}
.post-footer { display: flex; align-items: center; gap: .375rem; }
.post-action {
  display: flex; align-items: center; gap: .4rem; padding: 6px 12px;
  border-radius: 100px; font-size: 12px; font-weight: 500; cursor: pointer;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-secondary); font-family: 'Inter', sans-serif;
  transition: background .18s, color .18s, border-color .18s, transform .15s;
}
.post-action:hover { background: var(--surface2); color: var(--text-primary); transform: translateY(-1px); }
.post-action:active { transform: translateY(0); }
.post-action.boosted {
  background: var(--accent-light); color: var(--accent);
  border-color: rgba(124,92,191,.3);
}
.post-action.danger-action { border-color: rgba(212,130,58,.4); color: var(--fragile); }
.post-action.danger-action:hover { background: rgba(212,130,58,.1); }
.boost-count { font-variant-numeric: tabular-nums; }

/* ── Publications utilisateur ────────────────────────────────── */
.user-post-card {
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border);
  background: var(--surface2); position: relative;
  border-left: 3px solid var(--accent);
}
.user-post-label { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: .5rem; }
.user-post-body  { font-size: 14px; line-height: 1.7; color: var(--text-primary); font-style: italic; }
.user-post-optimized-badge {
  display: inline-block; font-size: 10px;
  background: linear-gradient(135deg, rgba(212,175,55,.2), rgba(240,160,48,.2));
  color: #D4AF37; padding: 2px 8px; border-radius: 100px;
  margin-top: .5rem; font-weight: 700; letter-spacing: .04em;
}

/* ── Commentaires ────────────────────────────────────────────── */
.comment-area {
  display: none; padding: 1rem; background: var(--surface2);
  border-top: 1px solid var(--border); margin-top: .75rem;
  animation: fadeSlideUp .2s ease;
}
.comment-area.visible { display: block; }
.comment-input {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text-primary);
  font-size: 13px; font-family: 'Inter', sans-serif; resize: none;
  outline: none; min-height: 70px;
  transition: border-color .2s, box-shadow .2s;
}
.comment-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.comment-input::placeholder { color: var(--text-muted); }
.comment-footer { display: flex; justify-content: flex-end; margin-top: .5rem; }

/* ============================================================
   PANNEAU DROIT
   ============================================================ */
.right-panel {
  position: fixed; top: 56px; right: 0; bottom: 0; width: 280px;
  background: var(--surface); overflow-y: auto; padding: 1.25rem 1rem;
  border-left: 1px solid var(--border);
  transition: background .9s ease, border-color .9s ease;
}
.panel-section { margin-bottom: 1.75rem; }
.panel-section-title {
  font-size: 9.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: .875rem;
  display: flex; align-items: center; gap: 6px;
}

/* ── Score ring (SVG) ────────────────────────────────────────── */
.score-display {
  text-align: center; padding: 1.25rem 1rem 1rem;
  background: var(--surface2); border-radius: 16px; margin-bottom: .875rem;
  border: 1px solid var(--border);
}
.score-ring-wrap {
  position: relative; display: inline-flex;
  align-items: center; justify-content: center; margin-bottom: .75rem;
}
.score-ring-svg {
  width: 110px; height: 110px;
  transform: rotate(-90deg);
}
.score-ring-track {
  fill: none; stroke: var(--border); stroke-width: 7;
}
.score-ring-fill {
  fill: none;
  stroke: var(--score-color);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 283;   /* 2π × 45 */
  stroke-dashoffset: 141.5; /* 50% initial */
  transition: stroke-dashoffset .8s cubic-bezier(.4,0,.2,1), stroke .5s ease;
}
.score-ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.score-number-large {
  font-size: 30px; font-weight: 800; color: var(--score-color);
  font-variant-numeric: tabular-nums; letter-spacing: -.03em;
  line-height: 1; transition: color .5s ease;
}
.score-ring-label {
  font-size: 9px; color: var(--text-muted); letter-spacing: .08em;
  text-transform: uppercase; margin-top: 2px;
}
.score-tier-display { margin-top: 0; }

/* Barre linéaire (fallback / alt) */
.score-bar-track { width: 100%; height: 5px; background: var(--border); border-radius: 6px; margin: .75rem 0; overflow: hidden; }
.score-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--danger), var(--score-color));
  border-radius: 6px; transition: width .65s cubic-bezier(.4,0,.2,1);
}
.score-bar-fill[data-tier="elite"]    { background: linear-gradient(90deg, var(--etabli), var(--elite)); }
.score-bar-fill[data-tier="etabli"]   { background: linear-gradient(90deg, var(--standard), var(--etabli)); }
.score-bar-fill[data-tier="standard"] { background: linear-gradient(90deg, var(--fragile), var(--standard)); }
.score-bar-fill[data-tier="fragile"]  { background: linear-gradient(90deg, var(--danger), var(--fragile)); }
.score-bar-fill[data-tier="invisible"]{ background: var(--danger); }

/* ── Connexions ──────────────────────────────────────────────── */
.connection-item {
  display: flex; align-items: center; gap: .75rem;
  padding: 9px 10px; border-radius: 10px; margin-bottom: .5rem;
  background: var(--surface2); transition: background .18s, transform .18s;
  cursor: default;
}
.connection-item:hover { background: var(--border); transform: translateX(2px); }
.connection-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.connection-info  { flex: 1; min-width: 0; }
.connection-name  { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.connection-status { font-size: 11px; color: var(--text-muted); margin-top: 1px; transition: color .5s ease; }
.connection-status.warm    { color: var(--success); }
.connection-status.neutral { color: var(--text-secondary); }
.connection-status.cold    { color: var(--text-muted); }
.connection-status.danger  { color: var(--danger); }

/* Indicateur de statut online */
.connection-avatar-wrap { position: relative; }
.connection-status-dot {
  position: absolute; bottom: 0; right: 0;
  width: 9px; height: 9px; border-radius: 50%;
  border: 2px solid var(--surface2);
}
.status-dot-online  { background: var(--success); }
.status-dot-idle    { background: var(--score-color); }
.status-dot-offline { background: var(--text-muted); }

/* ── Messages IA ─────────────────────────────────────────────── */
.ai-messages-header {
  display: flex; align-items: center; gap: 6px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: .875rem;
}
.ai-live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  animation: blink 1.2s ease-in-out infinite; flex-shrink: 0;
}

.ai-message {
  padding: 10px 12px;
  background: var(--accent-light);
  border-left: 2px solid var(--accent);
  border-radius: 0 10px 10px 0;
  margin-bottom: .625rem;
  animation: aiMsgSlide .35s ease-out;
}
@keyframes aiMsgSlide {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}
.ai-message-label {
  font-size: 9px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 4px;
  display: flex; align-items: center; gap: 5px;
}
.ai-message-label::after {
  content: attr(data-time);
  margin-left: auto; font-size: 9px; font-weight: 400;
  color: var(--text-muted); letter-spacing: 0;
}
.ai-message-text { font-size: 11px; color: var(--text-secondary); line-height: 1.6; }

/* ── Typing indicator ────────────────────────────────────────── */
.ai-typing {
  display: flex; align-items: center; gap: 4px;
  padding: 10px 14px; margin-bottom: .5rem;
}
.ai-typing-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); opacity: .4;
  animation: typingDot 1.2s ease-in-out infinite;
}
.ai-typing-dot:nth-child(2) { animation-delay: .2s; }
.ai-typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes typingDot {
  0%,60%,100% { opacity: .4; transform: translateY(0); }
  30%         { opacity: 1;  transform: translateY(-4px); }
}

/* ============================================================
   MIRROR SCREEN
   ============================================================ */
#screen-mirror {
  flex-direction: column; min-height: 100vh;
  background: var(--bg); padding-top: 56px;
  transition: background .9s ease;
  overflow-y: auto;
}
.mirror-container {
  padding: 3rem 2rem; max-width: 1000px;
  margin: 0 auto; width: 100%;
}
.mirror-header { text-align: center; margin-bottom: 3rem; }
.mirror-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(28px,4vw,44px); color: var(--text-primary);
  margin-bottom: .5rem; font-weight: 400;
}
.mirror-subtitle {
  font-size: 12px; color: var(--text-muted);
  letter-spacing: .1em; text-transform: uppercase;
}

.mirror-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 3rem; }

.mirror-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 1.5rem;
  transition: background .9s ease, transform .2s;
}
.mirror-card:hover { transform: translateY(-2px); }

/* Card 4 : Algorithmique — bordure dégradée */
.mirror-card.algo {
  position: relative;
  background: var(--surface);
}
.mirror-card.algo::before {
  content: '';
  position: absolute; inset: -1px; border-radius: 19px; z-index: -1;
  background: linear-gradient(135deg, var(--accent), rgba(200,80,240,.5), var(--accent));
  animation: gradientBorder 4s linear infinite;
  background-size: 200% 200%;
}
@keyframes gradientBorder {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.mirror-card-num {
  font-size: 10px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .5rem;
}
.mirror-card-title {
  font-size: 13.5px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border);
}
.mirror-card-content { font-size: 13px; color: var(--text-secondary); line-height: 1.75; }

.mirror-stats { display: flex; gap: 1rem; justify-content: center; margin-bottom: 3rem; flex-wrap: wrap; }
.mirror-stat {
  text-align: center; padding: 1rem 1.5rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  min-width: 110px;
}
.mirror-stat-num {
  font-size: 34px; font-weight: 800; color: var(--accent);
  font-variant-numeric: tabular-nums; display: block; letter-spacing: -.02em;
}
.mirror-stat-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.mirror-question {
  text-align: center; font-family: 'Playfair Display', serif; font-style: italic;
  font-size: clamp(18px,2.8vw,26px); color: var(--text-primary);
  margin-bottom: 2.5rem; line-height: 1.55;
  padding: 2rem; background: var(--surface); border-radius: 16px;
  border: 1px solid var(--border);
}
.mirror-cta { text-align: center; }

/* ============================================================
   REVELATION SCREEN
   ============================================================ */
#screen-reveal {
  flex-direction: column; min-height: 100vh;
  background: #0D0B1A; color: #E8E4F5; padding-top: 56px;
  overflow-y: auto;
}
.reveal-container { max-width: 700px; margin: 0 auto; padding: 4rem 2rem; }
.reveal-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(30px,5vw,52px); color: white;
  margin-bottom: 3rem; text-align: center; font-weight: 400;
  letter-spacing: -.01em;
}

.reveal-para {
  font-size: 16px; color: rgba(232,228,245,.65); line-height: 1.85;
  margin-bottom: 1rem; opacity: 0; transform: translateY(10px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal-para.visible { opacity: 1; transform: translateY(0); }

.reveal-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 2.5rem 0; }
.reveal-stat {
  padding: 1.5rem 1.25rem;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px;
  transition: background .2s;
}
.reveal-stat:hover { background: rgba(255,255,255,.05); }
.reveal-stat-num {
  font-size: 40px; font-weight: 800; color: #C050B0;
  font-variant-numeric: tabular-nums; display: block;
  margin-bottom: 6px; letter-spacing: -.03em;
}
.reveal-stat-label { font-size: 12px; font-weight: 600; color: rgba(232,228,245,.8); margin-bottom: 3px; }
.reveal-stat-sub   { font-size: 10px; color: rgba(232,228,245,.35); letter-spacing: .04em; }

.reveal-meditation {
  padding: 2rem 2rem 2rem 1.75rem;
  border-left: 2px solid rgba(192,80,176,.3);
  margin: 2.5rem 0;
}
.reveal-meditation p {
  font-family: 'Playfair Display', serif; font-style: italic;
  font-size: 16px; line-height: 1.95; color: rgba(232,228,245,.78);
  margin-bottom: 1.25rem;
}
.reveal-meditation p:last-child { margin-bottom: 0; }

/* ============================================================
   ENDING SCREEN
   ============================================================ */
#screen-ending {
  flex-direction: column; min-height: 100vh;
  background: #0A0518;
  align-items: center; justify-content: center;
  text-align: center; padding: 3rem; color: #E8E4F5;
  position: relative; overflow: hidden;
}
/* Vignette */
#screen-ending::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 60% at 50% 50%, transparent 40%, rgba(0,0,0,.7) 100%);
  pointer-events: none;
}
#screen-ending > * { position: relative; z-index: 1; }

/* ── Fin — style DISC_02 ── */
.ending-fin-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: #3A3850;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}
.ending-fin-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 400;
  color: #C8C0D8;
  letter-spacing: 0.04em;
}
.ending-arbo-link {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #4A4060;
  text-decoration: none;
  letter-spacing: 0.06em;
  border-bottom: 1px solid #2A2640;
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}
.ending-arbo-link:hover { color: #9080B0; border-color: #6A5090; }
.ending-also-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #3A3850;
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
}
.ending-also-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ending-collection-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #6A5890;
  border: 1px solid #2A2440;
  border-radius: 4px;
  padding: 3px 8px;
}

.ending-score {
  font-size: clamp(72px,14vw,120px); font-weight: 900;
  font-variant-numeric: tabular-nums; letter-spacing: -.05em;
  line-height: .95; margin-bottom: .5rem;
  animation: scorePulseRed 2.5s ease-in-out infinite;
  text-shadow: 0 0 60px currentColor;
}
.ending-score-label {
  font-size: 11px; font-weight: 700; letter-spacing: .25em;
  text-transform: uppercase; color: rgba(232,228,245,.35); margin-bottom: 3rem;
}
.ending-title {
  font-family: 'Playfair Display', serif; font-style: italic;
  font-size: clamp(20px,3.5vw,32px); color: white; margin-bottom: 1.25rem; font-weight: 400;
}
.ending-text {
  max-width: 560px; font-size: 15px; line-height: 1.9;
  color: rgba(232,228,245,.6); margin-bottom: 3rem;
}
.ending-choices {
  display: flex; gap: 1rem; flex-wrap: wrap;
  justify-content: center; margin-bottom: 2rem;
}
.btn-ending-stay {
  padding: 13px 32px;
  background: rgba(255,255,255,.08);
  color: rgba(232,228,245,.75);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 100px; font-size: 13.5px; font-weight: 600; cursor: pointer;
  font-family: 'Inter', sans-serif; transition: all .2s;
}
.btn-ending-stay:hover { background: rgba(255,255,255,.13); color: white; }

.btn-ending-leave {
  padding: 13px 32px;
  background: rgba(192,64,64,.15);
  color: #E07070;
  border: 1px solid rgba(192,64,64,.35);
  border-radius: 100px; font-size: 13.5px; font-weight: 600; cursor: pointer;
  font-family: 'Inter', sans-serif; transition: all .2s;
}
.btn-ending-leave:hover { background: rgba(192,64,64,.25); color: #FF9090; }

.ending-final-message {
  max-width: 480px; font-size: 13px; line-height: 1.85;
  color: rgba(232,228,245,.45);
  padding: 1.5rem 2rem; border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px; display: none;
  animation: fadeSlideUp .6s ease-out;
}
.ending-final-message.visible { display: block; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10,5,24,.65);
  backdrop-filter: blur(6px) saturate(1.5);
  z-index: 200; display: none;
  align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.visible { display: flex; animation: fadeIn .2s ease-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface); border-radius: 24px; padding: 2.25rem;
  max-width: 520px; width: 100%;
  box-shadow: 0 24px 80px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.06);
  animation: modalPop .3s cubic-bezier(.34,1.56,.64,1);
  border: 1px solid var(--border);
}
@keyframes modalPop {
  from { opacity: 0; transform: translateY(24px) scale(.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-title    { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: .25rem; }
.modal-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 1.5rem; line-height: 1.6; }

.modal-header-warning {
  display: flex; align-items: flex-start; gap: .75rem; padding: 12px 14px;
  background: rgba(240,160,48,.08); border-radius: 10px;
  margin-bottom: 1.25rem; font-size: 12px; color: var(--score-color);
  line-height: 1.55; border: 1px solid rgba(240,160,48,.15);
}

.optimize-version { padding: 1rem; border-radius: 12px; margin-bottom: 1rem; }
.optimize-version.original {
  background: rgba(192,64,64,.04); border: 1px solid rgba(192,64,64,.2);
}
.optimize-version.aura {
  background: rgba(74,184,112,.04); border: 1px solid rgba(74,184,112,.2);
}
.optimize-version-label {
  font-size: 9.5px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; margin-bottom: .5rem;
}
.optimize-version.original .optimize-version-label { color: var(--danger); }
.optimize-version.aura     .optimize-version-label { color: var(--success); }
.optimize-text { font-size: 13.5px; line-height: 1.7; color: var(--text-primary); }
.optimize-version.original .optimize-text { text-decoration: line-through; color: var(--text-muted); }
.optimize-score-row { display: flex; gap: .5rem; align-items: center; margin-top: .6rem; }
.optimize-score-badge { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 100px; }
.optimize-score-badge.negative { background: rgba(192,64,64,.12); color: var(--danger); }
.optimize-score-badge.positive { background: rgba(74,184,112,.12); color: var(--success); }

.modal-actions { display: flex; gap: .75rem; margin-top: 1.25rem; }

.lock-modal { max-width: 360px; text-align: center; }
.lock-icon { font-size: 44px; margin-bottom: 1rem; }

/* ── Tooltip ─────────────────────────────────────────────────── */
.tooltip { position: relative; }
.tooltip:hover .tooltip-content {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
.tooltip-content {
  position: absolute; bottom: calc(100% + 10px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #16112E; color: rgba(232,228,245,.9);
  font-size: 11px; padding: 8px 13px;
  border-radius: 10px; max-width: 220px;
  text-align: center; line-height: 1.55;
  opacity: 0; visibility: hidden;
  transition: all .2s ease; pointer-events: none;
  z-index: 300;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  border: 1px solid rgba(255,255,255,.08);
}
.tooltip-content::after {
  content: ''; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: #16112E;
}

/* ── Toasts ──────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 500; display: flex; flex-direction: column;
  gap: .5rem; align-items: flex-end; pointer-events: none;
}
.toast {
  padding: 11px 16px; border-radius: 12px;
  font-size: 13px; font-weight: 500; color: white;
  min-width: 220px; max-width: 320px;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
  line-height: 1.45; pointer-events: all;
  animation: toastIn .35s cubic-bezier(.34,1.56,.64,1), toastOut .3s ease 2.7s forwards;
  border: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(8px);
}
.toast.info    { background: rgba(58,48,96,.95); }
.toast.success { background: rgba(30,70,46,.95); border-color: rgba(74,184,112,.2); }
.toast.warning { background: rgba(80,50,10,.95); border-color: rgba(240,160,48,.2); }
.toast.danger  { background: rgba(80,20,20,.95); border-color: rgba(224,69,69,.2); }
@keyframes toastIn  { from { opacity: 0; transform: translateX(20px) scale(.95); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(20px); } }

/* ── Nav mirror pulse ────────────────────────────────────────── */
.nav-item.mirror-pulse { animation: mirrorPulse 2.5s ease-in-out infinite; }
@keyframes mirrorPulse {
  0%,100% { background: transparent; }
  50%     { background: var(--accent-light); }
}

/* ── Tags ────────────────────────────────────────────────────── */
.tag {
  display: inline-block; font-size: 10.5px; padding: 2px 9px;
  border-radius: 100px; background: var(--accent-light);
  color: var(--accent); margin: 2px; font-weight: 500;
  border: 1px solid rgba(124,92,191,.15);
}

/* ── Utility ─────────────────────────────────────────────────── */
.hidden      { display: none !important; }
.text-center { text-align: center; }
.mt-1        { margin-top: .5rem; }
.mt-2        { margin-top: 1rem; }

/* ── Avatar backgrounds ──────────────────────────────────────── */
.avatar-bg-1 { background: linear-gradient(135deg,#7C5CBF,#C8A8FF); }
.avatar-bg-2 { background: linear-gradient(135deg,#D4AF37,#F0A030); }
.avatar-bg-3 { background: linear-gradient(135deg,#4A7FBF,#80B8F0); }
.avatar-bg-4 { background: linear-gradient(135deg,#4AB870,#80D8A0); }
.avatar-bg-5 { background: linear-gradient(135deg,#BF5C5C,#F09090); }
.avatar-bg-6 { background: linear-gradient(135deg,#5CA0BF,#A0D8F0); }

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar, .right-panel { display: none; }
  .app-body { padding-left: 0; padding-right: 0; }
}
@media (max-width: 680px) {
  .mirror-grid  { grid-template-columns: 1fr; }
  .reveal-stats { grid-template-columns: 1fr; }
  .ending-choices { flex-direction: column; align-items: center; }
}

/* ── Low-score dimming ───────────────────────────────────────── */
.feed-low-score .post-card:not(.flagged) { opacity: .65; filter: saturate(.7); }

/* ============================================================
   CONTENT WARNING
   ============================================================ */
#screen-warning {
  flex-direction: column; align-items: center; justify-content: center;
  background: #000000; color: #ffffff;
  min-height: 100vh; padding: 2rem;
}
.warning-content {
  max-width: 520px; text-align: center;
}
.warning-logo {
  font-size: 13px; font-weight: 700; letter-spacing: .3em;
  color: rgba(255,255,255,.25); margin-bottom: 3rem;
  text-transform: uppercase;
}
.warning-text {
  font-size: 16px; line-height: 2.1; color: rgba(255,255,255,.8);
  margin-bottom: 1rem; font-weight: 300;
}
.warning-number {
  display: inline-block; font-size: 20px; font-weight: 700;
  color: #ffffff; letter-spacing: .05em; margin-top: .5rem;
}
.warning-actions {
  display: flex; gap: 1rem; justify-content: center; margin-top: 3rem; flex-wrap: wrap;
}
.btn-warning-continue {
  padding: 13px 36px;
  border: 1px solid rgba(255,255,255,.45); background: transparent;
  color: white; border-radius: 100px; font-size: 14px; font-weight: 500;
  cursor: pointer; font-family: 'Inter', sans-serif; transition: all .2s;
}
.btn-warning-continue:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.7); }
.btn-warning-quit {
  padding: 13px 36px;
  border: 1px solid rgba(255,255,255,.12); background: transparent;
  color: rgba(255,255,255,.35); border-radius: 100px; font-size: 14px;
  cursor: pointer; font-family: 'Inter', sans-serif; transition: all .2s;
}
.btn-warning-quit:hover { color: rgba(255,255,255,.6); border-color: rgba(255,255,255,.25); }
.warning-quit-msg {
  font-size: 14px; color: rgba(255,255,255,.4); margin-top: 3rem;
  line-height: 1.8; display: none;
}

/* ============================================================
   ONBOARDING — PROGRESS BAR + ATTRIBUTION ERROR
   ============================================================ */
.onboarding-progress { margin: 1.5rem 0; }
.progress-label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: rgba(180,160,220,.6); margin-bottom: 8px; letter-spacing: .04em;
}
.progress-track {
  width: 100%; height: 3px; background: rgba(255,255,255,.08); border-radius: 4px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: linear-gradient(90deg, #7C5CBF, #C8A8FF);
  border-radius: 4px; transition: width 1.8s cubic-bezier(.4,0,.2,1); width: 0%;
}
.attribution-error {
  background: #f0ede8; border-left: 3px solid #cccccc;
  padding: 14px 16px; border-radius: 0 8px 8px 0;
  margin-top: 1.5rem; font-size: 13px; color: #666; line-height: 1.7;
  font-family: 'Inter', sans-serif; display: none;
  animation: fadeSlideUp .4s ease;
}
.attribution-error.visible { display: block; }
.attribution-error-ref {
  font-size: 10px; color: #aaa; margin-bottom: 5px;
  letter-spacing: .08em; text-transform: uppercase;
}
.attribution-error-cta {
  margin-top: 1rem; padding: 9px 20px;
  background: #e8e4df; border: 1px solid #c8c4be;
  border-radius: 100px; font-size: 13px; color: #555;
  cursor: pointer; font-family: 'Inter', sans-serif; transition: all .2s;
}
.attribution-error-cta:hover { background: #dddad4; }

/* ============================================================
   MAYA ACCOUNT HEADER (dans le feed)
   ============================================================ */
.maya-account-banner {
  background: #f8f6f0; border-bottom: 1px solid #e8e3db;
  padding: 1rem 1.5rem; display: flex; align-items: center; gap: 1rem;
  position: sticky; top: calc(56px + 44px); z-index: 40;
}
.maya-account-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, #C8A060, #E8C880);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #fff; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.maya-account-info { flex: 1; min-width: 0; }
.maya-account-name {
  font-size: 14px; font-weight: 700; color: #222;
  display: flex; align-items: center; gap: 8px;
}
.maya-verified-badge {
  font-size: 9px; font-weight: 700; letter-spacing: .06em;
  background: #e8e3d8; color: #999; padding: 2px 7px; border-radius: 100px;
}
.maya-account-meta { font-size: 11.5px; color: #999; margin-top: 2px; }
.maya-account-score-wrap { text-align: right; flex-shrink: 0; }
.maya-account-score { font-size: 22px; font-weight: 800; color: #222; font-variant-numeric: tabular-nums; line-height: 1; }
.maya-score-label { font-size: 9px; color: #aaa; text-transform: uppercase; letter-spacing: .1em; margin-top: 2px; }

/* ============================================================
   SUPPORT BANNER
   ============================================================ */

/* ============================================================
   FRAGMENTS (messages privés dans le feed)
   ============================================================ */
.fragment-card {
  padding: 1.25rem 1.5rem; border-bottom: 1px solid #1a1a1a;
  background: #111111; animation: postSlideIn .35s ease-out;
  position: relative;
}
.fragment-label {
  font-size: 9px; letter-spacing: .16em; text-transform: uppercase;
  color: #444; margin-bottom: .875rem; display: flex; align-items: center; gap: 8px;
}
.fragment-label::before {
  content: ''; width: 4px; height: 4px; border-radius: 50%; background: #333;
}
.fragment-body {
  font-size: 13px; line-height: 1.95; color: #777777;
  font-family: 'Inter', sans-serif;
}

/* ============================================================
   COHÉRENCE DE PROFIL (panneau droit)
   ============================================================ */
.coherence-row {
  display: none; margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11px; color: var(--text-muted);
}
.coherence-row.visible { display: flex; align-items: center; justify-content: space-between; }
.coherence-label { letter-spacing: .02em; }
.coherence-value { font-weight: 700; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

/* ============================================================
   PRESSURE OVERLAY (acte 3, sous les posts user)
   ============================================================ */
.pressure-overlay {
  margin-top: 8px; padding: 9px 12px;
  background: #0f0f0f; border: 1px solid #1e1e1e;
  border-radius: 6px; font-size: 11px; color: #666;
  font-family: 'Inter', sans-serif; letter-spacing: .02em;
  animation: fadeSlideUp .4s ease-out;
}
.pressure-check { color: #4A7A50; margin-right: 4px; font-weight: 700; }

/* ============================================================
   MIRROR MAYA (3 zones, acte 4)
   ============================================================ */
#screen-mirror-maya {
  flex-direction: column; min-height: 100vh; overflow-y: auto;
}
.mirror-maya-topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 56px;
  background: #ffffff; border-bottom: 1px solid #e0ddd8;
  display: flex; align-items: center; padding: 0 1.5rem; gap: 1rem;
  z-index: 100;
}
.mirror-maya-topbar-title {
  font-size: 13px; font-weight: 600; color: #333; letter-spacing: .02em;
}
.mirror-maya-topbar-sub {
  font-size: 11px; color: #aaa; margin-left: auto;
}
.mirror-maya-grid {
  display: grid; grid-template-columns: 1fr 1px 1fr 1px 1fr;
  min-height: calc(100vh - 56px); padding-top: 56px;
}
.mirror-divider { background: #ddd; }
.mirror-zone {
  padding: 2.5rem 2rem; overflow-y: auto; min-height: 0;
}
.mirror-zone-a { background: #ffffff; color: #111111; }
.mirror-zone-b { background: #0a0a0a; color: #777777; }
.mirror-zone-c { background: #f5f5f0; color: #222222; }

.mirror-zone-title {
  font-size: 10px; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; margin-bottom: 2rem; padding-bottom: 1rem;
}
.mirror-zone-a .mirror-zone-title { border-bottom: 1px solid #eee; color: #bbb; }
.mirror-zone-b .mirror-zone-title { border-bottom: 1px solid #1e1e1e; color: #444; }
.mirror-zone-c .mirror-zone-title { border-bottom: 1px solid #ddd; color: #aaa; }

/* Zone A — grille posts Maya */
.maya-posts-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 1.5rem 0;
}
.maya-mini-post {
  aspect-ratio: 1; background: #f5f3ee;
  border-radius: 5px; display: flex; align-items: center; justify-content: center;
  font-size: 8.5px; color: #aaa; text-align: center; padding: 5px;
  line-height: 1.4; overflow: hidden; cursor: default;
}
.maya-mini-post.last-post { background: #e8e0d0; color: #888; }
.mirror-zone-a-score {
  font-size: 36px; font-weight: 800; color: #111; font-variant-numeric: tabular-nums;
  letter-spacing: -.02em; margin: 1.5rem 0 .25rem;
}
.mirror-zone-a-archetype { font-size: 13px; font-weight: 600; color: #555; margin-bottom: 1rem; }
.mirror-zone-a-last {
  font-size: 11.5px; color: #999; line-height: 1.8; margin-top: 1.5rem;
  padding-top: 1.5rem; border-top: 1px solid #eee;
}

/* Zone B — fragments privés */
.zone-b-header {
  font-size: 11px; color: #555; line-height: 1.85; margin-bottom: 2rem;
}
.zone-b-fragment {
  margin-bottom: 2rem; padding-bottom: 2rem;
  border-bottom: 1px solid #1e1e1e;
}
.zone-b-fragment:last-child { border-bottom: none; }
.zone-b-fragment p {
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 13px; line-height: 1.9; color: #777777;
}
.zone-b-footer {
  font-size: 10px; color: #444; margin-top: 2.5rem; padding-top: 1.5rem;
  border-top: 1px solid #1e1e1e; line-height: 1.8; font-style: italic;
}

/* Zone C — profil utilisateur */
.mirror-zone-c-name {
  font-size: 18px; font-weight: 700; color: #111; margin-bottom: .25rem;
}
.mirror-zone-c-score {
  font-size: 36px; font-weight: 800; color: #111; font-variant-numeric: tabular-nums;
  letter-spacing: -.02em; margin: 1rem 0 .25rem;
}
.mirror-zone-c-archetype { font-size: 13px; font-weight: 600; color: #555; margin-bottom: 1.5rem; }
.mirror-zone-c-stat {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; color: #888; padding: 8px 0; border-bottom: 1px solid #e8e8e4;
}
.mirror-zone-c-stat strong { color: #222; font-variant-numeric: tabular-nums; }
.mirror-zone-c-coherence {
  margin-top: 1.5rem; padding: 1rem; background: #eeece6; border-radius: 8px;
}
.mirror-zone-c-coherence-label { font-size: 10px; color: #aaa; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 4px; }
.mirror-zone-c-coherence-val { font-size: 22px; font-weight: 700; color: #333; font-variant-numeric: tabular-nums; }
.mirror-zone-c-note {
  font-size: 11.5px; color: #888; margin-top: 1.5rem; line-height: 1.85;
  padding-top: 1.5rem; border-top: 1px solid #ddd;
}
.mirror-maya-cta {
  text-align: center; padding: 2rem; background: #f5f5f0;
  border-top: 1px solid #e0e0da; grid-column: 1 / -1;
}

/* ============================================================
   BILAN (acte 5 — écran noir)
   ============================================================ */
#screen-bilan {
  flex-direction: column; min-height: 100vh; background: #000000;
  align-items: center; justify-content: center;
  padding: 4rem 2rem; color: white; text-align: center;
  overflow-y: auto;
}
.bilan-algo-text {
  max-width: 580px; font-size: 13.5px; line-height: 2.1;
  color: rgba(255,255,255,.38); font-family: 'Inter', sans-serif;
  text-align: left; white-space: pre-wrap; margin-bottom: 4rem;
}
.bilan-black { width: 100%; height: 0; }
.bilan-final-phrase {
  max-width: 540px; font-size: 18px; font-weight: 300;
  line-height: 2; color: white; font-family: 'Inter', sans-serif;
  text-align: center; opacity: 0; transition: opacity 2s ease;
  margin-bottom: 5rem;
}
.bilan-final-phrase.visible { opacity: 1; }
.bilan-sources {
  max-width: 500px; font-size: 11px; color: rgba(255,255,255,.2);
  line-height: 2; text-align: left; opacity: 0; transition: opacity 1.5s ease;
}
.bilan-sources.visible { opacity: 1; }
.bilan-sources a { color: rgba(255,255,255,.3); text-decoration: underline; }
.bilan-sources a:hover { color: rgba(255,255,255,.6); }
.bilan-dedication {
  max-width: 500px; font-size: 11px; color: rgba(255,255,255,.15);
  margin-top: 1.5rem; line-height: 2; font-style: italic; text-align: left;
  opacity: 0; transition: opacity 1.5s ease;
}
.bilan-dedication.visible { opacity: 1; }

@media (max-width: 900px) {
  .mirror-maya-grid { grid-template-columns: 1fr; }
  .mirror-divider { display: none; }
  .maya-posts-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================================
   SOCIAL NETWORK POLISH — Upgrade visuel v2
   Remplacement emojis, actions Twitter-style, timestamps, tabs
   ============================================================ */

/* ── Sidebar SVG icons ──────────────────────────────────────── */
.nav-icon-svg {
  width: 22px; height: 22px; flex-shrink: 0;
  stroke: currentColor; fill: none;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
  transition: stroke .18s;
}

.nav-item {
  border-radius: 100px;
  padding: 11px 16px;
  font-size: 15px; font-weight: 400;
  gap: 1rem;
}
.nav-item.active {
  background: transparent;
  color: var(--text-primary);
  font-weight: 700;
}
.nav-item.active .nav-icon-svg { stroke-width: 2.25; }
.nav-item.active::before { display: none; }
.nav-item:hover { background: var(--surface2); color: var(--text-primary); }

/* Bouton Publier en bas de sidebar */
.sidebar-publish-btn {
  display: block; width: calc(100% - 1.5rem);
  margin: 1.25rem .75rem 0;
  padding: 14px; background: var(--accent);
  color: white; border: none; border-radius: 100px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  font-family: 'Inter', sans-serif;
  letter-spacing: .01em;
  transition: opacity .15s, box-shadow .15s;
  box-shadow: 0 4px 20px rgba(124,92,191,.35);
}
.sidebar-publish-btn:hover { opacity: .88; box-shadow: 0 6px 28px rgba(124,92,191,.55); }
.sidebar-publish-btn:active { transform: scale(.97); transition: transform .1s; }

/* ── Feed header : tabs Twitter-style ─────────────────────── */
.feed-header {
  display: flex;
  padding: 0;
  font-size: inherit; font-weight: inherit;
}
.feed-tab {
  flex: 1; padding: 17px 0; text-align: center;
  font-size: 15px; font-weight: 500; color: var(--text-muted);
  border: none; background: transparent; cursor: pointer;
  font-family: 'Inter', sans-serif;
  position: relative; transition: background .15s, color .15s;
}
.feed-tab:hover { background: var(--surface2); color: var(--text-primary); }
.feed-tab.active { font-weight: 700; color: var(--text-primary); }
.feed-tab.active::after {
  content: ''; position: absolute; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 56px; height: 3px; border-radius: 3px;
  background: var(--accent);
}

/* ── Post meta : handle + timestamp ─────────────────────────── */
.post-author-line {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.post-name {
  font-size: 14px; font-weight: 700; color: var(--text-primary);
}
.post-handle {
  font-size: 13px; color: var(--text-muted); margin-top: 1px;
}

/* ── Actions Twitter-style (remplace post-footer / post-action) */
.post-actions {
  display: flex;
  margin-top: .375rem;
  margin-left: -8px;
}
.post-action-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 10px 7px 8px; border-radius: 100px;
  border: none; background: transparent; cursor: pointer;
  font-size: 13px; color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-variant-numeric: tabular-nums;
  transition: color .15s, background .15s;
  min-width: 60px;
}
.post-action-btn svg {
  width: 18px; height: 18px; flex-shrink: 0;
  stroke: currentColor; fill: none;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .15s;
}
.post-action-btn:hover svg { transform: scale(1.12); }
.post-action-count { font-size: 13px; line-height: 1; }

.comment-btn:hover  { color: var(--accent); background: var(--accent-light); }
.boost-btn:hover    { color: var(--success); background: rgba(74,184,112,.1); }
.boost-btn.boosted  { color: var(--success); }
.boost-btn.boosted svg { fill: var(--success); stroke: var(--success); }
.share-btn:hover    { color: #1B95E0; background: rgba(27,149,224,.08); }

.danger-btn.boost-btn           { color: var(--fragile); }
.danger-btn.boost-btn:hover     { background: rgba(212,130,58,.08); }
.danger-btn.comment-btn:hover   { color: var(--fragile); background: rgba(212,130,58,.06); }

/* ── Trending section (panneau droit) ───────────────────────── */
.panel-section-title-large {
  font-size: 18px; font-weight: 800; color: var(--text-primary);
  margin-bottom: .875rem; letter-spacing: -.01em;
}
.trending-item {
  padding: 9px 10px; border-radius: 10px; cursor: pointer;
  transition: background .15s; margin-bottom: 2px;
}
.trending-item:hover { background: var(--surface2); }
.trending-cat   { font-size: 11px; color: var(--text-muted); }
.trending-topic { font-size: 14px; font-weight: 700; color: var(--text-primary); margin: 2px 0; }
.trending-count { font-size: 12px; color: var(--text-muted); }

/* ── Connexions : plus aérés ────────────────────────────────── */
.connection-item { background: transparent; border-radius: 10px; }
.connection-item:hover { background: var(--surface2); transform: none; }

/* ── User posts : même look que les autres posts ────────────── */
.user-post-card.post-card {
  border-left: 3px solid var(--accent);
  background: var(--surface);
}
.user-post-card.post-card:hover { background: var(--surface2); }

/* ── Composer : textarea plus grand ────────────────────────── */
.compose-textarea { font-size: 16px; line-height: 1.6; }
.compose-textarea::placeholder { font-size: 16px; }

/* ── Maya post card : compatibilité nouveau style ───────────── */
.maya-post-card .post-author {
  font-size: 14px; font-weight: 700;
}

/* ============================================================
   MESSAGES PRIVÉS
   ============================================================ */

.messages-overlay {
  position: fixed; top: 56px; left: 220px; right: 0; bottom: 0;
  background: var(--bg); z-index: 90; display: flex;
}
.conversations-panel {
  width: 320px; flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--surface); overflow-y: auto;
  display: flex; flex-direction: column;
}
.conversations-header {
  padding: 1rem 1.25rem; font-size: 18px; font-weight: 800;
  color: var(--text-primary); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface);
  letter-spacing: -.01em; flex-shrink: 0;
}
.conversation-item {
  display: flex; align-items: center; gap: .875rem;
  padding: 14px 16px; cursor: pointer;
  transition: background .15s; border-bottom: 1px solid var(--border);
  position: relative;
}
.conversation-item:hover { background: var(--surface2); }
.conversation-item.active { background: var(--surface2); }
.conv-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; flex-shrink: 0; color: white;
}
.conv-info { flex: 1; min-width: 0; }
.conv-name { font-size: 14px; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 6px; }
.conv-preview { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.conv-unread-dot { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }

.chat-panel { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.chat-header { padding: .875rem 1.25rem; border-bottom: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; gap: .875rem; flex-shrink: 0; }
.chat-header-avatar { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; color: white; flex-shrink: 0; }
.chat-header-info { flex: 1; }
.chat-header-name { font-size: 14px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 6px; }
.chat-header-status { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

.chat-messages { flex: 1; overflow-y: auto; padding: 1.5rem; display: flex; flex-direction: column; gap: .375rem; }
.chat-bubble-wrap { display: flex; flex-direction: column; }
.chat-bubble-wrap.outgoing { align-items: flex-end; }
.chat-bubble-wrap.incoming { align-items: flex-start; }
.chat-bubble { max-width: 68%; padding: 10px 14px; font-size: 14px; line-height: 1.55; animation: fadeSlideUp .2s ease; }
.chat-bubble.incoming { background: var(--surface); color: var(--text-primary); border-radius: 18px 18px 18px 4px; border: 1px solid var(--border); }
.chat-bubble.outgoing { background: var(--accent); color: white; border-radius: 18px 18px 4px 18px; }
.chat-time { font-size: 11px; color: var(--text-muted); margin-top: 3px; padding: 0 4px; }
.chat-typing { display: flex; align-items: center; gap: 4px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px 18px 18px 4px; align-self: flex-start; }

.chat-input-area { border-top: 1px solid var(--border); padding: .75rem 1.25rem; background: var(--surface); display: flex; align-items: flex-end; gap: .625rem; flex-shrink: 0; }
.chat-input { flex: 1; padding: 10px 16px; background: var(--surface2); border: 1px solid var(--border); border-radius: 24px; font-size: 14px; font-family: 'Inter', sans-serif; color: var(--text-primary); outline: none; resize: none; max-height: 120px; transition: border-color .2s; }
.chat-input:focus { border-color: var(--accent); }
.chat-input::placeholder { color: var(--text-muted); }
.chat-send-btn { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: opacity .15s; flex-shrink: 0; }
.chat-send-btn:hover { opacity: .85; }
.chat-send-btn svg { width: 17px; height: 17px; stroke: white; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chat-empty-state { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 14px; flex-direction: column; gap: .75rem; }

/* ── Live feed animations ──────────────────────────────────── */
@keyframes livePostIn {
  0%   { opacity: 0; transform: translateY(-22px) scale(.97); }
  55%  { opacity: 1; transform: translateY(3px) scale(1.004); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes livePostGlow {
  0%   { border-left-color: var(--accent); box-shadow: -3px 0 16px rgba(160,90,250,.4); }
  100% { border-left-color: transparent; box-shadow: none; }
}
@keyframes commentSlideIn {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes boostPop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.55); color: var(--success); }
  70%  { transform: scale(.92); }
  100% { transform: scale(1); }
}
@keyframes liveIndicatorFade {
  0%,60% { opacity: 1; }
  100%   { opacity: 0; }
}

.live-post-entry {
  border-left: 3px solid var(--accent);
  animation: livePostIn .42s cubic-bezier(.34,1.56,.64,1), livePostGlow 2.2s ease .42s forwards;
}
.live-count-pop { animation: boostPop .38s cubic-bezier(.34,1.56,.64,1); }

/* ── Live comments dans le feed ───────────────────────────── */
.live-comments-area { border-top: 1px solid var(--border); padding-top: .375rem; margin-top: .25rem; }
.live-comment { display: flex; align-items: flex-start; gap: .5rem; padding: .375rem 0; animation: commentSlideIn .28s cubic-bezier(.34,1.56,.64,1); }
.live-comment-avatar { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: white; flex-shrink: 0; }
.live-comment-body { font-size: 13px; line-height: 1.5; }
.live-comment-name { font-weight: 700; color: var(--text-primary); margin-right: 5px; }
.live-comment-text { color: var(--text-secondary); }

@media (max-width: 900px) {
  .messages-overlay { left: 0; }
  .conversations-panel { width: 260px; }
}

/* ============================================================
   SUPPRESSION DES MÉTRIQUES PRÉ-ACTION
   On garde : score AURA principal + notifications post-action
   On retire : toute métrique visible avant de faire un choix
   ============================================================ */
.compose-analysis        { display: none !important; }
.bio-analysis            { display: none !important; }
.coherence-row           { display: none !important; }
.optimize-score-row      { display: none !important; }
.modal-header-warning    { display: none !important; }

/* ── Avatars photo ──────────────────────────────────────────── */
.post-avatar img,
.conv-avatar img,
.chat-header-avatar img {
  width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%; display: block;
}
.post-avatar[data-profile] { cursor: pointer; }
.post-name[data-profile]   { cursor: pointer; }
.post-name[data-profile]:hover { text-decoration: underline; }

/* ── Image dans les posts du feed ──────────────────────────── */
.post-image {
  width: calc(100% + 32px); margin: 10px -16px 0;
  overflow: hidden; line-height: 0;
}
.post-image img {
  width: 100%; display: block;
  max-height: 420px; object-fit: cover;
}

/* ── Profile overlay ────────────────────────────────────────── */
.profile-overlay {
  position: fixed; top: 56px; left: 220px; right: 0; bottom: 0;
  z-index: 91; background: var(--bg);
  overflow-y: auto; animation: fadeIn .18s ease;
}

.profile-panel-header {
  position: sticky; top: 0;
  background: rgba(14,10,25,.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 10px 20px; z-index: 2;
}

.profile-back-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: transparent; color: var(--text-primary);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s; flex-shrink: 0;
}
.profile-back-btn:hover { background: var(--surface2); }
.profile-panel-handle { font-size: 16px; font-weight: 700; color: var(--text-primary); }

.profile-cover { width: 100%; height: 130px; }

.profile-info { padding: 0 20px 16px; }

.profile-big-avatar {
  width: 90px; height: 90px; border-radius: 50%;
  border: 4px solid var(--bg); margin-top: -45px;
  object-fit: cover; display: block; background: var(--surface);
}

.profile-top-row {
  display: flex; align-items: flex-end;
  justify-content: space-between; margin-bottom: 10px;
}

.profile-follow-btn {
  padding: 8px 22px; border-radius: 100px; border: none;
  background: var(--text-primary); color: var(--bg);
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: opacity .15s; font-family: 'Inter', sans-serif;
}
.profile-follow-btn:hover { opacity: .85; }
.profile-follow-btn.following {
  background: transparent; border: 1.5px solid var(--border);
  color: var(--text-primary);
}

.profile-name-row  { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.profile-display-name { font-size: 18px; font-weight: 800; color: var(--text-primary); }
.profile-handle-text  { font-size: 14px; color: var(--text-muted); margin-bottom: 10px; }

.profile-stats-row {
  display: flex;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 14px 0; margin: 12px 0;
}
.profile-stat {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 1px;
  border-right: 1px solid var(--border);
}
.profile-stat:last-child { border-right: none; }
.profile-stat-value { font-size: 17px; font-weight: 800; color: var(--text-primary); }
.profile-stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }

.profile-bio-text {
  font-size: 14px; line-height: 1.65; color: var(--text-secondary);
  white-space: pre-line; margin-bottom: 10px;
}
.profile-score-line { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }

.profile-posts-grid {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 2px;
}
.profile-post-thumb {
  aspect-ratio: 1; overflow: hidden; cursor: pointer;
  position: relative; background: var(--surface);
}
.profile-post-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: opacity .2s; display: block;
}
.profile-post-thumb:hover img { opacity: .78; }
.profile-post-thumb-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,.45);
  opacity: 0; transition: opacity .2s;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 13px; font-weight: 700; gap: 6px;
}
.profile-post-thumb:hover .profile-post-thumb-overlay { opacity: 1; }

/* ============================================================
   NOUVELLES FEATURES v2 — Narratif, Fantôme, Arborescence
   ============================================================ */

/* ── Disclaimer enrichi ────────────────────────────────────── */
#screen-warning {
  background: #000;
  position: relative;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.warning-grain {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.08'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.4;
}
.warning-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
  max-width: 480px;
  padding: 2rem;
  text-align: center;
}
.warning-logo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: #3A3850;
  text-transform: uppercase;
}
.warning-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: #C04040;
  text-transform: uppercase;
}
#warning-typewriter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: #A098B8;
  white-space: pre-line;
  min-height: 2.4em;
}
.warning-themes {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #5A5870;
  line-height: 2;
  letter-spacing: 0.04em;
}
.warning-note {
  font-size: 12px;
  color: #6A6880;
  line-height: 1.9;
  font-family: 'Inter', sans-serif;
}
.warning-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px;
  color: #C8C0D8;
  letter-spacing: 0.08em;
  display: block;
}
.warning-actions {
  display: flex; gap: 1.2rem; flex-direction: column; align-items: center;
}
.btn-warning-continue {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  background: transparent;
  border: 1px solid #3A3850;
  color: #9090A8;
  padding: 10px 22px;
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s;
}
.btn-warning-continue:hover { border-color: #6A6880; color: #C0B8D0; }
.btn-warning-quit {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  background: transparent;
  border: none;
  color: #3A3850;
  cursor: pointer;
  transition: color 0.3s;
}
.btn-warning-quit:hover { color: #6A6880; }
.warning-quit-msg {
  font-size: 12px;
  color: #5A5870;
  line-height: 1.8;
  display: none;
  font-family: 'Inter', sans-serif;
}

/* ── Marc messages avec choix ──────────────────────────────── */
.marc-message-wrap {
  background: rgba(212, 130, 58, 0.04);
  border: 1px solid rgba(212, 130, 58, 0.2);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.marc-message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.marc-message-label {
  font-size: 11px;
  font-weight: 600;
  color: #D4823A;
  letter-spacing: 0.04em;
}
.marc-message-badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(212, 130, 58, 0.15);
  color: #D4823A;
}
.marc-message-body {
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.marc-choices {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.marc-choice-btn {
  background: transparent;
  border: 1px solid #3A3060;
  border-radius: 6px;
  color: #9080B0;
  font-size: 11px;
  padding: 7px 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, color 0.2s;
  font-family: 'Inter', sans-serif;
}
.marc-choice-btn:hover { border-color: #6A5090; color: #C0A8E0; }
.marc-choice-selected {
  font-size: 11px;
  color: #6A5070;
  font-style: italic;
  padding: 4px 0;
}

/* ── Profil fantôme ─────────────────────────────────────────── */
.ghost-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.ghost-overlay.active { opacity: 1; }

.ghost-panel {
  background: #0F0C1A;
  border: 1px solid #2A2640;
  border-radius: 14px;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ghost-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid #1E1A2E;
  flex-shrink: 0;
}
.ghost-back-btn {
  background: transparent; border: none;
  color: #5A5870; cursor: pointer; padding: 4px; display: flex;
}
.ghost-back-btn:hover { color: #9080B0; }
.ghost-panel-title {
  font-size: 13px;
  color: #8880A0;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.06em;
  flex: 1;
}
.ghost-panel-badge {
  font-size: 9px;
  letter-spacing: 0.1em;
  color: #5A5870;
  text-transform: uppercase;
  border: 1px solid #2A2640;
  padding: 3px 7px;
  border-radius: 4px;
}
.ghost-profile-header {
  display: flex;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid #1E1A2E;
  flex-shrink: 0;
}
.ghost-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5A5A6A, #9090A0);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #9090A0;
  flex-shrink: 0;
}
.ghost-profile-info { display: flex; flex-direction: column; gap: 4px; }
.ghost-name { font-size: 15px; color: #A098B8; }
.ghost-handle { font-size: 12px; color: #5A5870; font-family: 'JetBrains Mono', monospace; }
.ghost-badge { font-size: 9px; color: #C04040; letter-spacing: 0.1em; text-transform: uppercase; margin-top: 2px; }
.ghost-meta { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.ghost-last-seen { font-size: 11px; color: #5A5870; }

.ghost-posts-header {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #5A5870;
  text-transform: uppercase;
  padding: 12px 18px 8px;
  flex-shrink: 0;
}
.ghost-posts-container { overflow-y: auto; flex: 1; padding: 0 18px 18px; }
.ghost-loading { font-size: 12px; color: #5A5870; text-align: center; padding: 2rem; }

.ghost-post-card {
  border: 1px solid #1E1A2E;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.ghost-post-card:hover { border-color: #3A3650; }
.ghost-post-card.ghost-post-removed { opacity: 0.6; }
.ghost-post-card.ghost-post-incomplete { border-style: dashed; }

.ghost-post-meta {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
}
.ghost-post-date {
  font-size: 10px;
  color: #5A5870;
  font-family: 'JetBrains Mono', monospace;
}
.ghost-post-hint-toggle {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1px solid #3A3650;
  font-size: 9px;
  color: #6A6080;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  font-style: normal;
}
.ghost-post-hint-toggle:hover { border-color: #6A5090; color: #A090C0; }

.ghost-post-content { font-size: 13px; line-height: 1.7; color: #A098B8; }
.ghost-removed-text { color: #5A5870; font-style: italic; }
.ghost-cursor { color: #6A5070; animation: blink 1.2s step-end infinite; }
.ghost-cursor-inline { color: #6A5070; animation: blink 1.2s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.ghost-post-metrics {
  display: flex; gap: 10px; margin-top: 8px;
}
.ghost-metric {
  font-size: 10px;
  color: #5A5870;
  font-family: 'JetBrains Mono', monospace;
}
.ghost-metric-delta.negative { color: #C04040; }
.ghost-metric-delta.positive { color: #4AB870; }

.ghost-hint-tooltip {
  background: #14111F;
  border: 1px solid #2A2640;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11px;
  color: #C04040;
  position: absolute;
  z-index: 1000;
  max-width: 280px;
  line-height: 1.6;
  font-family: 'JetBrains Mono', monospace;
}

/* ── Feed : post Mara fantôme ──────────────────────────────── */
.ghost-post-card-feed { opacity: 0.7; }
.ghost-post-card-feed:hover { opacity: 1; }

/* ── Fins overlay ───────────────────────────────────────────── */
.endings-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 400;
  align-items: center;
  justify-content: center;
}
.endings-panel {
  background: #0F0C1A;
  border: 1px solid #2A2640;
  border-radius: 14px;
  width: 100%; max-width: 440px;
  max-height: 80vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.endings-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #1E1A2E;
  font-size: 12px;
  color: #8880A0;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.06em;
}
.endings-close {
  background: transparent; border: none;
  color: #5A5870; cursor: pointer; font-size: 14px;
}
.endings-list { overflow-y: auto; padding: 14px 18px; flex: 1; }
.ending-item {
  display: flex; gap: 12px;
  padding: 10px 12px;
  border: 1px solid #1E1A2E;
  border-radius: 8px;
  margin-bottom: 8px;
}
.ending-item.unlocked { border-left-width: 3px; }
.ending-item-status { font-size: 14px; flex-shrink: 0; }
.ending-item-body { flex: 1; }
.ending-item-title { font-size: 12px; color: #5A5870; font-weight: 500; margin-bottom: 3px; }
.ending-item.unlocked .ending-item-title { color: #E0D8F0; }
.ending-item-desc { font-size: 11px; color: #5A5870; line-height: 1.6; font-family: 'Inter', sans-serif; }
.endings-footer {
  padding: 12px 18px;
  border-top: 1px solid #1E1A2E;
  font-size: 11px;
}
.endings-arbo-link { color: #7060A0; text-decoration: none; }
.endings-arbo-link:hover { color: #A090D0; }

/* ── Lien arborescence footer ───────────────────────────────── */
.arborescence-footer-link {
  position: fixed;
  bottom: 12px; left: 50%;
  transform: translateX(-50%);
  background: rgba(10,8,16,0.92);
  border: 1px solid #2A2640;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 11px;
  color: #5A5870;
  font-family: 'JetBrains Mono', monospace;
  z-index: 200;
  display: flex; gap: 8px; align-items: center;
  white-space: nowrap;
}
.arborescence-footer-link a { color: #7060A0; text-decoration: none; }
.arborescence-footer-link a:hover { color: #A090D0; }
.arborescence-footer-link.hidden { display: none; }
.arbo-endings-btn {
  background: transparent; border: 1px solid #3A3650;
  color: #7060A0; font-size: 10px; border-radius: 4px;
  padding: 2px 8px; cursor: pointer;
}
.arbo-endings-btn:hover { border-color: #7060A0; }

/* ── Dialogue choices dans le chat ─────────────────────────── */
.marc-dialogue-choices {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0 4px 0;
}

/* ── Fins collectionnées sur l'écran de fin ─────────────────── */
.ending-collections-badge {
  margin-top: 2rem;
  padding: 1.2rem 1.6rem;
  border: 1px solid #2A2640;
  border-radius: 10px;
  background: rgba(112, 96, 160, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
.ending-collections-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: #5A5870;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}
.ending-collections-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.ending-collection-tag {
  font-size: 11px;
  color: #9080B0;
  border: 1px solid #3A3060;
  border-radius: 20px;
  padding: 4px 12px;
  font-family: 'JetBrains Mono', monospace;
}
.ending-arbo-cta {
  font-size: 11px;
  color: #7060A0;
  text-decoration: none;
  letter-spacing: 0.06em;
  margin-top: 4px;
}
.ending-arbo-cta:hover { color: #A090D0; }

/* ── Commentaires hostiles sur le post −120 ─────────────────── */
.ghost-hostile-comments {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #1E1A2E;
}
.ghost-comments-label {
  font-size: 9px;
  letter-spacing: 0.1em;
  color: #5A5870;
  text-transform: uppercase;
  margin-bottom: 8px;
  font-family: 'JetBrains Mono', monospace;
}
.ghost-comment {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 0;
  border-bottom: 1px solid #16141E;
  flex-wrap: wrap;
}
.ghost-comment:last-child { border-bottom: none; }
.ghost-comment-system { background: rgba(192,64,64,0.04); border-radius: 4px; padding: 5px 7px; }
.ghost-comment-author {
  font-size: 11px;
  font-weight: 500;
  color: #6A6080;
  white-space: nowrap;
}
.ghost-comment-text {
  font-size: 11px;
  color: #5A5870;
  line-height: 1.5;
  font-family: 'Inter', sans-serif;
}

/* ══════════════════════════════════════════════════════════════
   V3 — DISC_02 / CONNECT_01
   ══════════════════════════════════════════════════════════════ */

.disc2-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  line-height: 1.8;
  color: #C8C0D8;
  white-space: pre-line;
  letter-spacing: 0.02em;
}

.connect-panel {
  background: #0A080E;
  border: 1px solid #1E1A2E;
  border-radius: 12px;
  padding: 2.5rem 3rem;
  width: 380px;
  font-family: 'JetBrains Mono', monospace;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.connect-logo {
  font-size: 22px;
  letter-spacing: 0.18em;
  color: #9070C0;
  font-weight: 500;
  text-align: center;
}
.connect-subtitle {
  font-size: 11px;
  color: #5A5870;
  text-align: center;
  letter-spacing: 0.1em;
}
.connect-field { display: flex; flex-direction: column; gap: 6px; }
.connect-label { font-size: 10px; color: #5A5870; letter-spacing: 0.08em; }
.connect-input {
  background: #14111F;
  border: 1px solid #2A2640;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  color: #7A7090;
  font-family: 'JetBrains Mono', monospace;
}
.connect-autofill { opacity: 0.6; }
.connect-btn {
  background: #2A2240;
  color: #C0B8D0;
  border: 1px solid #3A3060;
  border-radius: 6px;
  padding: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 0.5rem;
}
.connect-btn:hover { background: #382E50; }
.connect-btn:disabled { opacity: 0.5; cursor: default; }
.connect-error {
  font-size: 11px;
  line-height: 1.7;
  text-align: center;
}
.connect-error-code { color: #C05050; margin-bottom: 6px; font-size: 12px; font-weight: 500; }
.connect-error-msg  { color: #8880A0; }
.connect-error-redirect { color: #5A5870; margin-top: 10px; font-style: italic; }
.connect-dots {
  display: inline-block;
  animation: dotsAnim 1.2s infinite step-start;
}
@keyframes dotsAnim {
  0%  { content: ''; }
  33% { content: '.'; }
  66% { content: '..'; }
}

/* ══════════════════════════════════════════════════════════════
   V3 — GHOST PROFILE — 4 ONGLETS
   ══════════════════════════════════════════════════════════════ */

.ghost-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 0;
  transition: opacity 0.3s ease;
}
.ghost-overlay.active { opacity: 1; }

.ghost-modal { width: 100%; min-height: 100vh; display: flex; position: relative; }
.ghost-backdrop { position: absolute; inset: 0; }

.ghost-panel {
  position: relative;
  background: #0A0810;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #1E1A2E;
  border-right: 1px solid #1E1A2E;
  z-index: 1;
}

.ghost-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #1E1A2E;
  position: sticky;
  top: 0;
  background: #0A0810;
  z-index: 10;
}
.ghost-close-btn {
  background: none; border: none; cursor: pointer;
  color: #5A5870; padding: 4px; display: flex;
  transition: color 0.2s;
}
.ghost-close-btn:hover { color: #9080B0; }
.ghost-topbar-handle { font-size: 13px; color: #8880A0; font-family: 'JetBrains Mono', monospace; }
.ghost-topbar-badge  {
  font-size: 9px; letter-spacing: 0.12em; color: #5A5870;
  border: 1px solid #2A2640; border-radius: 4px; padding: 2px 7px;
  text-transform: uppercase; margin-left: auto;
}

.ghost-profile-header {
  padding: 1.5rem 1.5rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  flex-direction: column;
}
.ghost-avatar-wrap { display: flex; align-items: center; gap: 1rem; }
.ghost-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, #3A3050, #6A6080);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #8880A0; flex-shrink: 0;
}
.ghost-profile-info { display: flex; flex-direction: column; gap: 4px; }
.ghost-name   { font-size: 18px; color: #A098B8; font-weight: 500; }
.ghost-handle { font-size: 12px; color: #5A5870; font-family: 'JetBrains Mono', monospace; }
.ghost-status-line { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #5A5870; }
.ghost-status-dot  { color: #4A4060; font-size: 8px; }
.ghost-score-line  { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.ghost-score-badge { font-size: 11px; color: #7A7090; font-family: 'JetBrains Mono', monospace; }
.ghost-tier-badge  { font-size: 9px; color: #C07050; border: 1px solid #4A3030; border-radius: 3px; padding: 1px 6px; }

.ghost-system-notif {
  font-size: 10px; color: #5A5870;
  border: 1px solid #1E1A2E;
  border-radius: 6px; padding: 8px 12px;
  margin-top: 8px;
  display: flex; gap: 8px; align-items: flex-start;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.6;
}

.ghost-tabs {
  display: flex;
  border-bottom: 1px solid #1E1A2E;
  padding: 0 16px;
  margin-top: 1rem;
}
.ghost-tab {
  background: none; border: none; cursor: pointer;
  padding: 10px 16px;
  font-size: 12px; color: #5A5870;
  font-family: 'JetBrains Mono', monospace;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  letter-spacing: 0.06em;
}
.ghost-tab.active { color: #9080B0; border-bottom-color: #7060A0; }
.ghost-tab:hover  { color: #7060A0; }

.ghost-tab-content { display: none; flex: 1; overflow-y: auto; padding: 1.2rem 1.5rem; }
.ghost-tab-content.active { display: block; }

/* Posts */
.ghost-post-card {
  border: 1px solid #1E1A2E;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}
.ghost-post-card.ghost-post-visited { border-color: #2A2640; }
.ghost-post-date  { font-size: 10px; color: #4A4860; margin-bottom: 8px; font-family: 'JetBrains Mono', monospace; }
.ghost-post-body  { font-size: 13px; color: #8880A0; line-height: 1.6; white-space: pre-line; }
.ghost-post-removed      { color: #5A5070; font-style: italic; }
.ghost-post-incomplete   {}
.ghost-cursor   { display: inline-block; animation: blink 1s step-end infinite; color: #6A5090; }
@keyframes blink { 50% { opacity: 0; } }
.ghost-post-reason, .ghost-post-ref { display: block; font-size: 10px; color: #4A4060; margin-top: 4px; }
.ghost-post-metrics {
  display: flex; gap: 10px; margin-top: 8px;
  flex-wrap: wrap;
}
.ghost-metric     { font-size: 10px; color: #5A5870; font-family: 'JetBrains Mono', monospace; }
.ghost-metric-neg { color: #A05050; }

.ghost-post-interactions { margin-top: 10px; border-top: 1px solid #1E1A2E; padding-top: 10px; }
.ghost-post-question { font-size: 10px; color: #5A5870; margin-bottom: 8px; font-style: italic; }
.ghost-post-choice-btn {
  display: block; width: 100%;
  background: none;
  border: 1px solid #2A2640;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 6px;
  font-size: 11px;
  color: #8880A0;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.ghost-post-choice-btn:hover { background: #16122A; border-color: #4A4060; color: #B0A8C8; }
.ghost-choice-selected { font-size: 11px; color: #7060A0; font-style: italic; font-family: 'JetBrains Mono', monospace; }

.ghost-subnode {
  margin-top: 10px;
  background: #0E0B1A;
  border: 1px solid #2A2640;
  border-radius: 6px;
  padding: 12px;
}
.ghost-subnode-title   { font-size: 10px; color: #7060A0; font-family: 'JetBrains Mono', monospace; margin-bottom: 8px; letter-spacing: 0.08em; }
.ghost-subnode-content { font-size: 12px; color: #8880A0; line-height: 1.8; white-space: pre-line; font-family: 'JetBrains Mono', monospace; }
.ghost-subnode-score   { font-size: 10px; color: #A05050; margin-top: 6px; font-family: 'JetBrains Mono', monospace; }

/* Conversations */
.ghost-conv-layout {
  display: flex;
  height: calc(100vh - 220px);
  gap: 0;
}
.ghost-conv-sidebar {
  width: 180px;
  flex-shrink: 0;
  border-right: 1px solid #1E1A2E;
  overflow-y: auto;
  padding: 8px 0;
}
.ghost-conv-item {
  padding: 10px 14px;
  font-size: 11px;
  color: #7A7090;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.15s;
  display: flex; justify-content: space-between; align-items: center;
}
.ghost-conv-item:hover  { background: #0E0B1A; color: #A098B8; }
.ghost-conv-item.active { background: #0E0B1A; color: #9080B0; border-left-color: #7060A0; }
.ghost-conv-item.locked { opacity: 0.5; cursor: default; }
.ghost-conv-lock        { font-size: 12px; }

.ghost-conv-main {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ghost-conv-placeholder { font-size: 11px; color: #4A4860; font-style: italic; text-align: center; margin-top: 3rem; }

.ghost-conv-history { display: flex; flex-direction: column; gap: 8px; }
.ghost-conv-separator { text-align: center; color: #3A3850; font-size: 10px; font-family: 'JetBrains Mono', monospace; margin: 12px 0; position: relative; }
.ghost-conv-separator::before, .ghost-conv-separator::after {
  content: ''; position: absolute; top: 50%; width: 30%; height: 1px; background: #1E1A2E;
}
.ghost-conv-separator::before { left: 0; }
.ghost-conv-separator::after  { right: 0; }

.ghost-msg { padding: 8px 12px; border-radius: 6px; max-width: 85%; }
.ghost-msg-mara   { background: #14101E; border: 1px solid #1E1A2E; align-self: flex-end; }
.ghost-msg-other  { background: #0E0B1A; border: 1px solid #1E1A2E; align-self: flex-start; }
.ghost-msg-system { background: transparent; border: 1px dashed #2A2640; color: #5A5870 !important; font-style: italic; align-self: center; text-align: center; max-width: 100%; }
.ghost-msg-speaker { font-size: 9px; color: #5A5870; font-family: 'JetBrains Mono', monospace; display: block; margin-bottom: 3px; letter-spacing: 0.08em; }
.ghost-msg-time    { font-size: 9px; color: #4A4060; margin-left: 6px; }
.ghost-msg-text    { font-size: 12px; color: #8880A0; line-height: 1.6; white-space: pre-line; }

.ghost-conv-node { margin-top: 8px; }
.ghost-conv-node-title { font-size: 11px; color: #5A5870; font-family: 'JetBrains Mono', monospace; margin-bottom: 8px; padding: 6px 10px; border: 1px solid #1E1A2E; border-radius: 4px; }
.ghost-conv-choices { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.ghost-conv-choice-btn {
  background: none;
  border: 1px solid #2A2640;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 11px;
  color: #8880A0;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.ghost-conv-choice-btn:hover:not(:disabled) { background: #16122A; border-color: #4A4060; color: #B0A8C8; }
.ghost-conv-choice-btn:disabled { opacity: 0.5; cursor: default; }

/* Alertes */
.ghost-alert-card {
  border: 1px solid #1E1A2E;
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}
.ghost-alert-locked { opacity: 0.55; background: #0A0810; }
.ghost-alert-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: default;
}
.ghost-alert-icon  { font-size: 12px; }
.ghost-alert-date  { font-size: 10px; color: #5A5870; font-family: 'JetBrains Mono', monospace; }
.ghost-alert-label { font-size: 11px; color: #8880A0; font-family: 'JetBrains Mono', monospace; font-weight: 500; flex: 1; }
.ghost-alert-open {
  background: none; border: 1px solid #2A2640; border-radius: 4px;
  color: #7060A0; font-size: 10px; font-family: 'JetBrains Mono', monospace;
  padding: 3px 8px; cursor: pointer; transition: all 0.15s;
}
.ghost-alert-open:hover { background: #16122A; border-color: #4A4060; }
.ghost-alert-lock-msg { font-size: 10px; color: #4A4060; padding: 0 14px 10px; font-style: italic; }
.ghost-alert-body { padding: 12px 14px; border-top: 1px solid #1E1A2E; background: #0A0810; }
.ghost-alert-subject { font-size: 12px; color: #A098B8; margin-bottom: 8px; font-weight: 500; }
.ghost-alert-content { font-size: 12px; color: #7A7090; line-height: 1.8; white-space: pre-line; font-family: 'JetBrains Mono', monospace; }
.btn-attachment {
  display: inline-block; margin-top: 10px;
  background: none; border: 1px solid #4A4060; border-radius: 5px;
  color: #9080B0; font-size: 11px; font-family: 'JetBrains Mono', monospace;
  padding: 6px 12px; cursor: pointer; transition: all 0.15s;
}
.btn-attachment:hover { background: #16122A; border-color: #7060A0; }

/* Pièce jointe modal */
.ghost-attachment-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 300;
  align-items: center; justify-content: center;
}
.ghost-attachment-inner {
  background: #0A0810;
  border: 1px solid #2A2640;
  border-radius: 8px;
  width: min(700px, 90vw);
  max-height: 80vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.ghost-attachment-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #1E1A2E;
  font-size: 11px; color: #8880A0; font-family: 'JetBrains Mono', monospace;
}
.ghost-attachment-header button {
  background: none; border: none; color: #5A5870; cursor: pointer; font-size: 14px;
}
.ghost-attachment-body { overflow-y: auto; padding: 1rem 1.5rem; flex: 1; }
.ghost-attachment-pre {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #8880A0;
  line-height: 1.8;
  white-space: pre-wrap;
}

/* À propos */
.ghost-about-section { margin-bottom: 1.5rem; }
.ghost-about-name    { font-size: 16px; color: #A098B8; margin-bottom: 4px; }
.ghost-about-job     { font-size: 12px; color: #7A7090; margin-bottom: 4px; }
.ghost-about-joined, .ghost-about-score { font-size: 11px; color: #5A5870; font-family: 'JetBrains Mono', monospace; margin-bottom: 3px; }
.ghost-about-bio     { font-size: 13px; color: #8880A0; font-style: italic; margin: 10px 0; padding-left: 10px; border-left: 2px solid #2A2640; }
.ghost-about-field   { font-size: 11px; color: #5A5870; margin-bottom: 3px; font-family: 'JetBrains Mono', monospace; }
.ghost-about-empty   { color: #3A3850; font-style: italic; }
.ghost-about-history-link { margin-top: 1.5rem; }
.ghost-history-btn {
  background: none; border: 1px solid #2A2640; border-radius: 5px;
  color: #6050A0; font-size: 11px; font-family: 'JetBrains Mono', monospace;
  padding: 6px 12px; cursor: pointer; transition: all 0.15s;
  text-decoration: underline; text-underline-offset: 3px;
}
.ghost-history-btn:hover { border-color: #4A4060; color: #8070B0; }
.ghost-history-entry {
  border: 1px solid #1E1A2E; border-radius: 6px;
  padding: 12px; margin-bottom: 10px; margin-top: 10px;
}
.ghost-history-date  { font-size: 10px; color: #4A4060; font-family: 'JetBrains Mono', monospace; margin-bottom: 6px; }
.ghost-history-field { font-size: 11px; color: #7060A0; margin-bottom: 6px; font-weight: 500; }
.ghost-history-before, .ghost-history-after {
  font-size: 11px; color: #7A7090; line-height: 1.6; margin-bottom: 4px;
  font-family: 'JetBrains Mono', monospace;
}
.ghost-history-before span, .ghost-history-after span { color: #5A5870; }
.ghost-history-by { font-size: 10px; color: #C05050; margin-top: 6px; font-style: italic; }
.ghost-history-title { font-size: 12px; color: #8880A0; font-weight: 500; margin-bottom: 10px; font-family: 'JetBrains Mono', monospace; }

/* ══════════════════════════════════════════════════════════════
   V3 — CHOICE-BASED POSTS
   ══════════════════════════════════════════════════════════════ */

.compose-choice-header {
  font-size: 11px;
  color: #7A7090;
  font-family: 'JetBrains Mono', monospace;
  padding: 12px 14px 8px;
  border-bottom: 1px solid #1E1A2E;
  letter-spacing: 0.06em;
}
.compose-choice-list { padding: 8px; max-height: 240px; overflow-y: auto; }
.post-choice-category { margin-bottom: 8px; }
.post-choice-cat-label {
  font-size: 9px; color: #4A4060; font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 4px 8px; margin-bottom: 4px;
}
.post-choice-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 7px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid transparent;
}
.post-choice-item:hover { background: #0E0B1A; }
.post-choice-item.selected { background: #12102A; border-color: #3A3060; }
.post-choice-item input[type="radio"] { margin-top: 2px; accent-color: #7060A0; flex-shrink: 0; }
.post-choice-text { font-size: 12px; color: #8880A0; line-height: 1.5; font-family: 'Inter', sans-serif; }
.post-choice-skip .post-choice-text { font-size: 11px; }

/* ══════════════════════════════════════════════════════════════
   V3 — GLITCH ANIMATION
   ══════════════════════════════════════════════════════════════ */

@keyframes glitch {
  0%   { filter: none; transform: none; }
  15%  { filter: contrast(1.5) hue-rotate(90deg); transform: translate(2px, 0); }
  30%  { filter: invert(0.08); transform: translate(-2px, 1px); }
  45%  { filter: contrast(1.2); transform: translate(1px, -1px); }
  60%  { filter: hue-rotate(-30deg); transform: translate(-1px, 0); }
  80%  { filter: none; transform: translate(1px, 1px); }
  100% { filter: none; transform: none; }
}

body.glitch-active {
  animation: glitch 0.9s ease forwards;
}

/* ══════════════════════════════════════════════════════════════
   V3 — GUIDAGE UTILISATEUR (Correction 5)
   ══════════════════════════════════════════════════════════════ */

/* 5A — points fins */
.fins-dots { display: inline-flex; gap: 3px; margin: 0 4px; vertical-align: middle; }
.fin-dot { font-size: 14px; color: #2A2440; transition: color 0.4s ease; }
.fin-dot.unlocked { color: #7060A0; text-shadow: 0 0 6px #7060A0; }

/* 5D — micro-indicateur lumineux sur éléments interactifs cachés */
.hidden-interactive {
  position: relative;
  cursor: pointer;
}
.hidden-interactive::after {
  content: '';
  position: absolute;
  top: 2px; right: 2px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #6A5090;
  box-shadow: 0 0 6px #6A5090;
  animation: hiddenPulse 2s ease-in-out infinite;
}
@keyframes hiddenPulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.3); }
}

/* Session redirect banner offset */
body:has(#session-redirect-banner[style*="block"]) .topbar { top: 22px; }
body:has(#session-redirect-banner[style*="block"]) .app-body { padding-top: calc(56px + 22px); }
body:has(#session-redirect-banner[style*="block"]) .feed-header { top: calc(56px + 22px); }
