/* ════════════════════════════════════════════════════════════
   PSY AGENT  –  Design System v2
   Theme: Glassmorphism · Violet/Bleu · Inter
════════════════════════════════════════════════════════════ */

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── Design tokens ──────────────────────────────────────── */
:root {
  /* Colors */
  --bg:            #0f0f1a;
  --bg-2:          #12121f;
  --surface:       rgba(255,255,255,0.035);
  --surface-2:     rgba(255,255,255,0.06);
  --surface-3:     rgba(255,255,255,0.10);
  --border:        rgba(255,255,255,0.08);
  --border-2:      rgba(255,255,255,0.13);

  --purple:        #7c3aed;
  --purple-2:      #9f67ff;
  --purple-glow:   rgba(124,58,237,0.35);
  --blue:          #3b82f6;
  --blue-2:        #60a5fa;
  --cyan:          #06b6d4;
  --green:         #10b981;
  --orange:        #f59e0b;
  --red:           #ef4444;

  --text:          #f1f5f9;
  --text-2:        #cbd5e1;
  --muted:         #94a3b8;
  --muted-2:       #64748b;

  --grad-primary:  linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
  --grad-subtle:   linear-gradient(135deg, rgba(124,58,237,0.15), rgba(59,130,246,0.10));

  /* Layout */
  --sidebar-w:     260px;
  --radius:        16px;
  --radius-sm:     10px;
  --radius-xs:     6px;
  --radius-full:   9999px;
  --shadow:        0 4px 32px rgba(0,0,0,0.45);
  --shadow-lg:     0 12px 64px rgba(0,0,0,0.6);

  /* Motion */
  --ease:          cubic-bezier(0.4, 0, 0.2, 1);
  --t:             0.2s;
  --t-slow:        0.4s;

  /* Typography */
  --font:          'Inter', system-ui, -apple-system, sans-serif;
}

/* ─── Base ───────────────────────────────────────────────── */
html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* ─── Glassmorphism helper ───────────────────────────────── */
.glass {
  background: var(--surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
}

/* ─── Utility ────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ─── Screens ────────────────────────────────────────────── */
.screen { display: none; height: 100vh; }
.screen.active { display: flex; }

/* ════════════════════════════════════════════════════════════
   BUTTONS
════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--t) var(--ease);
  outline: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

.btn-primary {
  background: var(--grad-primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.12);
}
.btn-glow:hover:not(:disabled) {
  box-shadow: 0 0 28px var(--purple-glow), 0 4px 16px rgba(0,0,0,0.3);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--muted);
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--purple-2);
  color: var(--text);
  background: rgba(124,58,237,0.08);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: none;
}
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-ghost.active-tool {
  color: var(--purple-2);
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.35);
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #fff;
}
.btn-danger:hover:not(:disabled) { filter: brightness(1.1); }

.btn-full { width: 100%; }
.btn-sm   { padding: 7px 14px; font-size: 13px; }

/* ════════════════════════════════════════════════════════════
   FORMS
════════════════════════════════════════════════════════════ */
.input-group { margin-bottom: 18px; }
.input-group label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.input-group .opt { color: var(--muted-2); font-weight: 400; }

.input-wrapper { position: relative; }
.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  pointer-events: none;
}
.input-wrapper input { padding-left: 42px; }

input[type="text"], input[type="number"], input[type="password"],
textarea, select {
  width: 100%;
  padding: 11px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), background var(--t);
  resize: vertical;
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--purple);
  background: rgba(124,58,237,0.06);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ─── Range Slider ───────────────────────────────────────── */
.styled-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  background: rgba(255,255,255,0.1);
  border-radius: 99px;
  border: none;
  padding: 0;
  outline: none;
  cursor: pointer;
  flex: 1;
}
.styled-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--grad-primary);
  cursor: pointer;
  box-shadow: 0 0 10px var(--purple-glow), 0 2px 6px rgba(0,0,0,0.3);
  transition: transform var(--t) var(--ease), box-shadow var(--t);
}
.styled-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 20px var(--purple-glow);
}
.styled-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--grad-primary);
  border: none;
  cursor: pointer;
}

/* ─── Feedback ───────────────────────────────────────────── */
.error-msg {
  color: var(--red);
  font-size: 13px;
  margin-top: 10px;
  text-align: center;
  padding: 10px;
  background: rgba(239,68,68,0.1);
  border-radius: var(--radius-xs);
  border: 1px solid rgba(239,68,68,0.2);
}
.inline-success {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-size: 13px;
  font-weight: 500;
}

/* ════════════════════════════════════════════════════════════
   CRISIS BANNER
════════════════════════════════════════════════════════════ */
.crisis-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 8000;
  background: linear-gradient(135deg, rgba(239,68,68,0.97), rgba(185,28,28,0.97));
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 8px 40px rgba(239,68,68,0.45);
  animation: crisisSlideDown 0.4s var(--ease);
  padding: 14px 20px;
}
@keyframes crisisSlideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

.crisis-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.crisis-icon {
  width: 44px; height: 44px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
}
.crisis-text { flex: 1; color: white; }
.crisis-text strong { display: block; font-size: 15px; margin-bottom: 10px; }
.crisis-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.crisis-number {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  text-decoration: none;
  color: white;
  font-size: 13px;
  font-weight: 500;
  transition: background var(--t);
}
.crisis-number:hover { background: rgba(255,255,255,0.28); }
.crisis-num-badge {
  background: white;
  color: #dc2626;
  font-weight: 700;
  font-size: 14px;
  border-radius: var(--radius-full);
  padding: 2px 10px;
}
.crisis-close {
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  width: 40px; height: 40px;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  flex-shrink: 0;
  transition: background var(--t);
  position: relative;
  z-index: 8001;
}
.crisis-close:hover { background: rgba(255,255,255,0.3); }

/* ════════════════════════════════════════════════════════════
   MARKDOWN DANS LES BULLES
════════════════════════════════════════════════════════════ */
.msg-content.markdown p   { margin-bottom: 10px; }
.msg-content.markdown p:last-child { margin-bottom: 0; }
.msg-content.markdown strong { font-weight: 700; }
.msg-content.markdown em     { font-style: italic; opacity: 0.9; }
.msg-content.markdown ul,
.msg-content.markdown ol  { padding-left: 18px; margin: 8px 0; }
.msg-content.markdown li  { margin-bottom: 5px; }
.msg-content.markdown h1,
.msg-content.markdown h2,
.msg-content.markdown h3  { font-size: 15px; font-weight: 700; margin: 12px 0 6px; }
.msg-content.markdown blockquote {
  border-left: 3px solid rgba(255,255,255,0.3);
  padding-left: 12px;
  margin: 10px 0;
  opacity: 0.85;
  font-style: italic;
}
.msg-content.markdown code {
  background: rgba(0,0,0,0.25);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: monospace;
  font-size: 13px;
}
.msg-content.markdown hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.2);
  margin: 12px 0;
}

/* Streaming cursor */
.streaming-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: currentColor;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: cursorBlink 0.8s ease-in-out infinite;
}
@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-2);
  box-shadow: var(--shadow);
  pointer-events: all;
  transform: translateX(120%);
  opacity: 0;
  transition: transform var(--t-slow) var(--ease), opacity var(--t-slow) var(--ease);
  max-width: 340px;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast-success { background: rgba(16,185,129,0.15); border-color: rgba(16,185,129,0.3); color: #6ee7b7; }
.toast-error   { background: rgba(239,68,68,0.15);  border-color: rgba(239,68,68,0.3);  color: #fca5a5; }
.toast-info    { background: rgba(59,130,246,0.15); border-color: rgba(59,130,246,0.3); color: #93c5fd; }

/* ════════════════════════════════════════════════════════════
   MODAL
════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 16px;
}
.modal-card {
  width: 100%;
  max-width: 420px;
  border-radius: 20px;
  padding: 32px;
  animation: modalIn 0.3s var(--ease);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to   { opacity: 1; transform: none; }
}
.modal-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}
.modal-icon-wrap {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--grad-subtle);
  border: 1px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--purple-2);
}
.modal-header h3 { font-size: 18px; margin-bottom: 4px; }
.modal-header p  { font-size: 14px; color: var(--muted); }

.mood-modal-slider {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  padding: 20px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.mood-modal-emoji { font-size: 40px; transition: transform 0.2s; }
.mood-modal-score {
  font-size: 32px;
  font-weight: 700;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.score-denom { font-size: 18px; color: var(--muted); font-weight: 400; -webkit-text-fill-color: var(--muted); }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ════════════════════════════════════════════════════════════
   AUTH SCREEN
════════════════════════════════════════════════════════════ */
#auth-screen {
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.auth-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: orbFloat 8s ease-in-out infinite alternate;
}
.orb-1 {
  width: 500px; height: 500px;
  top: -150px; left: -100px;
  background: radial-gradient(circle, #7c3aed, transparent 70%);
  animation-delay: 0s;
}
.orb-2 {
  width: 400px; height: 400px;
  bottom: -100px; right: -80px;
  background: radial-gradient(circle, #3b82f6, transparent 70%);
  animation-delay: -3s;
}
.orb-3 {
  width: 300px; height: 300px;
  top: 40%; left: 40%;
  background: radial-gradient(circle, #06b6d4, transparent 70%);
  animation-delay: -6s;
  opacity: 0.2;
}
@keyframes orbFloat {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, 20px) scale(1.08); }
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  border-radius: 24px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  z-index: 1;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}
.logo-mark {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.logo-title {
  font-size: 24px;
  font-weight: 700;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-tagline { font-size: 13px; color: var(--muted); margin-top: 2px; }

.auth-tabs {
  display: flex;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  gap: 4px;
  margin-bottom: 28px;
}
.tab-btn {
  flex: 1;
  padding: 9px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  transition: all var(--t) var(--ease);
}
.tab-btn.active {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 2px 12px var(--purple-glow);
}

.auth-form { display: none; }
.auth-form.active { display: block; }

/* ════════════════════════════════════════════════════════════
   PROFILE SETUP
════════════════════════════════════════════════════════════ */
#profile-screen {
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 24px;
}
.profile-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  border-radius: 24px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  z-index: 1;
  margin: auto;
}
.setup-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--grad-subtle);
  border: 1px solid rgba(124,58,237,0.3);
  font-size: 12px;
  font-weight: 600;
  color: var(--purple-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.setup-title { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.setup-sub   { font-size: 14px; color: var(--muted); margin-bottom: 28px; }

/* ════════════════════════════════════════════════════════════
   APP LAYOUT
════════════════════════════════════════════════════════════ */
#app-screen {
  flex-direction: row;
  overflow: hidden;
}

/* ─── Hamburger (mobile) ────────────────────────────────── */
.hamburger-btn {
  display: none;
  position: fixed;
  top: 16px; left: 16px;
  z-index: 300;
  width: 40px; height: 40px;
  border: none;
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
}
.hamburger-btn span {
  display: block;
  width: 18px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--t) var(--ease);
}
.hamburger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

/* ─── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: rgba(15,15,26,0.8);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 200;
  transition: transform var(--t-slow) var(--ease);
}

.sidebar-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-mark-sm {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-brand {
  font-size: 16px;
  font-weight: 700;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 10px 6px;
}
.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 10px;
}
.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  text-align: left;
  transition: all var(--t) var(--ease);
  position: relative;
}
.nav-btn:hover {
  background: var(--surface-2);
  color: var(--text-2);
}
.nav-btn.active {
  background: var(--grad-subtle);
  color: var(--text);
  border: 1px solid rgba(124,58,237,0.25);
}
.nav-btn.active .nav-icon {
  color: var(--purple-2);
}
.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color var(--t);
}
.nav-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  margin-left: auto;
  box-shadow: 0 0 8px var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
}
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.user-card-text { flex: 1; min-width: 0; }
.user-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role { font-size: 11px; color: var(--muted); }

.logout-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
  border-radius: var(--radius-xs);
  display: flex;
  transition: color var(--t), background var(--t);
}
.logout-icon-btn:hover { color: var(--red); background: rgba(239,68,68,0.1); }

/* ─── Main content ───────────────────────────────────────── */
.main-content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
}

.view {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  animation: viewIn 0.25s var(--ease);
}
.view.active { display: flex; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: rgba(15,15,26,0.5);
  backdrop-filter: blur(12px);
}
.view-header h2 { font-size: 20px; font-weight: 700; }
.view-subtitle  { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ════════════════════════════════════════════════════════════
   CHAT VIEW
════════════════════════════════════════════════════════════ */
#view-chat { overflow: hidden; }

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: rgba(15,15,26,0.6);
  backdrop-filter: blur(20px);
}
.dr-info {
  display: flex;
  align-items: center;
  gap: 14px;
}
.dr-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.dr-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(124,58,237,0.4);
  box-shadow: 0 0 20px rgba(124,58,237,0.25);
}
.dr-online-dot {
  position: absolute;
  bottom: 1px; right: 1px;
  width: 11px; height: 11px;
  background: var(--green);
  border-radius: 50%;
  border: 2px solid var(--bg-2);
  box-shadow: 0 0 8px var(--green);
}
.dr-name { font-size: 16px; font-weight: 700; margin-bottom: 3px; display: flex; align-items: center; gap: 8px; }

/* Badge "Sophie parle…" */
.sophie-speaking-badge {
  font-size: 11px; font-weight: 500; color: var(--purple);
  background: rgba(124,58,237,.15); border: 1px solid rgba(124,58,237,.3);
  border-radius: 10px; padding: 2px 8px; animation: speakPulse 1.5s ease-in-out infinite;
}
@keyframes speakPulse {
  0%, 100% { opacity: .6; }
  50% { opacity: 1; }
}

/* Bouton stop TTS */
#stop-tts-btn { color: var(--purple); }

/* Bouton binaural beats — état actif (override vert au lieu de violet) */
#binaural-btn.active-tool {
  color: #34d399;
  background: rgba(16,185,129,.15);
  border-color: rgba(16,185,129,.4);
  animation: binauralPulse 2.5s ease-in-out infinite;
}
#binaural-btn.active-tool svg {
  animation: binauralWave 1.2s ease-in-out infinite;
}
@keyframes binauralPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,.0); }
  50%       { box-shadow: 0 0 0 6px rgba(16,185,129,.18); }
}
@keyframes binauralWave {
  0%, 100% { transform: scaleY(1); opacity: .7; }
  50%       { transform: scaleY(1.5); opacity: 1; }
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}
.status-idle    { background: rgba(100,116,139,0.15); color: var(--muted);  border: 1px solid rgba(100,116,139,0.2); }
.status-active  { background: rgba(16,185,129,0.12);  color: #6ee7b7;       border: 1px solid rgba(16,185,129,0.25); }
.status-thinking { background: rgba(245,158,11,0.12); color: #fcd34d;       border: 1px solid rgba(245,158,11,0.25); }

.chat-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Session meta (timer + phase) */
.session-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: rgba(124,58,237,0.08);
  border: 1px solid rgba(124,58,237,0.18);
  border-radius: var(--radius-full);
}

.phase-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
}
.phase-checkin {
  background: rgba(59,130,246,0.15);
  color: #93c5fd;
  border-color: rgba(59,130,246,0.25);
}
.phase-travail {
  background: rgba(124,58,237,0.15);
  color: #c4b5fd;
  border-color: rgba(124,58,237,0.25);
}
.phase-cloture {
  background: rgba(245,158,11,0.15);
  color: #fcd34d;
  border-color: rgba(245,158,11,0.25);
}

