/* === RESET & BASE === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-deep:    #08090d;
  --bg-main:    #0a0c10;
  --bg-panel:   #0d1017;
  --bg-surface: rgba(255,255,255,0.04);
  --bg-hover:   rgba(255,255,255,0.07);

  --accent-blue:  #4f8ef7;
  --accent-teal:  #7ee8fa;
  --accent-green: #4ecdc4;
  --accent-amber: #ffb74d;

  --text-primary:   #e8eaf0;
  --text-secondary: #8892a4;
  --text-dim:       rgba(255,255,255,0.25);

  --border:        rgba(255,255,255,0.07);
  --border-accent: rgba(79,142,247,0.3);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --font-ui:      'DM Sans', sans-serif;
  --font-display: 'Syne', sans-serif;

  --sidebar-w: 240px;
}

html, body {
  height: 100%;
  height: -webkit-fill-available;
  overflow: hidden;
  font-family: var(--font-ui);
  background: var(--bg-main);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

@supports (height: 100dvh) {
  html, body { height: 100dvh; }
}

/* =====================
   LAYOUT ROOT
   ===================== */

body {
  display: flex;
  flex-direction: row;   /* sidebar | app-body côte à côte */
}

/* =====================
   SIDEBAR
   ===================== */

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #080a0f;
  border-right: 1px solid var(--border);
  height: 100%;
  transition: transform 0.28s cubic-bezier(.4,0,.2,1), width 0.28s;
  z-index: 100;
  overflow: hidden;
}

.sidebar.collapsed {
  width: 0;
  border-right: none;
}

/* En-tête sidebar */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.2px;
}

.btn-new-session {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-new-session svg { width: 14px; height: 14px; }

.btn-new-session:hover {
  background: rgba(79,142,247,0.12);
  border-color: var(--border-accent);
  color: var(--accent-blue);
}

/* Liste sessions */
.sidebar-sessions {
  flex: 1;
  overflow-y: auto;
  padding: 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-sessions::-webkit-scrollbar { width: 3px; }
.sidebar-sessions::-webkit-scrollbar-track { background: transparent; }
.sidebar-sessions::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
}

/* Session item */
.session-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
  min-width: 0;
}

.session-item:hover {
  background: var(--bg-hover);
}

.session-item.active {
  background: rgba(79,142,247,0.1);
  border: 1px solid rgba(79,142,247,0.18);
}

.session-item-icon {
  font-size: 14px;
  flex-shrink: 0;
  opacity: 0.7;
}

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

.session-item-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.session-item.active .session-item-name {
  color: #b8d0f8;
}

.session-item-date {
  font-size: 10.5px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1;
}

/* Bouton supprimer — visible au hover */
.btn-delete-session {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.btn-delete-session svg { width: 12px; height: 12px; }

.session-item:hover .btn-delete-session { opacity: 1; }

.btn-delete-session:hover {
  background: rgba(239,68,68,0.15);
  color: #f87171;
}

/* Séparateur de groupe (Aujourd'hui, Hier, etc.) */
.session-group-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  text-transform: uppercase;
  padding: 10px 10px 4px;
}

/* =====================
   APP BODY
   ===================== */

.app-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* =====================
   TOP BAR
   ===================== */

