.buddy-widget-root {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 45;
    font-family: var(--font-body, "Inter", "Segoe UI", sans-serif);
}

.buddy-hidden {
    display: none !important;
}

.buddy-launcher {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    border-radius: 9999px;
    border: 1px solid rgba(45, 212, 191, 0.45);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.82));
    color: rgb(236, 253, 245);
    padding: 0.7rem 0.95rem;
    box-shadow: 0 16px 36px rgba(2, 6, 23, 0.48);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.buddy-launcher:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 42px rgba(2, 6, 23, 0.56);
}

.buddy-launcher-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(52, 211, 153, 0.42);
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.2), rgba(45, 212, 191, 0.14));
    color: rgb(167, 243, 208);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.buddy-launcher-title {
    font-size: 0.9rem;
    line-height: 1.1;
    font-weight: 700;
}

.buddy-launcher-prefix,
.buddy-launcher-label {
    display: inline;
}

.buddy-launcher-sub {
    font-size: 0.72rem;
    color: rgb(148, 163, 184);
    line-height: 1.1;
}

.buddy-launcher-sub:empty {
    display: none;
}

.buddy-dock-reopen {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 9999px;
    border: 1px solid rgba(45, 212, 191, 0.45);
    background: rgba(15, 23, 42, 0.94);
    color: rgb(209, 250, 229);
    padding: 0.58rem 0.9rem;
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.48);
}

.buddy-panel {
    width: min(92vw, 390px);
    height: min(78vh, 620px);
    margin-top: 0.75rem;
    border-radius: 1rem;
    border: 1px solid rgba(52, 211, 153, 0.36);
    background: linear-gradient(162deg, rgba(2, 6, 23, 0.96), rgba(15, 23, 42, 0.9));
    box-shadow: 0 24px 48px rgba(2, 6, 23, 0.6);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.buddy-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.72rem 0.78rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.8);
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.88), rgba(6, 78, 59, 0.2));
}

.buddy-head-left {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.buddy-head-badge {
    width: 2rem;
    height: 2rem;
    border-radius: 0.62rem;
    border: 1px solid rgba(52, 211, 153, 0.48);
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.24), rgba(45, 212, 191, 0.14));
    color: rgb(167, 243, 208);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.buddy-head-title {
    font-size: 0.94rem;
    font-weight: 700;
    line-height: 1.15;
    color: rgb(241, 245, 249);
}

.buddy-head-subtitle {
    font-size: 0.72rem;
    line-height: 1.1;
    color: rgb(148, 163, 184);
}

.buddy-head-actions {
    display: flex;
    align-items: center;
    gap: 0.32rem;
    flex-shrink: 0;
}

.buddy-lang-toggle {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(71, 85, 105, 0.65);
    border-radius: 0.65rem;
    overflow: hidden;
    margin-right: 0.25rem;
}

