* {
  margin: 0; padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --green-dark:  #3d6b4f;
  --green-mid:   #4e8a64;
  --green-light: #c8ddc8;
  --green-pale:  #e8f2eb;
  --green-bg:    #f0f5f1;
  --text:        #2c3e30;
  --text-soft:   #6b836f;
  --border:      #d0e4d4;
  --white:       #ffffff;
  --card-shadow: 0 4px 24px rgba(61,107,79,0.10);
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(160deg, #ddeee2 0%, #eef6f0 40%, #f5faf6 100%);
  color: var(--text);
  overflow: hidden;
}

/* ── FEUILLES FOND ── */
.bg-leaves {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.leaf-top-right {
  position: absolute;
  top: -20px; right: -20px;
  width: 180px; height: 200px;
  opacity: 0.55;
}
.leaf-bottom-left {
  position: absolute;
  bottom: 60px; left: -30px;
  width: 160px; height: 180px;
  opacity: 0.45;
}

/* ── APP ── */
#app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
}
.hidden { display: none !important; }

/* ── HEADER ── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.7);
}
header h1 {
  font-family: 'Lora', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--green-dark);
  letter-spacing: 0.02em;
}
header button {
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--border);
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--green-dark);
  transition: background 0.2s;
}
header button:hover { background: var(--green-pale); }

/* ── MAIN ── */
main {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── WELCOME ── */
#welcome-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fadeUp 0.5s ease;
}
@keyframes fadeUp {
  from { opacity:0; transform:translateY(16px); }
  to   { opacity:1; transform:translateY(0); }
}

.profile-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}
.avatar-circle {
  width: 64px; height: 64px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(61,107,79,0.25);
}
.avatar-circle svg { width: 100%; height: 100%; }

.app-title {
  font-family: 'Lora', serif;
  font-size: 32px;
  font-weight: 600;
  color: var(--green-dark);
  letter-spacing: -0.01em;
}
.app-subtitle {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--text-soft);
  text-transform: uppercase;
  text-align: center;
}

/* ── VOIX ── */
.voice-block {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}
.voice-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--text-soft);
}
.voice-btns {
  display: flex;
  gap: 8px;
}
.voice-btn {
  padding: 7px 18px;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: transparent;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.voice-btn.active {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: white;
  font-weight: 500;
}

/* ── VITESSE ── */
.speed-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}
.speed-label, .speed-value {
  font-size: 12px;
  color: var(--text-soft);
  white-space: nowrap;
  min-width: 44px;
}
.speed-value { text-align: right; }
#speed-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
}
#speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--green-dark);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(61,107,79,0.3);
}

/* ── CARTE BIENVENUE ── */
/* ── MODES ── */
.modes-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}
.mode-btn {
  background: rgba(255,255,255,0.75);
  border: 1.5px solid var(--border);
  color: var(--text-soft);
  padding: 7px 13px;
  border-radius: 50px;
  font-size: 12.5px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.mode-btn:hover  { border-color: var(--green-mid); color: var(--green-dark); background: var(--green-pale); }
.mode-btn.active { background: var(--green-dark); border-color: var(--green-dark); color: #fff; font-weight: 500; }

/* ── BADGE WEB ── */
.web-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  color: var(--text-soft);
  background: var(--green-pale);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 9px;
  margin-top: 5px;
}

.welcome-card {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 20px;
  padding: 24px 22px;
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(255,255,255,0.9);
}
.welcome-card h3 {
  font-family: 'Lora', serif;
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.4;
}
.welcome-card p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-soft);
  margin-bottom: 20px;
}
.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip {
  background: var(--green-pale);
  border: 1.5px solid var(--green-light);
  color: var(--green-dark);
  padding: 9px 16px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.18s;
  font-family: 'Inter', sans-serif;
  text-align: left;
  line-height: 1.3;
}
.chip:hover {
  background: var(--green-light);
  transform: translateY(-1px);
}

/* ── CHAT ── */
#chat-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 8px;
  animation: fadeUp 0.3s ease;
}

