#vpa-bot,
#vpa-bot * {
    box-sizing: border-box;
}

#vpa-bot {
    font-family: Arial, sans-serif;
}

.vpa-bot-toggle {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 99990;
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 999px;
    background: #7a1430;
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .18);
}

.vpa-bot-panel {
    position: fixed;
    right: 20px;
    bottom: 92px;
    z-index: 99991;
    width: 380px;
    max-width: calc(100vw - 24px);
    height: min(640px, calc(100vh - 115px));
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .18);
    border: 1px solid rgba(0, 0, 0, .08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.vpa-bot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: #7a1430;
    color: #fff;
    flex: 0 0 auto;
}

.vpa-bot-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vpa-bot-header-text strong {
    font-size: 16px;
}

.vpa-bot-header-text small {
    font-size: 12px;
    opacity: .9;
}

.vpa-bot-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vpa-bot-close {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}

.vpa-bot-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 14px;
    background: #fafafa;
}

.vpa-bot-msg {
    max-width: 88%;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.vpa-bot-msg--bot {
    background: #f1f1f1;
    color: #111;
}

.vpa-bot-msg--user {
    margin-left: auto;
    background: #7a1430;
    color: #fff;
}

.vpa-bot-msg--meta {
    background: #fff7e6;
    border: 1px solid #f0d28a;
    color: #6b4d00;
}

.vpa-bot-actions {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.vpa-bot-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #7a1430;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}

.vpa-bot-link:hover {
    filter: brightness(1.05);
}

.vpa-bot-input-area {
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, .08);
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
}

.vpa-bot-mode-toggle {
    text-align: center;
    padding: 10px 0 0 0;
}

.vpa-bot-mode-btn {
    background: none;
    border: none;
    color: #7a1430;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    opacity: 0.8;
}

.vpa-bot-mode-btn:hover {
    opacity: 1;
}

.vpa-bot-form {
    display: flex;
    gap: 8px;
    padding: 10px 12px 12px 12px;
    align-items: flex-end;
}

.vpa-bot-mode-view {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vpa-bot-mode-view[hidden] {
    display: none !important;
}

.vpa-bot-select {
    width: 100%;
    min-width: 0;
    height: 42px;
    border: 1px solid rgba(122, 20, 48, .22);
    border-radius: 10px;
    padding: 0 10px;
    background: #fff;
    color: #7a1430;
    font-size: 13px;
    font-weight: 700;
    outline: none;
}

.vpa-bot-select[hidden] {
    display: none !important;
}

.vpa-bot-input {
    width: 100%;
    min-width: 0;
    height: 42px;
    border: 1px solid rgba(0, 0, 0, .15);
    border-radius: 10px;
    padding: 0 12px;
    font-size: 14px;
    outline: none;
}

.vpa-bot-submit {
    flex: 0 0 auto;
    height: 42px;
    border: 0;
    border-radius: 10px;
    padding: 0 16px;
    background: #7a1430;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.vpa-bot-submit:hover {
    filter: brightness(1.05);
}

@media (max-width: 767px) {
    .vpa-bot-toggle {
        right: 16px;
        bottom: 16px;
        z-index: 99980;
    }

    .vpa-bot-panel {
        top: 70px;
        right: 10px;
        bottom: 10px;
        left: 10px;
        width: auto;
        max-width: none;
        height: auto;
        border-radius: 14px;
        z-index: 99999;
    }

    .vpa-bot-control-row {
        gap: 6px;
    }

    .vpa-bot-select {
        height: 38px;
        font-size: 12px;
    }

    .vpa-bot-control-btn {
        height: 38px;
        padding: 0 12px;
        font-size: 12px;
    }

    body.bot-open .vpa-bot-toggle,
    body.support-open .vpa-bot-toggle,
    body.bot-open #vpa-support-toggle,
    body.support-open #vpa-support-toggle {
        display: none !important;
    }
}