#rebeyrat-chat {
    --reb-orange: #f47700;
    --reb-yellow: #f9c722;
    --reb-dark: #373c3e;
    --reb-light: #ffffff;
    --reb-soft: #f4f4f1;
    --reb-text-soft: #717678;
    --reb-border: rgba(55, 60, 62, 0.14);
    font-family: Arial, Helvetica, sans-serif;
}

#rebeyrat-chat *,
#rebeyrat-chat *::before,
#rebeyrat-chat *::after {
    box-sizing: border-box;
}

#rebeyrat-chat-teaser {
    position: fixed;
    right: 24px;
    bottom: 110px;
    z-index: 999997;
    width: 260px;
    padding: 15px 38px 15px 17px;
    border: 0;
    border-radius: 10px 10px 2px 10px;
    background: #fff;
    color: var(--reb-dark);
    box-shadow: 0 14px 45px rgba(0,0,0,.18);
    text-align: left;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(.97);
    transition: opacity .3s ease, transform .3s ease, visibility .3s ease;
}

#rebeyrat-chat-teaser.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

#rebeyrat-chat-teaser strong {
    display: block;
    margin-bottom: 3px;
    color: var(--reb-dark);
    font-size: 14px;
    font-weight: 800;
}

#rebeyrat-chat-teaser > span:not(.rebeyrat-chat-teaser-close) {
    display: block;
    color: var(--reb-text-soft);
    font-size: 12px;
    line-height: 1.35;
}

.rebeyrat-chat-teaser-close {
    position: absolute;
    top: 6px;
    right: 10px;
    color: #aaa;
    font-size: 20px;
    line-height: 1;
}

#rebeyrat-chat-trigger {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 999999;
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--reb-orange);
    cursor: pointer;
    box-shadow: 0 10px 35px rgba(0,0,0,.18);
    transition: transform .2s ease, box-shadow .2s ease;
}

#rebeyrat-chat-trigger:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 45px rgba(0,0,0,.24);
}

.rebeyrat-chat-trigger-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--reb-yellow);
    overflow: visible;
}

.rebeyrat-chat-trigger-icon img {
    width: 72px;
    max-width: none;
    transform: translateY(-7px) rotate(0deg);
    transform-origin: 50% 80%;
    transition: transform .25s ease;
}

#rebeyrat-chat-trigger:hover .rebeyrat-chat-trigger-icon img {
    transform: translateY(-9px) rotate(-5deg);
}

#rebeyrat-chat-window {
    position: fixed;
    right: 24px;
    bottom: 108px;
    z-index: 999998;
    width: min(405px, calc(100vw - 30px));
    height: min(650px, calc(100vh - 135px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 6px;
    background: var(--reb-light);
    box-shadow: 0 24px 70px rgba(0,0,0,.24);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(22px) scale(.97);
    transform-origin: bottom right;
    transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
}

#rebeyrat-chat-window.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.rebeyrat-chat-header {
    min-height: 76px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 14px 18px;
    background: var(--reb-dark);
    color: #fff;
}

.rebeyrat-chat-header-identity {
    display: flex;
    align-items: center;
    gap: 11px;
}

.rebeyrat-chat-avatar,
.rebeyrat-chat-mini-avatar,
.rebeyrat-message-avatar {
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    background: var(--reb-yellow);
}

.rebeyrat-chat-avatar {
    width: 45px;
    height: 45px;
    flex: 0 0 45px;
}

.rebeyrat-chat-avatar img {
    width: 48px;
    transform: translateY(4px);
}

.rebeyrat-chat-brand {
    font-size: 17px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: .08em;
}

.rebeyrat-chat-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    font-size: 10px;
    opacity: .75;
    text-transform: uppercase;
    letter-spacing: .1em;
}

.rebeyrat-chat-status > span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #78d86c;
    box-shadow: 0 0 0 3px rgba(120,216,108,.12);
}

#rebeyrat-chat-close {
    flex: 0 0 auto;
    padding: 4px;
    border: 0;
    background: none;
    color: #fff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    opacity: .72;
}

#rebeyrat-chat-close:hover {
    opacity: 1;
}

#rebeyrat-chat-messages {
    flex: 1;
    min-height: 0;
    padding: 20px;
    overflow-y: auto;
    background: #fff;
    scroll-behavior: smooth;
    scrollbar-width: thin;
}

.rebeyrat-message-row {
    display: flex;
    gap: 8px;
    margin-bottom: 13px;
    animation: rebMessageIn .25s ease both;
}

.rebeyrat-message-row.bot {
    align-items: flex-end;
}

.rebeyrat-message-row.user {
    justify-content: flex-end;
}

.rebeyrat-message-avatar {
    width: 29px;
    height: 29px;
    flex: 0 0 29px;
}

.rebeyrat-message-avatar img {
    width: 32px;
    transform: translateY(3px);
}

.rebeyrat-message {
    max-width: 82%;
    padding: 12px 14px;
    font-size: 13.5px;
    line-height: 1.45;
}

.rebeyrat-message.bot {
    background: var(--reb-soft);
    color: var(--reb-dark);
    border-radius: 3px 13px 13px 13px;
}

.rebeyrat-message.user {
    background: var(--reb-orange);
    color: #fff;
    border-radius: 13px 3px 13px 13px;
}

