/* Soma — tuteur médical DCT. Widget flottant, en français. */
#hippo-fab{position:fixed;right:18px;bottom:18px;z-index:80;width:60px;height:60px;border:1.5px solid #0B7C88;border-radius:18px;
 background:linear-gradient(135deg,#0A84FF,#0D9488);box-shadow:0 8px 24px rgba(10,132,255,.34),0 3px 10px rgba(10,25,41,.16);cursor:pointer;
 display:flex;align-items:center;justify-content:center;padding:3px;transition:transform .18s ease, box-shadow .18s}
#hippo-fab img,#hippo-fab svg{width:100%;height:100%;display:block;border-radius:14px}
#hippo-fab:hover{transform:translateY(-2px) scale(1.04);box-shadow:0 12px 30px rgba(10,132,255,.42),0 4px 12px rgba(10,25,41,.2)}
#hippo-fab:focus-visible{outline:3px solid #7FE0CE;outline-offset:3px}
#hippo-fab .dot{position:absolute;top:6px;right:6px;width:11px;height:11px;border-radius:50%;background:#FF6B57;
 border:2px solid #fff;opacity:0;transform:scale(.6);transition:.2s}
#hippo-fab.has-new .dot{opacity:1;transform:scale(1)}
#hippo-fab.hidden{display:none}

.soma-core{transform-origin:256px 256px;animation:somaCorePulse 2.4s ease-in-out infinite}
.soma-ecg{transform-origin:256px 256px;stroke-dasharray:68 38;stroke-dashoffset:106;animation:somaEcgSweep 2.2s linear infinite, somaBeat 1.4s ease-in-out infinite}
@keyframes somaCorePulse{0%,100%{transform:scale(.97);opacity:.92}50%{transform:scale(1.04);opacity:1}}
@keyframes somaEcgSweep{0%{stroke-dashoffset:106}100%{stroke-dashoffset:0}}
@keyframes somaBeat{0%,100%{transform:scale(1)}14%{transform:scale(1.07)}28%{transform:scale(.98)}42%{transform:scale(1.04)}60%{transform:scale(1)}}

#hippo-panel{position:fixed;right:18px;bottom:92px;z-index:81;width:min(392px,calc(100vw - 24px));
 height:min(580px,calc(100vh - 120px));display:none;flex-direction:column;background:#fff;border:1px solid #D8E3E0;
 border-radius:18px;box-shadow:0 24px 60px rgba(9,40,40,.22);overflow:hidden;font-family:'Inter',system-ui,-apple-system,Segoe UI,sans-serif}
#hippo-panel.open{display:flex}
#hippo-panel *{box-sizing:border-box}

