

@property --ghost-scan {
    syntax: '<angle>';
    inherits: true;
    initial-value: 0deg;
}
@keyframes ghost-pill-spin { to { --ghost-scan: 360deg; } }
@keyframes instinctor-ghost-panel-in {
    from { opacity:0; transform:translateY(12px) scale(.98) }
    to   { opacity:1; transform:translateY(0)    scale(1)   }
}
@keyframes instinctor-ghost-in-right {from{opacity:0;transform:translateX(12px)} to{opacity:1;transform:translateX(0)}}
@keyframes instinctor-ghost-in-left  {from{opacity:0;transform:translateX(-12px)}to{opacity:1;transform:translateX(0)}}
@keyframes instinctor-dot            {0%,80%,100%{transform:scale(0)}40%{transform:scale(1)}}

#instinctor-chat{
    right:20px!important;
    bottom:calc(84px + env(safe-area-inset-bottom,0px) + var(--instinctor-keyboard-h,0px))!important;
    z-index:999999!important;
    width:384px!important;
    max-height:min(600px,calc(100vh - 150px))!important;
    display:none!important;
    flex-direction:column!important;
    overflow:hidden!important;
    border-radius:16px!important;
    
    position:fixed!important;
    
    background:rgba(18,20,24,.66)!important;
    
    backdrop-filter:blur(34px) saturate(155%)!important;
    -webkit-backdrop-filter:blur(34px) saturate(155%)!important;
    border:1px solid rgba(255,255,255,.12)!important;
    box-shadow:0 18px 60px rgba(0,0,0,.45)!important;
    font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif!important;
    color:#fff!important;
}
#instinctor-chat.open{
    display:flex!important;
    
    animation:instinctor-ghost-panel-in .3s ease-in-out!important;
}
#instinctor-chat[data-position="left"]{right:auto!important;left:20px!important}
#instinctor-chat *{box-sizing:border-box!important}
#instinctor-chat.chat-hidden{display:none!important}

#instinctor-chat.chat-hidden ~ #instinctor-chat-bar{display:none!important}

#instinctor-chat.open ~ #instinctor-chat-bar{display:none!important}

.instinctor-chat-x{
    position:absolute!important;top:6px!important;right:6px!important;z-index:5!important;
    width:44px!important;height:44px!important;
    border:0!important;background:transparent!important;padding:0!important;
    display:flex!important;align-items:center!important;justify-content:center!important;
    cursor:pointer!important;
}
.instinctor-chat-x::before{
    content:''!important;position:absolute!important;
    width:30px!important;height:30px!important;border-radius:50%!important;
    background:rgba(10,11,13,.55)!important;
    backdrop-filter:blur(6px)!important;-webkit-backdrop-filter:blur(6px)!important;
    transition:background .2s ease-in-out!important;
}
.instinctor-chat-x:hover::before{background:rgba(10,11,13,.8)!important}
.instinctor-chat-x svg{position:relative!important;z-index:1!important}
.instinctor-chat-x:focus-visible{outline:2px solid rgba(255,255,255,.6)!important;outline-offset:-4px!important}

.instinctor-ghost-bubbles{
    flex:1!important;min-height:0!important;
    flex-direction:column!important;gap:10px!important;
    padding:16px!important;
    overflow-y:auto!important;overflow-x:hidden!important;
    pointer-events:auto!important;
    scrollbar-width:thin!important;
    scrollbar-color:rgba(255,255,255,.22) transparent!important;
}

.instinctor-ghost-bubbles:empty{
    flex:0 0 0!important;min-height:0!important;height:0!important;
    padding:0!important;overflow:hidden!important;
}

#instinctor-chat:has(.instinctor-ghost-bubbles:empty) .instinctor-chat-x{display:none!important}
.instinctor-ghost-bubbles:empty + #instinctor-ghost-pill-wrap{border-top:0!important}
.instinctor-ghost-bubbles::-webkit-scrollbar{width:8px!important}
.instinctor-ghost-bubbles::-webkit-scrollbar-thumb{
    background:rgba(255,255,255,.22)!important;border-radius:4px!important;
}
.instinctor-ghost-bubbles::-webkit-scrollbar-track{background:transparent!important}