.top-bar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 12px;
  background: rgba(255,255,255,0.025);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 10;
  gap: 12px;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.btn-sidebar-toggle-desktop {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-sidebar-toggle-desktop svg { width: 16px; height: 16px; }

.btn-sidebar-toggle-desktop:hover {
  background: var(--bg-hover);
  border-color: var(--border-accent);
  color: var(--accent-blue);
}

.logo {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.session-info {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}

.badge {
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-level {
  background: rgba(78,205,196,0.12);
  color: var(--accent-green);
  border: 1px solid rgba(78,205,196,0.25);
}

.badge-topic {
  background: rgba(79,142,247,0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(79,142,247,0.25);
}

.rec-dot {
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse-dot {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:0.5; transform:scale(0.8); }
}

.top-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--bg-hover);
  border-color: var(--border-accent);
}

/* =====================
   MAIN LAYOUT
   ===================== */

.main {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* =====================
   AVATAR ZONE
   ===================== */

.avatar-zone {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, #121626 0%, var(--bg-deep) 70%);
  overflow: hidden;
}

.avatar-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(79,142,247,0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(78,205,196,0.04) 0%, transparent 50%);
  pointer-events: none;
}

#avatar-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.avatar-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;   /* avatar collé en bas comme un vrai appel vidéo */
  gap: 16px;
  z-index: 1;
  overflow: hidden;
}

/* SPEAKING INDICATOR */
.speaking-indicator {
  position: absolute;
  bottom: 32px;
  display: flex;
  gap: 4px;
  align-items: flex-end;
  height: 28px;
  opacity: 0;
  transition: opacity 0.3s;
}

.speaking-indicator.active { opacity: 1; }

.bar {
  width: 3px;
  background: linear-gradient(to top, var(--accent-blue), var(--accent-teal));
  border-radius: 2px;
  animation: equalizer 0.8s ease-in-out infinite alternate;
}

.bar:nth-child(1) { height: 8px;  animation-delay: 0s; }
.bar:nth-child(2) { height: 18px; animation-delay: 0.1s; }
.bar:nth-child(3) { height: 28px; animation-delay: 0.2s; }
.bar:nth-child(4) { height: 16px; animation-delay: 0.3s; }
.bar:nth-child(5) { height: 6px;  animation-delay: 0.4s; }

@keyframes equalizer {
  from { transform: scaleY(1); }
  to   { transform: scaleY(0.3); }
}

/* SESSION TIMER */
.session-timer {
  position: absolute;
  top: 16px;
  left: 16px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 1px;
  background: rgba(0,0,0,0.3);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* =====================
   CHAT ZONE
   ===================== */

.chat-zone {
  width: 380px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.messages::-webkit-scrollbar { width: 4px; }
.messages::-webkit-scrollbar-track { background: transparent; }
.messages::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
}

/* Messages */
.msg {
  max-width: 88%;
  padding: 11px 14px;
  border-radius: var(--radius-lg);
  font-size: 13.5px;
  line-height: 1.55;
  animation: msg-in 0.25s ease-out;
}

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

.msg.samy {
  align-self: flex-start;
  background: rgba(79,142,247,0.1);
  border: 1px solid rgba(79,142,247,0.18);
  border-bottom-left-radius: 5px;
  color: #c8d8f8;
}

.msg.user {
  align-self: flex-end;
  background: rgba(78,205,196,0.09);
  border: 1px solid rgba(78,205,196,0.18);
  border-bottom-right-radius: 5px;
  color: #b8f0ea;
}

.msg-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  margin-bottom: 5px;
  opacity: 0.5;
  text-transform: uppercase;
}

.msg.samy .msg-label { color: var(--accent-blue); }
.msg.user .msg-label { color: var(--accent-green); }

.correction-box {
  margin-top: 9px;
  padding: 7px 11px;
  background: rgba(255,183,77,0.07);
  border-left: 2px solid var(--accent-amber);
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  color: #ffe0a0;
  line-height: 1.5;
}

.correction-box.good {
  background: rgba(78,205,196,0.07);
  border-left-color: var(--accent-green);
  color: #a8f0e0;
}

/* Typing indicator */
.typing-indicator {
  align-self: flex-start;
  padding: 12px 16px;
  background: rgba(79,142,247,0.08);
  border: 1px solid rgba(79,142,247,0.15);
  border-radius: var(--radius-lg);
  border-bottom-left-radius: 5px;
  display: flex;
  gap: 5px;
  align-items: center;
  animation: msg-in 0.2s ease-out;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-blue);
  border-radius: 50%;
  animation: typing-bounce 1.2s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%,60%,100% { transform:translateY(0); opacity:0.4; }
  30%          { transform:translateY(-6px); opacity:1; }
}

/* =====================
   INPUT ZONE
   ===================== */

.input-zone {
  padding: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.selectors {
  display: flex;
  gap: 8px;
}

.sel {
  flex: 1;
  padding: 7px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  font-family: var(--font-ui);
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23556' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;

}

.sel:focus { border-color: var(--border-accent); }
.sel option { background: #111520; }

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

.text-input {
  flex: 1;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: var(--font-ui);
  outline: none;
  resize: none;
  line-height: 1.5;
  transition: border-color 0.2s, background 0.2s;
}

.text-input:focus {
  border-color: rgba(79,142,247,0.45);
  background: rgba(79,142,247,0.04);
}

.text-input::placeholder { color: var(--text-dim); }

.input-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-mic {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  opacity: 0.5;
}

.btn-mic:hover { opacity: 0.8; background: var(--bg-hover); }

.btn-mic.listening {
  opacity: 1;
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.4);
  animation: mic-pulse 1.5s ease-in-out infinite;
}


.btn-send {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-teal));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-send:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 18px rgba(79,142,247,0.4);
}