.buddy-lang-btn {
    min-width: 2rem;
    height: 1.86rem;
    padding: 0 0.4rem;
    border: 0;
    background: rgba(15, 23, 42, 0.82);
    color: rgb(203, 213, 225);
    font-size: 0.9rem;
    line-height: 1;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.buddy-lang-btn.is-active {
    background: rgba(16, 185, 129, 0.3);
    color: rgb(236, 253, 245);
}

.buddy-flag-icon {
    width: 1.15rem;
    height: 0.8rem;
    display: block;
    border-radius: 2px;
}

.buddy-icon-btn {
    width: 1.86rem;
    height: 1.86rem;
    border-radius: 0.55rem;
    border: 1px solid rgba(71, 85, 105, 0.68);
    background: rgba(15, 23, 42, 0.8);
    color: rgb(148, 163, 184);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.buddy-icon-btn:hover {
    border-color: rgba(52, 211, 153, 0.5);
    color: rgb(236, 253, 245);
    background: rgba(6, 78, 59, 0.38);
}

.buddy-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0.88rem 0.82rem;
    display: flex;
    flex-direction: column;
    gap: 0.52rem;
}

.buddy-row {
    display: flex;
}

.buddy-row-user {
    justify-content: flex-end;
}

.buddy-row-bot {
    justify-content: flex-start;
}

.buddy-bubble {
    max-width: 86%;
    padding: 0.62rem 0.72rem;
    border-radius: 0.78rem;
    font-size: 0.86rem;
    line-height: 1.5;
    word-break: break-word;
}

.buddy-user-bubble {
    border: 1px solid rgba(45, 212, 191, 0.45);
    background: linear-gradient(145deg, rgba(6, 78, 59, 0.54), rgba(15, 23, 42, 0.82));
    color: rgb(236, 253, 245);
}

.buddy-bot-bubble {
    border: 1px solid rgba(71, 85, 105, 0.64);
    background: rgba(15, 23, 42, 0.78);
    color: rgb(226, 232, 240);
}

.buddy-bot-bubble a {
    color: rgb(110, 231, 183);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.buddy-bot-bubble strong {
    color: rgb(240, 253, 250);
}

.buddy-bot-bubble ul {
    margin: 0.4rem 0 0;
    padding-left: 1rem;
}

.buddy-bot-bubble li {
    margin: 0.14rem 0;
}

.buddy-typing {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    min-height: 1.1rem;
}

.buddy-typing span {
    width: 0.36rem;
    height: 0.36rem;
    border-radius: 9999px;
    background: rgb(148, 163, 184);
    animation: buddyTypingPulse 1s ease-in-out infinite;
}

.buddy-typing span:nth-child(2) {
    animation-delay: 0.18s;
}

.buddy-typing span:nth-child(3) {
    animation-delay: 0.36s;
}

@keyframes buddyTypingPulse {

    0%,
    100% {
        transform: translateY(0);
        opacity: 0.45;
    }

    50% {
        transform: translateY(-2px);
        opacity: 1;
    }
}

.buddy-actions {
    padding: 0.5rem 0.72rem 0.55rem;
    border-top: 1px solid rgba(51, 65, 85, 0.68);
    background: rgba(2, 6, 23, 0.58);
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
}

.buddy-chip {
    border-radius: 9999px;
    border: 1px solid rgba(45, 212, 191, 0.3);
    background: rgba(20, 184, 166, 0.12);
    color: rgb(167, 243, 208);
    font-size: 0.74rem;
    font-weight: 600;
    padding: 0.31rem 0.62rem;
    line-height: 1.2;
    transition: all 0.15s ease;
}

.buddy-chip:hover {
    border-color: rgba(45, 212, 191, 0.54);
    background: rgba(20, 184, 166, 0.2);
    color: rgb(236, 253, 245);
}

.buddy-composer {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.58rem 0.72rem 0.74rem;
    border-top: 1px solid rgba(51, 65, 85, 0.68);
    background: rgba(2, 6, 23, 0.7);
}

.buddy-input {
    flex: 1 1 auto;
    border: 1px solid rgba(71, 85, 105, 0.72);
    border-radius: 0.7rem;
    background: rgba(15, 23, 42, 0.85);
    color: rgb(226, 232, 240);
    font-size: 0.85rem;
    line-height: 1.2;
    padding: 0.58rem 0.7rem;
    outline: none;
}

.buddy-input:focus {
    border-color: rgba(52, 211, 153, 0.6);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.buddy-send {
    border: 1px solid rgba(167, 243, 208, 0.45);
    border-radius: 0.7rem;
    background: linear-gradient(135deg, rgb(74, 222, 128), rgb(45, 212, 191));
    color: rgb(2, 6, 23);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.1;
    padding: 0.6rem 0.8rem;
    min-width: 4.5rem;
}

.buddy-foot {
    padding: 0 0.72rem 0.62rem;
    font-size: 0.7rem;
    color: rgb(148, 163, 184);
}

.buddy-foot a {
    color: rgb(110, 231, 183);
    text-decoration: underline;
    text-underline-offset: 2px;
}

@media (max-width: 640px) {
    .buddy-widget-root {
        right: 0.65rem;
        bottom: 0.65rem;
    }

    .buddy-panel {
        width: min(95vw, 390px);
        height: min(80vh, 600px);
    }

    .buddy-launcher {
        gap: 0.48rem;
        padding: 0.54rem 0.72rem;
    }

    .buddy-launcher-icon {
        width: 1.75rem;
        height: 1.75rem;
        border-radius: 0.55rem;
    }

    .buddy-launcher-prefix {
        display: none;
    }

    .buddy-launcher-title {
        font-size: 0.8rem;
    }
}
