:root{
    --aiw-accent:#2f6df4;
    --aiw-accent-dark:#2b5fe0;
    --aiw-orange:#ff7a18;
    --aiw-panel-w:380px;
    --aiw-panel-h:96%;
    --aiw-muted:#0b1220;
    --aiw-border:#e6e9ee;
}
#aiChatWidget{
    display:none !important;
    position:fixed;
    right:20px;
    bottom:20px;
    z-index:9999;
    font-family:Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}
.aiw-bubble a{
    color:#1e6ef3;
    text-decoration:underline;
    word-break:break-word;
}
.aiw-bubble a:hover{ text-decoration:none; }

.aiw-toggle{
    position:relative;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:64px;
    height:64px;
    border-radius:50%;
    border:none;
    cursor:pointer;
    outline:none;
    background:var(--aiw-accent);
}
.aiw-toggle:focus{ box-shadow:0 0 0 4px rgba(37,99,235,0.14); }

.aiw-donate{
    grid-column:1 / -1;
    padding:12px 14px;
    border-radius:10px;
    border:none;
    cursor:pointer;
    background:var(--aiw-orange);
    color:#fff;
    font-weight:600;
    text-align:center;
}

.aiw-modal{
    width:var(--aiw-panel-w);
    height:100%;
    max-height:var(--aiw-panel-h);
    position:fixed;
    right:20px;
    bottom:20px;
    display:flex;
    flex-direction:column;
    border-radius:14px;
    overflow:hidden;
    background:#ffffff;
    color:var(--aiw-muted);
    border:1px solid rgba(15,23,42,0.10);
}
.aiw-header{
    padding:12px 14px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    background:var(--aiw-accent);
    color:#fff;
    border-bottom:1px solid rgba(0,0,0,0.06);
}
.aiw-title{ font-weight:600; font-size:15px; margin:0; color:#fff; }
.aiw-close{
    background:transparent;
    border:none;
    color:#fff;
    padding:6px;
    border-radius:8px;
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    justify-content:center;
}
.aiw-close:hover{ background:rgba(255,255,255,0.10); }
.aiw-close-icon{ width:18px; height:18px; stroke:white; }

.aiw-messages{
    flex:1 1 auto;
    padding:16px;
    overflow-y:auto;
    display:flex;
    flex-direction:column;
    gap:12px;
    background:#ffffff;
    -webkit-overflow-scrolling:touch;
}
.aiw-messages::-webkit-scrollbar{ width:8px }
.aiw-messages::-webkit-scrollbar-thumb{ background:rgba(0,0,0,0.08); border-radius:99px }
.aiw-empty{ text-align:center; color:#6b7280; font-size:13px; padding:6px 0 }

.aiw-msg{ display:flex; width:100% }
.aiw-msg.aiw-user{ justify-content:flex-end }
.aiw-msg.aiw-bot{ justify-content:flex-start }
.aiw-bubble{
    max-width:80%;
    padding:12px 14px;
    border-radius:12px;
    line-height:1.4;
    white-space:pre-wrap;
    word-wrap:break-word;
    font-size:14px;
}
.aiw-bubble.aiw-user{
    background:var(--aiw-accent);
    color:#fff;
    border-bottom-right-radius:4px;
}
.aiw-bubble.aiw-bot{
    background:#f8fafc;
    color:var(--aiw-muted);
    border:1px solid rgba(15,23,42,0.06);
    border-bottom-left-radius:4px;
}
.aiw-loading-bubble{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:10px 12px;
    border-radius:12px;
    background:#f8fafc;
    border:1px solid rgba(15,23,42,0.06);
    color:#6b7280;
    font-size:14px;
}

.aiw-quick{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:10px;
    padding:12px 14px;
    border-top:1px solid rgba(16,24,40,0.02);
    background:#f3f4f6;
}
.aiw-quick-question{
    padding:10px 12px;
    border-radius:10px;
    border:1px solid var(--aiw-border);
    background:#ffffff;
    color:var(--aiw-muted);
    text-align:left;
    font-size:13px;
    cursor:pointer;
}
.aiw-quick-question:hover{
    background:var(--aiw-orange);
    color:#fff;
    border-color:rgba(0,0,0,0);
}

.aiw-input-wrap{
    padding:12px 12px;
    border-top:1px solid rgba(16,24,40,0.02);
    background:#f3f4f6;
}
.aiw-form{ display:flex; gap:8px; align-items:center }
.aiw-input{
    flex:1;
    padding:10px 12px;
    border-radius:10px;
    border:1px solid var(--aiw-border);
    background:#fff;
    color:var(--aiw-muted);
    font-size:14px;
    outline:none;
}
.aiw-input:focus{ border-color:rgba(47,109,244,0.45) }
.aiw-input:disabled{
    opacity:0.55;
    cursor:not-allowed;
    background:#eef1f5;
}
.aiw-send:disabled,
.aiw-quick-question:disabled,
.aiw-donate:disabled{
    opacity:0.5;
    cursor:not-allowed;
    pointer-events:none;
}

.aiw-cooldown{
    display:flex;
    align-items:center;
    gap:10px;
    padding:0 14px 10px;
    background:#f3f4f6;
}
.aiw-cooldown-track{
    flex:1;
    height:8px;
    border-radius:99px;
    background:#e5e7eb;
    overflow:hidden;
}
.aiw-cooldown-bar{
    height:100%;
    width:100%;
    background:var(--aiw-accent);
    transform-origin:left center;
    transform:scaleX(1);
    will-change:transform;
}
.aiw-cooldown-label{
    min-width:2.25rem;
    text-align:right;
    font-size:12px;
    font-weight:700;
    color:var(--aiw-muted);
    font-variant-numeric:tabular-nums;
}

.aiw-send{
    background:var(--aiw-accent);
    border:1px solid var(--aiw-border);
    padding:10px;
    border-radius:10px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    position:relative;
    overflow:hidden;
}
.aiw-send:hover{ background:var(--aiw-orange); border-color:rgba(0,0,0,0); }
.aiw-send-icon{ width:18px; height:18px; color:#fff; stroke:white }

.aiw-hidden{ display:none!important }
@media (max-width:420px){
    .aiw-modal{ width:calc(100% - 32px); right:16px; left:16px; bottom:16px; height:100%; max-height:96%; border-radius:12px }
    .aiw-toggle{ width:56px; height:56px }
}
