.ri-assistant {
    --ri-leaf: #8ed34f;
    --ri-leaf-deep: #1f6b32;
    --ri-navy: #071833;
    position: fixed;
    z-index: 1085;
    left: 16px;
    bottom: 0;
    font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

.ri-assistant__launcher {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    border: 0;
    border-radius: 18px 18px 0 0;
    background: linear-gradient(180deg, #12315f, var(--ri-navy));
    color: #fff;
    padding: 0.45rem 0.95rem 0.55rem 0.45rem;
    box-shadow: 0 -8px 28px rgba(7, 24, 51, 0.35);
    animation: ri-assist-float 2.6s ease-in-out infinite;
}

.ri-assistant__launcher::before {
    content: "";
    position: absolute;
    inset: -7px;
    border-radius: inherit;
    border: 2px solid rgba(142, 211, 79, 0.55);
    animation: ri-assist-halo 2.6s ease-in-out infinite;
    pointer-events: none;
}

.ri-assistant.is-open .ri-assistant__launcher {
    animation: none;
    transform: none;
}

.ri-assistant.is-open .ri-assistant__launcher::before {
    animation: none;
    opacity: 0;
}

.ri-assistant__launcher img,
.ri-assistant__head img {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    object-fit: contain;
    background: #fff;
    padding: 3px;
}

.ri-assistant__launcher strong,
.ri-assistant__head strong {
    display: block;
    font-size: 0.95rem;
    line-height: 1.15;
}

.ri-assistant__launcher span,
.ri-assistant__head span {
    display: block;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.75);
}

.ri-assistant__panel {
    position: absolute;
    left: 0;
    bottom: 64px;
    width: min(400px, calc(100vw - 24px));
    height: min(540px, calc(100vh - 96px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(8, 24, 52, 0.96);
    color: #e7eef8;
    box-shadow: 0 24px 60px rgba(2, 8, 24, 0.45);
}

.ri-assistant__panel[hidden] {
    display: none !important;
}

.ri-assistant__head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0.9rem;
    background: linear-gradient(145deg, #1f6b32, #0d3f22 42%, #071833);
}

.ri-assistant__close {
    margin-left: auto;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
}

.ri-assistant__log {
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: 0.9rem;
}

.ri-assistant__msg {
    max-width: 92%;
    padding: 0.7rem 0.8rem;
    border-radius: 16px;
    line-height: 1.45;
    font-size: 0.92rem;
}

.ri-assistant__msg p {
    margin: 0;
}

.ri-assistant__msg--bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 5px;
}

.ri-assistant__msg--user {
    align-self: flex-end;
    background: linear-gradient(180deg, #8ed34f, #1f6b32);
    color: #07210f;
    border-bottom-right-radius: 5px;
}

.ri-assistant__sources {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: 0.55rem;
}

.ri-assistant__sources span {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ri-leaf);
}

.ri-assistant__sources a {
    color: #fff;
    background: rgba(142, 211, 79, 0.12);
    border-radius: 10px;
    padding: 0.35rem 0.55rem;
    text-decoration: none;
    font-size: 0.82rem;
}

.ri-assistant__suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0 0.85rem 0.7rem;
}

.ri-assistant__suggestions button,
.ri-assistant__form button {
    border: 0;
    border-radius: 999px;
    background: rgba(142, 211, 79, 0.16);
    color: #e7eef8;
    font-size: 0.78rem;
    font-weight: 650;
    padding: 0.35rem 0.65rem;
}

.ri-assistant__form {
    display: flex;
    gap: 0.4rem;
    padding: 0.7rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ri-assistant__form input {
    flex: 1;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    padding: 0.55rem 0.8rem;
}

.ri-assistant__form button {
    flex: 0 0 auto;
    background: linear-gradient(180deg, #8ed34f, #1f6b32);
    color: #07210f;
    font-size: 0.85rem;
}

.ri-assistant__form button:disabled {
    opacity: 0.65;
}

.ri-assistant__typing {
    display: flex;
    gap: 4px;
    padding: 0.2rem 0;
}

.ri-assistant__typing i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ri-leaf);
    display: block;
    animation: ri-assist-dot 1s infinite ease-in-out;
}

.ri-assistant__typing i:nth-child(2) { animation-delay: 0.15s; }
.ri-assistant__typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes ri-assist-dot {
    0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-2px); }
}

@keyframes ri-assist-float {
    0%, 100% { transform: translateY(0); box-shadow: 0 10px 22px rgba(7, 24, 51, 0.28); }
    50% { transform: translateY(-12px); box-shadow: 0 26px 36px rgba(7, 24, 51, 0.16); }
}

@keyframes ri-assist-halo {
    0%, 100% { transform: scale(1); opacity: 0.35; }
    50% { transform: scale(1.06); opacity: 0.9; }
}
