.bytca-chatbot-widget {
    bottom: 24px;
    font-family: Arial, sans-serif;
    position: fixed;
    right: 24px;
    z-index: 99999;
}

.bytca-chatbot-widget__toggle {
    background: #0057a8;
    border: 0;
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    padding: 14px 22px;
}

.bytca-chatbot-widget__toggle:focus,
.bytca-chatbot-widget__close:focus,
.bytca-chatbot-widget__form textarea:focus,
.bytca-chatbot-widget__form button:focus {
    outline: 3px solid #ffcf33;
    outline-offset: 2px;
}

.bytca-chatbot-widget__panel {
    background: #fff;
    border-radius: 16px;
    bottom: 64px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
    display: none;
    max-height: min(680px, calc(100vh - 120px));
    overflow: hidden;
    position: absolute;
    right: 0;
    width: min(380px, calc(100vw - 32px));
}

.bytca-chatbot-widget[data-state="open"] .bytca-chatbot-widget__panel {
    display: flex;
    flex-direction: column;
}

.bytca-chatbot-widget__header {
    align-items: flex-start;
    background: #0057a8;
    color: #fff;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 18px;
}

.bytca-chatbot-widget__header h2 {
    color: inherit;
    font-size: 18px;
    line-height: 1.2;
    margin: 0 0 4px;
}

.bytca-chatbot-widget__header p {
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
    opacity: 0.9;
}

.bytca-chatbot-widget__close {
    background: transparent;
    border: 0;
    color: #fff;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    padding: 0 2px;
}

.bytca-chatbot-widget__messages {
    background: #f5f7fb;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    max-height: 360px;
    overflow-y: auto;
    padding: 16px;
}

.bytca-chatbot-widget__message {
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.45;
    max-width: 88%;
    padding: 11px 13px;
    white-space: pre-wrap;
}

.bytca-chatbot-widget__message--bot {
    align-self: flex-start;
    background: #fff;
    color: #1f2937;
}

.bytca-chatbot-widget__message--user {
    align-self: flex-end;
    background: #0057a8;
    color: #fff;
}

.bytca-chatbot-widget__message--loading {
    color: #4b5563;
    font-style: italic;
}

.bytca-chatbot-widget__sources {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
}

.bytca-chatbot-widget__sources li {
    margin-top: 5px;
}

.bytca-chatbot-widget__sources a {
    color: #0057a8;
    font-weight: 700;
    text-decoration: underline;
}

.bytca-chatbot-widget__form {
    display: flex;
    gap: 10px;
    padding: 14px;
}

.bytca-chatbot-widget__form textarea {
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    flex: 1;
    font: inherit;
    min-height: 48px;
    padding: 10px;
    resize: vertical;
}

.bytca-chatbot-widget__form button {
    align-self: flex-end;
    background: #0057a8;
    border: 0;
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    padding: 12px 14px;
}

.bytca-chatbot-widget__form button:disabled,
.bytca-chatbot-widget__form textarea:disabled {
    cursor: wait;
    opacity: 0.65;
}

.bytca-chatbot-widget__note {
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
    margin: 0;
    padding: 0 14px 14px;
}

@media (max-width: 480px) {
    .bytca-chatbot-widget {
        bottom: 16px;
        right: 16px;
    }

    .bytca-chatbot-widget__panel {
        bottom: 60px;
        max-height: calc(100vh - 96px);
        width: calc(100vw - 32px);
    }

    .bytca-chatbot-widget__form {
        flex-direction: column;
    }

    .bytca-chatbot-widget__form button {
        align-self: stretch;
    }
}
