#mslgpt-fab {
    box-shadow: 0 8px 30px rgba(1,79,53,0.18);
    border-radius: 50%;
    background: #014f35; /* primary */
    width: var(--mslgpt-fab-size, 56px);
    height: var(--mslgpt-fab-size, 56px);
    align-items: center;
    justify-content: center;
    display: flex;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
#mslgpt-fab img {
    pointer-events: none;
    width: 60%;
    height: 60%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}
#mslgpt-fab:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(1,79,53,0.22);
}

#mslgpt-chatbox {
    position: fixed;
    z-index: 99999;
    width: 380px;
    max-width: 92vw;
    bottom: 110px;
    right: 40px;
    background: #ffffff;
    box-shadow: 0 12px 40px rgba(0,0,0,0.28);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(20px) scale(0.995);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.15s;
}
.mslgpt-hidden { display: none !important; }
#mslgpt-chatbox.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    animation: mslgpt-fadein 0.22s;
}
@keyframes mslgpt-fadein {
    0% { opacity:0; transform:translateY(32px) scale(0.96);}
    100%{opacity:1; transform:translateY(0) scale(1);}
}

.mslgpt-header {
    background: linear-gradient(180deg,#016f4f 0%, #014f35 100%); /* green header */
    color: #fff;
    font-weight: 600;
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
}
.mslgpt-title { font-size: 1rem; color: #fff; }
.mslgpt-header .mslgpt-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.4em;
    line-height: 1;
    cursor: pointer;
    margin-left: 10px;
}

.mslgpt-messages {
    background: #f5f7fa;
    flex: 1;
    padding: 1.1rem 0.9rem;
    overflow-y: auto;
    font-size:15px;
}
.mslgpt-msg {
    margin: 0.42rem 0;
    max-width: 84%;
    word-break: break-word;
}
.mslgpt-msg.user {
    align-self: flex-end;
    background: #e8f7f0; /* light green */
    color: #014f35;
    padding: 0.6em 1em;
    border-radius: 16px 8px 16px 8px;
    margin-left: auto;
    box-shadow: 0 4px 10px rgba(1,79,53,0.06);
}
.mslgpt-msg.ai {
    align-self: flex-start;
    background: #ffffff;
    color: #222;
    border: 1px solid #eef2ef;
    padding: 0.6em 1em;
    border-radius: 8px 16px 16px 8px;
    margin-right: auto;
    box-shadow: 0 6px 18px rgba(2,8,8,0.04);
}

.mslgpt-msg.typing {
    background: #f1f5fe !important;
    color: #9098ab !important;
    font-style: italic;
    font-size: 0.95em;
}

/* typing dot */
.mslgpt-typing-dot {
    display:inline-block;
    width:8px;
    height:8px;
    margin-right:8px;
    border-radius:50%;
    background:#a8b9ff;
    vertical-align:middle;
    animation: mslgpt-dot 1s linear infinite;
}
@keyframes mslgpt-dot {
    0% { transform: translateY(0); opacity: 0.6 }
    50% { transform: translateY(-4px); opacity: 1 }
    100% { transform: translateY(0); opacity: 0.6 }
}

.mslgpt-inputarea {
    background: transparent;
    display: flex;
    gap: 0.6rem;
    align-items: center;
    padding: 1rem;
}
.mslgpt-input {
    flex: 1;
    border-radius: 12px;
    border: 1px solid #d6dbe6;
    padding: 0.75em 1em;
    font-size: 1rem;
    background: #fff;
    outline: none;
    box-shadow: 0 6px 18px rgba(13,26,45,0.04);
}
.mslgpt-send {
    width: 46px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(180deg,#02a06f 0%, #014f35 100%);
    color: #fff;
    font-size: 1.06em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0 10px;
}
.mslgpt-send svg { width: 16px; height: 16px; }
.mslgpt-send[disabled] {
    opacity:0.6;
    pointer-events:none;
}

.mslgpt-footer {
    font-size: 0.78em;
    color: #6b736f;
    padding: 0.5rem 0.9rem;
    text-align: center;
    border-top: 1px solid #eef2ef;
    background: #ffffff;
}

@media (max-width: 749px) {
    #mslgpt-chatbox { width: 96vw; right: 2vw; left: 2vw; bottom: 90px; }
    #mslgpt-fab{ right: 18px !important; left: auto !important;}
}

@media (max-width: 420px) {
    #mslgpt-chatbox { width: 98vw; right: 1vw; left: 1vw; bottom: 78px; }
    .mslgpt-header { padding: 0.7rem; }
    .mslgpt-inputarea { padding: 0.6rem; }
}

::-webkit-scrollbar {width: 7px;}
::-webkit-scrollbar-thumb {background: #e0e7f5; border-radius: 4px;}