.as-fab {
position: fixed;
right: 1.25rem;
bottom: 1.25rem;
z-index: 1090;
width: 60px;
height: 60px;
border-radius: 50%;
border: 0;
background: linear-gradient(135deg, #1d4ed8, #3b82f6);
color: #fff;
font-size: 1.5rem;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 10px 26px rgba(37, 99, 235, .45);
transition: transform .2s ease;
}
.as-fab:hover { transform: scale(1.08); }
.as-fab .as-fab-close { display: none; }
.as-fab.as-open .as-fab-open { display: none; }
.as-fab.as-open .as-fab-close { display: block; }

.as-panel {
position: fixed;
right: 1.25rem;
bottom: 6rem;
z-index: 1090;
width: min(94vw, 400px);
max-height: min(72vh, 560px);
display: flex;
flex-direction: column;
background: #fff;
border-radius: 1.1rem;
box-shadow: 0 24px 60px rgba(10, 23, 51, .28);
overflow: hidden;
transform-origin: bottom right;
opacity: 0;
pointer-events: none;
transform: translateY(12px) scale(.96);
transition: opacity .2s ease, transform .2s ease;
}
.as-panel.as-open {
opacity: 1;
pointer-events: auto;
transform: translateY(0) scale(1);
}

.as-header {
background: linear-gradient(135deg, #0a1733, #1e3a8a);
color: #fff;
padding: .9rem 1.1rem;
display: flex;
align-items: center;
gap: .75rem;
}
.as-avatar {
width: 42px;
height: 42px;
border-radius: 50%;
background: linear-gradient(135deg, #60a5fa, #38bdf8);
color: #0a1733;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.2rem;
flex-shrink: 0;
}
.as-dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: #60a5fa;
display: inline-block;
margin-right: .35rem;
box-shadow: 0 0 0 3px rgba(59, 130, 246, .25);
}

.as-body {
flex: 1;
overflow-y: auto;
background: #f2f8f6;
padding: 1rem;
display: flex;
flex-direction: column;
gap: .75rem;
min-height: 320px;
max-height: 46vh;
}
.as-msg {
max-width: 86%;
padding: .65rem .9rem;
border-radius: 1rem;
font-size: .875rem;
line-height: 1.55;
white-space: normal;
word-break: break-word;
}
.as-msg-user {
align-self: flex-end;
background: linear-gradient(135deg, #1d4ed8, #3b82f6);
color: #fff;
border-bottom-right-radius: .25rem;
}
.as-msg-ai {
align-self: flex-start;
background: #fff;
color: #1e293b;
border: 1px solid #e2e8f0;
border-bottom-left-radius: .25rem;
box-shadow: 0 2px 8px rgba(10, 23, 51, .05);
}
.as-msg strong { color: #1e3a8a; }
.as-msg-user strong { color: #fff; }
.as-link {
color: #1d4ed8;
font-weight: 600;
text-decoration: underline;
word-break: break-all;
}
.as-msg-user .as-link { color: #dbeafe; }

.as-chips {
display: flex;
flex-wrap: wrap;
gap: .45rem;
align-self: flex-start;
}
.as-chip {
border: 1px solid #99f6e4;
background: #ecfdf5;
color: #1e3a8a;
font-size: .78rem;
font-weight: 600;
border-radius: 50rem;
padding: .3rem .8rem;
cursor: pointer;
transition: background .15s ease;
}
.as-chip:hover { background: #d1fae5; }

.as-typing {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .65rem .95rem;
    font-size: .82rem;
    color: #475569;
    font-weight: 500;
}
.as-typing-dots {
    display: inline-flex;
    gap: 4px;
}
.as-typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #3b82f6;
    animation: asBlink 1.2s infinite;
}
.as-typing-dots span:nth-child(2) { animation-delay: .2s; }
.as-typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes asBlink { 0%, 80%, 100% { opacity: .3; transform: scale(.85); } 40% { opacity: 1; transform: scale(1.25); } }

.as-cursor {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background-color: #2563eb;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: asCursorPulse 0.7s infinite;
}
@keyframes asCursorPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.as-tool-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #0369a1;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    border-radius: 0.4rem;
    padding: 0.2rem 0.55rem;
    margin-bottom: 0.4rem;
}

.as-input {
border-top: 1px solid #e2e8f0;
padding: .75rem;
display: flex;
gap: .5rem;
align-items: center;
}
.as-input input {
flex: 1;
border: 1px solid #e2e8f0;
border-radius: 50rem;
padding: .55rem 1rem;
font-size: .875rem;
outline: none;
}
.as-input input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(20, 184, 166, .15); }
.as-send {
width: 42px;
height: 42px;
border-radius: 50%;
border: 0;
background: linear-gradient(135deg, #1d4ed8, #3b82f6);
color: #fff;
font-size: 1.1rem;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.as-send:disabled { opacity: .5; }
.as-note {
font-size: .68rem;
color: #94a3b8;
padding: .4rem .9rem .6rem;
text-align: center;
background: #fff;
}
