.ssc-chatbot {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9998;
    font-family: 'Open Sans', Arial, sans-serif;
}

.ssc-chatbot-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    background: #90c940;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.2s ease;
}

.ssc-chatbot-toggle:hover,
.ssc-chatbot-toggle:focus {
    background: #80b734;
    outline: none;
    transform: translateY(-1px);
}

.ssc-chatbot-toggle .fa {
    font-size: 18px;
}

.ssc-chatbot-panel {
    position: absolute;
    right: 0;
    bottom: 64px;
    width: 360px;
    max-width: calc(100vw - 24px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e5e5e5;
}

.ssc-chatbot-panel[hidden] {
    display: none !important;
}

.ssc-chatbot-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: #f7faf4;
    border-bottom: 1px solid #e8e8e8;
    flex-shrink: 0;
}

.ssc-chatbot-header strong {
    display: block;
    color: #333;
    font-size: 15px;
}

.ssc-chatbot-context {
    margin-top: 4px;
    font-size: 12px;
    color: #666;
}

.ssc-chatbot-close {
    border: 0;
    background: transparent;
    color: #888;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.ssc-chatbot-close:hover,
.ssc-chatbot-close:focus {
    color: #333;
    outline: none;
}

.ssc-chatbot-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    background: #fafafa;
    -webkit-overflow-scrolling: touch;
}

.ssc-chatbot-message {
    max-width: 88%;
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.6;
    word-wrap: break-word;
}

.ssc-chatbot-message.assistant {
    max-width: 96%;
    margin-right: auto;
    padding: 14px 16px;
    background: #fff;
    color: #333;
    border: 1px solid #e0e8d8;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(74, 99, 48, 0.06);
}

.ssc-chatbot-message p {
    margin: 0 0 10px;
    color: #3d3d3d;
}

.ssc-chatbot-message p:last-child {
    margin-bottom: 0;
}

.ssc-chatbot-message .ssc-chatbot-heading {
    margin: 14px 0 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid #e8f3d8;
    font-size: 13px;
    font-weight: 700;
    color: #2d5016;
    letter-spacing: 0.02em;
}

.ssc-chatbot-message .ssc-chatbot-heading:first-child {
    margin-top: 0;
}

.ssc-chatbot-message .ssc-chatbot-section-title {
    margin: 12px 0 6px;
    padding-left: 10px;
    border-left: 3px solid #90c940;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #4a6330;
}

.ssc-chatbot-message .ssc-chatbot-section-title:first-child {
    margin-top: 0;
}

.ssc-chatbot-message ul.ssc-chatbot-list,
.ssc-chatbot-message ol.ssc-chatbot-list {
    margin: 0 0 12px;
    padding: 0 0 0 4px;
    list-style: none;
}

.ssc-chatbot-message ul.ssc-chatbot-list li,
.ssc-chatbot-message ol.ssc-chatbot-list li {
    position: relative;
    margin: 0 0 8px;
    padding-left: 18px;
    color: #444;
}

.ssc-chatbot-message ul.ssc-chatbot-list li.ssc-chatbot-list-heading {
    padding-left: 0;
    margin-top: 10px;
    list-style: none;
}

.ssc-chatbot-message ul.ssc-chatbot-list li.ssc-chatbot-list-heading:before {
    display: none;
}

.ssc-chatbot-message ul.ssc-chatbot-list li.ssc-chatbot-list-heading .ssc-chatbot-heading {
    margin: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.ssc-chatbot-message ul.ssc-chatbot-list li:before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #90c940;
}

.ssc-chatbot-message ol.ssc-chatbot-list {
    counter-reset: ssc-chatbot-counter;
}

.ssc-chatbot-message ol.ssc-chatbot-list li {
    counter-increment: ssc-chatbot-counter;
    padding-left: 22px;
}

.ssc-chatbot-message ol.ssc-chatbot-list li:before {
    content: counter(ssc-chatbot-counter) '.';
    position: absolute;
    left: 0;
    top: 0;
    width: auto;
    height: auto;
    border-radius: 0;
    background: none;
    color: #90c940;
    font-weight: 700;
    font-size: 12px;
}

.ssc-chatbot-message strong {
    color: #222;
    font-weight: 700;
}

.ssc-chatbot-message code {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    background: #f3f6ef;
    border: 1px solid #e2ead8;
    font-size: 12px;
    color: #4a6330;
}

.ssc-chatbot-message.user {
    margin-left: auto;
    background: #90c940;
    color: #fff;
    border-bottom-right-radius: 4px;
}


.ssc-chatbot-message.error {
    margin-right: auto;
    background: #fff3f3;
    color: #a94442;
    border: 1px solid #f5c6cb;
}

.ssc-chatbot-message.assistant a {
    color: #5a8a28;
    font-weight: 600;
}

.ssc-chatbot-action {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #90c940;
    color: #fff !important;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none !important;
    transition: background 0.2s ease;
}

.ssc-chatbot-action:hover,
.ssc-chatbot-action:focus {
    background: #80b734;
    color: #fff !important;
    outline: none;
}

.ssc-chatbot-starters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 16px 12px;
    flex-shrink: 0;
}

.ssc-chatbot-starters[hidden] {
    display: none !important;
}

.ssc-chatbot-starter {
    border: 1px solid #d6e8bc;
    background: #f7faf4;
    color: #4a6330;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    line-height: 1.35;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.ssc-chatbot-starter:hover,
.ssc-chatbot-starter:focus {
    background: #eef6e4;
    border-color: #90c940;
    outline: none;
}

.ssc-chatbot-starter:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ssc-chatbot-typing {
    display: none;
    gap: 4px;
    padding: 0 16px 8px;
    flex-shrink: 0;
}

.ssc-chatbot-typing.is-active {
    display: flex;
}

.ssc-chatbot-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #90c940;
    animation: ssc-chatbot-bounce 1.2s infinite ease-in-out;
}

.ssc-chatbot-typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.ssc-chatbot-typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes ssc-chatbot-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.ssc-chatbot-form {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    padding: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #e8e8e8;
    background: #fff;
    flex-shrink: 0;
}

.ssc-chatbot-input {
    flex: 1;
    resize: none;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.4;
    min-height: 42px;
    max-height: 120px;
}

.ssc-chatbot-input:focus {
    outline: none;
    border-color: #90c940;
    box-shadow: 0 0 0 2px rgba(144, 201, 64, 0.2);
}

.ssc-chatbot-send {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 10px;
    background: #90c940;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
}

.ssc-chatbot-send:hover,
.ssc-chatbot-send:focus {
    background: #80b734;
    outline: none;
}

.ssc-chatbot-send:disabled,
.ssc-chatbot-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ssc-chatbot.is-open .ssc-chatbot-toggle {
    display: none;
}

@media (max-width: 480px) {
    .ssc-chatbot {
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom, 0px));
        left: auto;
    }

    .ssc-chatbot-panel {
        position: fixed;
        top: max(12px, env(safe-area-inset-top, 0px));
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom, 0px));
        left: 12px;
        width: auto;
        height: auto;
        max-height: none;
        border-radius: 16px;
    }

    .ssc-chatbot-toggle-label {
        display: none;
    }
}

body.ssc-chatbot-mobile-open {
    overflow: hidden;
    touch-action: none;
}