.session-meta-clock {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.session-elapsed  { color: var(--muted); }
.clock-sep        { color: var(--border-2); }
.session-countdown { color: var(--text-2); font-weight: 600; }
.session-countdown.countdown-warning  { color: #fcd34d; }
.session-countdown.countdown-critical { color: #f87171; animation: pulse 1s ease infinite; }

/* Mood area */
.mood-area {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: rgba(15,15,26,0.5);
}
.mood-area-card {
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.mood-question {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
  text-align: center;
}
.mood-slider-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.mood-emoji-big {
  font-size: 32px;
  transition: transform 0.2s var(--ease);
  flex-shrink: 0;
}
.mood-score-display {
  display: flex;
  align-items: baseline;
  gap: 2px;
  flex-shrink: 0;
}
.mood-score-display span:first-child {
  font-size: 28px;
  font-weight: 700;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  min-width: 28px;
  text-align: right;
}

/* Messages */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 16px;
  text-align: center;
  padding: 40px;
}
.empty-orb {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: var(--grad-subtle);
  border: 1px solid rgba(124,58,237,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.empty-title { font-size: 18px; font-weight: 600; color: var(--text-2); }
.empty-desc  { font-size: 14px; color: var(--muted); max-width: 340px; line-height: 1.6; }

/* Message bubbles */
.message {
  display: flex;
  gap: 10px;
  max-width: 78%;
  animation: msgIn 0.3s var(--ease);
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.message.user      { align-self: flex-end; flex-direction: row-reverse; }
.message.assistant { align-self: flex-start; }

.msg-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 16px;
}
.message.user .msg-avatar {
  background: var(--grad-primary);
  font-size: 14px;
  font-weight: 700;
  color: white;
}
.message.assistant .msg-avatar {
  background: var(--grad-primary);
}

.msg-bubble-wrap { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.msg-content {
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.message.user .msg-content {
  background: var(--grad-primary);
  color: white;
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 4px 16px rgba(124,58,237,0.35);
}
.message.assistant .msg-content {
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  color: var(--text);
  border-radius: 4px 18px 18px 18px;
}

.msg-time {
  font-size: 11px;
  color: var(--muted-2);
  padding: 0 4px;
}
.message.user .msg-time      { text-align: right; }
.message.assistant .msg-time { text-align: left; }

/* Typing indicator */
.typing-dots {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 14px 18px;
}
.typing-dot {
  width: 8px; height: 8px;
  background: var(--purple-2);
  border-radius: 50%;
  animation: typingBounce 1s ease-in-out infinite;
  opacity: 0.7;
}
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.30s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.7; }
  30%            { transform: translateY(-9px); opacity: 1; }
}

/* ═══════════════════════════════════════════════════
   SESSION ACTIVE — CONVERSATION MODE
═══════════════════════════════════════════════════ */

/* ── Warm atmosphere ── */
#view-chat.session-active {
  background: radial-gradient(ellipse at 50% 0%, rgba(124,58,237,0.05) 0%, transparent 60%),
              var(--bg);
}

#view-chat.session-active .chat-header {
  border-bottom-color: rgba(124,58,237,0.1);
  background: rgba(15,15,26,0.4);
}

#view-chat.session-active .messages-container {
  gap: 6px;
}

/* Timer discret en séance */
#view-chat.session-active .session-meta {
  opacity: 0.2;
  transition: opacity 0.3s ease;
}
#view-chat.session-active .session-meta:hover {
  opacity: 1;
}

/* ── Sophie Presence Zone (fixé au-dessus du chat) ── */
.sophie-presence {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 0 18px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--bg) 60%, transparent);
  z-index: 10;
  transition: padding 0.4s ease;
}

.sophie-avatar-zone {
  position: relative;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.4s ease, height 0.4s ease, border-radius 0.4s ease;
}

.sophie-avatar-svg {
  position: relative;
  z-index: 2;
}

.sophie-avatar-glow {
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,0.18) 0%, transparent 70%);
  animation: sophieBreathe 4.5s ease-in-out infinite;
  z-index: 1;
}

@keyframes sophieBreathe {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50%      { transform: scale(1.15); opacity: 0.7; }
}

.sophie-presence-status {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.4s ease, opacity 0.4s ease;
}

/* Sophie states */
.sophie-presence[data-state="listening"] .sophie-avatar-glow {
  animation: sophieBreathe 3s ease-in-out infinite;
  background: radial-gradient(circle, rgba(16,185,129,0.18) 0%, transparent 70%);
}

.sophie-presence[data-state="thinking"] .sophie-avatar-glow {
  animation: sophieThink 1.8s ease-in-out infinite;
  background: radial-gradient(circle, rgba(245,158,11,0.2) 0%, transparent 70%);
}
@keyframes sophieThink {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50%      { transform: scale(1.1); opacity: 0.85; }
}

.sophie-presence[data-state="speaking"] .sophie-avatar-glow {
  animation: sophieSpeak 1.2s ease-in-out infinite;
  background: radial-gradient(circle, rgba(124,58,237,0.25) 0%, transparent 70%);
}
@keyframes sophieSpeak {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50%      { transform: scale(1.18); opacity: 1; }
}

.sophie-presence[data-state="present"] .sophie-avatar-glow {
  animation: sophieBreathe 5s ease-in-out infinite;
}

/* ── HeyGen real-time avatar ── */
.simli-video {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 2;
}

.sophie-presence.simli-active {
  padding: 0;
  flex: 1;
  min-height: 250px;
  max-height: 50vh;
}

.sophie-presence.simli-active .sophie-avatar-zone {
  width: 100%;
  height: 100%;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(124,58,237,0.25);
  box-shadow: 0 4px 30px rgba(124,58,237,0.15);
  background: #0a0a14;
}

.sophie-presence.simli-active .simli-video {
  display: block;
  border-radius: 0;
  object-fit: contain;
}

.sophie-presence.simli-active .sophie-avatar-svg {
  display: none;
}

.sophie-presence.simli-active .sophie-avatar-glow {
  display: none;
}

.sophie-presence.simli-active .sophie-presence-status {
  display: none;
}

/* Micro-nod quand user envoie un message */
.sophie-presence.sophie-nod .sophie-avatar-svg {
  animation: sophieNod 0.5s ease;
}
@keyframes sophieNod {
  0%, 100% { transform: translateY(0); }
  40%      { transform: translateY(-3px); }
  70%      { transform: translateY(1px); }
}

/* ── Conversation-style messages (no bubbles) ── */

/* Sophie: texte prominent, pas de bulle */
#view-chat.session-active .message.assistant {
  max-width: 90%;
  gap: 0;
  padding: 4px 0;
}

#view-chat.session-active .message.assistant .msg-avatar {
  display: none;
}

#view-chat.session-active .message.assistant .msg-content {
  background: none;
  border: none;
  border-radius: 0;
  padding: 6px 4px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  box-shadow: none;
  border-left: 2px solid rgba(124,58,237,0.15);
  padding-left: 16px;
}

/* User: discret, aligné à droite */
#view-chat.session-active .message.user {
  max-width: 72%;
  gap: 0;
}

#view-chat.session-active .message.user .msg-avatar {
  display: none;
}

#view-chat.session-active .message.user .msg-content {
  background: rgba(255,255,255,0.04);
  color: var(--text-2);
  border-radius: 14px;
  padding: 10px 16px;
  font-size: 13.5px;
  box-shadow: none;
  border: 1px solid rgba(255,255,255,0.06);
}

/* Séparateur visuel entre échanges */
#view-chat.session-active .message.assistant + .message.assistant {
  margin-top: 2px;
}

#view-chat.session-active .message.user + .message.assistant {
  margin-top: 12px;
}

#view-chat.session-active .message.assistant + .message.user {
  margin-top: 14px;
}

/* Messages anciens s'estompent */
#view-chat.session-active .message.msg-faded {
  opacity: 0.45;
  transition: opacity 0.5s ease;
}
#view-chat.session-active .message.msg-faded:hover {
  opacity: 0.85;
}

/* Typing indicator sans avatar en session */
#view-chat.session-active #typing-indicator .msg-avatar {
  display: none;
}

#view-chat.session-active #typing-indicator .msg-content {
  background: none;
  border: none;
  padding-left: 16px;
  border-left: 2px solid rgba(124,58,237,0.15);
}

/* ── Input doux en session ── */
#view-chat.session-active .input-area {
  background: rgba(15,15,26,0.5);
  border-top-color: rgba(124,58,237,0.08);
}

#view-chat.session-active #message-input:focus {
  box-shadow: 0 0 0 2px rgba(124,58,237,0.12);
  border-color: rgba(124,58,237,0.25);
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .sophie-avatar-zone { width: 140px; height: 140px; }
  .sophie-avatar-svg  { width: 64px; height: 64px; }
  .sophie-presence    { padding: 16px 0 8px; }
  #view-chat.session-active .message.assistant { max-width: 95%; }
  #view-chat.session-active .message.user      { max-width: 85%; }
}

/* ── Typing humanisé en session ── */
.sophie-thinking-text {
  font-size: 13px;
  font-style: italic;
  color: var(--muted);
  padding: 8px 16px;
  border-left: 2px solid rgba(124,58,237,0.15);
  animation: sophieThinkFade 2s ease-in-out infinite;
}

@keyframes sophieThinkFade {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1; }
}

.sophie-thinking-ellipsis::after {
  content: '';
  animation: ellipsis 1.5s steps(3, end) infinite;
}

@keyframes ellipsis {
  0%   { content: ''; }
  33%  { content: '.'; }
  66%  { content: '..'; }
  100% { content: '...'; }
}

/* ── Badge contextuel de séance ── */
.session-context-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.03em;
  opacity: 0.7;
  animation: fadeIn 0.5s ease;
}

/* ═══════════════════════════════════════════════════
   END SESSION ACTIVE
═══════════════════════════════════════════════════ */

/* Input area */
.input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: rgba(15,15,26,0.7);
  backdrop-filter: blur(20px);
  flex-shrink: 0;
}
.input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.input-field-wrap { flex: 1; }
#message-input {
  width: 100%;
  min-height: 46px;
  max-height: 140px;
  resize: none;
  border-radius: 14px;
  padding: 12px 16px;
  line-height: 1.5;
  overflow-y: auto;
}

.input-btns { display: flex; gap: 8px; align-items: flex-end; }

/* Mic button */
.btn-mic {
  position: relative;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t) var(--ease);
  flex-shrink: 0;
  color: var(--muted);
  outline: none;
}
.btn-mic:not(:disabled):hover {
  background: var(--surface-3);
  color: var(--text);
  border-color: rgba(255,255,255,0.2);
}
.btn-mic:disabled { opacity: 0.35; cursor: not-allowed; }

.mic-inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stop-svg { position: absolute; }

.mic-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--purple);
  opacity: 0;
  animation: none;
  pointer-events: none;
}
.btn-mic.recording {
  background: linear-gradient(135deg, rgba(124,58,237,0.3), rgba(59,130,246,0.3));
  border-color: var(--purple);
  color: var(--purple-2);
  box-shadow: 0 0 20px var(--purple-glow);
}
.btn-mic.recording .mic-ring {
  animation: micRipple 1.8s ease-out infinite;
}
.btn-mic.recording .mic-ring-1 { width: 46px; height: 46px; animation-delay: 0s; }
.btn-mic.recording .mic-ring-2 { width: 46px; height: 46px; animation-delay: 0.6s; }
.btn-mic.recording .mic-ring-3 { width: 46px; height: 46px; animation-delay: 1.2s; }

@keyframes micRipple {
  0%   { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Send button */
.btn-send {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--grad-primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
  transition: all var(--t) var(--ease);
  outline: none;
}
.btn-send:not(:disabled):hover {
  box-shadow: 0 0 20px var(--purple-glow);
  transform: scale(1.05);
}
.btn-send:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

.recording-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--red);
  font-size: 13px;
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(239,68,68,0.08);
  border-radius: var(--radius-xs);
  border: 1px solid rgba(239,68,68,0.15);
}
.rec-dot {
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--red);
  animation: recPulse 1s ease-in-out infinite;
}
@keyframes recPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}
.voice-status { font-size: 12px; color: var(--muted); margin-top: 6px; padding: 0 4px; }