.message {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 88%;
  animation: msgIn 0.22s ease;
}
@keyframes msgIn {
  from { opacity:0; transform:translateY(6px); }
  to   { opacity:1; transform:translateY(0); }
}
.message.user  { align-self: flex-end; flex-direction: row-reverse; }
.message.rachel{ align-self: flex-start; }

.msg-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  margin-bottom: 2px;
}
.msg-avatar svg { width: 100%; height: 100%; }

.msg-wrapper { display: flex; flex-direction: column; }
.message.user .msg-wrapper { align-items: flex-end; }

.bubble {
  padding: 11px 15px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.65;
  word-break: break-word;
}
.message.user .bubble {
  background: var(--green-dark);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 3px 10px rgba(61,107,79,0.25);
}
.message.rachel .bubble {
  background: rgba(255,255,255,0.92);
  color: var(--text);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  border: 1px solid var(--border);
}
.bubble p { margin-bottom: 6px; }
.bubble p:last-child { margin-bottom: 0; }

/* Curseur clignotant pendant le streaming */
.bubble.streaming p:last-child::after {
  content: '▋';
  display: inline-block;
  color: var(--green-mid);
  animation: blink 0.9s step-end infinite;
  margin-left: 2px;
  font-size: 0.85em;
  vertical-align: text-bottom;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.msg-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}
.msg-time {
  font-size: 10px;
  color: var(--text-soft);
  padding: 0 3px;
}
.replay-btn {
  background: none;
  border: none;
  color: var(--text-soft);
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}
.message.rachel:hover .replay-btn,
.message.rachel:focus-within .replay-btn { opacity: 1; }
.replay-btn:hover { background: var(--green-pale); color: var(--green-dark); }
@media (hover: none) { .replay-btn { opacity: 0.5; } }

/* ── TYPING ── */
#typing-indicator {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  animation: msgIn 0.22s ease;
}
.typing-dots {
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--border);
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  padding: 12px 16px;
  display: flex;
  gap: 5px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}
.typing-dots span {
  width: 7px; height: 7px;
  background: var(--green-light);
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%,60%,100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* ── FOOTER ── */
footer {
  padding: 12px 20px;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,0.8);
}
.input-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: rgba(255,255,255,0.8);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 8px 10px 8px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-row:focus-within {
  border-color: var(--green-mid);
  box-shadow: 0 0 0 3px rgba(78,138,100,0.12);
}
#mic-btn {
  width: 34px; height: 34px;
  background: var(--green-pale);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--green-dark);
  flex-shrink: 0;
  transition: all 0.2s;
}
#mic-btn.listening {
  background: #fee2e2;
  border-color: #f87171;
  color: #dc2626;
  animation: micPulse 1s infinite;
}
@keyframes micPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.3); }
  50%  { box-shadow: 0 0 0 6px rgba(220,38,38,0); }
}
textarea {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 16px; /* ≥16px évite le zoom iOS */
  line-height: 1.5;
  resize: none;
  outline: none;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  max-height: 100px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 481px) {
  textarea { font-size: 14px; }
}
textarea::placeholder { color: #a0b8a6; }
#send-btn {
  width: 36px; height: 36px;
  background: var(--green-dark);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 3px 10px rgba(61,107,79,0.3);
}
#send-btn:hover { transform: scale(1.07); }
#send-btn:active { transform: scale(0.94); }
#send-btn:disabled { background: #c8d8cc; box-shadow: none; cursor: not-allowed; transform: none; }

.footer-note {
  font-size: 11px;
  color: var(--text-soft);
  text-align: center;
  margin-top: 8px;
  opacity: 0.75;
}