.btn-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-send svg {
  width: 16px;
  height: 16px;
  stroke: #0a0c10;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* STATUS BAR */
.status-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.3px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  flex-shrink: 0;
}

.status-dot.loading { background: var(--accent-amber); animation: pulse-dot 1s ease-in-out infinite; }
.status-dot.error   { background: #ef4444; }

/* =====================
   MOBILE / RESPONSIVE
   ===================== */

/* Bouton toggle sidebar mobile */
.btn-sidebar-toggle {
  display: none;
}

/* Overlay mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.28s;
}

.sidebar-overlay.visible {
  display: block;
  opacity: 1;
}

@media (max-width: 768px) {
  body { flex-direction: column; }

  /* Sidebar en overlay sur mobile */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    transform: translateX(-100%);
    width: var(--sidebar-w);
    transition: transform 0.28s cubic-bezier(.4,0,.2,1);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  /* Cacher le toggle desktop sur mobile */
  .btn-sidebar-toggle-desktop { display: none; }

  /* Afficher le toggle mobile */
  .btn-sidebar-toggle {
    display: flex;
    position: fixed;
    bottom: 90px;
    left: 12px;
    z-index: 80;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(13,16,23,0.9);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(8px);
  }

  .btn-sidebar-toggle svg { width: 18px; height: 18px; }

  .app-body { width: 100%; }

  .main { flex-direction: column; }

  .avatar-zone { height: 220px; flex: none; }

  .chat-zone {
    width: 100%;
    flex: 1;
    min-height: 0;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  /* Sélecteurs visibles sur mobile — compacts et horizontaux */
  .selectors {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 4px 0 2px;
  }

  .sel {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    padding: 5px 6px;
    height: 32px;
  }

  .text-input { font-size: 16px; }

    /* Logo plus petit sur mobile pour libérer de l'espace */
  .logo {
    font-size: 13px;
    letter-spacing: -0.2px;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Badges compacts sur mobile */
  .badge {
    padding: 3px 7px;
    font-size: 9px;
    letter-spacing: 0.3px;
  }

  /* Session info ne rétrécit pas */
  .session-info {
    flex-shrink: 0;
    gap: 5px;
  }

  /* Top-bar : permet au logo de rétrécir en priorité */
  .top-bar-left {
    flex: 1;
    min-width: 0;
    overflow: hidden;
  }

  /* Cache le bouton de bascule desktop sur mobile (redondant mais sûr) */
  .btn-sidebar-toggle-desktop {
    display: none !important;
  }

}

/* Mobile keyboard fix */
@supports (height: 100dvh) {
  .app-body { height: 100dvh; }
  .main { height: calc(100dvh - 56px); }
}

/* =====================
   AVATAR ZONE — VIDEO CALL UPGRADE
   ===================== */

/* Fond encore plus sombre pour ressembler à un vrai appel */
.avatar-zone {
  background: #070910 !important;
}


/* =====================
   MICRO — ÉTAT RECORDING
   ===================== */
.btn-mic.recording {
  background: rgba(239, 68, 68, 0.18) !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
  color: #ef4444 !important;
  opacity: 1 !important;
  animation: mic-pulse 1.2s ease-in-out infinite;
}

@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.35); }
  50%       { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}

.btn-mic.recording::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  border: 1.5px solid rgba(239,68,68,0.4);
  animation: mic-ring 1.2s ease-out infinite;
}

@keyframes mic-ring {
  0%   { transform: scale(1);   opacity: 0.8; }
  100% { transform: scale(1.5); opacity: 0; }
}

.btn-mic { position: relative; overflow: visible; }

/* ========================
   MODE APPEL VIDÉO IMMERSIF
   ======================== */

#vc-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #060810;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
}
#vc-overlay.active { display: flex; }

/* Canvas bokeh derrière tout */
#vc-bokeh-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Zone avatar — corps visible jusqu'à la taille */
#vc-avatar-zone {
  position: absolute;
  top: 0; left: 0; right: 0;
  bottom: 160px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1;
}