/* ── Voice bar ── */
.voice-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px; margin-top: 8px;
  background: rgba(124,58,237,.06);
  border: 1px solid rgba(124,58,237,.2);
  border-radius: 10px;
  transition: all var(--t);
}
.vbar-state { display: flex; align-items: center; gap: 6px; min-width: 130px; }
.vbar-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: var(--purple); box-shadow: 0 0 6px var(--purple);
  animation: vdotPulse 1.4s ease-in-out infinite;
}
.voice-bar[data-state="speaking"] .vbar-dot { background: #22c55e; box-shadow: 0 0 6px #22c55e; animation-duration: 0.6s; }
.voice-bar[data-state="processing"] .vbar-dot { background: var(--blue); box-shadow: 0 0 6px var(--blue); }
#vbar-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.voice-bar[data-state="speaking"] #vbar-label { color: #22c55e; }

@keyframes vdotPulse { 0%,100%{opacity:.5} 50%{opacity:1} }

.vbar-levels {
  display: flex; align-items: center; gap: 3px; height: 24px;
}
.vbar-level {
  width: 3px; height: 24px; border-radius: 2px;
  background: var(--purple); opacity: .2;
  transform: scaleY(0.15); transform-origin: center;
  transition: transform 0.08s ease, opacity 0.08s ease;
}
.voice-bar[data-state="speaking"] .vbar-level { background: #22c55e; }

/* ════════════════════════════════════════════════════════════
   DASHBOARD
════════════════════════════════════════════════════════════ */
#view-dashboard { overflow: hidden; }

.dashboard-body {
  padding: 24px 0 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.stat-card {
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform var(--t) var(--ease), box-shadow var(--t);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.stat-icon-bg {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-purple { background: rgba(124,58,237,0.18); color: var(--purple-2); }
.stat-blue   { background: rgba(59,130,246,0.18);  color: var(--blue-2); }
.stat-orange { background: rgba(245,158,11,0.18);  color: #fcd34d; }
.stat-cyan   { background: rgba(6,182,212,0.18);   color: #67e8f9; }

.stat-value {
  font-size: 30px;
  font-weight: 700;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.stat-label { font-size: 12px; color: var(--muted); font-weight: 500; }

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.chart-card {
  border-radius: var(--radius);
  padding: 20px;
}
.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.chart-card-header h3 { font-size: 14px; font-weight: 600; color: var(--text-2); }
.chart-period-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  padding: 3px 9px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}
.chart-wrap { position: relative; height: 220px; }

.last-session-card {
  border-radius: var(--radius);
  padding: 20px 24px;
  font-size: 14px;
  line-height: 1.8;
}
.last-session-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-2);
}

/* ════════════════════════════════════════════════════════════
   JOURNAL
════════════════════════════════════════════════════════════ */
#view-journal { overflow: hidden; }

.journal-body {
  padding: 24px 0 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.journal-form-card {
  border-radius: var(--radius);
  padding: 24px;
}
.journal-form-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 20px;
}

.journal-metrics { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }

.metric-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.metric-label-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 110px;
  flex-shrink: 0;
}
.metric-emoji { font-size: 18px; }
.metric-label-wrap label { font-size: 13px; font-weight: 500; color: var(--muted); }

.metric-val {
  width: 38px;
  text-align: right;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.journal-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}

/* Journal history */
.journal-history { display: flex; flex-direction: column; gap: 10px; }
.journal-history-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

.journal-entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: border-color var(--t);
}
.journal-entry:hover { border-color: var(--border-2); }

.journal-entry-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.journal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 500;
}
.journal-entry-trigger {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.journal-entry-notes { font-size: 14px; color: var(--text-2); line-height: 1.6; }

/* ════════════════════════════════════════════════════════════
   ÉVALUATIONS (PHQ-9 / GAD-7)
════════════════════════════════════════════════════════════ */
#view-evaluations { overflow: hidden; }

.eval-body {
  padding: 24px 0 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Tabs PHQ9 / GAD7 */
.eval-tabs {
  display: flex;
  gap: 12px;
}
.eval-tab {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: all var(--t) var(--ease);
  font-family: var(--font);
}
.eval-tab:hover { border-color: var(--border-2); background: var(--surface-2); }
.eval-tab.active {
  border-color: rgba(124,58,237,0.5);
  background: var(--grad-subtle);
  box-shadow: 0 0 20px rgba(124,58,237,0.1);
}
.eval-tab-icon { font-size: 28px; flex-shrink: 0; }
.eval-tab-title { font-size: 16px; font-weight: 700; color: var(--text); }
.eval-tab-sub   { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Card questionnaire */
.eval-card {
  border-radius: var(--radius);
  padding: 28px;
}
.eval-intro { margin-bottom: 20px; }
.eval-intro p { font-size: 14px; color: var(--text-2); line-height: 1.6; }
.eval-period-note {
  margin-top: 10px;
  padding: 12px 16px;
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--blue-2);
}

/* Barre de progression */
.eval-progress-bar {
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  margin-bottom: 8px;
  overflow: hidden;
}
.eval-progress-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: 99px;
  transition: width 0.4s var(--ease);
  width: 0%;
}
.eval-progress-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 24px;
  text-align: right;
}

/* Questions */
.eval-questions { display: flex; flex-direction: column; gap: 20px; }

.eval-question {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  transition: border-color var(--t);
}
.eval-question.answered { border-color: rgba(124,58,237,0.3); }

.eval-question-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--purple-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.eval-question-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.55;
  margin-bottom: 14px;
  font-weight: 500;
}
.eval-answers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.eval-answer-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--t) var(--ease);
  text-align: center;
}
.eval-answer-btn:hover {
  border-color: var(--purple);
  background: rgba(124,58,237,0.08);
}
.eval-answer-btn.selected {
  background: var(--grad-primary);
  border-color: transparent;
  box-shadow: 0 2px 12px var(--purple-glow);
}
.eval-answer-score {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.eval-answer-btn.selected .eval-answer-score { color: white; }
.eval-answer-label {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}
.eval-answer-btn.selected .eval-answer-label { color: rgba(255,255,255,0.85); }

/* Submit row */
.eval-submit-row {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
}

/* Résultat */
.eval-result {
  margin-top: 24px;
  border-radius: var(--radius);
  overflow: hidden;
  animation: viewIn 0.3s var(--ease);
}
.eval-result-header {
  padding: 24px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.eval-score-circle {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 28px var(--purple-glow);
}
.eval-score-number { font-size: 26px; font-weight: 800; color: white; line-height: 1; }
.eval-score-max    { font-size: 11px; color: rgba(255,255,255,0.7); }
.eval-result-info  { flex: 1; }
.eval-result-type  { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.eval-result-severite {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}
.eval-result-interp { font-size: 13px; color: var(--text-2); line-height: 1.5; }

/* Severity colors */
.sev-minimale     { color: var(--green); }
.sev-legere       { color: var(--cyan); }
.sev-moderee      { color: var(--orange); }
.sev-mod-severe   { color: #fb923c; }
.sev-severe       { color: var(--red); }

.eval-result-scale {
  padding: 0 28px 20px;
}
.eval-scale-bar {
  display: flex;
  height: 8px;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 8px;
}
.eval-scale-seg { flex: 1; }
.scale-green  { background: var(--green); }
.scale-cyan   { background: var(--cyan); }
.scale-orange { background: var(--orange); }
.scale-red2   { background: #fb923c; }
.scale-red    { background: var(--red); }

.eval-result-actions {
  padding: 16px 28px 24px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Historique */
.eval-history-section { display: flex; flex-direction: column; gap: 12px; }
.eval-history-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.eval-history { display: flex; flex-direction: column; gap: 8px; }

.eval-history-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--t);
}
.eval-history-item:hover { border-color: var(--border-2); }

.eval-hist-type {
  width: 54px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 0;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
}
.eval-hist-type.phq9 { background: rgba(124,58,237,0.15); color: var(--purple-2); }
.eval-hist-type.gad7 { background: rgba(59,130,246,0.15);  color: var(--blue-2); }

.eval-hist-score {
  font-size: 22px;
  font-weight: 800;
  min-width: 40px;
}
.eval-hist-info { flex: 1; }
.eval-hist-severite { font-size: 14px; font-weight: 600; }
.eval-hist-date     { font-size: 12px; color: var(--muted); margin-top: 2px; }

.eval-hist-bar-wrap {
  width: 100px;
  flex-shrink: 0;
}
.eval-hist-bar-bg {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
}
.eval-hist-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--grad-primary);
  transition: width 0.5s var(--ease);
}

/* ════════════════════════════════════════════════════════════
   MEMORY
════════════════════════════════════════════════════════════ */
.memory-list {
  padding: 20px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  flex: 1;
}

.memory-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: border-color var(--t);
}
.memory-card:hover { border-color: var(--border-2); }

.memory-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.memory-period-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: var(--grad-primary);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: white;
}
.memory-type-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}
.memory-resume {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-2);
  margin-bottom: 14px;
}
.memory-patterns { display: flex; flex-wrap: wrap; gap: 7px; }
.pattern-tag {
  background: rgba(6,182,212,0.1);
  border: 1px solid rgba(6,182,212,0.2);
  color: #67e8f9;
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
}

/* ════════════════════════════════════════════════════════════
   PROFILE EDIT
════════════════════════════════════════════════════════════ */
#view-suivi        { overflow: hidden; }
.suivi-scroll-body { flex: 1; overflow-y: auto; min-height: 0; }
#view-profile-edit { overflow-y: auto; }

.profile-edit-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}
.profile-edit-card {
  max-width: 600px;
  border-radius: var(--radius);
  padding: 28px;
}
.profile-form-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}

/* ─── Traitement psychiatrique toggle ────────────────────── */
.med-safety-label { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.med-safety-label .opt { font-size: .8rem; color: var(--text-muted); font-weight: 400; }

.toggle-row { display: flex; align-items: center; gap: 12px; }
.toggle-label { font-size: .9rem; color: var(--text-muted); min-width: 28px; }

.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; cursor: pointer; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: 999px;
  transition: background .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform .2s, background .2s;
}
.toggle-switch input:checked + .toggle-slider { background: rgba(124,58,237,.35); border-color: var(--purple); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); background: var(--purple-2); }

.med-detail-block {
  background: rgba(124,58,237,.08);
  border: 1px solid rgba(124,58,237,.2);
  border-radius: 12px;
  padding: 16px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.med-safety-info {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: .82rem;
  color: var(--purple-2);
  line-height: 1.5;
}
.med-safety-info svg { flex-shrink: 0; margin-top: 2px; color: var(--purple-2); }

/* ─── Screening bipolaire / dissociation ─────────────────── */
.screening-block {
  background: rgba(59,130,246,.07);
  border: 1px solid rgba(59,130,246,.18);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.screening-title { font-size: .82rem; color: var(--blue-2); font-weight: 600; margin-bottom: 2px; }
.screening-title .opt { font-weight: 400; color: var(--text-muted); }
.screening-item { display: flex; align-items: center; gap: 12px; font-size: .88rem; color: var(--text-secondary); }

/* ─── Disclaimer inscription ─────────────────────────────── */
.disclaimer-check-wrap {
  background: rgba(239,68,68,.06);
  border: 1px solid rgba(239,68,68,.18);
  border-radius: 10px;
  padding: 12px 14px;
}
.disclaimer-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  cursor: pointer;
}
.disclaimer-check input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; accent-color: var(--purple); width: 15px; height: 15px; cursor: pointer; }

/* ════════════════════════════════════════════════════════════
   LOADING OVERLAY
════════════════════════════════════════════════════════════ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
}

.loader-ring {
  display: inline-block;
  position: relative;
  width: 52px; height: 52px;
}
.loader-ring div {
  box-sizing: border-box;
  display: block;
  position: absolute;
  width: 44px; height: 44px;
  margin: 4px;
  border: 3px solid transparent;
  border-top-color: var(--purple-2);
  border-radius: 50%;
  animation: loaderSpin 1.1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}
.loader-ring div:nth-child(1) { animation-delay: -0.45s; border-top-color: var(--purple); }
.loader-ring div:nth-child(2) { animation-delay: -0.30s; border-top-color: var(--blue); }
.loader-ring div:nth-child(3) { animation-delay: -0.15s; border-top-color: var(--cyan); }
@keyframes loaderSpin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .stats-grid  { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════
   ANALYSE DES SENTIMENTS
═══════════════════════════════════════════════════ */

.analyse-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.analyse-scope-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 3px;
}
.analyse-tab {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.analyse-tab:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}
.analyse-tab.active {
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #3b82f6);
}

@media (max-width: 600px) {
  .analyse-scope-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .analyse-tab {
    padding: 5px 10px;
    font-size: 12px;
  }
}

/* Empty + loading states */
.analyse-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 24px;
  text-align: center;
  color: var(--text-secondary);
}
.analyse-empty-icon { font-size: 48px; line-height: 1; }
.analyse-empty h3 { font-size: 20px; font-weight: 700; color: var(--text-primary); margin: 0; }
.analyse-empty p  { font-size: 14px; margin: 0; max-width: 420px; }
.analyse-empty-note { color: var(--text-muted); font-size: 13px !important; }

.analyse-loading {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 40px 24px;
  color: var(--text-secondary);
}
.analyse-loading-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.analyse-loading-sub   { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* Score banner */
.analyse-results { padding: 0 24px 32px; }

.analyse-score-banner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 24px;
  border-radius: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.analyse-score-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.analyse-score-value {
  font-size: 48px;
  font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}
.analyse-score-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.analyse-score-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}
.analyse-stat-pill {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--text-secondary);
}
.analyse-stat-pill strong { color: var(--text-primary); }

.analyse-trend-badge {
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
}
.trend-amelioration { background: rgba(16,185,129,.15); color: #10b981; }
.trend-degradation  { background: rgba(239,68,68,.15);  color: #ef4444; }
.trend-stable       { background: rgba(245,158,11,.15); color: #f59e0b; }

/* Grid */
.analyse-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.analyse-card {
  border-radius: 16px;
  padding: 20px;
}
.analyse-card-wide { grid-column: 1 / -1; }

.analyse-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Radar */
.analyse-radar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}
.emotions-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.emotion-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-secondary);
}
.emotion-legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.emotion-evolution {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 8px;
  margin-left: 2px;
}
.evo-amelioration { background: rgba(16,185,129,.2);  color: #10b981; }
.evo-degradation  { background: rgba(239,68,68,.2);   color: #ef4444; }
.evo-stable       { background: rgba(245,158,11,.2);  color: #f59e0b; }

/* Themes */
.themes-list { display: flex; flex-direction: column; gap: 10px; }
.theme-item {
  display: flex;
  align-items: center;
  gap: 12px;
}
.theme-emoji { font-size: 20px; width: 28px; text-align: center; flex-shrink: 0; }
.theme-body { flex: 1; }
.theme-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.theme-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.theme-freq { font-size: 11px; color: var(--text-muted); }
.theme-bar-bg {
  height: 5px;
  background: rgba(255,255,255,0.07);
  border-radius: 3px;
  overflow: hidden;
}
.theme-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--blue));
  border-radius: 3px;
  transition: width .6s ease;
}
.theme-desc { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* Patterns */
.patterns-list { display: flex; flex-direction: column; gap: 8px; }
.pattern-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.pattern-bullet {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--purple);
  flex-shrink: 0;
  margin-top: 6px;
}

/* Correlations */
.correlations-list { display: flex; flex-direction: column; gap: 10px; }
.correlation-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(59,130,246,.07);
  border: 1px solid rgba(59,130,246,.15);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.correlation-icon { font-size: 16px; flex-shrink: 0; }
.correlation-fiabilite {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}
.fiabilite-forte   { background: rgba(16,185,129,.15); color: #10b981; }
.fiabilite-moderee { background: rgba(245,158,11,.15); color: #f59e0b; }
.fiabilite-faible  { background: rgba(148,163,184,.15); color: #94a3b8; }

/* Points forts + axes */
.analyse-two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.analyse-ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.analyse-ul li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.analyse-ul li::before {
  content: '✓';
  flex-shrink: 0;
  font-weight: 700;
  margin-top: 1px;
}
.analyse-ul.green li::before { color: #10b981; }
.analyse-ul.orange li::before { content: '→'; color: #f59e0b; }
.analyse-ul.red li::before { content: '⚠'; color: #ef4444; }
.analyse-ul.purple li::before { content: '⚡'; color: #7c3aed; }

/* Alertes cliniques */
.alertes-list .alerte-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.2);
  border-radius: 10px;
  font-size: 13px;
  color: #fca5a5;
  line-height: 1.5;
}
.alertes-list .alerte-item::before { display: none; }
.alerte-icon { font-size: 16px; flex-shrink: 0; }

/* Patterns cognitifs enrichis */
.pattern-item-rich {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: rgba(124,58,237,.06);
  border: 1px solid rgba(124,58,237,.12);
  border-radius: 10px;
}
.pattern-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pattern-name {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  flex: 1;
}
.pattern-freq-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  flex-shrink: 0;
  font-weight: 600;
}
.freq-haute   { background: rgba(239,68,68,.15); color: #ef4444; }
.freq-moyenne { background: rgba(245,158,11,.15); color: #f59e0b; }
.freq-basse   { background: rgba(148,163,184,.12); color: #94a3b8; }
.pattern-verbatim {
  font-size: 12px;
  font-style: italic;
  color: rgba(148,163,184,.8);
  padding-left: 14px;
  border-left: 2px solid rgba(124,58,237,.3);
  line-height: 1.5;
}

/* Progression objectifs */
.prog-objectifs-list { display: flex; flex-direction: column; gap: 12px; }
.prog-obj-item {
  padding: 12px 16px;
  background: rgba(59,130,246,.07);
  border: 1px solid rgba(59,130,246,.15);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.prog-obj-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.prog-obj-eval {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.prog-obj-evidence {
  font-size: 12px;
  color: rgba(148,163,184,.7);
  font-style: italic;
  margin-top: 2px;
}

/* Évolution vs analyse précédente */
.evolution-vs-precedent {
  font-size: 13px;
  color: #7c3aed;
  background: rgba(124,58,237,.08);
  border: 1px solid rgba(124,58,237,.18);
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 12px;
  font-style: italic;
}

/* Synthèse */
.synthese-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
  background: rgba(124,58,237,.06);
  border-left: 3px solid rgba(124,58,237,.4);
  padding: 14px 18px;
  border-radius: 0 12px 12px 0;
  margin-bottom: 12px;
}
.analyse-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Historique des analyses */
.analyse-history-section { margin-top: 24px; }
.analyse-history-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.analyse-history-list { display: flex; gap: 10px; flex-wrap: wrap; }
.analyse-history-item {
  padding: 8px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
}
.analyse-history-item:hover { background: rgba(124,58,237,.12); border-color: rgba(124,58,237,.3); color: var(--purple); }
.analyse-history-item.active { background: rgba(124,58,237,.15); border-color: rgba(124,58,237,.4); color: var(--purple); font-weight: 600; }

@media (max-width: 768px) {
  .analyse-grid { grid-template-columns: 1fr; }
  .analyse-card-wide { grid-column: 1; }
  .analyse-two-cols { grid-template-columns: 1fr; }
  .analyse-results { padding: 0 16px 28px; }
}

/* ── Progression Multi-Échelle ── */
.progression-scales { display: flex; flex-direction: column; gap: 12px; }
.prog-scale-card {
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  transition: background .15s;
}
.prog-scale-card:hover { background: rgba(255,255,255,0.06); }
.prog-scale-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px; flex-wrap: wrap;
}
.prog-scale-icon { font-size: 18px; }
.prog-scale-label { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.prog-score { font-weight: 700; font-size: 14px; margin-left: auto; }
.prog-scale-date { font-size: 11px; color: var(--text-muted); }
.prog-scale-body { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.prog-detail { margin-bottom: 4px; }
.prog-detail strong { color: var(--text-primary); font-weight: 600; }

/* ═══════════════════════════════════════════════════
   HISTORY VIEW
═══════════════════════════════════════════════════ */

/* ── Htab panels (reuse extab pattern) ── */
.htab-panel { display: none; animation: fadeIn 0.25s ease; }
.htab-panel.active { display: block; }

/* ── Session layout (list + detail) ── */
.history-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  height: calc(100vh - 240px);
  min-height: 420px;
}

/* List panel */
.history-list-panel {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
}

.history-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.history-list-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.history-session-count {
  font-size: 11px;
  color: var(--purple);
  background: rgba(124,58,237,.15);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}

.history-session-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}

.history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 20px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* Session card in list */
.history-session-item {
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: all .2s ease;
  margin-bottom: 4px;
  border: 1px solid transparent;
}

.history-session-item:hover {
  background: rgba(255,255,255,0.05);
  transform: translateX(2px);
}

.history-session-item.active {
  background: rgba(124,58,237,.1);
  border-color: rgba(124,58,237,.25);
  box-shadow: 0 0 0 1px rgba(124,58,237,.1);
}

.hsi-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.hsi-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.hsi-badge {
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
}

.hsi-badge.terminee {
  background: rgba(16,185,129,.15);
  color: #10b981;
}

.hsi-badge.active-session,
.hsi-badge.en-cours {
  background: rgba(245,158,11,.15);
  color: #f59e0b;
}

.hsi-mood-delta {
  margin-left: auto;
  font-size: 12px;
}

/* Detail panel */
.history-detail-panel {
  border-radius: 16px;
  overflow-y: auto;
  padding: 0;
}

.history-detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: 100%;
  color: var(--text-muted);
  font-size: 13px;
  opacity: 0.7;
}

#history-detail-content {
  padding: 24px;
}

.history-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 20px;
}

.history-detail-date {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.history-detail-stats {
  display: flex;
  gap: 8px;
}

.hd-stat {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  padding: 3px 10px;
  border-radius: 20px;
}

.history-detail-moods {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hd-mood {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: var(--text-muted);
}

.hd-mood-emoji { font-size: 22px; }
.hd-mood-label { font-size: 10px; }

/* Resume section */
.history-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: 10px;
  margin-top: 20px;
}

.history-resume-section { margin-bottom: 8px; }

.history-resume-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  background: rgba(124,58,237,.06);
  border: 1px solid rgba(124,58,237,.12);
  border-radius: 14px;
  padding: 16px 20px;
  white-space: pre-wrap;
}

.history-resume-text p { margin: 0 0 8px; }
.history-resume-text p:last-child { margin-bottom: 0; }

/* Messages in detail */
.hd-messages-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.hd-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.hd-msg.user { flex-direction: row-reverse; }

.hd-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.hd-msg.assistant .hd-msg-avatar {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: #fff;
}

.hd-msg.user .hd-msg-avatar {
  background: rgba(255,255,255,0.08);
  color: var(--text-secondary);
}

.hd-msg-body { max-width: 75%; }

.hd-msg-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.6;
}

.hd-msg.assistant .hd-msg-bubble {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-top-left-radius: 4px;
}

.hd-msg.user .hd-msg-bubble {
  background: linear-gradient(135deg, rgba(124,58,237,.5), rgba(59,130,246,.4));
  border-top-right-radius: 4px;
  color: #fff;
}

.hd-msg-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  padding: 0 4px;
}

.hd-msg.user .hd-msg-time { text-align: right; }

/* ── Moments clés tab ── */
.moments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.moments-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* ── Load more button (pagination) ── */
.history-load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: calc(100% - 12px);
  margin: 4px 6px 8px;
  padding: 10px;
  background: rgba(124,58,237,.08);
  border: 1px dashed rgba(124,58,237,.2);
  border-radius: 10px;
  color: var(--purple);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}

.history-load-more:hover {
  background: rgba(124,58,237,.14);
  border-color: rgba(124,58,237,.35);
}

.history-load-more-count {
  font-weight: 400;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════
   EXERCISES VIEW
═══════════════════════════════════════════════════ */




/* ── Exercise cards grid ── */
.ex-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.ex-card {
  position: relative;
  padding: 20px 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
}

.ex-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--ex-color, rgba(124,58,237,0.7));
  opacity: 0;
  transition: opacity 0.18s ease;
}

