/* CoachMenan AI chat widget — styles scoped under #cm-ai-root.
   Accent color is set by JS (--cm-accent). Palette matches coachmenan.com:
   sage #7a9a7a, deep sage #5d7d5d, ink #23352f, cream #f9f7f4, tint #eef4ee. */
#cm-ai-root{--cm-main:var(--cm-accent,#7a9a7a);--cm-main2:#5d7d5d;--cm-soft:#eef4ee;--cm-ink:#23352f;--cm-muted:#5f6f66;
  --cm-line:#dce6dc;font-family:Georgia,'Times New Roman',serif;line-height:1.55;font-size:16px}
#cm-ai-root *{margin:0;padding:0;box-sizing:border-box}
#cm-ai-root button,#cm-ai-root input,#cm-ai-root textarea{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif}

#cm-launcher{position:fixed;right:22px;bottom:22px;z-index:99998;width:62px;height:62px;border-radius:50%;border:0;cursor:pointer;
  background:linear-gradient(135deg,var(--cm-main),var(--cm-main2));box-shadow:0 10px 28px rgba(35,53,47,.35);display:grid;place-items:center;
  transition:transform .25s cubic-bezier(.34,1.56,.64,1)}
#cm-launcher:hover{transform:scale(1.08)}
#cm-launcher svg{width:30px;height:30px}
#cm-launcher .cm-dot{position:absolute;top:-2px;right:-2px;width:16px;height:16px;border-radius:50%;background:#21ba6b;border:3px solid #fff}
@keyframes cm-pulse{0%{box-shadow:0 0 0 0 rgba(122,154,122,.45)}70%{box-shadow:0 0 0 16px rgba(122,154,122,0)}100%{box-shadow:0 0 0 0 rgba(122,154,122,0)}}
#cm-launcher.cm-pulsing{animation:cm-pulse 2s infinite}

#cm-teaser{position:fixed;right:96px;bottom:34px;z-index:99997;background:#fff;border:1px solid var(--cm-line);color:var(--cm-ink);
  padding:10px 16px;border-radius:14px 14px 4px 14px;font-size:.9rem;box-shadow:0 12px 28px rgba(35,53,47,.15);opacity:0;transform:translateY(8px);
  transition:.35s;pointer-events:none;max-width:250px;cursor:pointer}
#cm-teaser.cm-show{opacity:1;transform:translateY(0);pointer-events:auto}

#cm-panel{position:fixed;right:22px;bottom:98px;z-index:99999;width:392px;max-width:calc(100vw - 32px);height:600px;max-height:calc(100vh - 130px);
  background:#fff;border:1px solid var(--cm-line);border-radius:20px;overflow:hidden;display:flex;flex-direction:column;
  box-shadow:0 24px 60px rgba(35,53,47,.22);opacity:0;transform:translateY(18px) scale(.97);pointer-events:none;transition:.28s cubic-bezier(.34,1.3,.64,1)}
#cm-panel.cm-open{opacity:1;transform:none;pointer-events:auto}
@media(max-width:480px){
  #cm-panel{right:8px;bottom:88px;width:calc(100vw - 16px);height:calc(100vh - 110px)}
  #cm-teaser{right:86px;bottom:32px}
}

#cm-ai-root .cm-head{display:flex;align-items:center;gap:12px;padding:14px 16px;background:linear-gradient(120deg,var(--cm-main),var(--cm-main2))}
#cm-ai-root .cm-ava{width:40px;height:40px;border-radius:12px;background:rgba(255,255,255,.2);display:grid;place-items:center;flex:none}
#cm-ai-root .cm-ava svg{width:22px;height:22px}
#cm-ai-root .cm-who{flex:1;min-width:0}
#cm-ai-root .cm-name{font-weight:700;font-size:.98rem;color:#fff}
#cm-ai-root .cm-status{font-size:.76rem;color:#e3ede3;display:flex;align-items:center;gap:6px}
#cm-ai-root .cm-status:before{content:"";width:7px;height:7px;border-radius:50%;background:#21ba6b;box-shadow:0 0 8px #21ba6b;flex:none}
#cm-ai-root .cm-x{border:0;background:transparent;color:#e3ede3;font-size:1.25rem;cursor:pointer;padding:4px 6px;line-height:1}
#cm-ai-root .cm-x:hover{color:#fff}

