/* ============================================================
   AURA — Mode ghost : styles intégrés dans la plateforme
   ============================================================ */

/* ── Notice d'archive (remplace le composer) ────────────────── */
.ghost-archive-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 1.4rem;
  border-bottom: 1px solid rgba(106, 80, 144, 0.25);
  background: rgba(106, 80, 144, 0.06);
}
.ghost-archive-notice-content { flex: 1; min-width: 0; }
.ghost-archive-notice-icon {
  font-size: 13px;
  flex-shrink: 0;
}
.ghost-archive-notice-title {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ghost-archive-notice-text {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}
.ghost-archive-msg-hint {
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
}
.ghost-archive-msg-hint:hover { opacity: 0.8; }

/* ── Posts ghost dans le feed ───────────────────────────────── */
.ghost-post-card {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}
.ghost-post-card:hover {
  background: rgba(255,255,255,0.02);
}
.ghost-post-visited {
  opacity: 0.7;
}
.ghost-post-date {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.ghost-post-body {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
}
.ghost-post-removed {
  opacity: 0.5;
  font-style: italic;
  text-decoration: line-through;
}
.ghost-post-reason,
.ghost-post-ref {
  display: block;
  font-size: 10px;
  color: var(--error);
  text-decoration: none;
  margin-top: 4px;
  font-family: 'JetBrains Mono', monospace;
}
.ghost-post-incomplete { color: var(--text-muted); }
.ghost-cursor { animation: cursorBlink 1.2s ease-in-out infinite; }
@keyframes cursorBlink { 0%,100%{opacity:1} 50%{opacity:0} }

.ghost-post-metrics {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.ghost-metric {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}
.ghost-metric-neg { color: var(--error); }

.ghost-post-interactions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.ghost-post-question {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-style: italic;
}
.ghost-post-choice-btn {
  display: inline-block;
  margin: 4px 6px 4px 0;
  padding: 5px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.ghost-post-choice-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.ghost-choice-selected {
  font-size: 12px;
  color: var(--accent);
  font-style: italic;
}
.ghost-subnode {
  margin-top: 10px;
  padding: 10px 14px;
  border-left: 2px solid var(--accent);
  background: rgba(106, 80, 144, 0.08);
  border-radius: 0 6px 6px 0;
}
.ghost-subnode-title {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.ghost-subnode-content {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.ghost-subnode-score {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  font-family: 'JetBrains Mono', monospace;
}

/* ── Layout conversations dans le feed ──────────────────────── */
.ghost-conv-layout {
  display: flex;
  height: 65vh;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 0.5rem 0;
}
.ghost-conv-sidebar {
  width: 200px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  background: rgba(255,255,255,0.02);
}
.ghost-conv-main {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ghost-conv-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.ghost-conv-item:hover:not(.locked) { background: rgba(106,80,144,0.1); }
.ghost-conv-item.active { background: rgba(106,80,144,0.15); }
.ghost-conv-item.locked { opacity: 0.4; cursor: default; }
.ghost-conv-label {
  font-size: 12px;
  color: var(--text-secondary);
}
.ghost-conv-lock { font-size: 11px; margin-top: 3px; }
.ghost-conv-placeholder {
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
  padding: 1rem 0;
}
.ghost-conv-history { display: flex; flex-direction: column; gap: 8px; }
.ghost-conv-separator {
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.06em;
  margin: 8px 0;
}
.ghost-conv-node { display: flex; flex-direction: column; gap: 8px; }
.ghost-conv-node-title {
  font-size: 11px;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.ghost-conv-choices { display: flex; flex-direction: column; gap: 6px; }
.ghost-conv-choice-btn {
  text-align: left;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.ghost-conv-choice-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.ghost-conv-choice-btn:disabled { opacity: 0.4; cursor: default; }

/* Messages bubbles */
.ghost-msg {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.6;
  max-width: 90%;
}
.ghost-msg-mara  { background: rgba(106,80,144,0.15); align-self: flex-end; }
.ghost-msg-other { background: rgba(255,255,255,0.05); align-self: flex-start; }
.ghost-msg-system {
  background: rgba(255,100,100,0.08);
  border: 1px solid rgba(255,100,100,0.15);
  color: var(--text-muted);
  font-size: 11px;
  font-style: italic;
  align-self: center;
  max-width: 100%;
  text-align: center;
}
.ghost-msg-speaker {
  display: block;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  margin-bottom: 3px;
  letter-spacing: 0.04em;
}
.ghost-msg-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 6px;
}
.ghost-msg-text { color: var(--text-secondary); }

/* ── Alertes dans le feed ───────────────────────────────────── */
.ghost-alert-card {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.ghost-alert-locked {
  opacity: 0.4;
  pointer-events: none;
}
.ghost-alert-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ghost-alert-icon { font-size: 12px; }
.ghost-alert-date {
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}
.ghost-alert-label {
  flex: 1;
  font-size: 12px;
  color: var(--text-secondary);
}
.ghost-alert-open {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.ghost-alert-open:hover { border-color: var(--accent); color: var(--accent); }
.ghost-alert-body {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.ghost-alert-subject {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
}
.ghost-alert-content {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.ghost-alert-lock-msg {
  font-size: 10px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 4px;
}
.btn-attachment {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-attachment:hover { border-color: var(--accent); color: var(--accent); }

/* ── Modal pièce jointe (standalone, injecté dans body) ─────── */
.ghost-attachment-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
}
.ghost-attachment-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: min(90vw, 640px);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.ghost-attachment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.ghost-attachment-header button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.2s;
}
.ghost-attachment-header button:hover { color: var(--text-primary); }
.ghost-attachment-body { flex: 1; overflow-y: auto; padding: 1rem 1.2rem; }
.ghost-attachment-pre {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── À propos dans le feed ──────────────────────────────────── */
.ghost-about-section {
  padding: 1.4rem;
  border-bottom: 1px solid var(--border);
}
.ghost-about-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.ghost-about-job {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.ghost-about-joined {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 6px;
}
.ghost-about-score {
  font-size: 11px;
  color: var(--fragile, #BF5C5C);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 10px;
}
.ghost-about-bio {
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 10px;
}
.ghost-about-field {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.ghost-about-empty { color: var(--text-muted); font-style: italic; }
.ghost-about-history-link {
  padding: 1rem 1.4rem;
}
.ghost-history-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 12px;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.ghost-history-btn:hover { border-color: var(--accent); color: var(--accent); }
.ghost-history-title {
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  letter-spacing: 0.06em;
  padding: 0.8rem 1.4rem 0.5rem;
}
.ghost-history-entry {
  padding: 10px 1.4rem;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.ghost-history-date {
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 4px;
}
.ghost-history-field { color: var(--text-primary); font-weight: 600; margin-bottom: 4px; }
.ghost-history-before { color: var(--text-muted); margin-bottom: 2px; }
.ghost-history-after  { color: var(--text-secondary); margin-bottom: 2px; }
.ghost-history-by {
  font-size: 10px;
  color: var(--error);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 4px;
}

/* ── Loaders ────────────────────────────────────────────────── */
.ghost-loading {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
}

/* ── Ghost chat / dialogue tree ─────────────────────────────── */
.ghost-chat-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  letter-spacing: 0.06em;
  background: var(--bg-secondary);
}
.ghost-chat-system-msg {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  margin: 8px 0;
  padding: 4px 12px;
}
.ghost-chat-choices {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}
.ghost-chat-choice-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  text-align: left;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-family: inherit;
}
.ghost-chat-choice-btn:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.ghost-chat-choice-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.ghost-conv-locked .conversation-avatar,
.ghost-conv-locked .conversation-name {
  opacity: 0.45;
}
.ghost-conv-locked .conversation-preview {
  color: var(--text-muted);
  font-style: italic;
}