#vc-samy-wrap {
  width: min(80vw, 420px);
  height: min(100%, 680px);
  position: relative;
  filter: drop-shadow(0 30px 80px rgba(79,142,247,0.22));
  animation: vc-breathe 4s ease-in-out infinite;
}

@keyframes vc-breathe {
  0%,100% { transform: translateY(0px) scale(1); }
  50%      { transform: translateY(-6px) scale(1.008); }
}

#vc-samy-wrap.vc-talking {
  animation: vc-speak-sway 0.55s ease-in-out infinite alternate;
}

@keyframes vc-speak-sway {
  0%   { transform: translateY(0) rotate(-0.4deg); }
  100% { transform: translateY(-4px) rotate(0.4deg); }
}

/* Badge LIVE */
#vc-live-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,50,50,0.15);
  border: 1px solid rgba(255,70,70,0.5);
  border-radius: 20px;
  padding: 6px 14px;
  font-family: 'Syne', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #ff5555;
  backdrop-filter: blur(8px);
}
#vc-live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ff4444;
  animation: vc-live-pulse 1.2s ease-in-out infinite;
}
@keyframes vc-live-pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.8); }
}

/* Nom en bas de l'avatar */
#vc-name-tag {
  position: absolute;
  bottom: 170px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  text-align: center;
}
#vc-name-tag .vc-name {
  font-family: 'Syne', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #e8eaf0;
  letter-spacing: 1px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.8);
}
#vc-name-tag .vc-title {
  font-size: 12px;
  color: rgba(126,232,250,0.8);
  letter-spacing: 2px;
  margin-top: 2px;
}

/* Barre de contrôles en bas */
#vc-controls {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  z-index: 20;
  padding: 20px 24px 36px;
  background: linear-gradient(to top, rgba(6,8,16,0.98) 0%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Status text */
#vc-status-text {
  text-align: center;
  font-size: 13px;
  color: rgba(232,234,240,0.6);
  letter-spacing: 0.5px;
  min-height: 18px;
  transition: color 0.3s;
}
#vc-status-text.listening { color: #ff6666; }
#vc-status-text.speaking  { color: #7ee8fa; }

/* Ligne de boutons */
#vc-btn-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

/* Bouton mic principal */
#vc-btn-mic {
  width: 68px; height: 68px;
  border-radius: 50%;
  border: 2px solid rgba(79,142,247,0.5);
  background: rgba(79,142,247,0.15);
  color: #e8eaf0;
  font-size: 26px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
  position: relative;
}
#vc-btn-mic:hover {
  background: rgba(79,142,247,0.3);
  transform: scale(1.06);
}
#vc-btn-mic.recording {
  background: rgba(255,50,50,0.2);
  border-color: rgba(255,80,80,0.7);
  animation: vc-mic-pulse 1s ease-in-out infinite;
}
@keyframes vc-mic-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,80,80,0.4); }
  50%      { box-shadow: 0 0 0 14px rgba(255,80,80,0); }
}

/* Boutons secondaires */
.vc-btn-secondary {
  width: 50px; height: 50px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
  color: #8892a4;
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
}
.vc-btn-secondary:hover {
  background: rgba(255,255,255,0.12);
  color: #e8eaf0;
}

/* Bouton fin d'appel — rouge */
#vc-btn-end {
  width: 58px; height: 58px;
  border-radius: 50%;
  border: none;
  background: #e53935;
  color: white;
  font-size: 22px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 4px 24px rgba(229,57,53,0.4);
}
#vc-btn-end:hover {
  background: #c62828;
  transform: scale(1.05);
}

/* Indicateur ondes sonores (pendant que Samy parle) */
#vc-wave-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 22px;
  opacity: 0;
  transition: opacity 0.3s;
}
#vc-wave-indicator.active { opacity: 1; }
#vc-wave-indicator .w-bar {
  width: 3px;
  border-radius: 3px;
  background: var(--accent-teal);
  animation: vc-wave 1.1s ease-in-out infinite;
}
#vc-wave-indicator .w-bar:nth-child(1) { height: 8px;  animation-delay: 0s; }
#vc-wave-indicator .w-bar:nth-child(2) { height: 16px; animation-delay: 0.15s; }
#vc-wave-indicator .w-bar:nth-child(3) { height: 22px; animation-delay: 0.3s; }
#vc-wave-indicator .w-bar:nth-child(4) { height: 14px; animation-delay: 0.45s; }
#vc-wave-indicator .w-bar:nth-child(5) { height: 8px;  animation-delay: 0.6s; }
@keyframes vc-wave {
  0%,100% { transform: scaleY(0.4); opacity: 0.5; }
  50%      { transform: scaleY(1);   opacity: 1; }
}