#cm-ai-root .cm-msgs{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:12px;scrollbar-width:thin;scrollbar-color:#cfdccf transparent;background:#f9f7f4}
#cm-ai-root .cm-msgs::-webkit-scrollbar{width:6px}
#cm-ai-root .cm-msgs::-webkit-scrollbar-thumb{background:#cfdccf;border-radius:99px}
#cm-ai-root .cm-msg{max-width:84%;padding:11px 14px;border-radius:16px;font-size:.92rem;animation:cm-pop .25s cubic-bezier(.34,1.4,.64,1);word-wrap:break-word}
@keyframes cm-pop{from{opacity:0;transform:translateY(6px) scale(.97)}to{opacity:1;transform:none}}
#cm-ai-root .cm-msg.bot{align-self:flex-start;background:#fff;border:1px solid var(--cm-line);border-bottom-left-radius:5px;color:var(--cm-ink)}
#cm-ai-root .cm-msg.user{align-self:flex-end;background:var(--cm-main);color:#fff;font-weight:600;border-bottom-right-radius:5px}
#cm-ai-root .cm-msg ul{margin:6px 0 2px 18px}
#cm-ai-root .cm-msg b{color:var(--cm-main2)}
#cm-ai-root .cm-msg.user b{color:#fff}

#cm-ai-root .cm-msg.bot.cm-handoff{width:100%;max-width:100%}
#cm-ai-root .cm-ho-title{font-weight:700;font-size:.9rem;margin-bottom:4px;color:var(--cm-main2)}
#cm-ai-root .cm-ho-sub{font-size:.85rem;color:var(--cm-muted);margin-bottom:10px}
#cm-ai-root .cm-ho-btns{display:flex;gap:8px;flex-wrap:wrap}
#cm-ai-root .cm-ho-btn{flex:1;min-width:130px;border:1.5px solid var(--cm-main);background:var(--cm-soft);color:var(--cm-main2);font-weight:700;font-size:.83rem;
  padding:9px 12px;border-radius:10px;cursor:pointer;transition:.2s;text-align:center}
#cm-ai-root .cm-ho-btn:hover{background:var(--cm-main);color:#fff}
#cm-ai-root .cm-ho-form{margin-top:10px;display:none}
#cm-ai-root .cm-ho-form.cm-show{display:block}
#cm-ai-root .cm-ho-form label{display:block;font-size:.7rem;font-weight:700;color:var(--cm-muted);margin:8px 0 3px;letter-spacing:.04em}
#cm-ai-root .cm-ho-form input,#cm-ai-root .cm-ho-form textarea{width:100%;background:#fff;border:1px solid var(--cm-line);color:var(--cm-ink);border-radius:9px;padding:8px 11px;font-size:.86rem;
  outline:none;transition:.2s}
#cm-ai-root .cm-ho-form input:focus,#cm-ai-root .cm-ho-form textarea:focus{border-color:var(--cm-main)}
#cm-ai-root .cm-ho-form textarea{resize:vertical;min-height:56px}
#cm-ai-root .cm-ho-send{margin-top:10px;width:100%;border:0;border-radius:9px;padding:10px;font-weight:800;font-size:.88rem;cursor:pointer;
  background:var(--cm-main);color:#fff}
#cm-ai-root .cm-ho-send:hover{background:var(--cm-main2)}
#cm-ai-root .cm-ho-send:disabled{opacity:.6;cursor:wait}
#cm-ai-root .cm-ho-wa{display:block;margin-top:10px;text-align:center;font-size:.82rem;font-weight:600;color:#1faa55;text-decoration:none;
  border:1px dashed #b5dcc3;border-radius:9px;padding:8px}
#cm-ai-root .cm-ho-wa:hover{background:#eefaf2}
#cm-ai-root .cm-ho-ok{margin-top:10px;background:#e9f9f0;border:1px solid #9fe3c0;color:#0c7a43;border-radius:10px;padding:10px 12px;font-size:.85rem;display:none}
#cm-ai-root .cm-ho-ok.cm-show{display:block}
#cm-ai-root .cm-ho-err{margin-top:8px;background:#fdeeee;border:1px solid #f2b8b5;color:#a00;border-radius:10px;padding:8px 12px;font-size:.8rem;display:none}
#cm-ai-root .cm-ho-err.cm-show{display:block}