.rebeyrat-message strong {
    font-weight: 800;
}

@keyframes rebMessageIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

#rebeyrat-chat-choices {
    display: grid;
    gap: 8px;
    max-height: 245px;
    padding: 14px 20px 17px;
    overflow-y: auto;
    background: #fff;
    border-top: 1px solid var(--reb-border);
}

#rebeyrat-chat-choices:empty {
    display: none;
}

.rebeyrat-choice {
    position: relative;
    width: 100%;
    padding: 12px 38px 12px 14px;
    border: 1px solid rgba(244,119,0,.38);
    border-radius: 2px;
    background: #fff;
    color: var(--reb-dark);
    text-align: left;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 700;
    cursor: pointer;
    transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease;
}

.rebeyrat-choice::after {
    content: "→";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--reb-orange);
    font-size: 16px;
}

.rebeyrat-choice:hover {
    background: var(--reb-orange);
    border-color: var(--reb-orange);
    color: #fff;
    transform: translateX(2px);
}

.rebeyrat-choice:hover::after {
    color: #fff;
}

.rebeyrat-final-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 47px;
    padding: 13px 18px;
    background: var(--reb-orange);
    color: #fff !important;
    text-decoration: none;
    text-align: center;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.rebeyrat-final-action:hover {
    background: var(--reb-dark);
}

.rebeyrat-callback-form {
    display: grid;
    gap: 8px;
    width: 100%;
}

.rebeyrat-callback-form input {
    width: 100%;
    min-height: 45px;
    padding: 12px 13px;
    border: 1px solid var(--reb-border);
    border-radius: 2px;
    background: #fff;
    color: var(--reb-dark);
    font-size: 14px;
    outline: none;
}

.rebeyrat-callback-form input:focus {
    border-color: var(--reb-orange);
    box-shadow: 0 0 0 2px rgba(244,119,0,.08);
}

.rebeyrat-callback-form button {
    min-height: 45px;
    padding: 12px 16px;
    border: 0;
    border-radius: 2px;
    background: var(--reb-orange);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .03em;
    cursor: pointer;
}

.rebeyrat-callback-form button:hover {
    background: var(--reb-dark);
}

.rebeyrat-callback-form button:disabled {
    opacity: .6;
    cursor: wait;
}

.rebeyrat-callback-note {
    margin-top: 3px;
    color: #929292;
    font-size: 10px;
    line-height: 1.4;
}

.rebeyrat-chat-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 20px 11px;
    background: #fff;
}

.rebeyrat-chat-typing[hidden] {
    display: none;
}

.rebeyrat-chat-mini-avatar {
    width: 28px;
    height: 28px;
}

.rebeyrat-chat-mini-avatar img {
    width: 30px;
    transform: translateY(3px);
}

.rebeyrat-chat-dots {
    padding: 9px 12px;
    border-radius: 3px 12px 12px 12px;
    background: var(--reb-soft);
}

.rebeyrat-chat-dots span {
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-right: 2px;
    border-radius: 50%;
    background: #969b9d;
    animation: rebTyping 1s infinite ease-in-out;
}

.rebeyrat-chat-dots span:nth-child(2) { animation-delay: .12s; }
.rebeyrat-chat-dots span:nth-child(3) { animation-delay: .24s; margin-right: 0; }

@keyframes rebTyping {
    0%, 80%, 100% { opacity: .25; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}

.rebeyrat-chat-footer {
    min-height: 41px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: var(--reb-dark);
}

.rebeyrat-chat-link {
    padding: 2px 0;
    border: 0;
    background: none;
    color: rgba(255,255,255,.68);
    font-size: 11px;
    cursor: pointer;
}

.rebeyrat-chat-link:hover:not(:disabled) {
    color: #fff;
}

.rebeyrat-chat-link:disabled {
    opacity: .25;
    cursor: default;
}

@media (max-width: 600px) {
    #rebeyrat-chat-trigger {
        right: 15px;
        bottom: 15px;
        width: 64px;
        height: 64px;
    }

    .rebeyrat-chat-trigger-icon {
        width: 52px;
        height: 52px;
    }

    .rebeyrat-chat-trigger-icon img {
        width: 64px;
    }

    #rebeyrat-chat-teaser {
        right: 15px;
        bottom: 94px;
        width: min(260px, calc(100vw - 30px));
    }

    #rebeyrat-chat-window {
        top: 10px;
        right: 10px;
        bottom: 10px;
        left: 10px;
        width: auto;
        height: auto;
        max-width: none;
        max-height: none;
        border-radius: 5px;
    }

    .rebeyrat-chat-header {
        min-height: 70px;
        padding: 12px 15px;
    }

    #rebeyrat-chat-messages {
        padding: 17px 15px;
    }

    #rebeyrat-chat-choices {
        max-height: 37vh;
        padding: 12px 15px 14px;
    }

    .rebeyrat-choice {
        padding: 13px 38px 13px 13px;
        font-size: 13px;
    }

    .rebeyrat-chat-footer {
        padding: 10px 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #rebeyrat-chat *,
    #rebeyrat-chat *::before,
    #rebeyrat-chat *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

@media (max-width: 600px) {
    #rebeyrat-chat:has(#rebeyrat-chat-window.is-open)
    #rebeyrat-chat-trigger {
        display: none;
    }
}
