/* 🤖 NEO AI — assistant EAD */
.neo-root {
  --neo-primary: var(--ead-navy, #112b4f);
  --neo-ink: var(--ead-ink, #0a1a30);
  --neo-text: var(--ead-text, #1a2333);
  --neo-muted: var(--ead-muted, #5a6577);
  --neo-line: #E6EAF2;
  --neo-soft: #e8edf4;
  --neo-bg: var(--ead-paper, #f7f4ee);
  --neo-accent: var(--ead-gold, #e3a92f);
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1080;
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--neo-ink);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}
.neo-root > * { pointer-events: auto; }

/* Bouton flottant */
.neo-fab-row { display: flex; align-items: center; gap: 10px; }
.neo-fab {
  width: 68px; height: 68px; padding: 4px;
  border: 3px solid #fff; border-radius: 50%;
  background: var(--neo-soft);
  box-shadow: 0 10px 26px rgba(21, 114, 232, .35);
  cursor: pointer; transition: transform .2s;
}
.neo-fab:hover, .neo-fab:focus-visible { transform: scale(1.06); }
.neo-fab:focus-visible { outline: 3px solid var(--neo-accent); outline-offset: 2px; }
.neo-tip {
  max-width: 260px; padding: 10px 14px; border-radius: 12px;
  background: var(--neo-ink); color: #fff;
  font-size: 14px; font-weight: 600; line-height: 1.45;
  box-shadow: 0 8px 20px rgba(26, 32, 53, .25);
  animation: neoPop .3s cubic-bezier(.2, .9, .3, 1.25) both;
}
.neo-tip[hidden] { display: none; }

/* Panneau */
.neo-panel {
  width: 380px; max-width: calc(100vw - 32px);
  height: 560px; max-height: calc(100vh - 120px);
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--neo-line); border-radius: 18px;
  box-shadow: 0 18px 44px rgba(26, 32, 53, .2);
  overflow: hidden;
  animation: neoPop .35s cubic-bezier(.2, .9, .3, 1.25) both;
  transform-origin: bottom right;
}
.neo-panel[hidden] { display: none; }
@keyframes neoPop { from { opacity: 0; transform: translateY(12px) scale(.94); } to { opacity: 1; transform: none; } }

.neo-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 10px 12px 14px; border-bottom: 1px solid var(--neo-line);
}
.neo-head-avatar { width: 46px; height: 46px; flex-shrink: 0; }
.neo-head-title { flex-grow: 1; min-width: 0; }
.neo-head-title small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--neo-primary); }
.neo-head-title strong { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.neo-icon-btn {
  width: 40px; height: 40px; border: 0; border-radius: 10px;
  background: transparent; color: var(--neo-muted);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.neo-icon-btn:hover { background: var(--neo-bg); color: var(--neo-ink); }
.neo-icon-btn[aria-pressed="true"] { color: var(--neo-primary); background: var(--neo-soft); }

.neo-body { flex: 1 1 auto; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #FAFBFD; }
.neo-msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; font-size: 14.5px; line-height: 1.5; white-space: pre-line; word-wrap: break-word; }
.neo-msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--neo-line); color: var(--neo-text); border-bottom-left-radius: 4px; }
.neo-msg.user { align-self: flex-end; background: var(--neo-primary); color: #fff; border-bottom-right-radius: 4px; }
.neo-msg.error { border-color: #F5C2C2; background: #FDF3F3; }
.neo-msg-title { display: block; font-weight: 700; color: var(--neo-ink); margin-bottom: 2px; }
.neo-actions { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; }
.neo-action {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px;
  border: 1.5px solid var(--neo-primary); border-radius: 10px; background: #fff;
  color: var(--neo-primary); font-size: 13.5px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.neo-action:hover { background: var(--neo-soft); color: var(--neo-primary); text-decoration: none; }
.neo-action.solid { background: var(--neo-primary); color: #fff; }
.neo-dots { display: inline-flex; gap: 4px; }
.neo-dots span { width: 7px; height: 7px; border-radius: 50%; background: #B6BFCE; animation: neoDot 1s infinite; }
.neo-dots span:nth-child(2) { animation-delay: .15s; }
.neo-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes neoDot { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

/* Visite guidée */
.neo-steps { display: flex; align-items: center; gap: 8px; align-self: stretch; }
.neo-steps .neo-progress { display: flex; gap: 5px; flex-grow: 1; }
.neo-steps .neo-progress i { width: 8px; height: 8px; border-radius: 4px; background: #D5DBE6; transition: width .3s, background .3s; }
.neo-steps .neo-progress i.on { width: 22px; background: var(--neo-primary); }
.neo-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; align-self: stretch; }
.neo-choice button {
  min-height: 42px; border: 1.5px solid #D5DBE6; border-radius: 12px; background: #fff;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--neo-ink); cursor: pointer;
}
.neo-choice button:hover { border-color: var(--neo-primary); background: var(--neo-soft); }

/* Raccourcis + saisie */
.neo-quick { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px 0; scrollbar-width: none; }
.neo-quick::-webkit-scrollbar { display: none; }
.neo-quick a {
  flex-shrink: 0; padding: 6px 11px; border-radius: 999px; background: var(--neo-soft);
  color: var(--neo-primary); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.neo-form { display: flex; align-items: flex-end; gap: 6px; padding: 10px 12px 12px; }
.neo-form textarea {
  flex-grow: 1; min-height: 42px; max-height: 110px; resize: none;
  padding: 10px 12px; border: 1.5px solid #D5DBE6; border-radius: 12px;
  font: inherit; font-size: 14.5px; color: var(--neo-ink); line-height: 1.4;
}
.neo-form textarea:focus { outline: none; border-color: var(--neo-primary); }
.neo-send, .neo-mic {
  width: 42px; height: 42px; flex-shrink: 0; border: 0; border-radius: 12px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.neo-send { background: var(--neo-primary); color: #fff; }
.neo-send:disabled { opacity: .5; cursor: default; }
.neo-mic { background: var(--neo-bg); color: var(--neo-text); }
.neo-mic.listening { background: #D93025; color: #fff; animation: neoPulse 1.2s infinite; }
@keyframes neoPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(217, 48, 37, .45); } 50% { box-shadow: 0 0 0 8px rgba(217, 48, 37, 0); } }
.neo-foot { padding: 0 12px 10px; font-size: 11.5px; color: var(--neo-muted); text-align: center; }
.neo-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }


/* ---------- Réponses enrichies ---------- */
.neo-msg strong { font-weight: 700; color: var(--neo-ink); }
.neo-msg.user strong { color: #fff; }
.neo-msg.rich { max-width: 94%; display: grid; gap: 8px; white-space: normal; }
.neo-b-text { margin: 0; white-space: pre-line; }
.neo-b-title { font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--neo-muted); }

.neo-b-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 6px; }
.neo-stat {
  display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px;
  background: var(--neo-bg); border: 1px solid var(--neo-line);
}
.neo-stat-value { font-size: 16px; font-weight: 700; color: var(--neo-ink); line-height: 1.2; }
.neo-stat-label { font-size: 11.5px; color: var(--neo-muted); }
.neo-stat.good { background: #E8F5EC; border-color: #BFE3CB; }
.neo-stat.good .neo-stat-value { color: #146C2E; }
.neo-stat.warn { background: #FFF5E0; border-color: #F6DDA5; }
.neo-stat.warn .neo-stat-value { color: #8A5300; }
.neo-stat.bad { background: #FDECEC; border-color: #F5C2C2; }
.neo-stat.bad .neo-stat-value { color: #A8261D; }

.neo-b-list { display: grid; gap: 4px; }
.neo-b-list ul, .neo-b-alert ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.neo-b-list li {
  display: flex; flex-direction: column; gap: 1px; padding: 6px 10px 6px 12px;
  border-left: 3px solid var(--neo-line); background: #FAFBFD; border-radius: 0 8px 8px 0;
}
.neo-b-list li.tone-good { border-left-color: #1E8E3E; }
.neo-b-list li.tone-warn { border-left-color: #E8A317; }
.neo-b-list li.tone-bad { border-left-color: #D93025; }
.neo-li-meta { font-size: 12px; color: var(--neo-muted); }

.neo-b-alert { padding: 10px 12px; border-radius: 10px; border: 1px solid; display: grid; gap: 4px; }
.neo-b-alert .neo-b-title { text-transform: none; letter-spacing: 0; font-size: 13.5px; }
.neo-b-alert li { font-size: 13.5px; padding-left: 14px; position: relative; }
.neo-b-alert li::before { content: ""; position: absolute; left: 3px; top: .6em; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .6; }
.neo-b-alert.warning { background: #FFF5E0; border-color: #F6DDA5; color: #6B4100; }
.neo-b-alert.warning .neo-b-title { color: #6B4100; }
.neo-b-alert.danger { background: #FDECEC; border-color: #F5C2C2; color: #8A1C1C; }
.neo-b-alert.danger .neo-b-title { color: #8A1C1C; }
.neo-b-alert.success { background: #E8F5EC; border-color: #BFE3CB; color: #145A28; }
.neo-b-alert.success .neo-b-title { color: #145A28; }
.neo-b-alert.info { background: var(--neo-soft); border-color: #CFE2FB; color: #0B4C9C; }
.neo-b-alert.info .neo-b-title { color: #0B4C9C; }

.neo-b-tip {
  display: flex; gap: 8px; align-items: flex-start; padding: 9px 11px; border-radius: 10px;
  background: #F3F0FF; border: 1px dashed #C9BEF5; color: #3B2E7A; font-size: 13.5px; line-height: 1.45;
}
.neo-b-tip strong { color: #2A1F63; }
.neo-tip-icon { flex-shrink: 0; margin-top: 1px; color: #6B55D6; }
.neo-tip-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #6B55D6; }

.neo-voice-reply strong { color: #FFD27A; }

/* Réglages de la voix (dans le panneau) */
.neo-settings {
  display: grid; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--neo-line); background: #fff;
  font-size: 13.5px;
}
.neo-settings[hidden] { display: none; }
.neo-settings label { display: grid; gap: 4px; font-weight: 600; color: var(--neo-text); }
.neo-settings select, .neo-settings input[type="range"] { width: 100%; font: inherit; font-weight: 400; }
.neo-settings select { min-height: 36px; border: 1.5px solid #D5DBE6; border-radius: 8px; padding: 0 8px; background: #fff; }
.neo-settings .neo-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; }

/* Bouton « Montrer » collé à une action */
.neo-action-group { display: inline-flex; }
.neo-action-group .neo-action:first-child { border-radius: 10px 0 0 10px; }
.neo-action-group .neo-action:last-child { border-radius: 0 10px 10px 0; border-left-width: 0; }

/* ---------- Projecteur : assombrit la page sauf l'élément montré ---------- */
.neo-spot {
  position: fixed; z-index: 1070; pointer-events: none;
  border-radius: 12px;
  box-shadow: 0 0 0 200vmax rgba(15, 20, 35, .55);
  outline: 3px solid var(--neo-accent, var(--ead-gold, #e3a92f)); outline-offset: 2px;
  transition: top .35s cubic-bezier(.2, .8, .2, 1), left .35s cubic-bezier(.2, .8, .2, 1),
              width .35s cubic-bezier(.2, .8, .2, 1), height .35s cubic-bezier(.2, .8, .2, 1);
  animation: neoSpotPulse 1.8s ease-in-out infinite;
}
.neo-spot[hidden] { display: none; }
@keyframes neoSpotPulse { 0%, 100% { outline-offset: 2px; } 50% { outline-offset: 6px; } }

/* ---------- Mode compact : Neo se réduit pour laisser voir ce qu'il montre ---------- */
.neo-compact {
  position: fixed; z-index: 1085; top: 0; left: 0; width: 340px; max-width: calc(100vw - 24px);
  display: flex; gap: 10px; align-items: flex-start; box-sizing: border-box;
  padding: 12px 12px 12px 10px; background: #fff; border-radius: 16px;
  box-shadow: 0 16px 40px rgba(15, 20, 35, .28);
  transition: transform .4s cubic-bezier(.2, .8, .2, 1);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--neo-ink);
}
.neo-compact[hidden] { display: none; }
.neo-compact.pop { animation: neoMorphIn .35s cubic-bezier(.2, .9, .3, 1.2) both; }
/* « scale » et non « transform » : transform sert à positionner la carte */
@keyframes neoMorphIn { from { opacity: 0; scale: .85; } to { opacity: 1; scale: 1; } }
.neo-compact-avatar { width: 44px; height: 44px; flex-shrink: 0; }
.neo-compact-body { flex: 1; min-width: 0; }
.neo-compact-title { font-weight: 700; font-size: 15px; margin-bottom: 2px; padding-right: 30px; }
.neo-compact-text { font-size: 14px; line-height: 1.45; color: var(--neo-text); white-space: pre-line; }
.neo-compact-foot { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.neo-compact-foot .neo-progress { display: flex; gap: 4px; flex: 1; }
.neo-compact-foot .neo-progress i { width: 7px; height: 7px; border-radius: 4px; background: #D5DBE6; transition: width .3s; }
.neo-compact-foot .neo-progress i.on { width: 18px; background: var(--neo-primary); }
.neo-compact-expand { position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; }

/* ---------- Mode conversation vocale immersif ---------- */
.neo-voice {
  position: fixed; inset: 0; z-index: 1090; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  background: #0E1322; color: #fff; text-align: center;
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  animation: neoFade .3s ease both;
}
.neo-voice[hidden] { display: none; }
.neo-voice, .neo-voice *, .neo-toast, .neo-toast * { box-sizing: border-box; }
@keyframes neoFade { from { opacity: 0; } to { opacity: 1; } }

/* Fond vivant : trois halos qui changent avec l'état de NEO AI */
.neo-voice-aura { position: absolute; inset: 0; pointer-events: none; filter: blur(60px); opacity: .55; transition: opacity .6s; }
.neo-voice-aura i { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; background: var(--neo-primary); opacity: .45; animation: neoDrift 14s ease-in-out infinite alternate; }
.neo-voice-aura i:nth-child(1) { left: -12vmax; top: -10vmax; }
.neo-voice-aura i:nth-child(2) { right: -14vmax; top: 20vh; background: #7B5CF0; animation-duration: 18s; }
.neo-voice-aura i:nth-child(3) { left: 20vw; bottom: -22vmax; background: var(--ead-gold, #e3a92f); opacity: .22; animation-duration: 22s; }
.neo-voice[data-state="listening"] .neo-voice-aura { opacity: .8; }
.neo-voice[data-state="speaking"] .neo-voice-aura i:nth-child(3) { opacity: .4; }
@keyframes neoDrift { from { transform: translate(0, 0) scale(1); } to { transform: translate(6vmax, 4vmax) scale(1.15); } }

.neo-voice > :not(.neo-voice-aura):not(.neo-voice-particle) { position: relative; }
.neo-voice-top { width: 100%; max-width: 760px; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: #B9C2D6; }
.neo-voice-chip {
  border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .06); color: #DCE3F1;
  border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 12px; cursor: pointer;
}
.neo-voice-chip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.neo-voice-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #6B7590; }
.neo-voice-chip[aria-pressed="true"] { border-color: rgba(255, 255, 255, .5); color: #fff; }
.neo-voice-chip[aria-pressed="true"]::before { background: #34C76F; box-shadow: 0 0 0 3px rgba(52, 199, 111, .25); }

.neo-voice-stage {
  flex: 1; min-height: 0; width: 100%; max-width: 640px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  transition: max-width .45s;
}
.neo-voice-hero { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.neo-voice-says { display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* NEO AI : grand au centre, ou rangé en haut à gauche quand il affiche du contenu */
.neo-voice-orb {
  position: relative; width: 180px; height: 180px; border: 0; background: transparent; padding: 0;
  cursor: pointer; border-radius: 50%; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: width .45s cubic-bezier(.2, .8, .2, 1), height .45s cubic-bezier(.2, .8, .2, 1);
}
.neo-voice-face { position: absolute; inset: 0; display: block; transition: transform .25s; }
.neo-voice-orb:hover .neo-voice-face { transform: scale(1.04); }
.neo-voice-orb:focus-visible { outline: 3px solid var(--ead-gold, #e3a92f); outline-offset: 8px; }
.neo-voice-orb::before, .neo-voice-orb::after {
  content: ""; position: absolute; inset: -16px; border-radius: 50%;
  border: 3px solid var(--neo-primary); opacity: 0; transform: scale(.9); pointer-events: none;
}
.neo-voice[data-state="listening"] .neo-voice-orb::before { animation: neoWave 1.6s ease-out infinite; }
.neo-voice[data-state="listening"] .neo-voice-orb::after { animation: neoWave 1.6s ease-out .8s infinite; }
.neo-voice[data-state="speaking"] .neo-voice-orb::before { border-color: var(--ead-gold, #e3a92f); animation: neoWave 1s ease-out infinite; }
.neo-voice[data-state="thinking"] .neo-voice-face { animation: neoThink 1.4s ease-in-out infinite; }
.neo-voice[data-state="idle"] .neo-voice-face { animation: neoBreath 3.5s ease-in-out infinite; }
@keyframes neoWave { 0% { opacity: .7; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.35); } }
@keyframes neoThink { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
@keyframes neoBreath { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }

/* Toucher : il s'écrase un peu puis rebondit, avec une onde au point touché */
.neo-voice-orb.poke .neo-voice-face { animation: neoPoke .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes neoPoke { 0% { transform: scale(1); } 30% { transform: scale(.88, .82); } 65% { transform: scale(1.08, 1.1); } 100% { transform: scale(1); } }
.neo-voice-ripple {
  position: absolute; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%;
  background: rgba(255, 255, 255, .55); pointer-events: none; animation: neoRipple .6s ease-out forwards;
}
@keyframes neoRipple { to { transform: scale(9); opacity: 0; } }
.neo-voice-particle {
  position: fixed; z-index: 2; font-size: 26px; pointer-events: none; margin: -14px 0 0 -14px;
  animation: neoParticle 1.1s cubic-bezier(.2, .7, .3, 1) forwards;
}
@keyframes neoParticle {
  0% { transform: translate(0, 0) scale(.4); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.15); opacity: 0; }
}

.neo-voice-status { font-size: 15px; font-weight: 600; color: #DCE3F1; min-height: 22px; }
/* Barres « je vous entends » / « je parle » */
.neo-voice-bars { display: flex; gap: 4px; height: 18px; align-items: center; opacity: 0; transition: opacity .3s; }
.neo-voice-bars i { width: 4px; height: 6px; border-radius: 2px; background: #fff; }
.neo-voice[data-state="listening"] .neo-voice-bars, .neo-voice[data-state="speaking"] .neo-voice-bars { opacity: .85; }
.neo-voice[data-state="listening"] .neo-voice-bars i { animation: neoBar 1s ease-in-out infinite; }
.neo-voice[data-state="speaking"] .neo-voice-bars i { background: var(--ead-gold, #e3a92f); animation: neoBar .7s ease-in-out infinite; }
.neo-voice-bars i:nth-child(2) { animation-delay: .15s !important; }
.neo-voice-bars i:nth-child(3) { animation-delay: .3s !important; }
.neo-voice-bars i:nth-child(4) { animation-delay: .45s !important; }
.neo-voice-bars i:nth-child(5) { animation-delay: .6s !important; }
@keyframes neoBar { 0%, 100% { height: 5px; } 50% { height: 18px; } }

.neo-voice-user { font-size: 16px; color: #B9C2D6; font-style: italic; min-height: 24px; }
.neo-voice-reply { font-size: clamp(18px, 4.5vw, 22px); line-height: 1.45; white-space: pre-line; max-height: 30vh; overflow-y: auto; }
.neo-voice-reply strong { color: #FFD27A; }
.neo-voice .neo-actions { justify-content: center; align-self: center; }
.neo-voice .neo-action { background: rgba(255, 255, 255, .06); color: #fff; border-color: rgba(255, 255, 255, .6); }

/* Carte de contenu (chiffres, listes, alertes) */
.neo-voice-card {
  width: 100%; min-height: 0; overflow-y: auto; text-align: left;
  display: grid; gap: 8px; align-content: start;
  background: #fff; color: var(--neo-text, #343B4D); border-radius: 18px; padding: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
  font-size: 14px; line-height: 1.45;
  animation: neoCardIn .45s cubic-bezier(.2, .8, .2, 1) both;
  --neo-ink: var(--ead-ink, #0a1a30); --neo-muted: var(--ead-muted, #5a6577); --neo-line: #E6EAF2; --neo-bg: var(--ead-paper, #f7f4ee); --neo-soft: #e8edf4;
}
.neo-voice-card[hidden] { display: none; }
@keyframes neoCardIn { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }

.neo-voice[data-layout="docked"] .neo-voice-stage { justify-content: flex-start; max-width: 720px; gap: 12px; }
.neo-voice[data-layout="docked"] .neo-voice-hero { flex-direction: row; align-self: flex-start; gap: 14px; text-align: left; }
.neo-voice[data-layout="docked"] .neo-voice-says { align-items: flex-start; }
.neo-voice[data-layout="docked"] .neo-voice-orb { width: 84px; height: 84px; }
.neo-voice[data-layout="docked"] .neo-voice-orb::before, .neo-voice[data-layout="docked"] .neo-voice-orb::after { inset: -8px; }
.neo-voice[data-layout="docked"] .neo-voice-user,
.neo-voice[data-layout="docked"] .neo-voice-reply { align-self: stretch; text-align: left; }
.neo-voice[data-layout="docked"] .neo-voice-reply { font-size: 17px; max-height: none; flex-shrink: 0; }
.neo-voice[data-layout="docked"] .neo-voice-card { flex: 1; }
.neo-voice[data-layout="docked"] .neo-actions { align-self: flex-start; justify-content: flex-start; }

.neo-voice-bottom { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.neo-voice-controls { display: flex; gap: 18px; align-items: center; }
.neo-voice-btn {
  width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .12); color: #fff; transition: background .2s, transform .2s;
}
.neo-voice-btn:hover { background: rgba(255, 255, 255, .2); }
.neo-voice-btn:active { transform: scale(.94); }
.neo-voice-btn.end { background: #D93025; }
.neo-voice-btn[aria-pressed="true"] { background: #fff; color: var(--neo-ink); }
.neo-voice-hint { font-size: 12.5px; color: #8E99B0; margin: 0; }

/* ---------- Navigation : chargement et message d'arrivée ---------- */
.neo-loadbar {
  position: fixed; top: 0; left: 0; z-index: 1100; height: 3px; width: 100%;
  background: var(--neo-primary, var(--ead-navy, #112b4f)); transform-origin: left; transform: scaleX(0);
  box-shadow: 0 0 10px var(--neo-primary, var(--ead-navy, #112b4f));
}
.neo-loadbar[hidden] { display: none; }
.neo-loadbar.on { animation: neoLoad 8s cubic-bezier(.1, .7, .2, 1) forwards; }
@keyframes neoLoad { 0% { transform: scaleX(0); } 10% { transform: scaleX(.35); } 100% { transform: scaleX(.92); } }

.neo-action.is-loading, .neo-quick a.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.neo-action.is-loading::after, .neo-quick a.is-loading::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border-radius: 50%; border: 2px solid currentColor; border-color: var(--neo-primary, var(--ead-navy, #112b4f)) transparent var(--neo-primary, var(--ead-navy, #112b4f)) transparent;
  animation: neoSpin .7s linear infinite;
}
.neo-voice .neo-action.is-loading::after { border-color: #fff transparent #fff transparent; }
@keyframes neoSpin { to { transform: rotate(360deg); } }

.neo-toast {
  position: fixed; right: 20px; bottom: 100px; z-index: 1100;
  display: flex; align-items: center; gap: 10px; max-width: min(360px, calc(100vw - 32px));
  padding: 8px 8px 8px 8px; border-radius: 16px;
  background: var(--ead-ink, #0a1a30); color: #fff; box-shadow: 0 14px 34px rgba(26, 32, 53, .35);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 14px; line-height: 1.4;
}
.neo-toast[hidden] { display: none; }
.neo-toast.in { animation: neoToastIn .45s cubic-bezier(.2, .9, .3, 1.25) both; }
@keyframes neoToastIn { from { opacity: 0; transform: translateY(16px) scale(.92); } to { opacity: 1; transform: none; } }
.neo-toast-avatar { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; }
.neo-toast-text { flex: 1; cursor: pointer; }
.neo-toast.busy .neo-toast-text { cursor: default; }
.neo-toast-text strong { color: #FFD27A; }
.neo-toast-close { flex-shrink: 0; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: #B9C2D6; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.neo-toast-close:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.neo-toast.busy .neo-toast-close { display: none; }
.neo-spin { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--neo-primary, var(--ead-navy, #112b4f)); border-right-color: transparent; animation: neoSpin .7s linear infinite; }

/* ---------- NEO AI vivant (bulle fermée) ---------- */
.neo-fab { position: relative; }
.neo-fab .neo-eyes { transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.neo-fab.hop { animation: neoHop .7s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes neoHop { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-12px) scale(1.04, .97); } 55% { transform: translateY(0) scale(1.06, .92); } 75% { transform: translateY(-3px); } }
.neo-fab.wiggle { animation: neoWiggle .9s ease-in-out; }
@keyframes neoWiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-9deg); } 40% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } 80% { transform: rotate(3deg); } }
.neo-fab.antenna .neo-ant { animation: neoAnt .35s ease-in-out 4 alternate; }
@keyframes neoAnt { from { fill: var(--ead-gold, #e3a92f); } to { fill: #FFE7A3; } }
.neo-fab.sleeping { animation: neoSnore 3.2s ease-in-out infinite; }
@keyframes neoSnore { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.neo-fab.sleeping::after {
  content: "z"; position: absolute; top: -6px; right: -2px; font: 700 15px/1 'Manrope', system-ui, sans-serif; color: var(--neo-primary);
  animation: neoZ 2.4s ease-out infinite;
}
@keyframes neoZ { 0% { opacity: 0; transform: translate(0, 6px) scale(.7); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(10px, -16px) scale(1.25); } }

/* Réveil vocal actif : petit voyant vert, qui pulse quand le micro écoute */
.neo-root.wake-on .neo-fab::before {
  content: ""; position: absolute; left: 2px; top: 4px; width: 12px; height: 12px; border-radius: 50%;
  background: #34C76F; border: 2px solid #fff;
}
.neo-root.wake-on.wake-listening .neo-fab::before { animation: neoLive 1.8s ease-out infinite; }
@keyframes neoLive { 0% { box-shadow: 0 0 0 0 rgba(52, 199, 111, .55); } 100% { box-shadow: 0 0 0 9px rgba(52, 199, 111, 0); } }
.neo-settings-note { margin: -4px 0 0; font-size: 12px; color: var(--neo-muted); line-height: 1.4; }

/* ---------- Bordures lumineuses (façon Siri) ---------- */
@property --neo-edge-a { syntax: '<angle>'; inherits: true; initial-value: 0deg; }
@property --neo-edge-glow { syntax: '<length>'; inherits: true; initial-value: 22px; }
.neo-edge {
  position: fixed; inset: 0; z-index: 1095; pointer-events: none;
  opacity: 0; transition: opacity .45s ease;
  --neo-edge-w: 5px; --neo-edge-glow: 22px; --neo-edge-speed: 5s;
  animation: neoEdgeSpin var(--neo-edge-speed) linear infinite;
}
.neo-edge[hidden] { display: none; }
.neo-edge.on { opacity: 1; }
.neo-edge::before, .neo-edge i {
  position: absolute; inset: 0;
  background: conic-gradient(from var(--neo-edge-a), var(--ead-navy, #112b4f), #7B5CF0, #FF5FA2, var(--ead-gold, #e3a92f), #34C7B5, var(--ead-navy, #112b4f));
}
/* Fine ligne nette sur le bord */
.neo-edge::before {
  content: ""; padding: var(--neo-edge-w); transition: padding .4s ease;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
/* Halo qui s'estompe vers l'intérieur de l'écran */
.neo-edge i {
  --f: var(--neo-edge-glow);
  -webkit-mask:
    linear-gradient(to right, #000, transparent var(--f), transparent calc(100% - var(--f)), #000),
    linear-gradient(to bottom, #000, transparent var(--f), transparent calc(100% - var(--f)), #000);
  mask:
    linear-gradient(to right, #000, transparent var(--f), transparent calc(100% - var(--f)), #000),
    linear-gradient(to bottom, #000, transparent var(--f), transparent calc(100% - var(--f)), #000);
  filter: blur(4px); opacity: .8;
  transition: --neo-edge-glow .5s ease;
}
@keyframes neoEdgeSpin { to { --neo-edge-a: 360deg; } }
.neo-edge { --neo-edge-glow: 40px; }
.neo-edge[data-state="idle"] { --neo-edge-w: 2px; --neo-edge-glow: 14px; --neo-edge-speed: 9s; }
.neo-edge[data-state="idle"].on { opacity: .45; }
.neo-edge[data-state="listening"] { --neo-edge-w: 4px; --neo-edge-glow: 56px; --neo-edge-speed: 3s; }
.neo-edge[data-state="thinking"] { --neo-edge-w: 3px; --neo-edge-glow: 34px; --neo-edge-speed: 1.6s; }
.neo-edge[data-state="speaking"] { --neo-edge-w: 4px; --neo-edge-glow: 64px; --neo-edge-speed: 4s; }
.neo-edge[data-state="speaking"] i { animation: neoEdgeBreath 1.1s ease-in-out infinite; }
@keyframes neoEdgeBreath { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }
.neo-edge.flash i { animation: neoEdgeFlash 1.2s ease-out; }
.neo-edge.flash::before { animation: neoEdgeFlashLine 1.2s ease-out; }
@keyframes neoEdgeFlash { 0% { opacity: 0; --neo-edge-glow: 0px; } 25% { opacity: 1; --neo-edge-glow: 150px; } 100% { opacity: .8; } }
@keyframes neoEdgeFlashLine { 0% { padding: 0; } 25% { padding: 8px; } 100% { padding: var(--neo-edge-w); } }

/* ---------- Mobile : panneau en bottom sheet ajustable ---------- */
/* Dans le contexte d'empilement de .neo-root : derrière le panneau, devant la page */
.neo-backdrop { position: fixed; inset: 0; z-index: 0; background: rgba(15, 20, 35, .35); opacity: 0; transition: opacity .25s; }
.neo-backdrop[hidden] { display: none; }
.neo-backdrop.on { opacity: 1; }
.neo-grab { display: none; }

@media (max-width: 575.98px) {
  .neo-root { right: 12px; bottom: 12px; }
  .neo-root.is-open { right: 0; bottom: 0; left: 0; align-items: stretch; }
  .neo-root.is-open .neo-fab-row { display: none; }
  .neo-panel {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1;
    width: 100%; max-width: none; max-height: none;
    height: var(--neo-sheet-h, 60vh);
    border-radius: 20px 20px 0 0; border-bottom: 0;
    animation: neoSheetIn .35s cubic-bezier(.2, .8, .2, 1) both;
    transition: height .3s cubic-bezier(.2, .8, .2, 1);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .neo-panel.dragging { transition: none; }
  @keyframes neoSheetIn { from { transform: translateY(100%); } to { transform: none; } }
  .neo-grab {
    display: block; width: 100%; height: 22px; border: 0; padding: 0; background: transparent; cursor: grab; touch-action: none;
    position: relative; flex-shrink: 0;
  }
  .neo-grab::after { content: ""; position: absolute; left: 50%; top: 8px; width: 42px; height: 5px; margin-left: -21px; border-radius: 3px; background: #CBD2DE; }
  .neo-head { padding-top: 2px; touch-action: none; }
  .neo-voice-orb { width: 150px; height: 150px; }
  .neo-voice[data-layout="docked"] .neo-voice-orb { width: 64px; height: 64px; }
  .neo-voice-top { font-size: 12px; }
  .neo-toast { left: 12px; right: 12px; bottom: 92px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .neo-panel, .neo-tip, .neo-mic.listening, .neo-spot, .neo-compact, .neo-voice,
  .neo-voice-orb, .neo-voice-orb::before, .neo-voice-orb::after, .neo-voice-face, .neo-voice-aura i,
  .neo-voice-bars i, .neo-voice-card, .neo-toast, .neo-loadbar, .neo-fab, .neo-fab::after, .neo-fab::before,
  .neo-edge, .neo-edge i, .neo-edge::before { animation: none !important; transition: none !important; }
  .neo-loadbar.on { transform: scaleX(.6); }
}