.instinctor-ghost-bubble{
    padding:10px 13px!important;
    font-size:15px!important;line-height:1.55!important;
    max-width:85%!important;width:fit-content!important;
    
    white-space:pre-wrap!important;overflow-wrap:break-word!important;word-wrap:break-word!important;
    pointer-events:auto!important;
    border:0!important;
}

.instinctor-ghost-bubbles > .instinctor-ghost-bubble:first-child{
    max-width:calc(85% - 40px)!important;
}
.instinctor-ghost-bubble.admin{
    align-self:flex-start!important;
    background:#ffffff!important;color:#1d2327!important;
    border-radius:14px 14px 14px 4px!important;
    animation:instinctor-ghost-in-left .3s ease-in-out!important;
}
.instinctor-ghost-bubble.visitor{
    align-self:flex-end!important;margin-left:auto!important;
    background:rgba(255,255,255,.14)!important;color:#fff!important;
    border:1px solid rgba(255,255,255,.10)!important;
    border-radius:14px 14px 4px 14px!important;
    animation:instinctor-ghost-in-right .3s ease-in-out!important;
}
.instinctor-ghost-bubble img{max-width:100%!important;height:auto!important;border-radius:8px!important}

.instinctor-ghost-typing{
    display:flex!important;gap:5px!important;padding:12px 13px!important;
    background:#ffffff!important;
    border-radius:14px 14px 14px 4px!important;align-self:flex-start!important;
    pointer-events:none!important;width:fit-content!important;
}
.instinctor-ghost-typing span{
    width:6px!important;height:6px!important;background:#1d2327!important;
    border-radius:50%!important;opacity:.6!important;
    animation:instinctor-dot 1.4s infinite ease-in-out!important;
}
.instinctor-ghost-typing span:nth-child(1){animation-delay:-.32s!important}
.instinctor-ghost-typing span:nth-child(2){animation-delay:-.16s!important}

#instinctor-ghost-pill-wrap{
    flex:none!important;
    flex-direction:column!important;align-items:stretch!important;
    gap:0!important;
    padding:10px 10px calc(10px + env(safe-area-inset-bottom,0px))!important;
    border-top:1px solid rgba(255,255,255,.09)!important;
    pointer-events:auto!important;
}
.instinctor-ghost-pill{
    position:relative!important;
    width:100%!important;min-height:44px!important;height:auto!important;
    display:none!important;align-items:flex-end!important;gap:8px!important;
    border-radius:12px!important;
    background:transparent!important;
    pointer-events:auto!important;
}
.instinctor-ghost-pill-inner{
    flex:1!important;min-width:0!important;
    min-height:44px!important;display:flex!important;align-items:center!important;
    background:rgba(255,255,255,.08)!important;
    border-radius:12px!important;
    overflow:hidden!important;position:relative!important;
    --ghost-lx:50%;--ghost-ly:50%;
}

.instinctor-ghost-pill-inner::before{
    content:'';position:absolute;inset:0;border-radius:12px;
    padding:1px;
    background:conic-gradient(from var(--ghost-scan,0deg),rgba(255,255,255,.13) 0%,rgba(255,255,255,.13) 55%,rgba(255,255,255,.45) 70%,rgba(255,255,255,.7) 78%,rgba(255,255,255,.45) 86%,rgba(255,255,255,.13) 100%);
    -webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);
    -webkit-mask-composite:xor;mask-composite:exclude;
    opacity:1;pointer-events:none;z-index:10;
    animation:ghost-pill-spin 6s linear infinite;
}
.instinctor-ghost-field{
    flex:1!important;
    min-height:44px!important;max-height:120px!important;
    padding:12px 14px!important;
    background:transparent!important;border:none!important;outline:none!important;
    
    font-size:16px!important;color:#ffffff!important;
    font-family:inherit!important;min-width:0!important;
    resize:none!important;overflow:hidden!important;
    line-height:1.4!important;box-sizing:border-box!important;
    scrollbar-width:none!important;
    white-space:normal!important;
    transition:height .2s ease-in-out!important;
    display:block!important;
}
.instinctor-ghost-field::-webkit-scrollbar{display:none!important}
.instinctor-ghost-field::placeholder{color:rgba(255,255,255,.5)!important}

