.sw-chatbot {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1100;
    font-family: inherit;
}

.sw-chatbot__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border: 0;
    border-radius: 999px;
    background: #1f6b62;
    color: #fff;
    box-shadow: 0 8px 24px rgba(14, 44, 41, 0.24);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.sw-chatbot__toggle:hover,
.sw-chatbot__toggle:focus-visible {
    background: #19544d;
    box-shadow: 0 10px 28px rgba(14, 44, 41, 0.3);
    transform: translateY(-2px);
}

.sw-chatbot--open .sw-chatbot__toggle {
    background: #c25e34;
}

.sw-chatbot__toggle-icon {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
}

.sw-chatbot__panel {
    position: absolute;
    right: 0;
    bottom: 58px;
    display: flex;
    width: min(360px, calc(100vw - 32px));
    height: min(500px, calc(100vh - 110px));
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #d6d3d1;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(28, 25, 23, 0.2);
    animation: sw-chatbot-in 180ms ease-out;
}

.sw-chatbot__panel[hidden] {
    display: none;
}

@keyframes sw-chatbot-in {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.sw-chatbot__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    background: #143f3a;
    color: #fff;
}

.sw-chatbot__header strong,
.sw-chatbot__header span {
    display: block;
}

.sw-chatbot__header span {
    margin-top: 3px;
    color: #d4ecea;
    font-size: 0.78rem;
}

.sw-chatbot__close {
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
}

.sw-chatbot__messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding: 16px;
    background: #fafaf9;
}

.sw-chatbot__message {
    max-width: 86%;
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.45;
}

.sw-chatbot__message--bot {
    align-self: flex-start;
    background: #d4ecea;
    color: #143f3a;
}

.sw-chatbot__message--visitor {
    align-self: flex-end;
    background: #1f6b62;
    color: #fff;
}

.sw-chatbot__form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #e7e5e4;
    background: #fff;
}

.sw-chatbot__form input {
    min-width: 0;
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d6d3d1;
    border-radius: 6px;
    font: inherit;
}

.sw-chatbot__form input:focus {
    border-color: #4f9e93;
    outline: 2px solid #abd6cf;
    outline-offset: 1px;
}

.sw-chatbot__form button {
    width: 42px;
    border: 0;
    border-radius: 6px;
    background: #c25e34;
    color: #fff;
    cursor: pointer;
    font-size: 1.2rem;
}

.sw-chatbot__form button:hover,
.sw-chatbot__form button:focus-visible {
    background: #a64a28;
}

@media (max-width: 480px) {
    .sw-chatbot {
        right: 16px;
        bottom: 16px;
    }

    .sw-chatbot__panel {
        right: -8px;
        bottom: 56px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sw-chatbot__toggle,
    .sw-chatbot__panel {
        transition: none;
        animation: none;
    }
}