.ex-card:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.13);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.ex-card.active {
  border-color: var(--ex-color, rgba(124,58,237,0.5));
  background: rgba(var(--ex-rgb, 124,58,237), 0.1);
}

.ex-card.active::before { opacity: 1; }

/* Per-card accent colors */
.ex-card[data-ex="breath"]   { --ex-color: #3b82f6; --ex-rgb: 59,130,246; }
.ex-card[data-ex="scan"]     { --ex-color: #10b981; --ex-rgb: 16,185,129; }
.ex-card[data-ex="thoughts"] { --ex-color: #7c3aed; --ex-rgb: 124,58,237; }
.ex-card[data-ex="hypnose"]  { --ex-color: #8b5cf6; --ex-rgb: 139,92,246; }

.ex-card-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(var(--ex-rgb, 124,58,237), 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  transition: background 0.18s ease;
}

.ex-card.active .ex-card-icon-wrap {
  background: rgba(var(--ex-rgb, 124,58,237), 0.2);
}

.ex-card-emoji { font-size: 22px; line-height: 1; }

.ex-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1, var(--text));
  line-height: 1.2;
}

.ex-card-meta {
  font-size: 11px;
  color: rgba(255,255,255,0.38);
  line-height: 1.3;
}

.ex-card-duration {
  font-size: 11px;
  font-weight: 600;
  color: var(--ex-color, rgba(124,58,237,0.8));
  margin-top: 2px;
}

/* ── Exercise panel wrapper ── */
.ex-panel { animation: fadeIn .25s ease; }

.ex-panel-wrap {
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 24px;
  background: rgba(255,255,255,0.02);
  margin-bottom: 24px;
}

@media (max-width: 680px) {
  .ex-cards-grid { grid-template-columns: repeat(2, 1fr); }
  .ex-card { padding: 16px 10px 14px; }
  .ex-card-icon-wrap { width: 44px; height: 44px; }
  .ex-card-emoji { font-size: 18px; }
}

/* ── Breathing ── */
.breath-techniques {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.breath-tech-btn {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
}

.breath-tech-btn:hover { background: rgba(255,255,255,0.08); }

.breath-tech-btn.active {
  background: rgba(59,130,246,.18);
  border-color: rgba(59,130,246,.4);
  color: var(--blue);
  font-weight: 600;
}

.breath-info {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding: 12px 18px;
  border-radius: 12px;
  margin-bottom: 24px;
}

.breath-scene {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 260px;
  margin-bottom: 24px;
}

.breath-circle {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(124,58,237,.5), rgba(59,130,246,.4));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  transition: transform 0s linear;
  box-shadow: 0 0 40px rgba(124,58,237,.3);
}

.breath-label {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .02em;
}

.breath-count {
  font-size: 28px;
  font-weight: 800;
  color: rgba(255,255,255,.9);
  min-height: 36px;
  line-height: 1;
}

.breath-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid;
  opacity: 0;
  transition: transform 0s linear, opacity 0s linear;
}

.breath-ring-1 { width: 160px; height: 160px; border-color: rgba(124,58,237,.4); }
.breath-ring-2 { width: 200px; height: 200px; border-color: rgba(59,130,246,.25); }
.breath-ring-3 { width: 240px; height: 240px; border-color: rgba(124,58,237,.12); }

/* JS-driven expand class */
.breath-circle.expanding  { transition: transform var(--breath-dur,4s) ease-in-out; transform: scale(1.45); }
.breath-circle.holding    { transform: scale(1.45); }
.breath-circle.contracting { transition: transform var(--breath-dur,8s) ease-in-out; transform: scale(1); }
.breath-ring-1.expanding  { transition: transform var(--breath-dur,4s) ease-in-out, opacity .5s; transform: scale(1.7); opacity: .7; }
.breath-ring-2.expanding  { transition: transform var(--breath-dur,4s) ease-in-out, opacity .5s; transform: scale(1.6); opacity: .5; }
.breath-ring-3.expanding  { transition: transform var(--breath-dur,4s) ease-in-out, opacity .5s; transform: scale(1.5); opacity: .35; }
.breath-ring-1.contracting { transition: transform var(--breath-dur,8s) ease-in-out, opacity .5s; transform: scale(1); opacity: 0; }
.breath-ring-2.contracting { transition: transform var(--breath-dur,8s) ease-in-out, opacity .5s; transform: scale(1); opacity: 0; }
.breath-ring-3.contracting { transition: transform var(--breath-dur,8s) ease-in-out, opacity .5s; transform: scale(1); opacity: 0; }

.breath-progress-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.breath-cycles-label {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.breath-bar-wrap {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}

.breath-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--blue));
  border-radius: 3px;
  width: 0%;
  transition: width .5s;
}

.breath-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ── Body scan ── */
.scan-intro {
  padding: 16px 20px;
  border-radius: 14px;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.scan-intro p { margin: 0 0 8px; }
.scan-intro p:last-child { margin: 0; }
.scan-duration-note { color: var(--text-muted); font-size: 13px; }

.scan-scene {
  display: flex;
  gap: 24px;
  padding: 24px;
  border-radius: 16px;
  margin-bottom: 20px;
  min-height: 180px;
  align-items: center;
}

.scan-body-visual {
  width: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scan-highlight {
  width: 44px;
  height: 12px;
  border-radius: 6px;
  background: rgba(124,58,237,.5);
  box-shadow: 0 0 16px rgba(124,58,237,.5);
  transition: all .8s ease;
}

.scan-text-zone { flex: 1; }

.scan-step-label {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  transition: all .4s;
}

.scan-step-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 16px;
  transition: all .4s;
}

.scan-timer-bar {
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}

.scan-timer-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--blue));
  border-radius: 2px;
  width: 0%;
}

/* ── Hypnose Ericksonienne ── */
.hypno-themes {
  display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 16px;
}
.hypno-theme-btn {
  background: rgba(124,58,237,.08); border: 1px solid rgba(124,58,237,.25);
  border-radius: 20px; color: var(--text-muted); padding: .4rem 1.1rem;
  font-family: inherit; font-size: .85rem; cursor: pointer; transition: all var(--t);
}
.hypno-theme-btn:hover { color: var(--purple); border-color: var(--purple); }
.hypno-theme-btn.active { background: rgba(124,58,237,.25); border-color: var(--purple); color: #fff; }
.hypno-theme-btn:disabled { opacity: .4; cursor: not-allowed; }

.hypno-scene {
  display: flex; gap: 24px; align-items: center; padding: 24px;
  border-radius: 16px; min-height: 200px; margin-bottom: 20px;
  transition: background var(--t);
}
.hypno-scene.hypno-active { background: rgba(124,58,237,.06); }

.hypno-visual {
  position: relative; width: 160px; height: 160px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.hypno-ring {
  position: absolute; border-radius: 50%; border: 1.5px solid;
  animation: hypnoPulse 5s ease-in-out infinite;
}
.hypno-ring-3 { width: 148px; height: 148px; border-color: rgba(124,58,237,.15); animation-delay: -3.33s; }
.hypno-ring-2 { width: 104px; height: 104px; border-color: rgba(124,58,237,.3); animation-delay: -1.67s; }
.hypno-ring-1 { width: 62px; height: 62px; border-color: rgba(124,58,237,.55); }
.hypno-center {
  width: 32px; height: 32px; border-radius: 50%;
  background: radial-gradient(circle, #9f67fa 0%, var(--purple) 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 24px rgba(124,58,237,.7), 0 0 48px rgba(124,58,237,.3);
  animation: hypnoGlow 5s ease-in-out infinite;
}
.hypno-center-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.8); }

.hypno-text-zone {
  flex: 1; display: flex; flex-direction: column; gap: 12px; min-height: 140px;
}
.hypno-phase-label {
  font-size: .75rem; font-weight: 700; color: var(--purple);
  text-transform: uppercase; letter-spacing: .08em;
}
.hypno-step-text {
  font-size: 1rem; line-height: 1.75; color: var(--text-primary);
  font-style: italic; flex: 1;
}

@keyframes hypnoPulse {
  0%, 100% { transform: scale(1); opacity: .4; }
  50% { transform: scale(1.1); opacity: 1; }
}
@keyframes hypnoGlow {
  0%, 100% { box-shadow: 0 0 16px rgba(124,58,237,.5), 0 0 32px rgba(124,58,237,.2); }
  50% { box-shadow: 0 0 32px rgba(124,58,237,.9), 0 0 64px rgba(124,58,237,.5); }
}

/* ── Thoughts journal ── */
.thoughts-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  align-items: start;
}

.thoughts-form-card {
  border-radius: 16px;
  padding: 22px;
}

.thoughts-form-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 20px;
}

.thoughts-step {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
}

.thoughts-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(124,58,237,.2);
  border: 1px solid rgba(124,58,237,.4);
  color: var(--purple);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.thoughts-step-body { flex: 1; }

.emotion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.emotion-chip {
  padding: 5px 11px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}

.emotion-chip:hover { background: rgba(255,255,255,0.09); }

.emotion-chip.selected {
  background: rgba(124,58,237,.2);
  border-color: rgba(124,58,237,.5);
  color: var(--purple);
  font-weight: 600;
}

.intensity-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.intensity-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.1);
  outline: none;
  cursor: pointer;
}

.intensity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--purple);
  border: 2px solid rgba(255,255,255,.3);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(124,58,237,.5);
}

.form-select {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  cursor: pointer;
}

.form-select:focus { border-color: rgba(124,58,237,.5); }
.form-select option { background: #1a1a2e; color: var(--text-primary); }

/* Thoughts history column */
.thoughts-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.thoughts-history-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.thoughts-count {
  font-size: 12px;
  color: var(--purple);
  background: rgba(124,58,237,.12);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}

.thoughts-history {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 680px;
  overflow-y: auto;
}

.thought-card {
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 14px 16px;
  position: relative;
  transition: border-color .2s;
}

.thought-card:hover { border-color: rgba(255,255,255,0.14); }

.thought-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.thought-emotion-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(245,158,11,.15);
  color: #f59e0b;
}

.thought-date {
  font-size: 11px;
  color: var(--text-muted);
}

.thought-delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 14px;
  transition: color .15s;
}

.thought-delete-btn:hover { color: #ef4444; }

.thought-situation {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-style: italic;
}

.thought-pensee {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}

.thought-distorsion {
  font-size: 11px;
  color: #ef4444;
  background: rgba(239,68,68,.1);
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 8px;
}

.thought-alternative {
  font-size: 13px;
  color: #10b981;
  background: rgba(16,185,129,.07);
  border-left: 2px solid rgba(16,185,129,.4);
  padding: 8px 12px;
  border-radius: 0 8px 8px 0;
  line-height: 1.5;
}

.thought-intensity-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
}

.thought-int-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.thought-int-fill {
  height: 100%;
  border-radius: 2px;
}