.instinctor-chat-send{
    flex:none!important;width:44px!important;height:44px!important;
    border:0!important;border-radius:12px!important;padding:0!important;
    background:#ffffff!important;color:#14161a!important;cursor:pointer!important;
    display:flex!important;align-items:center!important;justify-content:center!important;
    transition:transform .2s ease-in-out,opacity .2s ease-in-out!important;
}
.instinctor-chat-send:hover{transform:scale(1.05)!important}
.instinctor-chat-send:focus-visible{outline:2px solid #fff!important;outline-offset:2px!important}

#instinctor-chat-bar{
    position:fixed!important;
    bottom:calc(20px + env(safe-area-inset-bottom,0px) + var(--instinctor-keyboard-h,0px))!important;
    right:20px!important;
    width:44px!important;height:44px!important;
    background:transparent!important;
    z-index:999998!important;
    cursor:pointer!important;
}
#instinctor-chat-bar[data-position="left"]{right:auto!important;left:20px!important}
.instinctor-bar-bottom{
    position:absolute!important;inset:0!important;
    display:flex!important;align-items:center!important;justify-content:center!important;
    pointer-events:none!important;
    background:rgba(26,29,33,.82)!important;
    backdrop-filter:blur(8px)!important;-webkit-backdrop-filter:blur(8px)!important;
    border:1px solid rgba(255,255,255,.18)!important;
    border-radius:50%!important;
    box-shadow:0 2px 10px rgba(0,0,0,.28)!important;
    transition:transform .2s ease-in-out!important;
}
#instinctor-chat-bar:hover .instinctor-bar-bottom{transform:scale(1.06)!important}
.instinctor-bar-icon-chat{
    display:block!important;pointer-events:none!important;opacity:1!important;
    transition:opacity .2s ease-in-out,transform .2s ease-in-out!important;
}
.instinctor-bar-icon-close{
    display:none!important;pointer-events:none!important;
    position:absolute!important;top:50%!important;left:50%!important;
    transform:translate(-50%,-50%)!important;opacity:0!important;
    transition:opacity .2s ease-in-out!important;
}

.instinctor-bar-icon-send{display:none!important}

.instinctor-bar-actions-col{
    position:absolute!important;left:0!important;right:0!important;bottom:52px!important;
    display:flex!important;flex-direction:column!important;align-items:center!important;
    gap:6px!important;
    opacity:0!important;transition:opacity .15s ease-in-out!important;pointer-events:none!important;
}
#instinctor-chat.open ~ #instinctor-chat-bar .instinctor-bar-actions-col{opacity:0!important}
.instinctor-bar-act{
    width:36px!important;height:36px!important;
    background:rgba(0,0,0,.55)!important;
    backdrop-filter:blur(22px) saturate(160%)!important;
    -webkit-backdrop-filter:blur(22px) saturate(160%)!important;
    border:none!important;border-radius:10px!important;cursor:pointer!important;
    display:flex!important;align-items:center!important;justify-content:center!important;
    padding:0!important;transition:background .15s ease-in-out!important;flex-shrink:0!important;
    position:relative!important;
}
.instinctor-bar-act:hover{background:rgba(0,0,0,.7)!important}
.instinctor-bar-act[data-tip]:hover::after{
    content:attr(data-tip)!important;
    position:absolute!important;right:calc(100% + 8px)!important;top:50%!important;
    transform:translateY(-50%)!important;
    background:rgba(0,0,0,.72)!important;color:#fff!important;
    font-size:11px!important;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif!important;
    white-space:nowrap!important;padding:3px 7px!important;border-radius:4px!important;
    pointer-events:none!important;z-index:1000000!important;
}

