/* Chat Optical Santé */
.os-chat{position:fixed;right:22px;bottom:22px;z-index:95;font-family:var(--ff-body,'Hanken Grotesk',sans-serif)}
.os-chat__toggle{position:relative;display:inline-flex;align-items:center;gap:11px;padding:8px 20px 8px 8px;border:0;border-radius:999px;background:var(--ink,#242823);color:#fff;font:inherit;text-align:left;cursor:pointer;box-shadow:0 10px 30px rgba(28,23,18,.25);transition:background .2s,transform .2s}
.os-chat__toggle:hover{background:var(--brand,#78583b);transform:translateY(-1px)}
.os-chat__toggle-avatar{position:relative;flex:0 0 auto;width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:var(--brand,#78583b)}
.os-chat__toggle:hover .os-chat__toggle-avatar{background:var(--ink,#242823)}
.os-chat__toggle-avatar svg{width:21px;height:21px}
.os-chat__toggle-avatar::after{content:"";position:absolute;inset:-4px;border-radius:50%;border:2px solid var(--brand,#78583b);opacity:0;animation:osPulse 2.6s ease-out infinite}
.os-chat__online{position:absolute;right:0;bottom:1px;width:11px;height:11px;border-radius:50%;background:#3fb26b;border:2px solid var(--ink,#242823)}
.os-chat__toggle-text{display:flex;flex-direction:column;line-height:1.2}
.os-chat__toggle-text strong{font-size:.92rem;font-weight:700}
.os-chat__toggle-text small{font-size:.76rem;opacity:.8;margin-top:2px}
@keyframes osPulse{0%{transform:scale(.9);opacity:.7}70%{transform:scale(1.35);opacity:0}100%{opacity:0}}
.os-chat__dot{position:absolute;top:2px;left:36px;width:12px;height:12px;border-radius:50%;background:#d0453a;border:2px solid #fff}
.os-chat__dot[hidden]{display:none}

/* Invitation */
.os-chat__teaser{position:absolute;right:0;bottom:68px;width:300px;display:flex;align-items:flex-start;gap:4px;background:#fff;border:1px solid var(--line,#dfe2da);border-radius:16px 16px 4px 16px;box-shadow:0 14px 40px rgba(28,23,18,.18);animation:osChatIn .35s ease-out}
.os-chat__teaser[hidden]{display:none}
.os-chat__teaser-open{flex:1;display:flex;gap:10px;align-items:flex-start;padding:14px 4px 14px 14px;border:0;background:none;text-align:left;font:inherit;font-size:.9rem;line-height:1.45;color:var(--ink,#242823);cursor:pointer}
.os-chat__teaser-close{border:0;background:none;color:var(--ink-soft,#61655e);font-size:1.3rem;line-height:1;padding:8px 10px;cursor:pointer}

/* Fenêtre */
.os-chat__panel{position:absolute;right:0;bottom:68px;width:min(390px,calc(100vw - 44px));height:min(600px,calc(100vh - 110px));display:flex;flex-direction:column;background:#fff;border:1px solid var(--line,#dfe2da);border-radius:20px;box-shadow:0 24px 60px rgba(28,23,18,.24);overflow:hidden;animation:osChatIn .25s ease-out}
.os-chat__panel[hidden]{display:none}
.os-chat__head{display:flex;align-items:center;gap:11px;padding:13px 12px 13px 16px;background:var(--ink,#242823);color:#fff}
.os-chat__avatar{position:relative;flex:0 0 auto;width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:var(--brand,#78583b);color:#fff;font-weight:700;font-size:1rem}
.os-chat__avatar i{position:absolute;right:0;bottom:0;width:10px;height:10px;border-radius:50%;background:#3fb26b;border:2px solid var(--ink,#242823)}
.os-chat__avatar--sm{width:30px;height:30px;font-size:.85rem}
.os-chat__who{flex:1;display:flex;flex-direction:column;line-height:1.25;min-width:0}
.os-chat__who strong{font-size:.98rem}
.os-chat__who small{font-size:.74rem;opacity:.75}
.os-chat__close,.os-chat__restart{border:0;background:transparent;color:#fff;cursor:pointer;width:34px;height:34px;border-radius:50%;display:grid;place-items:center;opacity:.85}
.os-chat__close{font-size:1.6rem;line-height:1}
.os-chat__restart svg{width:18px;height:18px}
.os-chat__close:hover,.os-chat__restart:hover{opacity:1;background:rgba(255,255,255,.1)}
.os-chat__log{flex:1;overflow-y:auto;padding:16px 14px;display:flex;flex-direction:column;gap:6px;background:var(--bg,#f6f5f1);overscroll-behavior:contain}
.os-chat__msg{max-width:84%;padding:10px 14px;border-radius:18px;font-size:.93rem;line-height:1.5;white-space:pre-wrap;word-wrap:break-word;animation:osMsgIn .22s ease-out}
.os-chat__msg--bot{align-self:flex-start;background:#fff;color:var(--ink,#242823);border:1px solid var(--line,#dfe2da);border-bottom-left-radius:6px}
.os-chat__msg--bot+.os-chat__msg--bot{border-top-left-radius:6px}
.os-chat__msg--user{align-self:flex-end;background:var(--ink,#242823);color:#fff;border-bottom-right-radius:6px;margin-top:6px}
.os-chat__msg--user+.os-chat__msg--bot,.os-chat__acts+.os-chat__msg--user{margin-top:6px}
.os-chat__msg--info{color:var(--ink-soft,#61655e);font-style:italic}
.os-chat__msg--typing{display:inline-flex;gap:4px;padding:13px 15px}
.os-chat__msg--typing span{width:7px;height:7px;border-radius:50%;background:#a3a69e;animation:osDot 1.2s infinite ease-in-out}
.os-chat__msg--typing span:nth-child(2){animation-delay:.15s}
.os-chat__msg--typing span:nth-child(3){animation-delay:.3s}
.os-chat__acts{display:flex;flex-wrap:wrap;gap:6px;margin:2px 0 4px}
.os-chat__act{display:inline-flex;align-items:center;padding:8px 14px;border-radius:999px;border:1px solid var(--brand,#78583b);background:#fff;color:var(--brand,#78583b);font:inherit;font-size:.85rem;font-weight:600;text-decoration:none;cursor:pointer}
.os-chat__act:hover{background:var(--brand,#78583b);color:#fff}
.os-chat__quick{display:flex;flex-wrap:wrap;gap:6px;padding:10px 12px 0;background:#fff}
.os-chat__quick[hidden]{display:none}
.os-chat__chip{padding:7px 12px;border-radius:999px;border:1px solid var(--line,#dfe2da);background:var(--bg,#f6f5f1);color:var(--ink,#242823);font:inherit;font-size:.84rem;cursor:pointer}
.os-chat__chip:hover{border-color:var(--brand,#78583b);color:var(--brand,#78583b)}
.os-chat__form{display:flex;gap:8px;padding:12px;background:#fff}
.os-chat__form textarea{flex:1;resize:none;border:1px solid var(--line,#dfe2da);border-radius:14px;padding:10px 12px;font:inherit;font-size:16px;line-height:1.4;max-height:120px}
.os-chat__form textarea:focus{outline:2px solid var(--brand,#78583b);outline-offset:-1px}
.os-chat__form button{width:42px;height:42px;border:0;border-radius:50%;background:var(--brand,#78583b);color:#fff;cursor:pointer;display:grid;place-items:center;flex-shrink:0}
.os-chat__form button svg{width:18px;height:18px}
.os-chat__note{margin:0;padding:0 14px 10px;font-size:.72rem;color:var(--ink-soft,#61655e);background:#fff}
.os-chat__sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
@keyframes osChatIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@keyframes osMsgIn{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
@keyframes osDot{0%,60%,100%{transform:none;opacity:.5}30%{transform:translateY(-4px);opacity:1}}
@media (prefers-reduced-motion:reduce){.os-chat__panel,.os-chat__teaser,.os-chat__msg,.os-chat__toggle-avatar::after{animation:none}.os-chat__msg--typing span{animation:none}}
@media (max-width:700px){.os-chat{right:14px;bottom:14px}.os-chat__toggle-text{display:none}.os-chat__toggle{padding:6px}.os-chat__toggle-avatar{width:48px;height:48px}.os-chat__teaser{width:min(290px,calc(100vw - 28px));bottom:72px}.os-chat__panel{position:fixed;left:8px;right:8px;bottom:8px;top:auto;width:auto;height:min(86vh,680px);height:min(86dvh,680px)}}
body.os-chat-open .os-chat{z-index:200}
@media (max-width:900px){body.os-chat-open .mbar,body.os-chat-open .back-to-top{display:none}}
body.os-chat-open .msg-tab{display:none}
.os-chat__form{align-items:flex-end}
.os-chat__form .os-chat__clip{background:none;color:var(--ink-soft,#61655e);width:38px}
.os-chat__form .os-chat__clip:hover{background:var(--surface,#f1f2ed);color:var(--ink,#242823)}
.os-chat__form .os-chat__clip svg{width:21px;height:21px}
.os-chat__attached{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:4px 10px;margin:0 12px;padding:8px 8px 8px 10px;border:1px solid var(--line,#dfe2da);border-radius:12px;background:var(--bg,#f6f5f1)}
.os-chat__attached img,.os-chat__attached-icon{width:44px;height:44px;border-radius:8px;object-fit:cover}
.os-chat__attached-icon{display:grid;place-items:center;background:#b5442f;color:#fff;font-size:.72rem;font-weight:700}
.os-chat__attached-name{font-size:.84rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.os-chat__attached button{border:0;background:none;font-size:1.3rem;line-height:1;padding:6px 8px;color:var(--ink-soft,#61655e);cursor:pointer}
.os-chat__attached small{grid-column:1/-1;font-size:.72rem;color:var(--ink-soft,#61655e)}
.os-chat__file-in{display:block;margin-bottom:6px;font-size:.84rem}
.os-chat__file-in:last-child{margin-bottom:0}
.os-chat__file-in img{display:block;max-width:180px;max-height:200px;border-radius:10px}