/* =====================
   SIDEBAR FOOTER — BOUTON ABOUT
   ===================== */

.sidebar-footer {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-footer-info {
  font-size: 10.5px;
  color: var(--text-dim);
}

.btn-about {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-about:hover {
  background: rgba(79,142,247,0.1);
  border-color: var(--border-accent);
  color: var(--accent-blue);
}

/* =====================
   MODAL À PROPOS
   ===================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 999;
  display: none;              /* ← caché par défaut */
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.visible {
  display: flex;              /* ← affiché via classe JS */
  animation: fade-in 0.2s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-card {
  background: #0d1017;
  border: 1px solid rgba(79,142,247,0.2);
  border-radius: 20px;
  padding: 32px 28px 28px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  position: relative;
  animation: slide-up 0.25s ease;
}

@keyframes slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-avatar-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  padding: 3px;
}

.modal-avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #0d1017;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 18px;
}

.modal-tag {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(79,142,247,0.1);
  border: 1px solid rgba(79,142,247,0.2);
  color: var(--accent-blue);
}

.modal-bio {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-secondary);
  text-align: left;
  margin-bottom: 18px;
}

.modal-bio strong {
  color: var(--text-primary);
}

.modal-divider {
  height: 1px;
  background: var(--border);
  margin: 0 0 14px;
}

.modal-quote {
  font-size: 12px;
  font-style: italic;
  color: var(--accent-teal);
  opacity: 0.8;
  line-height: 1.5;
  margin-bottom: 12px;
}

.modal-version {
  font-size: 10.5px;
  color: var(--text-dim);
}

/* =====================
   SPLASH SCREEN
   ===================== */

#splash-screen {
  position: fixed;
  inset: 0;
  background: #08090d;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

#splash-logo {
  width: 120px;
  height: 120px;
  border-radius: 28px;
  object-fit: cover;
  box-shadow: 0 20px 60px rgba(79,142,247,0.3);
  animation: splash-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes splash-pop {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.splash-name {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, #7ee8fa, #4f8ef7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
}

.splash-dots {
  display: flex;
  gap: 8px;
}

.splash-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4f8ef7;
  animation: splash-bounce 1.2s ease-in-out infinite;
  opacity: 0.6;
}

.splash-dot:nth-child(2) { animation-delay: 0.2s; }
.splash-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes splash-bounce {
  0%,60%,100% { transform: translateY(0); opacity: 0.4; }
  30%          { transform: translateY(-10px); opacity: 1; }
}

/* ═══════════════════════════════════════
   MODE GÉO-EXPERT
═══════════════════════════════════════ */

/* Bouton toggle actif */
.btn-geo-toggle.active-geo {
  background: rgba(234,179,8,0.15) !important;
  border: 1px solid rgba(234,179,8,0.5) !important;
}