.thought-int-before { background: #ef4444; }
.thought-int-after  { background: #10b981; }

@media (max-width: 768px) {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: loaderSpin .7s linear infinite;
  flex-shrink: 0;
}

.history-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px;
  color: var(--text-muted);
  font-size: 13px;
}

@media (max-width: 768px) {
  .hamburger-btn { display: flex; }

  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }

  .view-header { padding: 16px 18px 14px 60px; }

  .chat-header { padding: 14px 16px 14px 60px; }
  .messages-container { padding: 18px 16px; }
  .input-area { padding: 12px 14px; }

  .stats-grid  { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .dashboard-body  { padding: 16px 0 28px; }
  .journal-body    { padding: 16px 0 28px; }
  .suivi-section   { padding: 16px 16px 0; }
  .memory-list     { padding: 16px 16px 28px; }
  .profile-edit-body { padding: 16px; }
  .history-layout { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .history-list-panel { max-height: 300px; }
  .history-detail-panel { min-height: 400px; }
  .thoughts-layout { grid-template-columns: 1fr; }
  .thoughts-history { max-height: 400px; }

  .auth-card    { padding: 28px 24px; margin: 16px; }
  .profile-card { padding: 28px 20px; margin: 16px auto; }

  .message { max-width: 92%; }
  .form-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dr-name { font-size: 15px; }
  .chat-actions .btn span { display: none; }
}

/* ─────────────────────────────────────────────────────────
   SESSION ACTIVE BANNER
───────────────────────────────────────────────────────── */
.session-active-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 24px;
  background: rgba(124, 58, 237, 0.12);
  border-bottom: 1px solid rgba(124, 58, 237, 0.22);
  font-size: 13px;
  color: var(--text-2);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
}
.session-dot-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  animation: dot-pulse-live 1.5s ease-in-out infinite;
}
@keyframes dot-pulse-live {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.75); }
}
.session-banner-label { font-weight: 500; color: var(--text-primary); }
.session-banner-sep   { color: var(--muted); }
.session-banner-timer {
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.session-banner-resume {
  margin-left: auto;
  background: none;
  border: 1px solid rgba(124, 58, 237, 0.4);
  color: var(--accent);
  cursor: pointer;
  padding: 4px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  transition: background 0.2s, border-color 0.2s;
}
.session-banner-resume:hover {
  background: rgba(124, 58, 237, 0.18);
  border-color: rgba(124, 58, 237, 0.65);
}

/* ─────────────────────────────────────────────────────────
   DASHBOARD — SCORES PHQ-9 / GAD-7
───────────────────────────────────────────────────────── */
.scores-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.score-eval-card {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.score-eval-type {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}
.score-eval-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}
.score-eval-max {
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
}
.score-eval-sev {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  margin-top: 8px;
  display: inline-block;
}
.score-eval-date { font-size: 11px; color: var(--muted); margin-top: 5px; }

.sev-minimale            { background: rgba(34,197,94,0.15);  color: #22c55e; }
.sev-legere              { background: rgba(234,179,8,0.15);   color: #eab308; }
.sev-moderee             { background: rgba(249,115,22,0.15);  color: #f97316; }
.sev-severe              { background: rgba(239,68,68,0.15);   color: #ef4444; }
.sev-moderement-severe   { background: rgba(239,68,68,0.10);   color: #f87171; }

/* ─────────────────────────────────────────────────────────
   DASHBOARD — CARTE ANALYSE RÉCENTE
───────────────────────────────────────────────────────── */
.dash-analyse-card {
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
}
.dash-analyse-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}
.dash-analyse-score-block {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 4px;
}
.dash-analyse-score-num {
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.dash-analyse-score-denom { font-size: 18px; color: var(--muted); }
.dash-analyse-title { font-size: 12px; color: var(--muted); margin-top: 2px; }

.dash-emotion-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
}
.dash-emotion-name { width: 88px; font-size: 12px; color: var(--text-2); flex-shrink: 0; }
.dash-emotion-bar-bg {
  flex: 1;
  height: 5px;
  background: rgba(255,255,255,0.07);
  border-radius: 3px;
  overflow: hidden;
}
.dash-emotion-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}
.dash-emotion-val { font-size: 11px; color: var(--muted); width: 30px; text-align: right; flex-shrink: 0; }

.dash-analyse-synthese {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
  margin: 12px 0;
  font-style: italic;
}
.dash-analyse-link {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}
.dash-analyse-link:hover { text-decoration: underline; }

/* ─────────────────────────────────────────────────────────
   CONTEXTUAL "CONNECTED" SUBTITLE
───────────────────────────────────────────────────────── */
.view-subtitle-connected {
  font-size: 11px;
  color: var(--accent);
  margin-top: 4px;
  opacity: 0.75;
  display: flex;
  align-items: center;
  gap: 5px;
}
.view-subtitle-connected::before { content: '✦'; font-size: 8px; }

/* ─────────────────────────────────────────────────────────
   LAST SESSION CARD — mood arrow + duration
───────────────────────────────────────────────────────── */
.session-duration {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 10px;
}
.session-mood-arrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
}
.mood-score-badge { font-weight: 700; font-size: 15px; }
.mood-arrow-icon  { font-size: 16px; }

/* ─────────────────────────────────────────────────────────
   DISTRESS BANNER (orange)
───────────────────────────────────────────────────────── */
.distress-banner {
  background: linear-gradient(135deg, rgba(245,158,11,0.18), rgba(234,88,12,0.12));
  border-left: 4px solid var(--orange);
  border-bottom: 1px solid rgba(245,158,11,0.25);
  padding: 14px 20px;
  position: relative;
  z-index: 80;
}
.distress-content {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
}
.distress-icon { color: var(--orange); flex-shrink: 0; margin-top: 2px; }
.distress-text { flex: 1; min-width: 180px; }
.distress-text strong { display: block; color: var(--orange); font-size: 14px; margin-bottom: 3px; }
.distress-text span   { font-size: 13px; color: var(--text-2); }
.distress-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  width: 100%;
}
.distress-tool {
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: var(--radius-xs);
  padding: 5px 10px;
  font-size: 12px;
  color: var(--text-2);
}
.distress-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  flex-shrink: 0;
  transition: color var(--t) var(--ease);
}
.distress-close:hover { color: var(--text); }

/* ─────────────────────────────────────────────────────────
   ALERTES DASHBOARD
───────────────────────────────────────────────────────── */
.dash-alertes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.alerte-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
}
.alerte-info    { background: rgba(59,130,246,0.10); border-left: 3px solid var(--blue); color: var(--text-2); }
.alerte-warn    { background: rgba(245,158,11,0.10); border-left: 3px solid var(--orange); color: var(--text-2); }
.alerte-danger  { background: rgba(239,68,68,0.10);  border-left: 3px solid var(--red);    color: var(--text-2); }
.alerte-icon    { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.alerte-message { flex: 1; }

/* ─────────────────────────────────────────────────────────
   DEVOIRS THÉRAPEUTIQUES
───────────────────────────────────────────────────────── */
/* ─────────────────────────────────────────────────────────
   EXERCICES TAB BAR
───────────────────────────────────────────────────────── */
.extab-bar {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  margin-bottom: 24px;
}
.extab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.45);
  font-size: 13px;
  font-weight: 600;
  border-radius: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
}
.extab-btn:hover { color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.04); }
.extab-btn.active {
  background: rgba(124,58,237,0.15);
  color: #c4b5fd;
  box-shadow: 0 2px 8px rgba(124,58,237,0.15);
}
.extab-btn svg { flex-shrink: 0; opacity: 0.6; }
.extab-btn.active svg { opacity: 1; color: #a78bfa; }
.extab-badge {
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
  line-height: 1.5;
}

.extab-panel { display: none; animation: fadeIn 0.25s ease; }
.extab-panel.active { display: block; }

@media (max-width: 540px) {
  .extab-btn span:not(.extab-badge) { font-size: 12px; }
  .extab-btn { padding: 10px 10px; gap: 5px; }
  .extab-btn svg { width: 14px; height: 14px; }
}

/* ─────────────────────────────────────────────────────────
   DEVOIRS — Stats row
───────────────────────────────────────────────────────── */
.devoirs-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.devoirs-stat-card {
  padding: 16px;
  border-radius: 14px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.06);
}
.devoirs-stat-val {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 4px;
}
.devoirs-stat-done { color: #10b981; }
.devoirs-stat-pct  { color: #a78bfa; }
.devoirs-stat-label {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Progress bar */
.devoirs-progress-wrap {
  margin-bottom: 20px;
}
.devoirs-progress-track {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}
.devoirs-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #7c3aed, #3b82f6);
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(.4,0,.2,1);
}

/* Devoirs groups */
.devoirs-group { margin-bottom: 20px; }
.devoirs-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.devoirs-group-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.devoirs-dot-pending { background: #f59e0b; }
.devoirs-dot-done    { background: #10b981; }
.devoirs-group-title {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.devoirs-group-count {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 1px 8px;
}

.devoirs-list { display: flex; flex-direction: column; gap: 8px; }

/* Empty state */
.devoirs-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
  gap: 10px;
}
.devoirs-empty-title {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  margin: 0;
}
.devoirs-empty-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.2);
  margin: 0;
}

/* ─────────────────────────────────────────────────────────
   DEVOIR ITEM — card style
───────────────────────────────────────────────────────── */
.devoir-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  transition: all 0.2s ease;
}
.devoir-item:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.devoir-done {
  opacity: 0.45;
}
.devoir-done .devoir-titre {
  text-decoration: line-through;
  color: rgba(255,255,255,0.35);
}
.devoir-done:hover { opacity: 0.65; }

.devoir-check {
  display: flex;
  align-items: flex-start;
  padding-top: 2px;
  cursor: pointer;
  flex-shrink: 0;
}
.devoir-check input[type=checkbox] { display: none; }
.devoir-check-box {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.devoir-check-box:hover { border-color: rgba(255,255,255,0.3); }
.devoir-check input:checked + .devoir-check-box {
  background: #10b981;
  border-color: #10b981;
}
.devoir-check input:checked + .devoir-check-box::after {
  content: '✓';
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.devoir-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.devoir-top-row { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }

/* Type pills */
.devoir-type-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
.devoir-type-meditation  { background: rgba(59,130,246,0.15);  color: #60a5fa; }
.devoir-type-relaxation  { background: rgba(16,185,129,0.15);  color: #34d399; }
.devoir-type-journaling  { background: rgba(245,158,11,0.15);  color: #fbbf24; }
.devoir-type-exposition  { background: rgba(249,115,22,0.15);  color: #fb923c; }
.devoir-type-tcc         { background: rgba(124,58,237,0.15);  color: #a78bfa; }
.devoir-type-exercice    { background: rgba(236,72,153,0.15);  color: #f472b6; }
.devoir-type-autre       { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.4); }

.devoir-titre { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.4; }
.devoir-desc  { font-size: 12px; color: rgba(255,255,255,0.45); line-height: 1.5; }

.devoir-echeance        { font-size: 11px; color: rgba(255,255,255,0.3); margin-top: 2px; }
.devoir-echeance--late  { color: #ef4444; font-weight: 600; }
.devoir-echeance--soon  { color: #f59e0b; font-weight: 600; }

.devoir-delete-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.15);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.devoir-delete-btn:hover { color: #ef4444; background: rgba(239,68,68,0.1); }

/* ─────────────────────────────────────────────────────────
   FICHES PSYCHOÉDUCATIVES — personnalisées
───────────────────────────────────────────────────────── */
.psychoed-perso-section {
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 24px;
  border: 1px solid rgba(124, 58, 237, 0.2);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.05) 0%, rgba(59, 130, 246, 0.03) 100%);
}
.psychoed-perso-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.psychoed-perso-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
}
.psychoed-perso-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.psychoed-perso-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.psychoed-perso-empty {
  font-size: 13px;
  color: rgba(255,255,255,0.3);
  text-align: center;
  padding: 28px 16px;
}
.psychoed-perso-card {
  padding: 18px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
  transition: all 0.2s ease;
}
.psychoed-perso-card:hover {
  border-color: rgba(124, 58, 237, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.psychoed-perso-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.psychoed-perso-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.psychoed-theme-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.psychoed-theme-purple { background: rgba(124,58,237,.18); color: #a78bfa; }
.psychoed-theme-orange { background: rgba(251,146,60,.18); color: #fb923c; }
.psychoed-theme-blue   { background: rgba(59,130,246,.18); color: #60a5fa; }
.psychoed-theme-cyan   { background: rgba(34,211,238,.18); color: #22d3ee; }
.psychoed-theme-red    { background: rgba(239,68,68,.18); color: #f87171; }
.psychoed-theme-green  { background: rgba(34,197,94,.18); color: #4ade80; }
.psychoed-theme-pink   { background: rgba(236,72,153,.18); color: #f472b6; }
.psychoed-theme-amber  { background: rgba(245,158,11,.18); color: #fbbf24; }
.psychoed-theme-gray   { background: rgba(148,163,184,.12); color: #94a3b8; }
.psychoed-perso-card-body {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  line-height: 1.7;
}
.psychoed-perso-card-body p { margin: 0 0 8px; }
.psychoed-perso-card-body ul { padding-left: 18px; margin: 0 0 8px; }
.psychoed-perso-card-body li { margin-bottom: 4px; }
.psychoed-perso-card-body strong { color: var(--text); }
.psychoed-perso-card-body em { color: var(--muted); font-style: italic; }
.psychoed-auto-badge {
  margin-top: 12px;
  font-size: 11px;
  color: rgba(124, 58, 237, 0.6);
  font-style: italic;
}

/* ─────────────────────────────────────────────────────────
   FICHES DE RÉFÉRENCE — modern cards
───────────────────────────────────────────────────────── */
.psychoed-ref-section {
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.06);
}
.psychoed-ref-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}
.psychoed-ref-header h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}
.psychoed-ref-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
}

.psychoed-ref-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.psychoed-ref-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.2s ease;
}
.psychoed-ref-card[open] {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.12);
}
.psychoed-ref-card summary {
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
  transition: background 0.15s ease;
}
.psychoed-ref-card summary::-webkit-details-marker { display: none; }
.psychoed-ref-card summary:hover { background: rgba(255,255,255,0.03); }

.psychoed-ref-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(124,58,237,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.psychoed-ref-info { flex: 1; min-width: 0; }
.psychoed-ref-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.psychoed-ref-desc {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  margin-top: 2px;
}
.psychoed-ref-chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}
.psychoed-ref-chevron::after {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 2px solid rgba(255,255,255,0.25);
  border-bottom: 2px solid rgba(255,255,255,0.25);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}
.psychoed-ref-card[open] .psychoed-ref-chevron::after {
  transform: rotate(45deg);
}

.psychoed-ref-body {
  padding: 0 16px 18px 68px;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  line-height: 1.7;
}
.psychoed-ref-body p { margin: 0 0 8px; }
.psychoed-ref-body ul { padding-left: 18px; margin: 0 0 8px; }
.psychoed-ref-body li { margin-bottom: 4px; }
.psychoed-ref-body strong { color: var(--text); }
.psychoed-ref-body em { color: var(--muted); font-style: italic; }

@media (max-width: 540px) {
  .devoirs-stats-row { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .devoirs-stat-card { padding: 12px 8px; }
  .devoirs-stat-val { font-size: 22px; }
  .psychoed-ref-body { padding-left: 16px; }
}

/* ══════════════════════════════════════════════════════════════════
   V5 — Scores cliniques évolution
   ══════════════════════════════════════════════════════════════════ */

.scores-evolution {
  padding: 20px 24px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.scores-evolution-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.scores-evolution h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.eval-type-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 3px;
}
.eval-type-tab {
  padding: 5px 14px;
  border: none;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: all var(--t) var(--ease);
}
.eval-type-tab:hover { color: var(--text); background: var(--surface-3); }
.eval-type-tab.active {
  color: var(--text);
  background: var(--purple);
  box-shadow: 0 2px 8px rgba(124,58,237,0.35);
}
.scores-empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 24px 0;
}

/* ══════════════════════════════════════════════════════════════════
   V5 — Heatmap calendrier d'humeur
   ══════════════════════════════════════════════════════════════════ */

.heatmap-card {
  padding: 20px 24px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.heatmap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.heatmap-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.heatmap-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}
.heatmap-nav-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  transition: all var(--t) var(--ease);
}
.heatmap-nav-btn:hover { color: var(--text); background: var(--surface-3); border-color: var(--border-2); }

.heatmap-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}
.heatmap-weekdays span {
  text-align: center;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.mood-heatmap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  cursor: pointer;
  transition: transform .15s, opacity .15s;
  position: relative;
}
.heatmap-cell:hover { transform: scale(1.2); z-index: 2; }
.heatmap-cell-empty { background: transparent !important; cursor: default; }
.heatmap-cell-nodata { background: rgba(255,255,255,0.04); }
.heatmap-cell-today { outline: 2px solid var(--purple-2); outline-offset: 1px; }

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  justify-content: flex-end;
}
.heatmap-legend-label { font-size: 11px; color: var(--muted); }
.heatmap-legend-gradient {
  width: 80px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, rgb(124,58,237), rgb(34,197,94));
}

/* ══════════════════════════════════════════════════════════════════
   V5 — Rapport mensuel
   ══════════════════════════════════════════════════════════════════ */

.monthly-report-card {
  padding: 20px 24px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.report-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.report-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  flex: 1;
}
.report-period {
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 10px;
}
.report-content {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-2);
}
.report-content h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 20px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.report-content h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--purple-2);
  margin: 14px 0 6px;
}
.report-content p { margin: 6px 0; }
.report-content ul, .report-content ol {
  padding-left: 20px;
  margin: 6px 0;
}
.report-content li { margin-bottom: 3px; }
.report-content strong { color: var(--text); }
.report-empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 20px 0;
}
.report-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  padding: 12px 0;
}

/* ══════════════════════════════════════════════════════════════════
   V5 — Plan thérapeutique
   ══════════════════════════════════════════════════════════════════ */

.plan-section {
  padding: 20px 24px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.plan-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.plan-empty {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 16px 0;
}
.plan-titre-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--purple-2);
  display: block;
  margin-bottom: 12px;
}
.plan-title-row { margin-bottom: 4px; }
.plan-empty-obj {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 12px 0;
}
.objectifs-list { display: flex; flex-direction: column; gap: 14px; }

.objectif-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: border-color var(--t) var(--ease);
}
.objectif-item:hover { border-color: var(--border-2); }
.objectif-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.objectif-titre {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
}
.objectif-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.status-encours   { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.25); }
.status-atteint   { background: rgba(34,197,94,0.15);  color: #4ade80; border: 1px solid rgba(34,197,94,0.25); }
.status-abandonne { background: rgba(148,163,184,0.1); color: var(--muted); border: 1px solid var(--border); }

.objectif-mesure {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
  font-style: italic;
}
.objectif-echeance {
  display: block;
  font-size: 11px;
  color: var(--muted-2);
  margin-bottom: 8px;
}
.objectif-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.objectif-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--surface-3);
  border-radius: 3px;
  overflow: hidden;
}
.objectif-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--purple), var(--purple-2));
  transition: width .3s ease;
}
.objectif-pct {
  font-size: 12px;
  font-weight: 600;
  color: var(--purple-2);
  min-width: 34px;
  text-align: right;
}
.objectif-range {
  width: 100%;
  accent-color: var(--purple);
  cursor: pointer;
  margin-bottom: 8px;
}
.objectif-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}
.objectif-status-select {
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
}

