:root {
    --botesa-blue: #075a91;
    --botesa-blue-dark: #03436f;
    --botesa-yellow: #ffd426;
    --botesa-yellow-soft: #fff7c7;
    --botesa-ink: #17324a;
    --botesa-muted: #6d7882;
    --botesa-bg: #f5f8fb;
    --botesa-white: #ffffff;
}

#botesa-assistent-root {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 99999;
    font-family: inherit;
    color: var(--botesa-ink);
}

#botesa-chat-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    border-radius: 999px;
    padding: 10px 16px 10px 10px;
    background: var(--botesa-blue);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(3,67,111,.30);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

#botesa-chat-toggle:hover {
    background: var(--botesa-blue-dark);
    transform: translateY(-1px);
    box-shadow: 0 13px 34px rgba(3,67,111,.36);
}

.botesa-toggle-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--botesa-yellow);
    font-size: 22px;
}

.botesa-toggle-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.08;
}

.botesa-toggle-text strong {
    font-size: 14px;
}

.botesa-toggle-text small {
    margin-top: 4px;
    font-size: 11px;
    opacity: .82;
    font-weight: 500;
}

#botesa-chat-panel {
    display: none;
    position: absolute;
    right: 0;
    bottom: 70px;
    width: min(400px, calc(100vw - 28px));
    height: min(620px, calc(100vh - 112px));
    background: var(--botesa-white);
    border-radius: 20px;
    box-shadow: 0 18px 55px rgba(3,50,83,.28);
    overflow: hidden;
    flex-direction: column;
    border: 1px solid rgba(7,90,145,.10);
}

#botesa-chat-panel.open {
    display: flex;
    animation: botesa-pop .18s ease-out;
}

@keyframes botesa-pop {
    from { opacity: 0; transform: translateY(8px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.botesa-chat-header {
    min-height: 78px;
    padding: 14px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--botesa-blue);
    color: #fff;
    border-bottom: 5px solid var(--botesa-yellow);
}

.botesa-brand {
    display: flex;
    align-items: center;
    gap: 11px;
}

.botesa-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--botesa-yellow);
    color: var(--botesa-blue-dark);
    border: 3px solid #fff;
    font-weight: 900;
    font-size: 21px;
    box-shadow: inset 0 0 0 2px var(--botesa-blue);
}

.botesa-chat-header strong,
.botesa-chat-header small {
    display: block;
}

.botesa-chat-header strong {
    font-size: 17px;
    line-height: 1.1;
}

.botesa-chat-header small {
    opacity: .86;
    margin-top: 4px;
    font-size: 11px;
}

#botesa-chat-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    color: #fff;
    font-size: 25px;
    cursor: pointer;
    line-height: 1;
}

#botesa-chat-close:hover {
    background: rgba(255,255,255,.22);
}

.botesa-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px 8px;
    background:
        radial-gradient(circle at top right, rgba(255,212,38,.13), transparent 30%),
        var(--botesa-bg);
}

.botesa-msg {
    max-width: 86%;
    margin: 0 0 11px;
    padding: 11px 13px;
    border-radius: 15px;
    line-height: 1.45;
    word-break: break-word;
    font-size: 14px;
}

.botesa-msg.bot {
    background: #fff;
    border: 1px solid #dce7ef;
    border-bottom-left-radius: 5px;
    box-shadow: 0 3px 10px rgba(18,59,85,.06);
}

.botesa-msg.user {
    margin-left: auto;
    background: var(--botesa-blue);
    color: #fff;
    border-bottom-right-radius: 5px;
}

.botesa-msg a {
    color: var(--botesa-blue-dark);
    text-decoration: underline;
    font-weight: 700;
}

.botesa-quick-title {
    padding: 10px 12px 1px;
    background: #fff;
    color: var(--botesa-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.botesa-quick-actions {
    padding: 8px 10px 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    background: #fff;
}

.botesa-quick-actions button,
.botesa-quick-actions .botesa-whatsapp-action {
    border: 1px solid #d9e4ec;
    background: #fff;
    color: var(--botesa-blue-dark);
    border-radius: 11px;
    padding: 9px 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    transition: background .15s ease, border-color .15s ease;
}

.botesa-quick-actions button:hover,
.botesa-quick-actions .botesa-whatsapp-action:hover {
    background: var(--botesa-yellow-soft);
    border-color: var(--botesa-yellow);
}

.botesa-quick-actions .botesa-whatsapp-action {
    grid-column: 1 / -1;
    display: block;
    text-decoration: none;
    text-align: center;
    background: var(--botesa-yellow-soft);
    border-color: var(--botesa-yellow);
    font-size: 13px;
}

#botesa-chat-form {
    display: flex;
    gap: 8px;
    padding: 10px;
    background: #fff;
    border-top: 1px solid #e3ebf1;
}

#botesa-chat-input {
    flex: 1;
    min-width: 0;
    border: 1px solid #cbd9e3;
    border-radius: 12px;
    padding: 11px 12px;
    color: var(--botesa-ink);
    outline: none;
    background: #fff;
}

#botesa-chat-input:focus {
    border-color: var(--botesa-blue);
    box-shadow: 0 0 0 3px rgba(7,90,145,.10);
}

#botesa-chat-form button {
    border: 0;
    border-radius: 12px;
    padding: 10px 15px;
    background: var(--botesa-yellow);
    color: var(--botesa-blue-dark);
    font-weight: 900;
    cursor: pointer;
}

#botesa-chat-form button:hover {
    filter: brightness(.97);
}

@media (max-width: 520px) {
    #botesa-assistent-root {
        right: 12px;
        bottom: 12px;
    }

    #botesa-chat-toggle {
        padding-right: 13px;
    }

    #botesa-chat-panel {
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100vh;
        max-width: none;
        border-radius: 0;
        border: 0;
    }

    .botesa-chat-header {
        padding-top: max(14px, env(safe-area-inset-top));
    }

    #botesa-chat-form {
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }
}