.nature-buddy {
    bottom: 24px;
    display: grid;
    gap: 12px;
    justify-items: end;
    max-width: min(390px, calc(100vw - 24px));
    position: fixed;
    right: 18px;
    z-index: 99990;
}

.nature-buddy-panel {
    background: #fffdf8;
    border: 1px solid rgba(20, 69, 47, .16);
    border-radius: 8px;
    box-shadow: 0 18px 52px rgba(20, 69, 47, .22);
    color: #17372e;
    display: none;
    flex-direction: column;
    max-height: min(640px, calc(100vh - 132px));
    overflow: hidden;
    width: min(390px, calc(100vw - 24px));
}

.nature-buddy-bubble {
    background: #ffffff;
    border: 1px solid rgba(20, 69, 47, .16);
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(20, 69, 47, .16);
    color: #263128;
    display: none;
    font-size: 14px;
    line-height: 1.45;
    min-width: 210px;
    padding: 12px 40px 12px 14px;
    position: relative;
}

.nature-buddy.is-visible.has-teaser:not(.is-open) .nature-buddy-bubble {
    display: block;
}

.nature-buddy-bubble::after {
    border-left: 10px solid transparent;
    border-right: 0 solid transparent;
    border-top: 12px solid #ffffff;
    bottom: -10px;
    content: "";
    position: absolute;
    right: 42px;
}

.nature-buddy-bubble-close {
    align-items: center;
    background: #eef5ec;
    border: 0;
    border-radius: 50%;
    color: #14452f;
    cursor: pointer;
    display: flex;
    font-size: 16px;
    font-weight: 800;
    height: 24px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    position: absolute;
    right: 9px;
    top: 9px;
    width: 24px;
}

.nature-buddy-bubble-close:hover {
    background: #14452f;
    color: #ffffff;
}

.nature-buddy.is-open .nature-buddy-panel {
    display: flex;
}

.nature-buddy-head {
    align-items: center;
    background: #14452f;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    padding: 14px 16px;
}

.nature-buddy-head strong,
.nature-buddy-head span {
    display: block;
}

.nature-buddy-head strong {
    font-size: 16px;
}

.nature-buddy-head span {
    color: rgba(255, 255, 255, .78);
    font-size: 12px;
    margin-top: 2px;
}

.nature-buddy-close {
    align-items: center;
    background: rgba(255, 255, 255, .15);
    border: 0;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    font-size: 16px;
    font-weight: 800;
    height: 28px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 28px;
}

.nature-buddy-messages {
    display: grid;
    gap: 9px;
    max-height: none;
    overflow-y: auto;
    padding: 14px;
    flex: 1 1 auto;
    min-height: 120px;
}

.nature-buddy-message {
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.45;
    max-width: 86%;
    padding: 10px 12px;
    white-space: pre-line;
}

.nature-buddy-message.is-bot {
    background: #edf5eb;
    color: #17372e;
    justify-self: start;
}

.nature-buddy-message.is-user {
    background: #14452f;
    color: #ffffff;
    justify-self: end;
}

.nature-buddy-summary {
    border-top: 1px solid rgba(20, 69, 47, .12);
    padding: 12px 14px;
}

.nature-buddy-summary strong {
    display: block;
    font-size: 13px;
    margin-bottom: 8px;
}