/* Modal générique (plan / objectif) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.hidden { display: none; }
.modal-card {
  width: 100%;
  max-width: 460px;
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border-2);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.modal-close:hover { color: var(--text); }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}
.btn-xs { padding: 4px 10px; font-size: 11px; }

/* ══════════════════════════════════════════════════════════════════
   Dashboard fixes v5.1
   ══════════════════════════════════════════════════════════════════ */

/* 6 stat cards sur 3 colonnes × 2 rangées */
.stats-grid-6 {
  grid-template-columns: repeat(6, 1fr);
}
@media (max-width: 1100px) {
  .stats-grid-6 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .stats-grid-6 { grid-template-columns: repeat(2, 1fr); }
}

/* Stats compactes dans Indicateurs */
.stats-grid-6 .stat-card {
  padding: 12px 14px;
  gap: 6px;
}
.stats-grid-6 .stat-icon-bg {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}
.stats-grid-6 .stat-icon-bg svg {
  width: 15px;
  height: 15px;
}
.stats-grid-6 .stat-value {
  font-size: 20px;
}
.stats-grid-6 .stat-label {
  font-size: 11px;
}

/* Nouvelles couleurs stat */
.stat-green { background: rgba(34,197,94,0.15);  color: #4ade80; }
.stat-rose  { background: rgba(244,63,94,0.15);  color: #fb7185; }

/* Mini-widgets devoirs + plan */
.dash-mini-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 640px) {
  .dash-mini-row { grid-template-columns: 1fr; }
}

.dash-mini-card {
  border-radius: var(--radius);
  padding: 16px 18px;
}
.dash-mini-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.dash-mini-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.dash-mini-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-mini-empty {
  font-size: 12px;
  color: var(--muted);
}
.dash-mini-more {
  font-size: 11px;
  color: var(--muted);
  padding-top: 2px;
}

/* Devoir mini-item */
.dash-mini-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-mini-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--purple-2);
  flex-shrink: 0;
}
.dash-mini-text {
  font-size: 12.5px;
  color: var(--text-2);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-mini-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1px 6px;
  flex-shrink: 0;
}

/* Plan mini-objectif */
.dash-mini-obj { display: flex; flex-direction: column; gap: 4px; }
.dash-mini-obj-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.dash-mini-pct {
  font-size: 11px;
  font-weight: 700;
  color: var(--purple-2);
  flex-shrink: 0;
}
.dash-mini-bar-bg {
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
}
.dash-mini-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .4s ease;
}

/* ── Parcours timeline ───────────────────────────── */
.parcours-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.parcours-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}
.parcours-timeline { display: flex; flex-direction: column; }
.timeline-card {
  position: relative;
  padding: 0 0 24px 32px;
}
.timeline-card::before {
  content: '';
  position: absolute;
  left: 8px; top: 20px;
  width: 2px; bottom: 0;
  background: rgba(255,255,255,0.1);
}
.timeline-card:last-child::before { display: none; }
.timeline-dot {
  position: absolute;
  left: 3px; top: 16px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent-violet);
  border: 2px solid var(--bg);
}
.timeline-session { padding: 16px; border-radius: 12px; }
.timeline-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.timeline-date { font-weight: 600; color: var(--text-1); }
.timeline-duration { font-size: 13px; color: var(--muted); }
.timeline-mood {
  font-size: 12px;
  color: var(--accent-blue);
  font-weight: 600;
}
.badge-checkin {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(59,130,246,0.2);
  color: var(--accent-blue);
  font-weight: 600;
}
.timeline-resume {
  margin: 10px 0 8px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.timeline-devoirs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.timeline-devoir-chip {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  background: rgba(255,255,255,0.07);
  color: var(--text-2);
}
.timeline-devoir-chip.done {
  background: rgba(16,185,129,0.15);
  color: #10b981;
  text-decoration: line-through;
}
.parcours-sidebar { padding: 20px; }
.objectif-item { margin-bottom: 16px; }
.objectif-titre { font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text-1); }
.objectif-bar-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
}
.objectif-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-violet), var(--accent-blue));
  transition: width 0.6s ease;
}
.moment-cle-item {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
}
.moment-cle-type {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-violet);
  font-weight: 600;
  flex-shrink: 0;
  padding-top: 2px;
}
.moment-cle-text { color: var(--text-2); line-height: 1.4; }

/* ── Journal Sophie comment ───────────────────────── */
.journal-sophie-comment {
  padding: 16px 20px;
  margin-top: 16px;
  border-radius: 12px;
  border-left: 3px solid var(--accent-violet);
}
.sophie-comment-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-violet);
  margin-bottom: 8px;
  font-weight: 600;
}
.sophie-comment-text { font-size: 14px; color: var(--text-2); line-height: 1.6; }

/* ── Session type selector ───────────────────────── */
.session-type-selector {
  display: flex;
  gap: 12px;
  margin: 12px 0;
  flex-wrap: wrap;
}
.type-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.1);
  transition: border-color 0.2s, background 0.2s;
  font-size: 14px;
  color: var(--text-2);
}
.type-option:has(input:checked) {
  border-color: var(--accent-violet);
  background: rgba(124,58,237,0.15);
  color: var(--text-1);
}
.type-option input { display: none; }

/* ── Graphique humeur parcours ───────────────────── */
.parcours-mood-chart {
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 24px;
}
.parcours-mood-chart .chart-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 12px;
}
.parcours-mood-chart .chart-wrap { height: 180px; }

/* ── Exercice guidé ──────────────────────────────── */
/* ── Hypnose in-chat card ── */
.hypno-chat-card {
  padding: 20px; border-radius: 16px; margin: 12px 0;
  border-left: 3px solid var(--purple); max-width: 520px;
  background: rgba(124,58,237,.06);
}
.hypno-chat-card.hypno-chat-done { opacity: .7; }
.hypno-chat-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.hypno-chat-icon { font-size: 26px; flex-shrink: 0; }
.hypno-chat-info { flex: 1; }
.hypno-chat-title { font-weight: 700; font-size: 14px; color: var(--text-primary); }
.hypno-chat-theme { font-size: 12px; color: var(--purple); margin-top: 2px; }
.hypno-chat-close {
  background: none; border: none; color: var(--text-muted); font-size: 18px;
  cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: color var(--t);
  flex-shrink: 0;
}
.hypno-chat-close:hover { color: var(--text-primary); }
.hypno-chat-visual {
  position: relative; width: 100px; height: 100px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.hypno-chat-visual .hypno-ring-3 { width: 92px; height: 92px; }
.hypno-chat-visual .hypno-ring-2 { width: 66px; height: 66px; }
.hypno-chat-visual .hypno-ring-1 { width: 40px; height: 40px; }
.hypno-chat-visual .hypno-center { width: 22px; height: 22px; }
.hypno-chat-body { display: flex; flex-direction: column; gap: 8px; }

.exercise-card {
  padding: 20px;
  border-radius: 16px;
  margin: 12px 0;
  border-left: 3px solid var(--accent-violet);
  max-width: 480px;
}
.exercise-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}
.exercise-icon { font-size: 28px; }
.exercise-titre {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-1);
}
.exercise-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.exercise-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.exercise-step-text {
  font-size: 15px;
  color: var(--text-1);
  text-align: center;
  line-height: 1.5;
  min-height: 44px;
}
.exercise-timer-wrap {
  position: relative;
  width: 80px;
  height: 80px;
}
.exercise-ring { width: 80px; height: 80px; }
.exercise-ring circle {
  transition: stroke-dashoffset 0.9s linear;
}
.exercise-timer-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-violet);
}
.exercise-rep {
  font-size: 12px;
  color: var(--muted);
  min-height: 16px;
}
.exercise-stop {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  align-self: center;
}
.exercise-done {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  color: #10b981;
  font-size: 14px;
}
.exercise-done-icon {
  font-size: 22px;
  font-weight: 700;
}

/* ── Responsive parcours ─────────────────────────── */
@media (max-width: 768px) {
  .parcours-layout { grid-template-columns: 1fr; }
  .parcours-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ══════════════════════════════════════════════════════════════════
   Analytics séances
   ══════════════════════════════════════════════════════════════════ */

/* Section header */
.analytics-section-header {
  margin: 8px 0 20px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.analytics-section-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-1);
  margin: 0;
}
.analytics-section-sub {
  font-size: 13px;
  color: var(--muted);
}

/* Bannière bien-être */
.wellbeing-banner {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 4px 16px;
  padding: 20px 24px;
  border-radius: 14px;
  margin-bottom: 20px;
  border-left: 4px solid #10b981;
  position: relative;
  overflow: hidden;
}
.wb-left {
  display: flex;
  align-items: baseline;
  gap: 4px;
  grid-row: 1 / 3;
  align-self: center;
}
.wb-score {
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
}
.wb-max {
  font-size: 22px;
  color: var(--muted);
  font-weight: 400;
}
.wb-right {
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
}
.wb-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
}
.wb-trend {
  font-size: 13px;
  font-weight: 500;
}
.wb-up   { color: #10b981; }
.wb-down { color: #ef4444; }
.wb-flat { color: #f59e0b; }
.wb-sub  { font-size: 12px; color: var(--muted); }
.wb-gauge {
  grid-column: 1 / 3;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 12px;
}
.wb-gauge-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s ease;
}

/* Grille analytics double colonne */
.analytics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.analytics-row .chart-card { margin-bottom: 0; }

/* Thèmes récurrents */
.themes-bars {
  padding: 8px 4px;
}
.theme-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.theme-word {
  font-size: 13px;
  color: var(--text-2);
  width: 100px;
  flex-shrink: 0;
  text-align: right;
}
.theme-bar-track {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.07);
  border-radius: 4px;
  overflow: hidden;
}
.theme-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-violet), var(--accent-blue));
  transition: width 0.6s ease;
}
.theme-count {
  font-size: 12px;
  color: var(--muted);
  width: 28px;
  text-align: right;
}

/* Responsive analytics */
@media (max-width: 768px) {
  .analytics-row { grid-template-columns: 1fr; }
  .wb-score { font-size: 42px; }
}

/* ════════════════════════════════════════════════════════════
   SCROLL — vues génériques avec .view-body
════════════════════════════════════════════════════════════ */

/* ── Scroll global : toutes les vues avec conteneur interne ── */
#view-clinique,
#view-agenda,
#view-exercises,
#view-memory,
#view-analyse,
#view-parcours,
#view-abonnement,
#view-history { overflow: hidden; }

/* Conteneur générique .view-body (clinique, agenda, abonnement) */
.view-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 40px;
  min-height: 0;
}




/* Mémoire long terme */
.memory-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* Analyse — le contenu est direct sous le header */
#view-analyse > *:not(.view-header) {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}


/* ════════════════════════════════════════════════════════════
   DOSSIER CLINIQUE v7
════════════════════════════════════════════════════════════ */

.clinique-section {
  margin-bottom: 2rem;
}

.clinique-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.clinique-section-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

/* Formulation de cas */
.formulation-card {
  padding: 1.5rem;
}

.formulation-card h1,
.formulation-card h2,
.formulation-card h3 {
  color: var(--text-primary);
  margin-top: 1.2rem;
}

.formulation-meta {
  font-size: .75rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.formulation-unavail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  padding: 2rem;
  color: var(--text-muted);
  text-align: center;
}

/* Plan de sécurité */
.safety-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.safety-section {
  padding: 1rem 1.2rem;
  border-radius: 12px;
}

.safety-section h4 {
  margin: 0 0 .6rem;
  font-size: .9rem;
  font-weight: 600;
}

.safety-section ul {
  margin: 0;
  padding-left: 1.2rem;
  font-size: .875rem;
  line-height: 1.6;
}

.safety-orange { background: rgba(249,115,22,.1); border: 1px solid rgba(249,115,22,.25); }
.safety-blue   { background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.25); }
.safety-green  { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.25); }
.safety-violet { background: rgba(139,92,246,.1); border: 1px solid rgba(139,92,246,.25); }

/* Badge pulsant plan sécurité sidebar */
.safety-pulse-badge {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  margin-left: auto;
  animation: safePulse 1.8s ease-in-out infinite;
}

@keyframes safePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(1.4); }
}

/* EMDR cards */
.emdr-card {
  padding: 1.2rem;
  margin-bottom: 1rem;
}

.emdr-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .6rem;
}

.emdr-desc {
  font-size: .9rem;
  font-weight: 500;
  flex: 1;
}

.emdr-cogn {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: .3rem;
}

.emdr-cogn-label {
  display: inline-block;
  padding: .1rem .4rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: .7rem;
  letter-spacing: .03em;
}

