/* A² Assistant — chat widget */
.chat-fab{position:fixed;bottom:22px;inset-inline-start:22px;z-index:70;width:56px;height:56px;border-radius:50%;
  display:grid;place-items:center;background:var(--grad,#8338F6);color:#0A0A12;border:0;cursor:pointer;
  box-shadow:0 10px 30px rgba(131,56,246,.45);transition:transform .2s}
.chat-fab:hover{transform:scale(1.08)}
.chat-fab svg{width:26px;height:26px;fill:currentColor}
.chat-fab .chat-close{display:none}
.chat-fab.open .chat-open{display:none}
.chat-fab.open .chat-close{display:block}
.chat-panel{position:fixed;bottom:92px;inset-inline-start:22px;z-index:70;width:min(380px,calc(100vw - 32px));
  height:min(520px,calc(100dvh - 130px));display:flex;flex-direction:column;
  background:#0C101B;border:1px solid rgba(255,255,255,.1);border-radius:20px;overflow:hidden;
  box-shadow:0 24px 70px rgba(0,0,0,.6);opacity:0;transform:translateY(16px);pointer-events:none;
  transition:opacity .25s ease,transform .25s ease;font-family:inherit}
.chat-panel.open{opacity:1;transform:none;pointer-events:auto}
.chat-head{display:flex;align-items:center;gap:.7rem;padding:.9rem 1.1rem;border-bottom:1px solid rgba(255,255,255,.08);
  background:linear-gradient(100deg,rgba(44,99,255,.18),rgba(131,56,246,.18))}
.chat-head .avatar{width:36px;height:36px;border-radius:12px;background:linear-gradient(100deg,#2C63FF,#8338F6 55%,#F5C235);
  display:grid;place-items:center;font-weight:900;color:#0A0A12;font-size:.95rem;flex:none}
.chat-head b{font-size:.98rem;display:block}
.chat-head small{color:rgba(255,255,255,.55);font-size:.75rem;display:block}
.chat-body{flex:1;overflow-y:auto;padding:1rem;display:flex;flex-direction:column;gap:.6rem}
.chat-msg{max-width:85%;padding:.65em 1em;border-radius:16px;font-size:.92rem;line-height:1.7;white-space:pre-wrap;word-break:break-word}
.chat-msg.bot{background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.07);align-self:flex-start;border-start-start-radius:4px}
.chat-msg.user{background:linear-gradient(100deg,#2C63FF,#8338F6);color:#fff;align-self:flex-end;border-start-end-radius:4px}
.chat-msg a{color:#F5C235;font-weight:700}
.chat-msg.user a{color:#fff;text-decoration:underline}
.chat-chips{display:flex;flex-wrap:wrap;gap:.45rem;padding:0 1rem .6rem}
.chat-chip{border:1px solid rgba(255,255,255,.14);border-radius:999px;padding:.42em 1em;font-size:.82rem;font-weight:700;
  color:rgba(255,255,255,.75);background:none;cursor:pointer;font-family:inherit;transition:all .2s}
.chat-chip:hover{border-color:#8338F6;color:#fff}
.chat-input{display:flex;gap:.5rem;padding:.8rem;border-top:1px solid rgba(255,255,255,.08)}
.chat-input input{flex:1;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.1);border-radius:12px;
  padding:.65em 1em;color:#fff;font-family:inherit;font-size:.92rem}
.chat-input input:focus{outline:none;border-color:#8338F6}
.chat-input button{width:44px;height:44px;border-radius:12px;border:0;cursor:pointer;
  background:linear-gradient(100deg,#2C63FF,#8338F6 55%,#F5C235);color:#0A0A12;display:grid;place-items:center;flex:none}
.chat-input button svg{width:18px;height:18px;fill:currentColor}
html[dir="rtl"] .chat-input button svg{transform:scaleX(-1)}
.chat-typing{display:inline-flex;gap:4px;padding:.4em 0}
.chat-typing i{width:6px;height:6px;border-radius:50%;background:rgba(255,255,255,.4);animation:ctp 1s infinite}
.chat-typing i:nth-child(2){animation-delay:.15s}
.chat-typing i:nth-child(3){animation-delay:.3s}
@keyframes ctp{0%,100%{opacity:.3}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){.chat-panel{transition:none}.chat-typing i{animation:none}}


.mobile-utilities{display:none}
@media(max-width:680px){
 .site-header .mobile-utilities{display:flex;direction:ltr;gap:8px;position:absolute;top:14px;left:50%;transform:translateX(-50%);z-index:60}
 .mobile-utilities > .chat-fab,.mobile-utilities > .wa-float{position:static!important;inset:auto!important;transform:none!important;width:34px;height:34px;margin:0;flex:none;transition:none}
 .mobile-utilities > .chat-fab svg,.mobile-utilities > .wa-float svg{width:18px;height:18px}
 body:has(.site-header) .chat-panel{top:68px;bottom:auto;max-height:calc(100dvh - 80px);left:12px;right:12px;inset-inline-start:12px;width:auto}
 body:not(:has(.site-header)) .chat-fab{width:42px;height:42px;top:12px;bottom:auto;inset-inline-start:12px}
 body:not(:has(.site-header)) .chat-panel{top:64px;bottom:auto;max-height:calc(100dvh - 80px)}
}