.hp-head{display:flex;align-items:center;gap:10px;padding:11px 14px;background:linear-gradient(135deg,#0066CC,#0D9488);color:#fff}
.hp-head .av{width:36px;height:36px;border-radius:10px;background:transparent;display:flex;align-items:center;justify-content:center;flex:none;overflow:hidden}
.hp-head .av img,.hp-head .av svg{width:36px;height:36px;display:block;border-radius:10px}
.hp-head b{display:block;font-size:15px;line-height:1.1;font-weight:700}
.hp-head small{display:block;font-size:11.5px;opacity:.85;margin-top:2px}
.hp-head .x{margin-left:auto;background:transparent;border:0;color:#fff;font-size:20px;line-height:1;cursor:pointer;opacity:.85;padding:6px}
.hp-head .x:hover{opacity:1}

.hp-body{flex:1;overflow-y:auto;padding:12px 14px;background:#F6FAF9;display:flex;flex-direction:column;gap:10px;scroll-behavior:smooth}
.hp-msg{max-width:88%;padding:9px 12px;border-radius:14px;font-size:14px;line-height:1.5;white-space:pre-wrap;word-break:break-word}
.hp-msg.bot{background:#fff;border:1px solid #E1EAE8;color:#0F2430;border-bottom-left-radius:5px;align-self:flex-start}
.hp-msg.me{background:linear-gradient(135deg,#0A84FF,#0D9488);color:#fff;border-bottom-right-radius:5px;align-self:flex-end}
.hp-msg.err{background:#FFF2EF;border:1px solid #FFD3C9;color:#8A2314}
.hp-msg img{display:block;width:100%;border-radius:10px;margin-top:6px}
.hp-msg .cap{display:block;font-size:12px;opacity:.7;margin-top:6px}
.hp-typing{display:flex;gap:4px;align-items:center;padding:10px 13px;background:#fff;border:1px solid #E1EAE8;border-radius:14px;width:56px}
.hp-typing i{width:6px;height:6px;border-radius:50%;background:#8FB3AC;animation:hp-b 1.2s infinite}
.hp-typing i:nth-child(2){animation-delay:.15s}.hp-typing i:nth-child(3){animation-delay:.3s}
@keyframes hp-b{0%,60%,100%{transform:translateY(0);opacity:.5}30%{transform:translateY(-4px);opacity:1}}

.hp-chips{display:flex;gap:6px;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;padding:4px 12px 6px;background:#F6FAF9}
.hp-chips::-webkit-scrollbar{display:none}
.hp-chip{flex:none;white-space:nowrap;border:1px solid #CFE0DC;background:#fff;color:#0E6F5F;font-size:11.5px;font-weight:600;border-radius:999px;
 padding:4px 9px;cursor:pointer;font-family:inherit}
.hp-chip:hover{border-color:#0A84FF;background:#F0FAF7}

.hp-foot{border-top:1px solid #E1EAE8;padding:9px 10px;background:#fff}
.hp-note{font-size:11px;color:#7C918C;margin:0 0 6px;padding:0 2px}
.hp-row{display:flex;gap:8px;align-items:flex-end}
.hp-row textarea{flex:1;resize:none;border:1px solid #D8E3E0;border-radius:12px;padding:9px 11px;font:inherit;
 font-size:14px;line-height:1.4;max-height:110px;min-height:42px;outline:none;color:#0F2430;background:#fff}
.hp-row textarea:focus{border-color:#0A84FF;box-shadow:0 0 0 3px rgba(10,132,255,.12)}
.hp-send{width:42px;height:42px;flex:none;border:0;border-radius:12px;background:linear-gradient(135deg,#0A84FF,#0D9488);color:#fff;cursor:pointer;
 display:flex;align-items:center;justify-content:center}
.hp-send:disabled{opacity:.45;cursor:default}
.hp-send svg{width:19px;height:19px}
.hp-tools{display:flex;gap:8px;margin-top:7px}
.hp-tool{display:flex;align-items:center;gap:5px;border:1px solid #CFE0DC;background:#fff;color:#0E6F5F;
 font-size:12px;font-weight:600;border-radius:9px;padding:6px 9px;cursor:pointer;font-family:inherit}
.hp-tool:hover{border-color:#0A84FF;background:#F0FAF7}
.hp-tool svg{width:14px;height:14px}
.hp-tool:disabled{opacity:.5;cursor:default}

@media (max-width:520px){
  #hippo-panel{right:8px;left:8px;width:auto;bottom:84px;height:min(72vh,560px)}
  #hippo-fab{right:12px;bottom:12px;width:56px;height:56px;border-radius:16px}
  #hippo-fab svg{width:100%;height:100%;border-radius:12px}
}
@media (prefers-color-scheme:dark){
  html.dark #hippo-panel{background:#0F1B22;border-color:#1E3038}
  html.dark .hp-body{background:#0B1519}
  html.dark .hp-msg.bot{background:#13232A;border-color:#1E3038;color:#E6F0EE}
  html.dark .hp-foot{background:#0F1B22;border-color:#1E3038}
  html.dark .hp-row textarea{background:#13232A;border-color:#1E3038;color:#E6F0EE}
  html.dark .hp-chips{background:#0B1519}
  html.dark .hp-chip,html.dark .hp-tool{background:#13232A;border-color:#1E3038;color:#8FD9C9}
}

html.dark #hippo-fab{border-color:#2BD9B4;box-shadow:0 8px 26px rgba(10,132,255,.45),0 0 0 1px rgba(43,217,180,.35)}

#soma-live-bar{display:flex;flex-direction:column;background:#F8FAFC;border-bottom:1px solid #E2E8F0;padding:7px 14px;font-size:11.5px;font-weight:600}
.soma-live-row{display:flex;align-items:center;gap:7px;color:#334155}
.soma-dot{width:8px;height:8px;border-radius:50%;flex:none;background:#0A84FF}
.soma-dot.checking{background:#0A84FF;box-shadow:0 0 0 3px rgba(10,132,255,.18)}
.soma-dot.live{background:#10B981;box-shadow:0 0 0 3px rgba(16,185,129,.18)}
.soma-dot.base{background:#F59E0B;box-shadow:0 0 0 3px rgba(245,158,11,.18)}
.soma-prog{display:none;position:relative;width:100%;height:3px;margin-top:6px;border-radius:999px;background:#E2E8F0;overflow:hidden}
.soma-prog.active{display:block}
.soma-prog i{position:absolute;top:0;left:0;height:100%;width:42%;border-radius:999px;background:linear-gradient(90deg,#0A84FF,#14D4C4);animation:somaSlide 1.15s ease-in-out infinite}
@keyframes somaSlide{0%{transform:translateX(-110%)}100%{transform:translateX(260%)}}
html.dark #soma-live-bar{background:#13232A;border-bottom-color:#1E3038}
html.dark .soma-live-row{color:#CBD5E1}
html.dark .soma-prog{background:#1E3038}