.emdr-cogn-label.cn { background: rgba(239,68,68,.2); color: #ef4444; }
.emdr-cogn-label.cp { background: rgba(16,185,129,.2); color: #10b981; }

.emdr-bars {
  margin: .8rem 0;
}

.emdr-bar-row {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: .4rem;
}

.emdr-bar-label {
  font-size: .75rem;
  color: var(--text-muted);
  min-width: 70px;
}

/* SUD bar (rouge → jaune → vert) */
.sud-bar-wrap, .voc-bar-wrap {
  flex: 1;
  background: rgba(255,255,255,.08);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}

.sud-bar {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #22c55e 0%, #eab308 50%, #ef4444 100%);
  transition: width .4s ease;
}

.voc-bar {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #ef4444 0%, #7c3aed 100%);
  transition: width .4s ease;
}

.emdr-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: .6rem;
}

.emdr-update-form {
  margin-top: .8rem;
  padding-top: .8rem;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* Ressources grid */
.ressources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.ressource-card {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  padding: 1rem;
  position: relative;
}

.ressource-icon { font-size: 1.6rem; flex-shrink: 0; }

.ressource-body { flex: 1; min-width: 0; }

.ressource-nom {
  font-size: .875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ressource-desc {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .2rem;
  line-height: 1.4;
}

/* Patterns */
.pattern-item {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .8rem 1rem;
  margin-bottom: .6rem;
  border-radius: 10px;
  flex-wrap: wrap;
}

.domaine-badge {
  padding: .2rem .6rem;
  border-radius: 6px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  flex-shrink: 0;
}

.pattern-desc { flex: 1; font-size: .875rem; }

.pattern-count {
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255,255,255,.07);
  padding: .1rem .5rem;
  border-radius: 6px;
  flex-shrink: 0;
}

/* Valeurs ACT table */
.valeurs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.valeurs-table th {
  text-align: left;
  padding: .5rem .6rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: .75rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.valeurs-table td {
  padding: .4rem .6rem;
  border-bottom: 1px solid rgba(255,255,255,.05);
  vertical-align: middle;
}

.btn-danger { border-color: rgba(239,68,68,.4); color: #ef4444; }
.btn-danger:hover { background: rgba(239,68,68,.15); }

.btn-xs {
  padding: .2rem .5rem;
  font-size: .75rem;
  border-radius: 6px;
}

/* ════════════════════════════════════════════════════════════
   AGENDA v7
════════════════════════════════════════════════════════════ */

.agenda-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.2rem 1.5rem;
  margin-bottom: 1rem;
  gap: 1rem;
}

.agenda-card-left { flex: 1; }

.agenda-date {
  font-size: .95rem;
  font-weight: 600;
  margin-bottom: .4rem;
  text-transform: capitalize;
}

.agenda-meta {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}

.agenda-notes {
  font-size: .8rem;
  color: var(--text-muted);
  font-style: italic;
}

.agenda-card-actions {
  display: flex;
  gap: .6rem;
  flex-shrink: 0;
  align-items: center;
}

@media (max-width: 600px) {
  .safety-grid { grid-template-columns: 1fr; }
  .ressources-grid { grid-template-columns: 1fr 1fr; }
  .agenda-card { flex-direction: column; }
  .emdr-header { flex-direction: column; }
}

/* ════════════════════════════════════════════════════════════
   V8 — Nouvelles sections unifiées
════════════════════════════════════════════════════════════ */

/* ── Suivi sections ── */
.suivi-section {
  margin-bottom: 2.5rem;
  padding: 24px 28px 0;
}

.suivi-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.2rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.suivi-section-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.suivi-section-sub {
  font-size: .8rem;
  color: var(--text-muted);
}


/* ── Profile tabs ── */
.profile-tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  padding-bottom: 0;
}

.profile-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: .95rem;
  font-weight: 500;
  padding: .6rem 1.2rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--t), border-color var(--t);
}

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

.profile-tab.active {
  color: var(--purple);
  border-bottom-color: var(--purple);
}

.profile-tab-content {
  animation: fadeIn .2s ease;
}

/* ════════════════════════════════════════════════
   ONGLETS INTERNES — Mon Suivi & Mon Parcours
   (même style que .profile-tabs / .profile-tab)
════════════════════════════════════════════════ */
#view-suivi  { overflow: hidden; }
.suivi-scroll-body { flex: 1; overflow-y: auto; min-height: 0; }

.view-inner-tabs {
  display: flex;
  gap: .5rem;
  padding: 0 28px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.view-inner-tabs::-webkit-scrollbar { display: none; }

.view-inner-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: .95rem;
  font-weight: 500;
  padding: .6rem 1.2rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color var(--t), border-color var(--t);
}
.view-inner-tab:hover  { color: var(--text-primary); }
.view-inner-tab.active { color: var(--purple); border-bottom-color: var(--purple); }

.view-inner-tab .tab-badge {
  display: inline-block;
  background: var(--purple);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  line-height: 1.6;
  margin-left: 4px;
  vertical-align: middle;
}

/* Barre d'alertes dans l'onglet Journal */
.alertes-tab-bar { margin-bottom: 20px; }

@media (max-width: 768px) {
  .view-inner-tabs { padding: 0 16px; }
  .view-inner-tab  { font-size: .85rem; padding: .5rem .9rem; }
}

/* ─────────────────────────────────────────────────────────────
   Neuro Metrics — Bilan psychologique + Cerveau animé
   ───────────────────────────────────────────────────────────── */

#neuro-metrics-section {
  display: none;
  margin-bottom: 8px;
}

.neuro-disclaimer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  border-radius: 10px;
  margin-bottom: 12px;
}

.neuro-confiance-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
}

/* Card commune */
.neuro-card {
  margin-bottom: 12px;
}

/* ── Jauges demi-donut ── */
.neuro-gauges-row {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 16px;
  padding: 8px 0 4px;
}

.neuro-gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.neuro-gauge-label {
  position: absolute;
  bottom: 6px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.neuro-gauge-pct {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.neuro-gauge-name {
  font-size: 11px;
  color: var(--text-2);
  text-align: center;
  margin-top: 6px;
}

/* ── Tendance row ── */
.neuro-tendance-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.neuro-tendance-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}

.neuro-wellbeing-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-2);
}

/* ── Rechute non applicable ── */
.neuro-relapse-na {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 160px;
  height: 90px;
  color: rgba(255,255,255,0.25);
}

.neuro-relapse-reason {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  text-align: center;
  margin-top: 4px;
  font-style: italic;
  max-width: 140px;
}

/* ── Cerveau SVG ── */
.neuro-brain-layout {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
}

.neuro-brain-svg-wrap {
  background: rgba(15,15,26,0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  flex: 0 0 auto;
}

.brain-region {
  cursor: default;
  transition: opacity 0.2s;
}

@keyframes brainGlow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(239,68,68,0.5)); }
  50%       { filter: drop-shadow(0 0 10px rgba(239,68,68,0.9)); }
}

.brain-region-glow {
  animation: brainGlow 2s ease-in-out infinite;
}

/* ── Légende cerveau ── */
.neuro-brain-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 160px;
  min-width: 130px;
}

.neuro-legend-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-2);
}

.neuro-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.neuro-legend-divider {
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

.neuro-brain-detail {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.neuro-detail-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.neuro-detail-name {
  flex: 1;
  font-size: 12px;
  color: var(--text-2);
}

.neuro-detail-val {
  font-size: 11px;
  color: var(--text-3, rgba(255,255,255,0.4));
  font-weight: 600;
}

/* ── Cartes région cérébrale enrichies ── */
.neuro-region-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s;
}

.neuro-region-card--alert {
  border-color: rgba(239,68,68,0.35);
  background: rgba(239,68,68,0.04);
}

.neuro-region-card-header {
  display: flex;
  align-items: center;
  gap: 7px;
}

.neuro-region-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
  flex: 1;
}

.neuro-region-label {
  font-size: 11px;
  font-weight: 600;
}

.neuro-region-score {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  font-variant-numeric: tabular-nums;
}

.neuro-region-role {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.02em;
}

.neuro-region-impact {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  line-height: 1.45;
  margin-top: 2px;
}

/* ── Badge éducatif amber ── */
.neuro-edu-badge {
  background: rgba(245,158,11,0.12) !important;
  color: #fbbf24 !important;
}

/* ── Responsive ── */
/* ── Signaux verbaux (transcriptions séances) ── */
.neuro-verbal-signals {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.verbal-signals-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 10px;
}

.verbal-signals-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.verbal-signal-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid;
  font-size: 11px;
  font-weight: 500;
  cursor: default;
}

@media (max-width: 640px) {
  .neuro-brain-svg-wrap svg {
    width: 100%;
    height: auto;
  }
  .neuro-gauge-label {
    bottom: 2px;
  }
  .neuro-gauge-pct {
    font-size: 18px;
  }
  .neuro-brain-layout {
    flex-direction: column;
  }
}

/* ── Séparateur entre analytics et transcript insights ── */
.tia-divider {
  border-top: 1px solid var(--border);
  margin: 24px 0;
  position: relative;
}

.tia-divider::after {
  content: 'Analyse lexicale';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  padding: 0 12px;
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  white-space: nowrap;
}

/* ─────────────────────────────────────────────────────────────
   Transcript Insights — Analyse des séances
   ───────────────────────────────────────────────────────────── */

.tia-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 32px 20px;
  color: rgba(255,255,255,0.4);
  font-size: 13px;
}

.tia-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(124,58,237,0.3);
  border-top-color: #7c3aed;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.tia-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 20px;
  text-align: center;
  color: rgba(255,255,255,0.35);
  font-size: 14px;
}

/* Stats résumé */
.tia-summary-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.tia-stat {
  padding: 16px;
  border-radius: 12px;
  text-align: center;
}

.tia-stat-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
}

.tia-stat-label {
  font-size: 11px;
  color: var(--text-2);
}

/* Card commune */
.tia-card {
  margin-bottom: 12px;
}

/* Two-col layout */
.tia-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

/* Thèmes */
.tia-themes-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0;
}

.tia-theme-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tia-theme-name {
  width: 180px;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-2);
}

.tia-theme-bar-wrap {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
  height: 18px;
  overflow: hidden;
}

.tia-theme-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
  min-width: 4px;
}

.tia-theme-pct {
  width: 38px;
  text-align: right;
  font-size: 11px;
  font-weight: 600;
}

/* Patterns cognitifs */
.tia-patterns-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0;
}

.tia-pattern-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tia-pattern-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tia-pattern-name {
  font-size: 12px;
  color: var(--text-2);
  flex: 1;
}

.tia-pattern-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}

.tia-pattern-bar-wrap {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.tia-pattern-bar {
  height: 100%;
  border-radius: 2px;
  opacity: 0.7;
  transition: width 0.6s ease;
}

/* Détail séances */
.tia-sessions-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tia-session-item {
  border-bottom: 1px solid var(--border);
}

.tia-session-item:last-child { border-bottom: none; }

.tia-session-latest .tia-session-header {
  background: rgba(124,58,237,0.04);
}

.tia-session-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s;
}

.tia-session-header:hover { background: rgba(255,255,255,0.04); }

.tia-session-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tia-session-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
}

.tia-session-words {
  font-size: 11px;
  color: var(--text-3, rgba(255,255,255,0.35));
}

.tia-session-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tia-emo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.tia-session-emo {
  font-size: 12px;
  font-weight: 500;
}

.tia-chevron {
  color: rgba(255,255,255,0.3);
  transition: transform 0.2s;
}

.tia-session-open .tia-chevron { transform: rotate(180deg); }

.tia-session-body {
  display: none;
  padding: 0 4px 14px;
}

.tia-session-open .tia-session-body { display: block; }

.tia-sess-themes-row, .tia-sess-patterns-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.tia-sess-theme {
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  background: rgba(124,58,237,0.15);
  color: #a78bfa;
  border: 1px solid rgba(124,58,237,0.25);
}

.tia-sess-pattern {
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  background: rgba(245,158,11,0.1);
  color: #fbbf24;
  border: 1px solid rgba(245,158,11,0.2);
}

.tia-key-phrase {
  margin: 8px 0 0;
  padding: 10px 14px;
  border-left: 3px solid rgba(124,58,237,0.5);
  background: rgba(124,58,237,0.06);
  border-radius: 0 8px 8px 0;
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  font-style: italic;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .tia-summary-row    { grid-template-columns: repeat(2,1fr); }
  .tia-two-col        { grid-template-columns: 1fr; }
  .tia-theme-name     { width: 120px; }
}

/* ─────────────────────────────────────────────────────────────
   Plan thérapeutique — Mon Parcours (refonte)
   ───────────────────────────────────────────────────────────── */

.plan-parcours-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 20px;
  text-align: center;
  color: rgba(255,255,255,0.35);
  font-size: 14px;
  border-radius: 14px;
  margin-top: 12px;
}

/* En-tête du plan */
.plan-header-card {
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
}

.plan-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.plan-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
}

.plan-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}

.plan-statut-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Progression globale */
.plan-global-progress { display: flex; flex-direction: column; gap: 6px; }

.plan-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-2);
}

.plan-progress-track {
  height: 8px;
  background: rgba(255,255,255,0.07);
  border-radius: 4px;
  overflow: hidden;
}

.plan-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.plan-progress-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
}

/* Sections objectifs */
.plan-obj-section {
  margin-bottom: 20px;
}

.plan-obj-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 10px;
}

.plan-obj-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.plan-obj-count {
  margin-left: auto;
  background: rgba(255,255,255,0.07);
  padding: 1px 8px;
  border-radius: 20px;
  font-size: 11px;
  color: var(--text-3, rgba(255,255,255,0.35));
}

.plan-obj-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Carte objectif */
.plan-obj-card {
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border);
}

.plan-obj-card--done {
  border-color: rgba(16,185,129,0.2);
  background: rgba(16,185,129,0.04);
  opacity: 0.85;
}

.plan-obj-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-obj-check { flex-shrink: 0; }

.plan-obj-card-titre {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.3;
}

.plan-obj-mesure {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 6px 10px;
  line-height: 1.4;
}

.plan-obj-echeance {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
}

.plan-obj-echeance--late {
  color: #ef4444;
  font-weight: 600;
}

.plan-obj-echeance--soon {
  color: #f59e0b;
  font-weight: 600;
}

.plan-obj-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.plan-obj-track {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.07);
  border-radius: 3px;
  overflow: hidden;
}

.plan-obj-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.plan-obj-pct {
  font-size: 12px;
  font-weight: 700;
  min-width: 34px;
  text-align: right;
}

.plan-obj-none {
  font-size: 13px;
  color: rgba(255,255,255,0.3);
  padding: 8px 0;
  font-style: italic;
}

/* ════════════════════════════════════════════════════════════
   SUIVI v11 — 4 blocs professionnels
════════════════════════════════════════════════════════════ */

.suivi-scroll-body {
  padding: 0 20px 40px;
}

.suivi-bloc {
  margin-bottom: 28px;
}

.suivi-bloc.glass {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 20px 24px;
}

.suivi-bloc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 16px;
}

.suivi-bloc-title {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #f1f5f9);
  display: flex;
  align-items: center;
  gap: 8px;
}

.suivi-bloc-sub {
  font-size: .8rem;
  color: var(--text-muted, #64748b);
  margin: 0 0 16px;
}

/* ── KPI Row ── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: border-color .2s;
}

.kpi-card:hover {
  border-color: rgba(124,58,237,0.3);
}

.kpi-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1;
  display: inline;
}

.kpi-max {
  font-size: .85rem;
  color: #64748b;
  display: inline;
}

.kpi-label {
  font-size: .75rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 6px;
}

.kpi-delta {
  font-size: .75rem;
  margin-top: 4px;
  min-height: 18px;
}

/* ── KPI Scores badges ── */
.kpi-scores-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.kpi-score-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: .8rem;
}

.kpi-score-type {
  color: #94a3b8;
  font-weight: 500;
}

.kpi-score-val {
  color: #f1f5f9;
  font-weight: 700;
  font-size: .95rem;
}

.kpi-score-sev {
  font-size: .75rem;
  font-weight: 500;
}

.kpi-sessions-badge {
  margin-left: auto;
  background: rgba(124,58,237,0.1);
  border-color: rgba(124,58,237,0.2);
}

/* ── Suivi Grid ── */
.suivi-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

/* ── Period toggle ── */
.suivi-period-toggle {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 3px;
}

.period-btn {
  background: none;
  border: none;
  color: #64748b;
  padding: 5px 14px;
  border-radius: 6px;
  font-size: .8rem;
  cursor: pointer;
  transition: all .15s;
}

.period-btn.active {
  background: rgba(124,58,237,0.2);
  color: #c4b5fd;
}

.period-btn:hover:not(.active) {
  color: #94a3b8;
}

/* ── Smaller eval tabs for inline use ── */
.eval-type-tabs-sm {
  gap: 2px;
}
.eval-type-tabs-sm .eval-type-tab {
  padding: 3px 10px;
  font-size: .7rem;
}