/* Panneau principal */
.geo-panel {
  display: flex;
  flex-direction: row;     /* sidebar | contenu côte à côte */
  flex: 1;
  overflow: hidden;
  background: var(--bg, #0a0c10);
  height: 100%;
  gap: 0;
}

/* Barre d'outils géo */
.geo-tools-bar {
  display: flex;
  gap: 6px;
  padding: 10px 16px;
  background: var(--bg-panel, #111520);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  overflow-x: auto;
  scrollbar-width: none;
}
.geo-tools-bar::-webkit-scrollbar { display: none; }

.geo-tool-pill {
  flex-shrink: 0;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-main, 'DM Sans', sans-serif);
  transition: all 0.15s;
}
.geo-tool-pill:hover { border-color: #eab308; color: #eab308; }
.geo-tool-pill.active {
  background: rgba(234,179,8,0.12);
  border-color: #eab308;
  color: #eab308;
}

/* Preview image */
.geo-img-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(234,179,8,0.05);
  border-bottom: 1px solid rgba(234,179,8,0.2);
}
.geo-img-preview img {
  width: 52px; height: 52px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(234,179,8,0.3);
}
.geo-img-info { flex: 1; font-size: 12px; color: #9ca3af; }
.geo-img-info strong { color: #eab308; display: block; font-size: 13px; }
.geo-img-preview button {
  background: none; border: none; color: #6b7280;
  cursor: pointer; font-size: 16px; padding: 4px;
  transition: color 0.2s;
}
.geo-img-preview button:hover { color: #ef4444; }

/* Zone de messages */
.geo-messages-panel {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.07) transparent;
}

.geo-msg-item {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  animation: geoMsgIn 0.3s ease;
}
@keyframes geoMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.geo-msg-item.user      { align-self: flex-end; align-items: flex-end; }
.geo-msg-item.assistant { align-self: flex-start; }

.geo-msg-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
  color: #6b7280;
}
.geo-msg-item.assistant .geo-msg-label { color: #eab308; }

.geo-msg-bubble {
  padding: 11px 15px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
}
.geo-msg-item.user .geo-msg-bubble {
  background: rgba(234,179,8,0.1);
  border: 1px solid rgba(234,179,8,0.3);
  color: #e8eaf0;
}
.geo-msg-item.assistant .geo-msg-bubble {
  background: #161c28;
  border: 1px solid rgba(255,255,255,0.07);
  color: #e8eaf0;
}
.geo-msg-img {
  max-width: 160px; max-height: 120px;
  border-radius: 8px;
  border: 1px solid rgba(234,179,8,0.3);
  margin-bottom: 6px;
  object-fit: cover;
}

/* Indicateur de frappe */
.geo-typing-ind {
  display: flex; align-items: center; gap: 5px;
  padding: 10px 14px;
  background: #161c28;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  width: fit-content;
}
.geo-typing-ind span {
  width: 6px; height: 6px; border-radius: 50%;
  background: #eab308;
  animation: gTyping 1.2s infinite ease-in-out;
  display: block;
}
.geo-typing-ind span:nth-child(2) { animation-delay: 0.2s; background: #f97316; }
.geo-typing-ind span:nth-child(3) { animation-delay: 0.4s; }
@keyframes gTyping {
  0%,80%,100% { transform: scale(0.7); opacity: 0.5; }
  40%         { transform: scale(1);   opacity: 1;   }
}

/* Zone de saisie géo */
.geo-input-bar {
  padding: 10px 16px;
  background: var(--bg-panel, #111520);
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.geo-textarea-inline {
  flex: 1;
  background: #1a2133;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #e8eaf0;
  font-family: var(--font-main, 'DM Sans', sans-serif);
  font-size: 14px;
  padding: 10px 13px;
  resize: none;
  outline: none;
  min-height: 44px;
  max-height: 120px;
  line-height: 1.5;
  transition: border-color 0.2s;
}
.geo-textarea-inline::placeholder { color: #4b5563; }
.geo-textarea-inline:focus { border-color: #eab308; }

.geo-input-btns { display: flex; gap: 6px; }

.geo-btn-upload, .geo-btn-mic {
  width: 44px; height: 44px;
  border-radius: 8px;
  background: #161c28;
  border: 1px solid rgba(255,255,255,0.1);
  color: #6b7280;
  cursor: pointer; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.geo-btn-upload:hover { border-color: #f97316; color: #f97316; }
.geo-btn-mic:hover    { border-color: #22c55e; color: #22c55e; }
.geo-btn-mic.recording {
  background: rgba(239,68,68,0.15);
  border-color: #ef4444; color: #ef4444;
}

.geo-btn-send {
  width: 44px; height: 44px;
  border-radius: 8px;
  background: #eab308;
  border: none; color: #000;
  cursor: pointer; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.geo-btn-send:hover    { background: #fbbf24; transform: scale(1.04); }
.geo-btn-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Barre de statut */
.geo-status-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 16px 10px;
  font-size: 11px;
  color: #6b7280;
  background: var(--bg-panel, #111520);
}
.geo-status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}
.geo-status-dot.loading { background: #eab308; animation: blink 0.8s infinite; }
.geo-status-dot.error   { background: #ef4444; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ═══════════════════════════════════
   SIDEBAR GÉO
═══════════════════════════════════ */

/* Le panel géo devient flex-row pour accueillir la sidebar */
.geo-panel {
  display: flex;
  flex-direction: row;
  gap: 0;
}

.geo-sidebar {
  width: 220px;
  min-width: 200px;
  background: var(--bg-card, #111620);
  border-right: 1px solid rgba(234, 179, 8, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.25s ease;
  flex-shrink: 0;
}

.geo-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px;
  border-bottom: 1px solid rgba(234, 179, 8, 0.12);
}

.geo-sidebar-logo {
  font-size: 12px;
  font-weight: 700;
  color: #eab308;
  letter-spacing: 0.5px;
}

.btn-geo-new-session {
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.25);
  border-radius: 6px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #eab308;
  transition: background 0.2s;
}
.btn-geo-new-session:hover { background: rgba(234, 179, 8, 0.2); }
.btn-geo-new-session svg   { width: 14px; height: 14px; }

.geo-sidebar-sessions {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.geo-session-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  cursor: pointer;
  border-radius: 0;
  transition: background 0.15s;
  border-left: 2px solid transparent;
}
.geo-session-item:hover { background: rgba(234, 179, 8, 0.06); }
.geo-session-item.active {
  background: rgba(234, 179, 8, 0.1);
  border-left-color: #eab308;
}

.geo-session-item-body {
  flex: 1;
  min-width: 0;
}
.geo-session-item-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main, #e8eaf0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.geo-session-item-date {
  font-size: 10px;
  color: var(--text-dim, #6b7280);
  margin-top: 2px;
}

.btn-geo-delete-session {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 3px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  flex-shrink: 0;
}
.geo-session-item:hover .btn-geo-delete-session { opacity: 1; }
.btn-geo-delete-session:hover { color: #ef4444; }
.btn-geo-delete-session svg   { width: 13px; height: 13px; display: block; }

.geo-sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid rgba(234, 179, 8, 0.1);
  font-size: 10px;
  color: var(--text-dim, #6b7280);
}


/* Sur mobile : masquer la sidebar géo */
/* ═══════════════════════════════════
   SIDEBAR GÉO — MOBILE DRAWER
═══════════════════════════════════ */

/* Bouton toggle sidebar géo (mobile seulement) */
.btn-geo-sidebar-toggle {
  display: none; /* caché par défaut sur desktop */
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 50;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.3);
  color: #eab308;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.btn-geo-sidebar-toggle:hover { background: rgba(234, 179, 8, 0.22); }

/* Overlay mobile géo */
.geo-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 149;
  opacity: 0;
  transition: opacity 0.28s;
}
.geo-sidebar-overlay.visible {
  display: block;
  opacity: 1;
}

@media (max-width: 600px) {
  /* Le geo-panel doit être en position relative pour le bouton absolu */
  .geo-panel {
    position: relative;
  }

  /* ✅ Sur mobile : sidebar géo en position fixe (drawer) */
  .geo-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 260px;
    z-index: 150;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(.4,0,.2,1);
    /* display: flex est déjà dans la règle de base, on ne le masque plus */
  }

  .geo-sidebar.open {
    transform: translateX(0);
  }

  /* ✅ Affiche le bouton toggle sur mobile */
  .btn-geo-sidebar-toggle {
    display: flex;
  }

  /* La zone géo-content prend tout l'espace sur mobile */
  .geo-content {
    width: 100%;
  }


  /* ✅ Bouton supprimer session géo toujours visible sur mobile (pas de hover) */
  .btn-geo-delete-session {
    opacity: 1;
  }
}

/* ═══════════════════════════════════
   AVATAR ZONE GÉO
═══════════════════════════════════ */



/* Réutilise les styles de .avatar-zone pour le placeholder */
#geo-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* Timer géo */
#geo-session-timer {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(234, 179, 8, 0.5);
  font-family: 'DM Sans', monospace;
  letter-spacing: 1px;
}

/* Indicateur de parole géo — réutilise les classes .bar de l'anglais */
#geo-speaking-indicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 18px;
  opacity: 0;
  transition: opacity 0.3s;
}

#geo-speaking-indicator.active {
  opacity: 1;
}

#geo-speaking-indicator .bar {
  width: 3px;
  border-radius: 2px;
  background: #eab308;
  animation: speak-bar 0.8s ease-in-out infinite;
}
@keyframes speak-bar {
  0%, 100% { transform: scaleY(0.35); opacity: 0.5; }
  50%       { transform: scaleY(1);   opacity: 1;   }
}

#geo-speaking-indicator .bar:nth-child(1) { height: 8px;  animation-delay: 0s;    }
#geo-speaking-indicator .bar:nth-child(2) { height: 14px; animation-delay: 0.1s;  }
#geo-speaking-indicator .bar:nth-child(3) { height: 18px; animation-delay: 0.2s;  }
#geo-speaking-indicator .bar:nth-child(4) { height: 14px; animation-delay: 0.3s;  }
#geo-speaking-indicator .bar:nth-child(5) { height: 8px;  animation-delay: 0.4s;  }

/* ═══════════════════════════════════════════════════════
   GÉO PANEL — NOUVEAU LAYOUT : avatar gauche + chat droite
   Miroir du layout anglais, discussion légèrement plus large
═══════════════════════════════════════════════════════ */

/* .geo-panel est déjà flex-row (sidebar géo | geo-main) */

/* geo-main = miroir de .main (avatar-zone | chat-zone) */
.geo-main {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Avatar géo — même que .avatar-zone anglais */
.geo-avatar-zone {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #070910 !important;
  background-image:
    radial-gradient(circle at 30% 80%, rgba(234,179,8,0.06) 0%, transparent 50%),
    radial-gradient(circle at 70% 20%, rgba(234,179,8,0.03) 0%, transparent 50%) !important;
  overflow: hidden;
  border-bottom: none; /* supprime l'ancien border-bottom du bandeau */
  min-height: 0;       /* laisse le flex gérer la hauteur */
  padding: 0;          /* supprime le padding du bandeau */
}

/* Placeholder avatar géo : couvre toute la zone comme .avatar-fallback */
#geo-avatar-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
}

/* Indicateur parole géo repositionné pour cette zone pleine */
#geo-speaking-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

/* Timer géo repositionné en haut à gauche comme le timer anglais */
#geo-session-timer {
  position: absolute;
  top: 16px;
  left: 16px;
  bottom: auto;
  right: auto;
  font-size: 13px;
  font-weight: 700;
  color: rgba(234, 179, 8, 0.6);
  font-family: var(--font-display);
  letter-spacing: 1px;
  background: rgba(0,0,0,0.3);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(234,179,8,0.2);
}

/* Zone discussion géo — légèrement plus large que le chat anglais (380px → 430px) */
.geo-chat-panel {
  width: 430px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border-left: 1px solid rgba(234,179,8,0.15);
  overflow: hidden;
}

/* Les messages géo prennent tout l'espace restant dans le panel */
.geo-chat-panel .geo-messages-panel {
  flex: 1;
  min-height: 0;
}

/* ═══════════════════════════════════
   GÉO LAYOUT MOBILE
═══════════════════════════════════ */
@media (max-width: 768px) {
  .geo-main {
    flex-direction: column;
  }

  /* Avatar géo compact en haut — même hauteur que l'avatar anglais mobile */
  .geo-avatar-zone {
    height: 220px;
    flex: none;
    min-height: 0;
  }

  /* Discussion prend tout l'espace restant */
  .geo-chat-panel {
    width: 100%;
    flex: 1;
    min-height: 0;
    border-left: none;
    border-top: 1px solid rgba(234,179,8,0.15);
  }

  /* Bouton toggle sidebar géo — visible sur mobile */
  .btn-geo-sidebar-toggle {
    display: flex;
    /* position: absolute est déjà en place via la règle existante */
  }
}

/* Neutraliser les anciennes règles du bandeau geo-avatar-zone qui entrent en conflit */
@media (min-width: 601px) {
  .geo-avatar-zone {
    min-height: 0; /* écrase l'ancien min-height: 200px du bandeau */
  }
}

/* === BOUTON CAMÉRA GÉO === */
.geo-upload-group {
  display: flex;
  gap: 4px;
}

.geo-btn-camera {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #161c28;
  border: 1px solid rgba(255,255,255,0.1);
  color: #6b7280;
  cursor: pointer;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.geo-btn-camera:hover {
  border-color: #7ee8fa;
  color: #7ee8fa;
}

/* Sur desktop : le bouton caméra est plus discret */
@media (min-width: 769px) {
  .geo-btn-camera {
    opacity: 0.5;
  }
  .geo-btn-camera:hover {
    opacity: 1;
  }
}

/* Bouton stop TTS */
.btn-stop-tts {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #ef4444;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  letter-spacing: 0.5px;
}
.btn-stop-tts:hover {
  background: rgba(239, 68, 68, 0.3);
  transform: translateX(-50%) scale(1.04);
}
