#modrex-ai-launcher {
    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 99998;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border: 1px solid #d5ad55;
    border-radius: 50px;
    background: #101010;
    color: #f1c66b;
    font: 600 14px Arial, sans-serif;
    cursor: pointer;
    box-shadow: 0 8px 30px #0005;
}
#modrex-ai-launcher:hover { transform: translateY(-2px); }
#modrex-ai-launcher.hidden { display: none; }
.modrex-ai-launch-icon { font-size: 22px; }

#modrex-ai-panel {
    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 99999;
    display: none;
    flex-direction: column;
    width: 370px;
    max-width: calc(100vw - 30px);
    height: 540px;
    max-height: calc(100dvh - 40px);
    overflow: hidden;
    border: 1px solid #bd984d;
    border-radius: 18px;
    background: #101010;
    color: #f5f5f5;
    font-family: Arial, sans-serif;
    box-shadow: 0 15px 55px #0008;
}
#modrex-ai-panel.open { display: flex; }

.modrex-ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #171717;
    border-bottom: 1px solid #383027;
}
.modrex-ai-brand { display: flex; align-items: center; gap: 11px; }
.modrex-ai-avatar {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #d5ad55;
    color: #111;
    font-weight: 800;
}
.modrex-ai-brand strong { display: block; color: #f1c66b; font-size: 15px; }
.modrex-ai-brand small { display: block; margin-top: 5px; color: #bbb; font-size: 11px; }
.modrex-ai-online-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 4px;
    border-radius: 50%;
    background: #49c879;
}
.modrex-ai-close {
    border: 0;
    background: transparent;
    color: white;
    font-size: 28px;
    cursor: pointer;
}

.modrex-ai-messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding: 17px;
}
.modrex-ai-message {
    max-width: 88%;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.modrex-ai-message.bot {
    align-self: flex-start;
    border: 1px solid #3b3428;
    background: #222;
    color: #eee;
    border-bottom-left-radius: 4px;
}
.modrex-ai-message.user {
    align-self: flex-end;
    background: #c49a45;
    color: #111;
    border-bottom-right-radius: 4px;
}
.modrex-ai-message.typing { opacity: .7; }

.modrex-ai-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 0 14px 12px;
}
.modrex-ai-quick button {
    padding: 8px 10px;
    border: 1px solid #8f713a;
    border-radius: 20px;
    background: transparent;
    color: #e9c477;
    font-size: 11px;
    cursor: pointer;
}
.modrex-ai-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #383027;
}
.modrex-ai-form input {
    flex: 1;
    min-width: 0;
    padding: 12px;
    border: 1px solid #48413a;
    border-radius: 25px;
    outline: none;
    background: #1c1c1c;
    color: white;
    font-size: 13px;
}
.modrex-ai-form input:focus { border-color: #d5ad55; }
.modrex-ai-form button {
    width: 43px;
    border: 0;
    border-radius: 50%;
    background: #d5ad55;
    color: #111;
    font-size: 18px;
    cursor: pointer;
}
.modrex-ai-form button:disabled { opacity: .5; cursor: wait; }
.modrex-ai-footer {
    padding: 0 12px 10px;
    color: #888;
    text-align: center;
    font-size: 10px;
}

@media (max-width: 480px) {
    #modrex-ai-launcher { right: 15px; bottom: 15px; }
    #modrex-ai-panel {
        right: 10px;
        bottom: 10px;
        width: calc(100vw - 20px);
        height: min(600px, calc(100dvh - 20px));
        max-width: none;
        max-height: calc(100dvh - 20px);
    }
}