/* ── Correlations bullets ── */
.correlations-bullets {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.correlation-bullet {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .85rem;
  color: #cbd5e1;
  line-height: 1.4;
}

.correlation-bullet::before {
  content: '';
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7c3aed;
  margin-top: 6px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .suivi-grid-2 { grid-template-columns: 1fr; }
  .kpi-scores-row { flex-direction: column; }
  .kpi-sessions-badge { margin-left: 0; }
  .suivi-scroll-body { padding: 0 12px 30px; }
  .suivi-bloc.glass { padding: 16px; }
}

/* ════════════════════════════════════════════════════════════
   ANALYSE IA v11 — Progression objectifs + Recommandations
════════════════════════════════════════════════════════════ */

/* ── Progression objectifs v2 ── */
.prog-obj-item-v2 {
  padding: 14px 16px;
  background: rgba(124,58,237,0.05);
  border: 1px solid rgba(124,58,237,0.12);
  border-radius: 12px;
  margin-bottom: 10px;
}

.prog-obj-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.prog-obj-item-v2 .prog-obj-name {
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
}

.prog-obj-score {
  font-size: 16px;
  font-weight: 700;
  color: #f1f5f9;
}

.prog-obj-bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.prog-obj-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.prog-obj-eval-badge {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.prog-obj-item-v2 .prog-obj-evidence {
  font-size: 12px;
  color: rgba(148,163,184,0.7);
  font-style: italic;
  margin-top: 4px;
  line-height: 1.4;
}

/* Sous-objectifs */
.prog-sub-list {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.prog-sub-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 12px;
}

.prog-sub-name {
  color: #94a3b8;
  min-width: 120px;
  flex-shrink: 0;
}

.prog-sub-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.prog-sub-fill {
  height: 100%;
  border-radius: 2px;
}

.prog-sub-pct {
  color: #64748b;
  font-size: 11px;
  min-width: 32px;
  text-align: right;
}

/* ── Recommandations v2 ── */
.analyse-recos-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reco-item {
  padding: 12px 16px;
  background: rgba(245,158,11,0.05);
  border: 1px solid rgba(245,158,11,0.12);
  border-radius: 10px;
}

.reco-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.reco-prio-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.reco-action {
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
}

.reco-technique {
  font-size: 11px;
  padding: 2px 8px;
  background: rgba(124,58,237,0.15);
  color: #c4b5fd;
  border-radius: 4px;
  font-weight: 500;
}

.reco-justification {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 6px;
  line-height: 1.5;
}

.reco-text {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.5;
}

/* ─── Breathing Guide Overlay ─────────────────────────────── */
.breathing-overlay {
  position: fixed; inset: 0;
  background: rgba(15,15,26,0.92);
  backdrop-filter: blur(20px);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  animation: breathFadeIn .3s ease;
}
.breathing-overlay.hidden { display: none; }
@keyframes breathFadeIn { from { opacity: 0; } to { opacity: 1; } }

.breathing-content {
  position: relative;
  max-width: 400px; width: 90%;
  text-align: center;
}
.breathing-close {
  position: absolute; top: -40px; right: 0;
  background: none; border: none; color: #94a3b8;
  font-size: 28px; cursor: pointer; transition: color .2s;
}
.breathing-close:hover { color: #fff; }

.breathing-picker h3 {
  font-size: 20px; color: #f1f5f9; margin-bottom: 8px;
}
.breathing-subtitle {
  font-size: 13px; color: #94a3b8; margin-bottom: 20px;
}
.breathing-choice {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 14px 18px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; color: #e2e8f0;
  font-size: 14px; cursor: pointer;
  transition: all .2s; margin-bottom: 10px;
  text-align: left;
}
.breathing-choice:hover {
  background: rgba(124,58,237,0.15);
  border-color: rgba(124,58,237,0.3);
  transform: translateY(-1px);
}
.breathing-choice-icon { font-size: 24px; }

/* Exercise circle */
.breathing-circle {
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,0.3) 0%, rgba(59,130,246,0.1) 100%);
  border: 3px solid rgba(124,58,237,0.5);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  transition: transform ease, border-color .5s, box-shadow .5s;
  box-shadow: 0 0 40px rgba(124,58,237,0.2);
}
.breathing-circle.inhale {
  transform: scale(1.35);
  border-color: rgba(124,58,237,0.8);
  box-shadow: 0 0 60px rgba(124,58,237,0.4);
}
.breathing-circle.hold {
  transform: scale(1.35);
  border-color: rgba(59,130,246,0.8);
  box-shadow: 0 0 60px rgba(59,130,246,0.3);
}
.breathing-circle.exhale {
  transform: scale(1);
  border-color: rgba(16,185,129,0.6);
  box-shadow: 0 0 40px rgba(16,185,129,0.2);
}
.breathing-circle-inner {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.breathing-phase {
  font-size: 18px; font-weight: 600; color: #f1f5f9;
}
.breathing-timer {
  font-size: 36px; font-weight: 700; color: #c4b5fd;
  font-variant-numeric: tabular-nums;
}
.breathing-name {
  font-size: 15px; color: #c4b5fd; font-weight: 600; margin-bottom: 4px;
}
.breathing-cycle {
  font-size: 13px; color: #64748b; margin-bottom: 20px;
}
.breath-detect-wrap {
  margin: 12px 0; text-align: center;
}
.breath-detect-label {
  font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px;
}
.breath-detect-track {
  width: 80%; max-width: 200px; height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px; margin: 6px auto 0; overflow: hidden;
}
.breath-detect-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #7c3aed, #3b82f6);
  border-radius: 3px;
  transition: width .1s ease;
}

.breathing-stop-btn {
  border: 1px solid rgba(255,255,255,0.1) !important;
}

/* ─── Therapeutic Moment Toast ────────────────────────────── */
.therapeutic-moment-toast {
  position: fixed; top: 80px; right: 20px;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  background: rgba(15,15,26,0.9);
  border: 1px solid var(--tm-color, #7c3aed);
  border-left: 4px solid var(--tm-color, #7c3aed);
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3), 0 0 20px color-mix(in srgb, var(--tm-color) 20%, transparent);
  backdrop-filter: blur(12px);
  z-index: 10000;
  transform: translateX(120%);
  transition: transform .4s cubic-bezier(.22,1,.36,1), opacity .3s;
  opacity: 0;
}
.therapeutic-moment-toast.show {
  transform: translateX(0);
  opacity: 1;
}
.tm-icon { font-size: 22px; }
.tm-label { font-size: 14px; font-weight: 600; color: #e2e8f0; }

/* ─── Ambient Sound Picker ────────────────────────────────── */
.ambient-picker {
  position: absolute; bottom: 40px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 4px;
  background: rgba(15,15,26,0.95);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; padding: 8px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 100; min-width: 130px;
}
.ambient-picker.hidden { display: none; }
.ambient-pick-btn {
  background: none; border: none; color: #e2e8f0;
  padding: 8px 12px; border-radius: 8px; cursor: pointer;
  font-size: 13px; text-align: left; transition: background .2s;
  white-space: nowrap;
}
.ambient-pick-btn:hover { background: rgba(124,58,237,0.2); }
.ambient-stop-btn { color: #ef4444; border-top: 1px solid rgba(255,255,255,0.06); margin-top: 4px; padding-top: 10px; }

/* ─── SOAP Clinical Notes ─────────────────────────────────── */
.soap-btn {
  font-size: 13px; margin: 8px 0;
  border: 1px solid rgba(124,58,237,0.3) !important;
  color: #c4b5fd !important;
}
.soap-btn:hover { background: rgba(124,58,237,0.15) !important; }
.soap-loading { font-size: 13px; color: #94a3b8; padding: 12px 0; }
.soap-note {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px; padding: 16px; margin: 8px 0;
}
.soap-title { font-size: 15px; color: #e2e8f0; margin-bottom: 12px; }
.soap-section { margin-bottom: 10px; }
.soap-label {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  color: #7c3aed; letter-spacing: 0.5px;
  display: block; margin-bottom: 4px;
}
.soap-section p {
  font-size: 13px; color: #cbd5e1; line-height: 1.5; margin: 0;
}

/* ─── Confetti Particles (gamification) ───────────────────── */
.confetti-particle {
  position: fixed; width: 8px; height: 8px; border-radius: 50%;
  z-index: 99999; pointer-events: none;
  animation: confettiBurst .8s cubic-bezier(.25,.46,.45,.94) forwards;
}
@keyframes confettiBurst {
  0%   { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}

/* ─── Journey Map ─────────────────────────────────────────── */
.journey-map-wrap {
  padding: 16px; border-radius: 14px; margin-bottom: 16px;
  height: 260px;
}

/* ═══ MAJOR FEATURES ══════════════════════════════════════ */

/* ─── Face Emotion Detection ──────────────────────────────── */
.face-consent-overlay {
  position: fixed; inset: 0;
  background: rgba(15,15,26,0.9);
  backdrop-filter: blur(16px);
  z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  animation: breathFadeIn .3s ease;
}
.face-consent-card {
  max-width: 380px; width: 90%;
  padding: 28px; border-radius: 16px; text-align: center;
}
.face-consent-icon { font-size: 40px; margin-bottom: 12px; }
.face-consent-card h3 { font-size: 18px; color: #f1f5f9; margin-bottom: 8px; }
.face-consent-card p { font-size: 13px; color: #94a3b8; line-height: 1.6; margin-bottom: 16px; }
.face-consent-list {
  list-style: none; text-align: left; padding: 0; margin-bottom: 20px;
}
.face-consent-list li {
  font-size: 12px; color: #cbd5e1; padding: 4px 0;
}
.face-consent-btns { display: flex; gap: 10px; justify-content: center; }
.face-consent-btns .btn { font-size: 13px; padding: 8px 18px; }

/* Hume tourne en background — pas d'UI visible */

/* ─── Voice Emotion Indicator ─────────────────────────────── */
.session-indicators {
  display: flex; gap: 8px; justify-content: center;
  padding: 4px 16px; flex-wrap: wrap;
}
.voice-emotion-indicator {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  transition: all .4s ease;
}
.voice-emotion-indicator.hidden { display: none; }
.ve-icon { font-size: 16px; }
.ve-label { font-size: 11px; font-weight: 600; transition: color .4s; }

/* ─── Patient State Badge ─────────────────────────────────── */
.patient-state-badge {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  transition: all .5s ease;
}
.patient-state-badge.hidden { display: none; }

/* ─── Emotion-Reactive Avatar ─────────────────────────────── */
.sophie-presence.avatar-calm .sophie-avatar-glow {
  box-shadow: 0 0 40px rgba(16,185,129,0.3);
}
.sophie-presence.avatar-stressed .sophie-avatar-glow {
  box-shadow: 0 0 40px rgba(245,158,11,0.3);
}
.sophie-presence.avatar-agitated .sophie-avatar-glow {
  box-shadow: 0 0 40px rgba(239,68,68,0.25);
}
.sophie-presence.avatar-engaged .sophie-avatar-glow {
  box-shadow: 0 0 40px rgba(59,130,246,0.3);
}
.empathy-pulse {
  animation: empathyPulse 1.5s ease-in-out 2;
}
@keyframes empathyPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50%      { transform: scale(1.3); opacity: 1; }
}

/* ─── Virtual Therapy Room (3D background) ────────────────── */
.therapy-room-bg {
  position: absolute; inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
  border-radius: inherit;
  overflow: hidden;
}
.therapy-room-bg.hidden { display: none; }
.therapy-room-bg canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
/* Ensure chat content stays above the 3D bg */
.sophie-presence,
.messages-container,
.chat-input-area,
.session-indicators {
  position: relative;
  z-index: 1;
}

/* ════════════════════════════════════════════════════════════
   INTELLIGENCE AGENT — Cartes de visualisation
════════════════════════════════════════════════════════════ */
.agent-card {
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,.06);
}
.agent-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.agent-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.agent-card-title {
  font-weight: 600;
  font-size: 15px;
  color: #e2e8f0;
}
.agent-card-sub {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}
.agent-card-body {
  font-size: 13.5px;
  line-height: 1.6;
  color: #cbd5e1;
}
.agent-empty {
  text-align: center;
  padding: 20px;
  color: #64748b;
  font-size: 13px;
  font-style: italic;
}

/* ── Modele Mental ── */
.mm-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #a78bfa;
  margin: 12px 0 6px;
}
.mm-section-label:first-child { margin-top: 0; }
.mm-belief {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(124,58,237,.08);
  margin-bottom: 6px;
}
.mm-belief-text { flex: 1; font-size: 13px; }
.mm-conf {
  flex-shrink: 0;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}
.mm-conf-low  { background: rgba(245,158,11,.15); color: #fbbf24; }
.mm-conf-med  { background: rgba(59,130,246,.15);  color: #60a5fa; }
.mm-conf-high { background: rgba(16,185,129,.15);  color: #34d399; }
.mm-tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 20px;
  background: rgba(255,255,255,.06);
  color: #94a3b8;
  margin: 2px 4px 2px 0;
}
.mm-alliance-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,.08);
  margin-top: 6px;
  overflow: hidden;
}
.mm-alliance-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #7c3aed, #3b82f6);
  transition: width .5s ease;
}

/* ── Plan de seance ── */
.plan-obj {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.plan-obj:last-child { border-bottom: none; }
.plan-obj-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #60a5fa;
  flex-shrink: 0;
}
.plan-strategy {
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(59,130,246,.08);
  margin: 8px 0;
  font-size: 13px;
  border-left: 3px solid #3b82f6;
}
.plan-risk {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(239,68,68,.1);
  color: #f87171;
  margin: 2px 4px 2px 0;
}

/* ── Auto-supervision ── */
.sup-scores {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.sup-score-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  min-width: 80px;
}
.sup-score-val {
  font-size: 22px;
  font-weight: 700;
}
.sup-score-label {
  font-size: 11px;
  color: #94a3b8;
  text-align: center;
}
.sup-calibration {
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(245,158,11,.08);
  border-left: 3px solid #f59e0b;
  font-size: 13px;
  line-height: 1.6;
  margin-top: 10px;
}
.sup-list {
  margin: 6px 0;
  padding-left: 16px;
  list-style: none;
}
.sup-list li {
  position: relative;
  padding: 3px 0 3px 12px;
  font-size: 13px;
}
.sup-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #94a3b8;
}
.sup-list.positive li::before { background: #34d399; }
.sup-list.negative li::before { background: #f87171; }

/* ── Predictions ── */
.pred-section {
  margin-bottom: 10px;
}
.pred-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 4px;
}
.pred-label-risk  { color: #f87171; }
.pred-label-pos   { color: #34d399; }
.pred-label-trig  { color: #fbbf24; }
.pred-label-check { color: #60a5fa; }
.pred-item {
  font-size: 13px;
  padding: 4px 0 4px 14px;
  position: relative;
}
.pred-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.pred-risk .pred-item::before  { background: #f87171; }
.pred-pos .pred-item::before   { background: #34d399; }
.pred-trig .pred-item::before  { background: #fbbf24; }
.pred-mood {
  display: inline-block;
  font-size: 12px;
  padding: 3px 12px;
  border-radius: 20px;
  font-weight: 600;
  margin-top: 6px;
}
.pred-mood-ascending  { background: rgba(16,185,129,.15); color: #34d399; }
.pred-mood-descending { background: rgba(239,68,68,.1);   color: #f87171; }
.pred-mood-stable     { background: rgba(148,163,184,.15);color: #94a3b8; }

/* ── Trajectoire emotionnelle ── */
.traj-arc {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 0;
}
.traj-phase {
  text-align: center;
}
.traj-phase-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #64748b;
  margin-bottom: 4px;
}
.traj-phase-val {
  font-size: 13px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 20px;
}
.traj-arrow {
  color: #475569;
  font-size: 18px;
}
.traj-sent-positif  { background: rgba(16,185,129,.15); color: #34d399; }
.traj-sent-negatif  { background: rgba(239,68,68,.1);   color: #f87171; }
.traj-sent-neutre   { background: rgba(148,163,184,.1); color: #94a3b8; }
.traj-trajectory {
  text-align: center;
  margin-top: 6px;
}
.traj-trajectory-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 20px;
}
.traj-ascending  { background: rgba(16,185,129,.12); color: #34d399; }
.traj-descending { background: rgba(239,68,68,.1);   color: #f87171; }
.traj-volatile   { background: rgba(245,158,11,.12); color: #fbbf24; }
.traj-stable     { background: rgba(148,163,184,.1); color: #94a3b8; }
.traj-incongruences {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.traj-inc-item {
  display: flex;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(245,158,11,.06);
  margin-bottom: 4px;
  font-size: 12px;
  align-items: center;
}
.traj-inc-badge {
  flex-shrink: 0;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(245,158,11,.15);
  color: #fbbf24;
  font-weight: 600;
}