#instinctor-draw-canvas{position:fixed!important;top:0!important;left:0!important;width:100%!important;height:100%!important;z-index:2147483645!important;cursor:crosshair!important;touch-action:none!important}
#instinctor-draw-strip{position:fixed!important;bottom:0!important;left:0!important;right:0!important;height:48px!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:16px!important;z-index:2147483646!important;font-family:sans-serif!important;font-size:13px!important;color:rgba(255,255,255,.8)!important}
#instinctor-draw-strip-cancel{background:rgba(255,255,255,.15)!important;border:none!important;color:#fff!important;font-size:12px!important;padding:5px 14px!important;border-radius:20px!important;cursor:pointer!important}
@keyframes instinctor-pin-pulse{0%{transform:translate(-50%,-50%) scale(1);opacity:.8}100%{transform:translate(-50%,-50%) scale(2.5);opacity:0}}
.instinctor-pin-ring{position:fixed!important;width:32px!important;height:32px!important;border-radius:50%!important;border:2px solid #fff!important;pointer-events:none!important;z-index:2147483644!important;animation:instinctor-pin-pulse .8s ease-in-out 3!important;transform:translate(-50%,-50%)!important}
.instinctor-branding,.instinctor-branding *{visibility:visible!important;opacity:1!important;position:relative!important;height:auto!important;overflow:visible!important;clip:auto!important;clip-path:none!important;transform:none!important;filter:none!important;pointer-events:auto!important;font-size:10px!important;line-height:1.4!important;max-height:none!important;min-height:0!important;min-width:0!important;margin:0!important;z-index:1!important}
.instinctor-branding{display:block!important;padding:0 16px 8px!important;background:transparent!important;text-align:center!important}
.instinctor-branding a{display:inline!important;color:rgba(255,255,255,.45)!important;font-size:10px!important;text-decoration:none!important}
.instinctor-branding a:hover{color:rgba(255,255,255,.75)!important}
.instinctor-branding strong{font-weight:600!important;display:inline!important}
#instinctor-screenshot-overlay{position:fixed!important;top:0!important;left:0!important;width:100%!important;height:100%!important;background:rgba(0,0,0,.3)!important;z-index:9999999!important;cursor:crosshair!important}
.instinctor-screenshot-hint{position:absolute!important;top:20px!important;left:50%!important;transform:translateX(-50%)!important;background:#000!important;color:#fff!important;padding:10px 20px!important;border-radius:8px!important;font-size:14px!important}
.instinctor-selection-box{position:absolute!important;border:2px solid #fff!important;background:rgba(255,255,255,.1)!important;pointer-events:none!important}
.instinctor-toast{position:fixed!important;bottom:100px!important;left:50%!important;transform:translateX(-50%)!important;background:#333!important;color:#fff!important;padding:12px 24px!important;border-radius:8px!important;font-size:14px!important;z-index:99999999!important}
#instinctor-ghost-preview{
    margin:0 0 8px!important;padding:8px!important;
    background:rgba(255,255,255,.08)!important;
    border:1px solid rgba(255,255,255,.13)!important;
    border-radius:10px!important;max-width:100%!important;
}

.instinctor-ghost-bubbles.ghost-rtl{direction:rtl!important}
.instinctor-ghost-pill.ghost-rtl{direction:rtl!important}

@media(max-width:767px){
    
    #instinctor-chat{
        left:12px!important;right:12px!important;
        width:auto!important;
        bottom:calc(12px + env(safe-area-inset-bottom,0px) + var(--instinctor-keyboard-h,0px))!important;
        max-height:min(74vh,620px)!important;
        border-radius:20px!important;
    }
    #instinctor-chat[data-position="left"]{left:12px!important;right:12px!important}

    #instinctor-chat-bar{
        right:16px!important;
        bottom:calc(16px + env(safe-area-inset-bottom,0px) + var(--instinctor-keyboard-h,0px))!important;
    }
    #instinctor-chat-bar[data-position="left"]{right:auto!important;left:16px!important}

    .instinctor-ghost-bubbles{padding:14px!important;gap:9px!important}
    .instinctor-ghost-bubble{max-width:88%!important}
}