#cm-ai-root .cm-typing{align-self:flex-start;display:flex;gap:5px;padding:13px 16px;background:#fff;border:1px solid var(--cm-line);border-radius:16px;border-bottom-left-radius:5px}
#cm-ai-root .cm-typing i{width:7px;height:7px;border-radius:50%;background:#a8bfa8;animation:cm-blink 1.2s infinite}
#cm-ai-root .cm-typing i:nth-child(2){animation-delay:.18s}
#cm-ai-root .cm-typing i:nth-child(3){animation-delay:.36s}
@keyframes cm-blink{0%,80%,100%{opacity:.25;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}

#cm-ai-root .cm-chips{display:flex;flex-wrap:wrap;gap:8px;padding:0 16px 10px;background:#f9f7f4}
#cm-ai-root .cm-chip{border:1.5px solid var(--cm-line);background:#fff;color:var(--cm-main2);font-size:.8rem;font-weight:600;padding:7px 13px;border-radius:99px;cursor:pointer;transition:.2s}
#cm-ai-root .cm-chip:hover{border-color:var(--cm-main);background:var(--cm-soft)}

#cm-ai-root .cm-input{display:flex;gap:10px;padding:12px 14px;border-top:1px solid var(--cm-line);background:#fff}
#cm-ai-root .cm-input input{flex:1;background:#f7faf7;border:1px solid var(--cm-line);color:var(--cm-ink);border-radius:99px;padding:11px 18px;font-size:.92rem;outline:none;transition:.2s;min-width:0}
#cm-ai-root .cm-input input:focus{border-color:var(--cm-main);box-shadow:0 0 0 3px rgba(122,154,122,.15)}
#cm-ai-root .cm-input button{width:44px;height:44px;border-radius:50%;border:0;cursor:pointer;background:var(--cm-main);display:grid;place-items:center;flex:none;transition:.2s}
#cm-ai-root .cm-input button:hover{background:var(--cm-main2)}
#cm-ai-root .cm-input button svg{width:19px;height:19px}
#cm-ai-root .cm-input button:disabled{opacity:.4;cursor:default}
#cm-ai-root .cm-foot{text-align:center;font-size:.68rem;color:#93a29a;padding:0 14px 10px;background:#fff}
#cm-ai-root .cm-foot b{color:var(--cm-main2)}

/* ---- RTL (Arabic pages): mirror the widget ---- */
#cm-ai-root.cm-rtl #cm-launcher{right:auto;left:22px}
#cm-ai-root.cm-rtl #cm-teaser{right:auto;left:96px;border-radius:14px 14px 14px 4px}
#cm-ai-root.cm-rtl #cm-panel{right:auto;left:22px}
#cm-ai-root.cm-rtl .cm-msg.bot{border-bottom-left-radius:16px;border-bottom-right-radius:5px}
#cm-ai-root.cm-rtl .cm-msg.user{border-bottom-right-radius:16px;border-bottom-left-radius:5px}
#cm-ai-root.cm-rtl .cm-typing{border-bottom-left-radius:16px;border-bottom-right-radius:5px}
#cm-ai-root.cm-rtl .cm-msg,#cm-ai-root.cm-rtl .cm-ho-title,#cm-ai-root.cm-rtl .cm-ho-sub,#cm-ai-root.cm-rtl .cm-foot,
#cm-ai-root.cm-rtl .cm-ho-wa,#cm-ai-root.cm-rtl .cm-ho-ok,#cm-ai-root.cm-rtl .cm-ho-err{direction:rtl;text-align:right}
#cm-ai-root.cm-rtl .cm-msg ul{margin:6px 18px 2px 0}
@media(max-width:480px){
  #cm-ai-root.cm-rtl #cm-panel{right:auto;left:8px}
  #cm-ai-root.cm-rtl #cm-teaser{right:auto;left:86px}
}
