#isp-chat-root {
    --isp-color: #0ea5e9;
    --isp-radius: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Bengali", sans-serif;
    z-index: 999999;
    position: fixed;
    bottom: 24px;
}

#isp-chat-root.isp-chat-pos-right { right: 24px; }
#isp-chat-root.isp-chat-pos-left  { left: 24px; }

/* Toggle button */
.isp-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: var(--isp-color);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s, box-shadow .2s;
}
.isp-chat-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 28px rgba(0,0,0,.3);
}
.isp-chat-toggle.open .isp-icon-chat { display: none; }
.isp-chat-toggle.open .isp-icon-close { display: block !important; }

/* Chat box */
.isp-chat-box {
    position: absolute;
    bottom: 76px;
    width: 370px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: var(--isp-radius);
    box-shadow: 0 12px 40px rgba(0,0,0,.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: ispSlideUp .25s ease;
}
#isp-chat-root.isp-chat-pos-right .isp-chat-box { right: 0; }
#isp-chat-root.isp-chat-pos-left  .isp-chat-box { left: 0; }

@keyframes ispSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Header */
.isp-chat-header {
    background: var(--isp-color);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.isp-chat-header-info strong {
    display: block;
    font-size: 15px;
}
.isp-chat-status {
    font-size: 12px;
    opacity: .9;
}
.isp-chat-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    opacity: .85;
}
.isp-chat-close:hover { opacity: 1; }

/* Messages */
.isp-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.isp-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}
.isp-msg.bot {
    background: #fff;
    border: 1px solid #e2e8f0;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.isp-msg.user {
    background: var(--isp-color);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.isp-msg.typing {
    background: #fff;
    border: 1px solid #e2e8f0;
    align-self: flex-start;
    color: #64748b;
    font-style: italic;
}

/* Input */
.isp-chat-input-wrap {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}
#isp-chat-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    outline: none;
    font-family: inherit;
    line-height: 1.4;
}
#isp-chat-input:focus {
    border-color: var(--isp-color);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--isp-color) 25%, transparent);
}
#isp-chat-send {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: var(--isp-color);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity .15s;
}
#isp-chat-send:disabled {
    opacity: .5;
    cursor: not-allowed;
}
#isp-chat-send:hover:not(:disabled) {
    filter: brightness(1.1);
}

/* Mobile */
@media (max-width: 480px) {
    #isp-chat-root { bottom: 16px; }
    #isp-chat-root.isp-chat-pos-right { right: 16px; }
    #isp-chat-root.isp-chat-pos-left  { left: 16px; }
    .isp-chat-box {
        width: calc(100vw - 32px);
        height: calc(100vh - 100px);
        bottom: 70px;
    }
}
