.rb_assistant {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 9998;
    font-family: Arial, Helvetica, sans-serif;
}

.rb_assistant_launcher {
    height: 52px;
    padding: 0 18px 0 12px;
    border: 1px solid rgba(223, 174, 75, .72);
    border-radius: 28px;
    background: linear-gradient(135deg, #1f1b18 0%, #34291d 100%);
    color: #f4dfae;
    box-shadow: 0 12px 35px rgba(0, 0, 0, .36);
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: .2px;
}

.rb_assistant_launcher:hover { transform: translateY(-1px); }
.rb_assistant_launcher_icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #1d1711;
    background: linear-gradient(135deg, #f2d58c, #b97828);
    font-size: 18px;
}

.rb_assistant_panel {
    position: absolute;
    right: 0;
    bottom: 64px;
    width: 380px;
    height: min(590px, calc(100vh - 110px));
    min-height: 430px;
    border: 1px solid rgba(212, 168, 80, .42);
    border-radius: 18px;
    background: rgba(19, 17, 16, .985);
    box-shadow: 0 24px 65px rgba(0,0,0,.55);
    overflow: hidden;
    display: none;
    grid-template-rows: auto 1fr auto auto auto;
    color: #eee5d5;
}

.rb_assistant.rb_assistant_open .rb_assistant_panel { display: grid; }

.rb_assistant_header {
    min-height: 66px;
    padding: 11px 14px;
    display: flex;
    align-items: center;
    gap: 11px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: linear-gradient(135deg, #28211a, #191715);
}
.rb_assistant_avatar {
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #eccb78, #a96825);
    color: #17120d;
    font-size: 20px;
    font-weight: 900;
}
.rb_assistant_header strong { display: block; color: #f4db9e; font-size: 15px; }
.rb_assistant_header span { display: block; margin-top: 2px; color: #91877a; font-size: 11px; }
.rb_assistant_close {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: #aaa095;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.rb_assistant_messages {
    padding: 16px 13px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.rb_assistant_message { display: flex; margin-bottom: 11px; }
.rb_assistant_message_user { justify-content: flex-end; }
.rb_assistant_bubble {
    max-width: 87%;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.rb_assistant_message_bot .rb_assistant_bubble {
    background: #2a2622;
    border: 1px solid rgba(255,255,255,.06);
    color: #e8dfd2;
    border-bottom-left-radius: 5px;
}
.rb_assistant_message_user .rb_assistant_bubble {
    background: linear-gradient(135deg, #b67a2b, #85531c);
    color: #fff7e7;
    border-bottom-right-radius: 5px;
}
.rb_assistant_message_error .rb_assistant_bubble {
    background: #3a2020;
    border-color: rgba(255, 92, 92, .24);
    color: #f1bbbb;
}
.rb_assistant_typing .rb_assistant_bubble { color: #bcb1a3; font-style: italic; }

.rb_assistant_mode {
    display: inline-block;
    width: fit-content;
    margin: -5px 0 7px 4px;
    padding: 3px 7px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.08);
    background: #211e1b;
    color: #8f867b;
    font-size: 9px;
    letter-spacing: .15px;
}
.rb_assistant_mode_ai { color: #d8b46b; border-color: rgba(214,170,82,.25); }
.rb_assistant_mode_cache { color: #aaa49a; }
.rb_assistant_mode_fallback { color: #c69a66; }

.rb_assistant_sources {
    max-width: 87%;
    margin: -5px 0 12px 0;
    padding-left: 4px;
}
.rb_assistant_sources span { display: block; color: #81776b; font-size: 10px; margin-bottom: 3px; }
.rb_assistant_sources a {
    display: inline-block;
    margin: 2px 4px 0 0;
    padding: 4px 7px;
    border: 1px solid rgba(214, 170, 82, .25);
    border-radius: 8px;
    color: #d8b46b;
    text-decoration: none;
    font-size: 10px;
}

.rb_assistant_quick {
    padding: 8px 11px 5px;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    border-top: 1px solid rgba(255,255,255,.06);
}
.rb_assistant_quick button {
    flex: 0 0 auto;
    padding: 6px 9px;
    border: 1px solid rgba(212, 168, 80, .24);
    border-radius: 12px;
    background: #24201c;
    color: #c8ad79;
    cursor: pointer;
    font-size: 10px;
}

.rb_assistant_form {
    display: grid;
    grid-template-columns: 1fr 42px;
    align-items: end;
    gap: 7px;
    padding: 8px 10px;
}
.rb_assistant_form textarea {
    resize: none;
    max-height: 92px;
    min-height: 40px;
    padding: 10px 11px;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 12px;
    outline: none;
    background: #11100f;
    color: #f1e8db;
    font: inherit;
    font-size: 13px;
    line-height: 1.35;
}
.rb_assistant_form textarea:focus { border-color: rgba(215, 170, 80, .62); }
.rb_assistant_form button {
    width: 42px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #d5a84f, #9b631e);
    color: #19130d;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
}
.rb_assistant_form button:disabled { opacity: .5; cursor: default; }
.rb_assistant_note {
    padding: 0 11px 9px;
    color: #70695f;
    font-size: 9px;
    line-height: 1.3;
    text-align: center;
}

@media (max-width: 640px) {
    .rb_assistant { right: 12px; bottom: 12px; }
    .rb_assistant_panel {
        position: fixed;
        right: 10px;
        left: 10px;
        bottom: 74px;
        width: auto;
        height: min(70vh, 600px);
    }
    .rb_assistant_launcher_text { display: none; }
    .rb_assistant_launcher { width: 52px; padding: 0; justify-content: center; }
}