/* ── MENU LATERAL ── */
#side-menu {
  position: fixed;
  inset: 0;
  z-index: 50;
}
.menu-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(2px);
}
.menu-panel {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 270px;
  background: white;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0,0,0,0.1);
  animation: slideIn 0.22s ease;
}
@keyframes slideIn {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}
.menu-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}
.menu-avatar { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; }
.menu-avatar svg { width: 100%; height: 100%; }
.menu-top span { flex: 1; font-size: 14px; font-weight: 500; color: var(--green-dark); }
.menu-top button { background: none; border: none; cursor: pointer; color: var(--text-soft); padding: 4px; }
#conversations-list { flex: 1; overflow-y: auto; padding: 8px; }
.conv-item {
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.conv-item:hover, .conv-item.active { background: var(--green-pale); }
.conv-item.active { border-left: 3px solid var(--green-dark); padding-left: 9px; }
.conv-item-info { flex: 1; min-width: 0; }
.conv-item-title { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.conv-item-date  { font-size: 11px; color: var(--text-soft); }
.conv-delete-btn {
  flex-shrink: 0;
  opacity: 0;
  background: none;
  border: none;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
  touch-action: manipulation;
}
.conv-item:hover .conv-delete-btn { opacity: 1; }
.conv-delete-btn:hover, .conv-delete-btn:active { color: #ef4444; background: rgba(239,68,68,0.1); }
@media (hover: none) {
  .conv-delete-btn { opacity: 0.5; }
}
.menu-footer { padding: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.menu-action-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 13px;
  border-radius: 10px;
  border: none;
  background: var(--green-pale);
  color: var(--green-dark);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  font-family: 'Inter', sans-serif;
}
.menu-action-btn:hover { background: var(--green-light); }

/* ── MODAL ── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
}
.modal-content {
  position: relative;
  background: white;
  border-radius: 24px;
  padding: 32px 24px 24px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  animation: modalIn 0.22s ease;
  text-align: center;
}
@keyframes modalIn {
  from { opacity:0; transform:scale(0.93) translateY(16px); }
  to   { opacity:1; transform:scale(1) translateY(0); }
}
.modal-icon { margin-bottom: 16px; }
.modal-content h3 { font-family: 'Lora', serif; font-size: 20px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.modal-content p { font-size: 13px; color: var(--text-soft); line-height: 1.6; margin-bottom: 20px; }
.modal-content a { color: var(--green-dark); font-weight: 500; }
.modal-content input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 18px;
  color: var(--text);
  text-align: left;
}
.modal-content input:focus { border-color: var(--green-mid); }
.modal-actions { display: flex; gap: 10px; }
.btn-cancel {
  flex: 1; padding: 11px;
  border: 1.5px solid var(--border);
  background: none;
  border-radius: 12px;
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  color: var(--text-soft);
  transition: background 0.15s;
}
.btn-cancel:hover { background: var(--green-pale); }
.btn-save {
  flex: 2; padding: 11px;
  background: var(--green-dark);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-save:hover { opacity: 0.88; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-thumb { background: var(--green-light); border-radius: 3px; }

/* ── SAFE AREA (notch, home indicator) ── */
@supports (padding: env(safe-area-inset-bottom)) {
  footer {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    padding-left: calc(20px + env(safe-area-inset-left));
    padding-right: calc(20px + env(safe-area-inset-right));
  }
  header {
    padding-top: calc(14px + env(safe-area-inset-top));
  }
}

/* ── TOUCH targets ── */
button, .chip, .mode-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ── WELCOME MODAL ── */
.welcome-content { max-width: 360px; }
.welcome-intro {
  text-align: center;
  color: var(--text-soft);
  font-family: 'Lora', serif;
  font-size: 15px;
  line-height: 1.55;
  margin: 8px 0 18px;
}
#welcome-name {
  width: 100%; padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  background: white;
  margin-bottom: 14px;
  font-family: inherit;
}
#welcome-name:focus {
  outline: none;
  border-color: var(--green-mid);
  box-shadow: 0 0 0 3px rgba(78,138,100,0.12);
}
.welcome-btn { width: 100%; margin-bottom: 10px; }
.welcome-anon {
  display: block; width: 100%;
  background: none; border: none;
  color: var(--green-mid);
  font-size: 14px;
  cursor: pointer;
  padding: 8px;
  text-decoration: underline;
  font-family: inherit;
}
.welcome-anon:hover { color: var(--green-dark); }
.welcome-note {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-soft);
  margin-top: 14px;
  opacity: 0.75;
}

