/* ==========================================================
   Assistance Vocale — La Centrale de la Caravane
   PC + téléphone portrait/paysage
   ========================================================== */
:root{
  --av-bg:#0b1220;
  --av-bg-2:#111827;
  --av-panel:#0f172a;
  --av-card:#172033;
  --av-text:#f8fafc;
  --av-muted:#cbd5e1;
  --av-line:rgba(255,255,255,.12);
  --av-orange:#f97316;
  --av-orange-dark:#ea580c;
  --av-green:#22c55e;
  --av-red:#ef4444;
  --av-shadow:0 24px 70px rgba(0,0,0,.38);
}

.centrale-assistant-launcher{
  position:fixed;
  right:22px;
  bottom:22px;
  z-index:12050;
  min-width:190px;
  height:58px;
  padding:0 18px;
  border:1px solid rgba(255,255,255,.24);
  border-radius:999px;
  background:linear-gradient(145deg,var(--av-orange),var(--av-orange-dark));
  color:#fff;
  box-shadow:0 14px 34px rgba(249,115,22,.36),0 7px 22px rgba(0,0,0,.24);
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  cursor:pointer;
  font:inherit;
  font-size:14px;
  font-weight:800;
  white-space:nowrap;
  -webkit-tap-highlight-color:transparent;
  transition:transform .18s ease,box-shadow .18s ease,filter .18s ease;
}
.centrale-assistant-launcher:hover{transform:translateY(-2px);filter:brightness(1.04);box-shadow:0 18px 42px rgba(249,115,22,.42),0 9px 24px rgba(0,0,0,.27)}
.centrale-assistant-launcher:focus-visible{outline:3px solid #fff;outline-offset:3px}
.centrale-assistant-launcher svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.centrale-assistant-launcher-label{line-height:1}

.centrale-assistant-backdrop{
  position:fixed;
  inset:0;
  z-index:12055;
  border:0;
  padding:0;
  margin:0;
  background:rgba(2,6,23,.32);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity .18s ease,visibility .18s ease;
}
.centrale-assistant-backdrop.is-open{opacity:1;visibility:visible;pointer-events:auto}

.centrale-assistant-panel{
  position:fixed;
  right:22px;
  bottom:92px;
  z-index:12060;
  width:min(460px,calc(100vw - 32px));
  height:min(720px,calc(100dvh - 125px));
  min-height:520px;
  border:1px solid var(--av-line);
  border-radius:24px;
  background:linear-gradient(180deg,#111827 0%,#0b1220 100%);
  color:var(--av-text);
  box-shadow:var(--av-shadow);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transform:translateY(14px) scale(.985);
  transition:opacity .18s ease,visibility .18s ease,transform .18s ease;
  isolation:isolate;
}
.centrale-assistant-panel.is-open{opacity:1;visibility:visible;pointer-events:auto;transform:none}

.centrale-assistant-header{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:10px;
  padding:14px;
  border-bottom:1px solid var(--av-line);
  background:linear-gradient(135deg,rgba(249,115,22,.18),rgba(255,255,255,.025));
}
.centrale-assistant-brand-icon{
  width:40px;height:40px;flex:0 0 40px;border-radius:12px;
  display:grid;place-items:center;background:var(--av-orange);color:#fff;
  box-shadow:0 8px 22px rgba(249,115,22,.28);
}
.centrale-assistant-brand-icon svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.centrale-assistant-title{min-width:0;flex:1}
.centrale-assistant-title strong{display:block;color:#fff;font-size:16px;line-height:1.15}
.centrale-assistant-title span{display:block;margin-top:3px;color:var(--av-muted);font-size:11px;line-height:1.25}
.centrale-assistant-close,.centrale-assistant-speaker{
  width:38px;height:38px;flex:0 0 38px;border:1px solid var(--av-line);border-radius:11px;
  background:rgba(255,255,255,.055);color:#fff;display:grid;place-items:center;cursor:pointer;
}
.centrale-assistant-close:hover,.centrale-assistant-speaker:hover{background:rgba(255,255,255,.1)}
.centrale-assistant-close svg,.centrale-assistant-speaker svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.centrale-assistant-speaker.is-muted{opacity:.5}

.centrale-assistant-settings{
  flex:0 0 auto;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  padding:11px 14px;
  border-bottom:1px solid var(--av-line);
  background:rgba(255,255,255,.025);
}
.centrale-assistant-setting label{display:block;margin:0 0 5px;color:#dbe4ef;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.055em}
.centrale-assistant-setting select{
  width:100%;height:38px;padding:0 10px;border:1px solid rgba(255,255,255,.16);border-radius:10px;
  background:#111827;color:#fff;font:inherit;font-size:12px;font-weight:650;outline:none;
}
.centrale-assistant-setting select:focus{border-color:rgba(249,115,22,.9);box-shadow:0 0 0 3px rgba(249,115,22,.12)}

.centrale-assistant-status{
  flex:0 0 auto;
  min-height:26px;
  padding:7px 14px 4px;
  color:#aebdce;
  font-size:11px;
  text-align:center;
}
.centrale-assistant-status:empty{min-height:8px;padding:4px 14px}

.centrale-assistant-messages{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overscroll-behavior:contain;
  padding:8px 14px 12px;
  display:flex;
  flex-direction:column;
  gap:11px;
  scrollbar-width:thin;
  scrollbar-color:rgba(255,255,255,.18) transparent;
}
.centrale-assistant-message{
  max-width:91%;
  padding:11px 12px;
  border-radius:15px;
  font-size:13px;
  line-height:1.48;
  word-break:break-word;
}
.centrale-assistant-message.assistant{
  align-self:flex-start;
  background:#172033;
  border:1px solid rgba(255,255,255,.075);
  color:#f8fafc;
  border-bottom-left-radius:5px;
}
.centrale-assistant-message.user{
  align-self:flex-end;
  background:linear-gradient(145deg,var(--av-orange),var(--av-orange-dark));
  color:#fff;
  border-bottom-right-radius:5px;
  box-shadow:0 7px 18px rgba(249,115,22,.16);
}
.centrale-assistant-message-text{white-space:pre-wrap}
.centrale-assistant-message-actions{display:grid;gap:7px;margin-top:10px}
.centrale-assistant-result-link{
  min-height:38px;
  padding:8px 10px;
  border:1px solid rgba(249,115,22,.44);
  border-radius:10px;
  background:rgba(249,115,22,.12);
  color:#fff !important;
  text-decoration:none !important;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  font-weight:800;
  font-size:12px;
  line-height:1.2;
}
.centrale-assistant-result-link:hover{background:rgba(249,115,22,.22);border-color:rgba(249,115,22,.72)}
.centrale-assistant-result-link svg{width:16px;height:16px;flex:0 0 16px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}

.centrale-assistant-quick-wrap{
  flex:0 0 auto;
  padding:10px 14px 12px;
  border-top:1px solid var(--av-line);
  background:rgba(255,255,255,.02);
}
.centrale-assistant-quick-title{margin:0 0 8px;color:#dbe4ef;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.055em}
.centrale-assistant-quick{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  max-height:none;
  overflow-y:visible;
}
.centrale-assistant-quick button{
  min-width:0;
  min-height:40px;
  padding:8px 9px;
  border:1px solid rgba(255,255,255,.14);
  border-radius:11px;
  background:#1a2538;
  color:#fff;
  font:inherit;
  font-size:11.5px;
  font-weight:760;
  line-height:1.2;
  text-align:center;
  cursor:pointer;
  white-space:normal;
  overflow-wrap:anywhere;
  transition:background .16s ease,border-color .16s ease,transform .16s ease;
}
.centrale-assistant-quick button:hover{background:#23314a;border-color:rgba(249,115,22,.55);transform:translateY(-1px)}
.centrale-assistant-quick button:active{transform:translateY(0)}

.centrale-assistant-input-row{
  flex:0 0 auto;
  display:grid;
  grid-template-columns:46px minmax(0,1fr) 46px;
  gap:8px;
  padding:11px 14px 14px;
  border-top:1px solid var(--av-line);
  background:#070d18;
}
.centrale-assistant-input{
  min-width:0;
  width:100%;
  height:46px;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.16);
  border-radius:12px;
  background:#111827;
  color:#fff;
  font:inherit;
  font-size:13px;
  outline:none;
}
.centrale-assistant-input::placeholder{color:#94a3b8}
.centrale-assistant-input:focus{border-color:rgba(249,115,22,.9);box-shadow:0 0 0 3px rgba(249,115,22,.13)}
.centrale-assistant-mic,.centrale-assistant-send{
  width:46px;height:46px;border:0;border-radius:12px;color:#fff;display:grid;place-items:center;cursor:pointer;
}
.centrale-assistant-mic{background:#263247;border:1px solid rgba(255,255,255,.1)}
.centrale-assistant-send{background:linear-gradient(145deg,var(--av-orange),var(--av-orange-dark))}
.centrale-assistant-mic:hover{background:#334155}
.centrale-assistant-send:hover{filter:brightness(1.05)}
.centrale-assistant-mic:disabled{opacity:.35;cursor:not-allowed}
.centrale-assistant-mic svg,.centrale-assistant-send svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.centrale-assistant-mic.is-listening{background:#dc2626;animation:centraleAssistantListen 1s ease-in-out infinite}

.centrale-assistant-mobile-launch{
  appearance:none;
  -webkit-appearance:none;
  font-family:inherit;
  cursor:pointer;
  text-align:left;
}
.centrale-assistant-mobile-launch .float-icon svg{width:100%;height:100%;display:block;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

.centrale-assistant-launcher.is-listening,.centrale-assistant-mobile-launch.is-listening{background:#dc2626 !important;animation:centraleAssistantListen 1s ease-in-out infinite !important}
.centrale-assistant-launcher.is-thinking,.centrale-assistant-mobile-launch.is-thinking{animation:centraleAssistantThink .82s ease-in-out infinite !important}
.centrale-assistant-launcher.is-speaking,.centrale-assistant-mobile-launch.is-speaking{animation:centraleAssistantSpeak .72s ease-in-out infinite alternate !important}

.centrale-assistant-message.is-typing{min-width:58px;display:flex;align-items:center;justify-content:center;gap:5px}
.centrale-assistant-message.is-typing span{width:7px;height:7px;border-radius:50%;background:#cbd5e1;opacity:.4;animation:centraleAssistantTyping 1s ease-in-out infinite}
.centrale-assistant-message.is-typing span:nth-child(2){animation-delay:.14s}
.centrale-assistant-message.is-typing span:nth-child(3){animation-delay:.28s}
.centrale-assistant-panel[data-activity="speaking"] .centrale-assistant-title strong::after{content:"";display:inline-block;width:7px;height:7px;margin-left:7px;border-radius:50%;background:var(--av-green);vertical-align:middle;animation:centraleAssistantDot .7s ease-in-out infinite alternate}
.centrale-assistant-panel[data-activity="listening"] .centrale-assistant-title strong::after{content:"";display:inline-block;width:7px;height:7px;margin-left:7px;border-radius:50%;background:var(--av-red);vertical-align:middle;animation:centraleAssistantDot .7s ease-in-out infinite alternate}

@keyframes centraleAssistantTyping{0%,80%,100%{transform:translateY(0);opacity:.35}40%{transform:translateY(-5px);opacity:1}}
@keyframes centraleAssistantListen{0%,100%{box-shadow:0 0 0 0 rgba(220,38,38,.4)}50%{box-shadow:0 0 0 9px rgba(220,38,38,0)}}
@keyframes centraleAssistantThink{0%,100%{transform:translateY(0)}50%{transform:translateY(-3px)}}
@keyframes centraleAssistantSpeak{from{box-shadow:0 0 0 0 rgba(249,115,22,.2)}to{box-shadow:0 0 0 8px rgba(249,115,22,0)}}
@keyframes centraleAssistantDot{from{opacity:.35;transform:scale(.8)}to{opacity:1;transform:scale(1.15)}}

/* Téléphone/tablette : l'entrée est dans les raccourcis existants. */
@media (max-width:960px){
  body.centrale-assistant-has-mobile-slot .centrale-assistant-launcher{display:none !important}
  .mobile-floating-actions .centrale-assistant-mobile-launch{display:flex !important}

  body.centrale-assistant-open .mobile-floating-actions,
  body.centrale-assistant-open .floating-actions-toggle,
  body.centrale-assistant-open .floating-actions-toggle-button,
  body.centrale-assistant-open .mobile-menu-toggle,
  body.centrale-assistant-open .mobile-menu-button{
    opacity:0 !important;
    visibility:hidden !important;
    pointer-events:none !important;
  }

  .centrale-assistant-panel{
    left:8px;
    right:8px;
    bottom:calc(8px + env(safe-area-inset-bottom,0px));
    width:auto;
    height:calc(100dvh - 16px - env(safe-area-inset-bottom,0px));
    max-height:780px;
    min-height:0;
    border-radius:20px;
  }
  .centrale-assistant-backdrop{background:rgba(2,6,23,.55)}
  .centrale-assistant-messages{padding-left:12px;padding-right:12px}
  .centrale-assistant-quick-wrap{padding-left:12px;padding-right:12px}
  .centrale-assistant-input-row{padding-left:12px;padding-right:12px;padding-bottom:calc(12px + env(safe-area-inset-bottom,0px))}
}

@media (max-width:560px){
  .centrale-assistant-header{padding:11px 10px;gap:8px}
  .centrale-assistant-brand-icon{width:36px;height:36px;flex-basis:36px;border-radius:10px}
  .centrale-assistant-title strong{font-size:14px}
  .centrale-assistant-title span{font-size:10.5px}
  .centrale-assistant-close,.centrale-assistant-speaker{width:34px;height:34px;flex-basis:34px}
  .centrale-assistant-settings{grid-template-columns:1fr 1fr;gap:7px;padding:9px 10px}
  .centrale-assistant-setting select{height:36px;padding:0 7px;font-size:11px}
  .centrale-assistant-status{font-size:10.5px}
  .centrale-assistant-message{max-width:94%;font-size:12.5px;padding:10px 11px}
  .centrale-assistant-quick{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;max-height:none}
  .centrale-assistant-quick button{min-height:38px;padding:7px 7px;font-size:11px}
}

@media (max-width:380px){
  .centrale-assistant-settings{grid-template-columns:1fr}
  .centrale-assistant-quick{grid-template-columns:1fr 1fr}
  .centrale-assistant-panel{left:5px;right:5px;bottom:calc(5px + env(safe-area-inset-bottom,0px));height:calc(100dvh - 10px - env(safe-area-inset-bottom,0px));border-radius:17px}
}

@media (orientation:landscape) and (max-height:560px){
  .centrale-assistant-panel{
    left:8px;
    right:8px;
    bottom:8px;
    width:auto;
    height:calc(100dvh - 16px);
    max-height:none;
    border-radius:16px;
  }
  .centrale-assistant-header{padding:8px 10px}
  .centrale-assistant-brand-icon{width:32px;height:32px;flex-basis:32px}
  .centrale-assistant-settings{padding:6px 10px}
  .centrale-assistant-setting label{display:none}
  .centrale-assistant-setting select{height:32px}
  .centrale-assistant-status{min-height:20px;padding:3px 10px;font-size:10px}
  .centrale-assistant-messages{padding:5px 10px;gap:7px}
  .centrale-assistant-quick-wrap{padding:6px 10px}
  .centrale-assistant-quick-title{display:none}
  .centrale-assistant-quick{grid-template-columns:repeat(4,minmax(0,1fr));max-height:72px;gap:5px}
  .centrale-assistant-quick button{min-height:32px;font-size:10px;padding:5px}
  .centrale-assistant-input-row{padding:7px 10px;grid-template-columns:40px minmax(0,1fr) 40px}
  .centrale-assistant-input,.centrale-assistant-mic,.centrale-assistant-send{height:40px}
  .centrale-assistant-mic,.centrale-assistant-send{width:40px}
}

@media (prefers-reduced-motion:reduce){
  .centrale-assistant-panel,.centrale-assistant-backdrop,.centrale-assistant-launcher,.centrale-assistant-quick button{transition:none !important}
  .centrale-assistant-launcher.is-listening,.centrale-assistant-mobile-launch.is-listening,.centrale-assistant-launcher.is-thinking,.centrale-assistant-mobile-launch.is-thinking,.centrale-assistant-launcher.is-speaking,.centrale-assistant-mobile-launch.is-speaking,.centrale-assistant-message.is-typing span{animation:none !important}
}