.nature-buddy-summary ul {
    display: grid;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nature-buddy-summary li {
    align-items: center;
    background: #ffffff;
    border: 1px solid rgba(20, 69, 47, .12);
    border-radius: 8px;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    padding: 8px 10px;
}

.nature-buddy-summary li span {
    font-size: 12px;
    line-height: 1.35;
}

.nature-buddy-summary li button {
    background: #f4eee5;
    border: 0;
    border-radius: 50%;
    color: #14452f;
    cursor: pointer;
    flex: 0 0 auto;
    font-weight: 800;
    height: 24px;
    width: 24px;
}

.nature-buddy-form,
.nature-buddy-customer {
    border-top: 1px solid rgba(20, 69, 47, .12);
    padding: 12px 14px 14px;
}

.nature-buddy-form textarea,
.nature-buddy-customer input,
.nature-buddy-customer textarea {
    background: #ffffff;
    border: 1px solid rgba(20, 69, 47, .18);
    border-radius: 8px;
    color: #17372e;
    font: inherit;
    font-size: 13px;
    outline: none;
    padding: 10px 11px;
    resize: vertical;
    width: 100%;
}

.nature-buddy-form textarea:focus,
.nature-buddy-customer input:focus,
.nature-buddy-customer textarea:focus {
    border-color: #14452f;
    box-shadow: 0 0 0 3px rgba(20, 69, 47, .1);
}

.nature-buddy-tools {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(72px, .9fr) minmax(72px, .9fr) minmax(118px, 1.45fr);
    margin-top: 10px;
}

.nature-buddy-tools button {
    align-items: center;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    font-size: 13px;
    font-weight: 800;
    gap: 6px;
    justify-content: center;
    min-height: 38px;
    min-width: 0;
    padding: 0 12px;
    white-space: nowrap;
}

.nature-buddy-mic {
    background: #edf5eb;
    color: #14452f;
}

.nature-buddy-send {
    background: #14452f;
    color: #ffffff;
}

.nature-buddy-cart {
    background: #eddd5e;
    color: #17372e;
}

.nature-buddy-tools button:hover {
    filter: brightness(.96);
}

.nature-buddy-tools button:focus-visible {
    outline: 3px solid rgba(20, 69, 47, .18);
    outline-offset: 2px;
}

.nature-buddy-customer {
    display: grid;
    gap: 8px;
}

.nature-buddy-customer[hidden] {
    display: none;
}

.nature-buddy-character {
    align-items: center;
    background: #ffffff;
    border: 2px solid #eddd5e;
    border-radius: 50%;
    box-shadow: 0 16px 30px rgba(20, 69, 47, .22);
    cursor: pointer;
    display: grid;
    height: 78px;
    justify-items: center;
    padding: 7px;
    position: relative;
    transform: translateY(120%);
    transition: transform .45s ease, opacity .3s ease;
    width: 78px;
}

.nature-buddy.is-visible .nature-buddy-character {
    transform: translateY(0);
}

.nature-buddy-character:hover {
    transform: translateY(-3px) rotate(-2deg);
}

.nature-buddy-logo {
    border-radius: 50%;
    height: 58px;
    object-fit: cover;
    width: 58px;
}

.nature-buddy-clip {
    border: 3px solid #14452f;
    border-left-color: transparent;
    border-radius: 999px;
    bottom: -9px;
    height: 36px;
    position: absolute;
    right: 0;
    transform: rotate(27deg);
    width: 20px;
}

.nature-buddy-grass {
    align-items: end;
    bottom: -5px;
    display: none;
    gap: 2px;
    height: 18px;
    left: 10px;
    position: absolute;
}

.nature-buddy-grass span {
    background: #5b8c51;
    border-radius: 8px 8px 0 0;
    display: block;
    width: 4px;
}

.nature-buddy-grass span:nth-child(1) { height: 12px; }
.nature-buddy-grass span:nth-child(2) { height: 18px; }
.nature-buddy-grass span:nth-child(3) { height: 10px; }

.nature-buddy-zzz {
    color: #14452f;
    display: none;
    font-size: 13px;
    font-weight: 800;
    position: absolute;
    right: -7px;
    top: -12px;
}

.nature-buddy.is-talking:not(.is-open) .nature-buddy-character {
    animation: nature-buddy-hop .9s ease;
}

.nature-buddy.is-idle:not(.is-open) .nature-buddy-character {
    animation: nature-buddy-sleep 2.6s ease-in-out infinite;
}

.nature-buddy.is-idle:not(.is-open) .nature-buddy-grass,
.nature-buddy.is-idle:not(.is-open) .nature-buddy-zzz {
    display: flex;
}

.nature-buddy.is-listening .nature-buddy-character {
    animation: nature-buddy-listening .85s ease-in-out infinite;
}

@keyframes nature-buddy-hop {
    0%, 100% { transform: translateY(0) rotate(0); }
    35% { transform: translateY(-10px) rotate(-4deg); }
    70% { transform: translateY(0) rotate(3deg); }
}

@keyframes nature-buddy-sleep {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(3px) rotate(2deg); }
}

@keyframes nature-buddy-listening {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-4px) scale(1.04);
    }
}

@media (max-width: 575px) {
    .nature-buddy {
        bottom: 12px;
        left: 12px;
        max-width: calc(100vw - 24px);
        right: 12px;
    }

    .nature-buddy-panel {
        max-height: calc(100vh - 104px);
        width: 100%;
    }

    .nature-buddy-messages {
        min-height: 100px;
    }

    .nature-buddy-tools {
        gap: 6px;
        grid-template-columns: minmax(58px, .8fr) minmax(58px, .8fr) minmax(108px, 1.4fr);
    }

    .nature-buddy-tools button {
        font-size: 12px;
        gap: 5px;
        min-height: 40px;
        padding: 0 8px;
    }

    .nature-buddy-bubble {
        font-size: 13px;
        min-width: 190px;
    }

    .nature-buddy-character {
        height: 70px;
        width: 70px;
    }

    .nature-buddy-logo {
        height: 52px;
        width: 52px;
    }
}