/* ── THÈMES ── */
body.theme-dark {
  --green-dark:  #1a1a1a;
  --green-mid:   #2d2d2d;
  --green-light: #404040;
  --green-pale:  #2a2a2a;
  --green-bg:    #1a1a1a;
  --text:        #f5f5f5;
  --text-soft:   #b0b0b0;
  --border:      #3a3a3a;
  --white:       #2d2d2d;
  --card-shadow: 0 4px 24px rgba(0,0,0,0.4);
  background: linear-gradient(160deg, #1a1a1a 0%, #232323 40%, #2a2a2a 100%);
  color: var(--text);
}
body.theme-dark .bg-leaves svg path { fill: #2d4030 !important; stroke: #2d4030 !important; }
body.theme-dark header,
body.theme-dark footer { background: rgba(45,45,45,0.85); border-color: #3a3a3a; }
body.theme-dark .welcome-card,
body.theme-dark .modal-content,
body.theme-dark .menu-panel,
body.theme-dark .bubble.user,
body.theme-dark #user-input { background: #2d2d2d; color: var(--text); border-color: #3a3a3a; }
body.theme-dark .bubble.user { color: var(--text); }
body.theme-dark .chip { background: #2d2d2d; color: var(--text); border-color: #3a3a3a; }

body.theme-red {
  --green-dark:  #8b1e2f;
  --green-mid:   #b3344a;
  --green-light: #f0c4cb;
  --green-pale:  #fae4e7;
  --green-bg:    #fcf2f3;
  --text:        #3a1418;
  --text-soft:   #815058;
  --border:      #ecd2d6;
  --card-shadow: 0 4px 24px rgba(139,30,47,0.10);
  background: linear-gradient(160deg, #f5d8dc 0%, #faedef 40%, #fdf6f7 100%);
}
body.theme-red .bg-leaves svg path { fill: #e8b4ba !important; stroke: #d09da3 !important; }

body.theme-orange {
  --green-dark:  #c2691e;
  --green-mid:   #e08234;
  --green-light: #f5d4af;
  --green-pale:  #fbeada;
  --green-bg:    #fdf6ed;
  --text:        #4a2911;
  --text-soft:   #8f6041;
  --border:      #f0d6b9;
  --card-shadow: 0 4px 24px rgba(194,105,30,0.12);
  background: linear-gradient(160deg, #fad9b0 0%, #fcebd1 40%, #fef6e6 100%);
}
body.theme-orange .bg-leaves svg path { fill: #f0c890 !important; stroke: #d9af75 !important; }

/* Thème picker UI */
.theme-picker {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 8px 0 16px;
}
.theme-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.theme-dot:hover { transform: scale(1.1); }
.theme-dot.active { border-color: var(--text); }
.theme-dot[data-theme="green"]  { background: #3d6b4f; }
.theme-dot[data-theme="dark"]   { background: #1a1a1a; }
.theme-dot[data-theme="red"]    { background: #8b1e2f; }
.theme-dot[data-theme="orange"] { background: #c2691e; }

.theme-label {
  text-align: center;
  font-size: 13px;
  color: var(--text-soft);
  margin: 12px 0 4px;
}

/* ── PHOTO DE RACHEL ── */
.rachel-photo {
  width: 130px; height: 130px;
  margin: 0 auto 14px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(61,107,79,0.18), 0 0 0 4px var(--white);
  position: relative;
  transition: box-shadow 0.3s;
}
.rachel-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.rachel-photo.speaking {
  box-shadow: 0 8px 28px rgba(61,107,79,0.25), 0 0 0 4px var(--white), 0 0 0 8px rgba(78,138,100,0.2), 0 0 0 14px rgba(78,138,100,0.08);
  animation: speakingPulse 1.4s ease-in-out infinite;
}
@keyframes speakingPulse {
  0%, 100% { box-shadow: 0 8px 28px rgba(61,107,79,0.25), 0 0 0 4px var(--white), 0 0 0 8px rgba(78,138,100,0.2), 0 0 0 14px rgba(78,138,100,0.08); }
  50%       { box-shadow: 0 8px 28px rgba(61,107,79,0.25), 0 0 0 4px var(--white), 0 0 0 12px rgba(78,138,100,0.25), 0 0 0 20px rgba(78,138,100,0.05); }
}

/* Bouton stop voix dans le header */
#stop-btn {
  background: rgba(239,68,68,0.1) !important;
  border-color: rgba(239,68,68,0.3) !important;
  color: #dc2626 !important;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity:0; transform:scale(0.8); } to { opacity:1; transform:scale(1); } }

/* ── MENU : section voix ── */
.menu-section {
  padding: 14px 16px 6px;
  border-top: 1px solid var(--border);
}
.menu-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-soft);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.menu-voice-btns {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.menu-voice-btns .voice-btn {
  flex: 1;
  padding: 8px 4px;
  font-size: 12px;
}
.menu-speed-block {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.menu-speed-block #speed-slider { flex: 1; }

/* ── COMPTEUR EN LIGNE ── */
.online-counter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(78,138,100,0.12);
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.online-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #2bbb50;
  box-shadow: 0 0 0 3px rgba(43,187,80,0.25);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(43,187,80,0.25); }
  50%      { box-shadow: 0 0 0 5px rgba(43,187,80,0.08); }
}
header h1 { display: inline-block; }

/* ── HINT DESKTOP ONLY ── */
@media (hover: none) {
  .desktop-hint { display: none; }
}

/* ── IMAGE ERROR ── */
.image-error {
  font-size: 12px;
  color: var(--text-soft);
  font-style: italic;
  margin-top: 8px;
  opacity: 0.75;
}

/* ── IA VISUELLE : animation quand Rachel parle ── */
.rachel-photo {
  position: relative;
  width: 130px; height: 130px;
  margin: 12px auto 18px;
}
.rachel-photo img {
  position: relative;
  z-index: 3;
  border-radius: 50%;
}
.voice-canvas {
  position: absolute;
  inset: -45px;
  width: 220px; height: 220px;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.voice-aura {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(78,138,100,0.35) 0%, rgba(78,138,100,0) 70%);
  z-index: 2;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.voice-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--green-mid);
  z-index: 2;
  opacity: 0;
  pointer-events: none;
}
body.theme-dark .voice-aura { background: radial-gradient(circle, rgba(120,180,140,0.4) 0%, transparent 70%); }
body.theme-dark .voice-ring { border-color: #6ab880; }
body.theme-red .voice-aura  { background: radial-gradient(circle, rgba(179,52,74,0.35) 0%, transparent 70%); }
body.theme-red .voice-ring  { border-color: #b3344a; }
body.theme-orange .voice-aura { background: radial-gradient(circle, rgba(224,130,52,0.4) 0%, transparent 70%); }
body.theme-orange .voice-ring { border-color: #e08234; }

/* État : Rachel parle */
.rachel-photo.speaking .voice-aura  { opacity: 1; animation: aura-breathe 2.4s ease-in-out infinite; }
.rachel-photo.speaking .voice-canvas { opacity: 0.9; }
.rachel-photo.speaking .voice-ring  { animation: ring-expand 2.4s ease-out infinite; }
.rachel-photo.speaking .ring-2 { animation-delay: 0.8s; }
.rachel-photo.speaking .ring-3 { animation-delay: 1.6s; }

@keyframes aura-breathe {
  0%, 100% { transform: scale(1);   opacity: 0.85; }
  50%      { transform: scale(1.18); opacity: 1; }
}
@keyframes ring-expand {
  0%   { transform: scale(1);    opacity: 0.7; }
  100% { transform: scale(1.7);  opacity: 0; }
}

/* Pulse subtil sur la photo elle-même quand elle parle */
.rachel-photo.speaking img {
  animation: photo-pulse 1.8s ease-in-out infinite;
}
@keyframes photo-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 4px var(--white), 0 8px 28px rgba(61,107,79,0.25); }
  50%      { transform: scale(1.03); box-shadow: 0 0 0 4px var(--white), 0 12px 40px rgba(61,107,79,0.4); }
}
