.be-chatbot {
    --chatbot-navy: #173f6b;
    --chatbot-navy-dark: #102f52;
    --chatbot-gold: #f4ae00;
    --chatbot-border: #d8e1ea;
    --chatbot-muted: #64748b;
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
    font-family: Arial, sans-serif;
}

.be-chatbot-launcher {
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 50%;
    background: var(--chatbot-gold);
    color: var(--chatbot-navy-dark);
    box-shadow: 0 8px 24px rgba(16, 47, 82, 0.25);
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.2s ease, background 0.2s ease;
    padding: 3px;
    overflow: hidden;
    animation: be-chatbot-breathe 4s ease-in-out infinite;
}

.be-chatbot-launcher:hover,
.be-chatbot-launcher:focus-visible {
    background: #ffc229;
    transform: translateY(-2px);
}

.be-chatbot-launcher:focus-visible,
.be-chatbot-close:focus-visible,
.be-chatbot-send:focus-visible,
.be-chatbot-input:focus-visible,
.be-chatbot-form textarea:focus-visible {
    outline: 3px solid rgba(244, 174, 0, 0.45);
    outline-offset: 2px;
}

.be-chatbot-launcher.is-pulsing {
    animation: be-chatbot-launch-pulse 320ms ease-out;
}

.be-chatbot-avatar {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.be-chatbot-launcher .be-chatbot-avatar {
    border: 3px solid var(--chatbot-gold);
}

.be-chatbot-identity {
    display: flex;
    align-items: center;
    gap: 9px;
}

.be-chatbot-header-avatar {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border: 2px solid var(--chatbot-gold);
}

.be-chatbot-message-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.be-chatbot-message-row p {
    min-width: 0;
    flex: 1;
}

.be-chatbot-message-avatar {
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    border: 1px solid var(--chatbot-gold);
}

.be-chatbot-panel {
    display: flex;
    flex-direction: column;
    width: min(360px, calc(100vw - 32px));
    height: min(520px, calc(100vh - 112px));
    margin-bottom: 12px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--chatbot-border);
    border-radius: 14px;
    box-shadow: 0 16px 42px rgba(16, 47, 82, 0.22);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px) scale(0.95);
    transform-origin: bottom right;
    transition: opacity 300ms ease, transform 300ms ease;
}

.be-chatbot-panel[hidden] {
    display: none;
}

.be-chatbot-panel.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.be-chatbot-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 16px 14px;
    background: var(--chatbot-navy);
    color: #ffffff;
}

.be-chatbot-header h2 {
    margin: 0;
    font-size: 16px;
    line-height: 1.3;
}

.be-chatbot-header p {
    margin: 3px 0 0;
    color: #dce8f4;
    font-size: 12px;
}

.be-chatbot-close {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.be-chatbot-close:hover {
    background: rgba(255, 255, 255, 0.12);
}

.be-chatbot-messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    padding: 16px;
    overflow-y: auto;
    background: #f7f9fb;
}

.be-chatbot-messages::-webkit-scrollbar {
    width: 7px;
}

.be-chatbot-messages::-webkit-scrollbar-thumb {
    border-radius: 7px;
    background: #c3ceda;
}

.be-chatbot-message {
    max-width: 86%;
    padding: 10px 12px;
    border-radius: 12px;
    color: #24364a;
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.be-chatbot-message p {
    margin: 0;
    white-space: pre-wrap;
}

.be-chatbot-message-assistant {
    align-self: flex-start;
    border: 1px solid var(--chatbot-border);
    background: #ffffff;
    border-top-left-radius: 4px;
}

.be-chatbot-message-user {
    align-self: flex-end;
    background: var(--chatbot-navy);
    color: #ffffff;
    border-top-right-radius: 4px;
}

.be-chatbot-message-thinking {
    color: var(--chatbot-muted);
    font-style: italic;
}

.be-chatbot-message-thinking p::after {
    content: "";
    display: inline-block;
    width: 1.2em;
    text-align: left;
    animation: be-chatbot-thinking-dots 1.2s steps(4, end) infinite;
}

@keyframes be-chatbot-thinking-dots {
    0%, 20% { content: ""; }
    40% { content: "."; }
    60% { content: ".."; }
    80%, 100% { content: "..."; }
}

.be-chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 12px 10px;
    background: #f7f9fb;
}

.be-chatbot-suggestions[hidden] {
    display: none;
}

.be-chatbot-suggestions button {
    padding: 7px 9px;
    border: 1px solid #cbd8e5;
    border-radius: 14px;
    background: #ffffff;
    color: var(--chatbot-navy);
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    line-height: 1.2;
}

.be-chatbot-suggestions button:hover,
.be-chatbot-suggestions button:focus-visible {
    border-color: var(--chatbot-gold);
    background: #fffaf0;
}

.be-chatbot-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--chatbot-border);
    background: #ffffff;
}

.be-chatbot-input-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.be-chatbot-form textarea {
    min-width: 0;
    min-height: 40px;
    max-height: 110px;
    padding: 10px 11px;
    resize: vertical;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #24364a;
    font: inherit;
    font-size: 13px;
    line-height: 1.35;
}

.be-chatbot-form textarea:focus {
    border-color: var(--chatbot-navy);
    outline: 0;
}

.be-chatbot-send {
    align-self: end;
    min-height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: var(--chatbot-gold);
    color: var(--chatbot-navy-dark);
    cursor: pointer;
    font-weight: 700;
}

.be-chatbot-send:hover:not(:disabled) {
    background: #ffc229;
}

.be-chatbot-send:disabled {
    cursor: wait;
    opacity: 0.55;
}

.be-chatbot-status {
    min-height: 17px;
    margin: -6px 12px 8px;
    color: var(--chatbot-muted);
    font-size: 11px;
}

.be-chatbot-disclaimer {
    margin: 0 12px 10px;
    color: #8794a3;
    font-size: 10px;
    line-height: 1.35;
    text-align: center;
}

@media (max-width: 600px) {
    .be-chatbot {
        right: 12px;
        bottom: 12px;
    }

    .be-chatbot-panel {
        width: calc(100vw - 24px);
        height: min(500px, calc(100vh - 88px));
        margin-bottom: 10px;
    }
}

@keyframes be-chatbot-breathe {
    0%, 100% { box-shadow: 0 8px 24px rgba(16, 47, 82, 0.25); }
    50% { box-shadow: 0 10px 28px rgba(16, 47, 82, 0.32); }
}

@keyframes be-chatbot-launch-pulse {
    50% { transform: scale(0.94); }
}

@media (prefers-reduced-motion: reduce) {
    .be-chatbot-launcher,
    .be-chatbot-launcher.is-pulsing {
        animation: none;
    }

    .be-chatbot-panel {
        transition: none;
    }

    .be-chatbot-suggestions button,
    .be-chatbot-messages::-webkit-scrollbar-thumb {
        transition: none;
    }
}