/* Handy Assistant – chat widget
   Theme: navy #0b1329/#122a62/#1e3a8a  |  orange #f97316/#fb923c                */

/* ------------------------------------------------------------------ */
/*  Panel + FAB                                                        */
/* ------------------------------------------------------------------ */
.ha-widget{position:fixed;bottom:24px;right:24px;z-index:99999;font-family:inherit}

.ha-fab{position:relative;width:60px;height:60px;border-radius:50%;border:none;
    background:linear-gradient(135deg,#f97316,#fb923c);color:#fff;
    font-size:26px;cursor:pointer;box-shadow:0 4px 18px rgba(249,115,22,.45);
    display:flex;align-items:center;justify-content:center;
    transition:transform .25s,box-shadow .25s}
.ha-fab:hover{transform:scale(1.07);box-shadow:0 6px 22px rgba(249,115,22,.55)}
.ha-fab-label{pointer-events:none}
.ha-fab-pulse{position:absolute;inset:-4px;border-radius:50%;border:3px solid rgba(249,115,22,.35);
    animation:ha-pulse 2.2s ease-out infinite}
@keyframes ha-pulse{0%{transform:scale(1);opacity:.8} 100%{transform:scale(1.35);opacity:0}}

.ha-panel{position:fixed;bottom:96px;right:24px;width:380px;max-width:calc(100vw - 48px);
    background:#fff;border-radius:16px;
    box-shadow:0 12px 40px rgba(11,19,41,.22),0 0 0 1px rgba(11,19,41,.06);
    display:none;flex-direction:column;overflow:hidden;
    max-height:min(620px,calc(100vh - 130px));pointer-events:none}
.ha-panel.ha-open{display:flex;pointer-events:auto;
    animation:ha-slideUp .28s cubic-bezier(.4,0,.2,1)}
@keyframes ha-slideUp{from{opacity:0;transform:translateY(18px)} to{opacity:1;transform:none}}

/* ------------------------------------------------------------------ */
/*  Header                                                             */
/* ------------------------------------------------------------------ */
.ha-panel-header{background:linear-gradient(135deg,#0b1329 0%,#122a62 60%,#1e3a8a 100%);
    color:#fff;padding:14px 16px;display:flex;align-items:center;justify-content:space-between;
    flex-shrink:0}
.ha-header-title{display:flex;align-items:center;gap:10px}
.ha-avatar-small{width:34px;height:34px;border-radius:50%;
    background:rgba(249,115,22,.18);display:flex;align-items:center;justify-content:center;
    font-size:16px;flex-shrink:0}
.ha-header-name{font-weight:700;font-size:15px;letter-spacing:.2px}
.ha-header-status{font-size:11px;color:rgba(255,255,255,.82);display:flex;align-items:center;gap:5px;margin-top:2px}
.ha-status-dot{width:7px;height:7px;border-radius:50%;background:#22c55e;animation:ha-pulseDot 2s infinite}
@keyframes ha-pulseDot{0%,100%{opacity:1} 50%{opacity:.45}}
.ha-header-actions{display:flex;gap:4px}
.ha-header-btn{background:rgba(255,255,255,.12);border:none;color:#fff;
    width:30px;height:30px;border-radius:8px;cursor:pointer;
    display:flex;align-items:center;justify-content:center;font-size:13px;
    transition:background .2s}
.ha-header-btn:hover{background:rgba(255,255,255,.25)}

/* ------------------------------------------------------------------ */
/*  Body / messages                                                    */
/* ------------------------------------------------------------------ */
.ha-body{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:12px;
    background:#f7f8fa;scroll-behavior:smooth}

.ha-msg{max-width:82%;display:flex;flex-direction:column;gap:4px}
.ha-msg.ha-bot{align-self:flex-start}
.ha-msg.ha-user{align-self:flex-end}

.ha-bubble{padding:11px 14px;border-radius:16px;font-size:14px;line-height:1.55;white-space:pre-wrap;word-break:break-word}
.ha-bot .ha-bubble{background:#fff;border:1px solid rgba(0,0,0,.06);
    border-bottom-left-radius:4px;box-shadow:0 1px 4px rgba(0,0,0,.05)}
.ha-bot .ha-success{background:#f0fdf4;border-color:#bbf7d0}
.ha-bot .ha-error{background:#fef2f2;border-color:#fecaca}
.ha-user .ha-bubble{background:linear-gradient(135deg,#122a62,#1e3a8a);
    color:#fff;border-bottom-right-radius:4px}

.ha-time{font-size:10px;color:#94a3b8;padding:0 2px}
.ha-user .ha-time{text-align:right}

/* Links inside bot replies:  [[Label|URL]] tokens converted to anchors */
.ha-bubble a.ha-link{color:#1e3a8a;text-decoration:underline;text-decoration-color:rgba(30,58,138,.35);
    text-underline-offset:2px;transition:color .15s,text-decoration-color .15s}
.ha-bubble a.ha-link:hover{color:#f97316;text-decoration-color:#f97316}

/* ------------------------------------------------------------------ */
/*  Chips (quick-reply pills)                                          */
/* ------------------------------------------------------------------ */
.ha-chips{display:flex;flex-wrap:wrap;gap:8px;padding:0 2px 4px;align-self:flex-start;max-width:100%}
.ha-chip{border:1px solid #1e3a8a;background:#fff;color:#122a62;
    padding:7px 14px;border-radius:99px;font-size:13px;font-weight:500;
    cursor:pointer;white-space:nowrap;
    transition:background .15s,color .15s,box-shadow .15s;box-shadow:0 1px 3px rgba(0,0,0,.06)}
.ha-chip:hover{background:#1e3a8a;color:#fff;box-shadow:0 2px 6px rgba(18,42,98,.25)}
.ha-chip:active{transform:scale(.97)}

/* ------------------------------------------------------------------ */
/*  Typing indicator                                                   */
/* ------------------------------------------------------------------ */
.ha-typing{display:flex;align-items:center;gap:5px;padding:12px 16px}
.ha-typing-dot{width:8px;height:8px;border-radius:50%;background:#94a3b8;
    animation:ha-typeBounce 1.2s ease-in-out infinite}
.ha-typing-dot:nth-child(2){animation-delay:.15s}
.ha-typing-dot:nth-child(3){animation-delay:.3s}
@keyframes ha-typeBounce{0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-5px)}}

/* ------------------------------------------------------------------ */
/*  Form / input                                                       */
/* ------------------------------------------------------------------ */
.ha-form{padding:0;border-top:1px solid rgba(0,0,0,.06);flex-shrink:0;background:#fff}
.ha-form-inner{display:flex;align-items:center;gap:0}
.ha-form input{flex:1;border:none;padding:14px 16px;font-size:14px;outline:none;
    background:transparent;color:#0b1329;min-width:0}
.ha-form input::placeholder{color:#94a3b8}
.ha-send-btn{border:none;background:transparent;color:#1e3a8a;padding:0 16px;
    font-size:16px;cursor:pointer;display:flex;align-items:center;justify-content:center;
    transition:color .15s}
.ha-send-btn:hover{color:#f97316}
.ha-send-btn:disabled{opacity:.4;cursor:default}

/* ------------------------------------------------------------------ */
/*  Utilities                                                          */
/* ------------------------------------------------------------------ */
.ha-fade-in{animation:ha-fadeIn .22s ease-out}
@keyframes ha-fadeIn{from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:none}}

@media(max-width:480px){
    .ha-panel{right:12px;bottom:84px;width:calc(100vw - 24px);max-width:none;border-radius:14px;
        max-height:min(560px,calc(100vh - 100px))}
    .ha-fab{width:52px;height:52px;bottom:16px;right:16px}
}