@use "sass:color";
@use "sass:map";
@use "sass:math";
@use "sass:string";
@use "./animate";
@use "./minireset";

$use-vars: false !default;
$use-important: false !default;

@function ifImportant(){
    @if $use-important { @return '!important'; }
    @else { @return ''; }
}

$fullscreen-vertical-koef: 2 !default;

$chat-square-btn: false !default;
$chat-consistent-border-radius: false !default;
$chat-consistent-border-radius-messages: false !default;
$chat-first-message-at-top: false !default;

$btn-accessory-foldable-width: 0 !default;
$btn-accessory-foldable-width-mobile: $btn-accessory-foldable-width !default;

$background: #CECECE !default;
$light: #EEEEEE !default;
$medium-grey: #8D8D8D !default;
$grey: #A0A0A0 !default;
$black: #454545 !default;
$white: #ffffff !default;
$dark-grey: #454545 !default;
$action-color: #1fffb4 !default;
$attachment-border: 2px solid $background !default;
$link-color: if(sass($use-vars): $dark-grey; else: color.adjust($black, $lightness: 20%)) !default;

$action-shadow-color: if(sass($use-vars): rgba($action-color, 0.8); else: color.adjust(color.adjust($action-color, $lightness: -10%), $alpha: -0.8)) !default;
$action-color-disabled: if(sass($use-vars): $medium-grey; else: color.adjust($action-color, $saturation: -100%)) !default;
$link-color-hover: if(sass($use-vars): #111111; else: color.adjust($link-color, $lightness: -20%));

$action-shadow: 0px 0px 10px 3px rgba(0, 0, 0, 0.2), 0px 0px 4px 1px $action-shadow-color !default;

$tooltip-bg: $dark-grey !default;
$tooltip-text: $white !default;
$uploader-width: 36px !default;
$tooltip-box-shadow: 0px 0px 10px 5px rgba(0, 0, 0, 0.1) !default;
$tooltip-font-height-px: 10px !default;

$chat-z-index: 999 !default;

$chat-font-family: BlinkMacSystemFont, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif !default;
$chat-font-weight: 400 !default;
$chat-font-color: $dark-grey !default;
$chat-font-size: 14px !default;
$chat-line-height: $chat-font-size * 1.25 !default;

$chat-placeholder-color: $background !default;

$chat-margin: 12px !default;
$chat-radius: 20px !default;
$accessory-margin: 4px !default;
$chat-history-margin: $chat-margin + $accessory-margin !default;
$scrollbar-width: 10px !default;

$msg-in-background: $light !default;
$msg-out-background: $background !default;
$msg-in-color: $dark-grey !default;
$msg-out-color: $dark-grey !default;
$msg-padding: #{$chat-margin} #{math.div($chat-margin, 0.7)} #{$chat-margin} #{math.div($chat-margin, 0.7)} !default;
$msg-border-radius: $chat-radius !default;

$chat-margin-fullscreen: 31px !default;

$chat-history-gradient-color: $white !default;

$header-height: 45px !default;
$header-btn-size: $header-height - $chat-margin !default;
$header-btn-width: 33px !default;
$header-btn-color: $chat-font-color !default;

$chat-btn-width: $chat-margin * if(sass($chat-square-btn): 7; else: 6) !default;
$chat-btn-height: $chat-margin * if(sass($chat-square-btn): 7; else: 6) !default;
$chat-btn-width-mobile: $chat-btn-width !default;
$chat-btn-height-mobile: $chat-btn-height !default;

$chat-btn-right: if(sass($chat-square-btn): 0; else: $chat-btn-width * 0.5) !default;
$chat-btn-bottom: if(sass($chat-square-btn): 0; else: $chat-btn-height * 0.5) !default;
$chat-btn-right-mobile: $chat-btn-right !default;
$chat-btn-bottom-mobile: $chat-btn-bottom !default;

$chat-btn-background: $background !default;
$chat-btn-fill: $chat-font-color !default;

$chat-width: 385px !default;
$chat-height: 88% !default;
$chat-bottom: 0 !default;
$chat-right: 0 !default;
$chat-bottom-mobile: $chat-bottom !default;
$chat-right-mobile: $chat-right !default;
$chat-border-radius: $chat-radius !default;
$chat-fullscreen-width: $chat-width * 2 !default;

$media-mobile-threshold: 425px !default;
$media-tablet-threshold: $chat-fullscreen-width !default;
$media-desktop-md-threshold: 900px !default;
$media-desktop-lg-threshold: 1200px !default;

$lightbox-min-width: $media-mobile-threshold !default;

$chat-background: $white !default;
$chat-box-shadow: 0px 0px 10px 5px rgba(0, 0, 0, 0.1) !default;
$chat-message-side-margin: $chat-margin * 2.5 !default;
$chat-message-max-size: 325px - $chat-message-side-margin;
$chat-message-large-font-size: $chat-font-size * 2 !default;

$chat-history-background: $background !default;
$chat-history-border-radius: $chat-border-radius if(sass($chat-consistent-border-radius): $chat-border-radius; else: 0) 0 0 !default;


$chat-composer-send-btn-ready-color: $action-color !default;
$chat-send-btn-color: $background !default;
$send-btn-icon-color: $dark-grey !default;
$chat-composer-font-size-in-px: 15px !default;
$chat-composer-line-height: 1.2 !default;

$chat-composer-send-btn-size: (
    ($chat-composer-font-size-in-px * $chat-composer-line-height) + (2 * $chat-margin)
) !default;
$chat-composer-height: $chat-composer-send-btn-size + (2 * $chat-margin) !default;
$send-btn-border-radius: math.div($chat-composer-send-btn-size, 2) !default;
$chat-composer-border-radius: 15px !default;
$chat-composer-background: $light !default;

$chat-composer-min-height: ($chat-composer-font-size-in-px * $chat-composer-line-height) + 1px;

$chat-qr-border: 2px solid $dark-grey !default;
$chat-qr-font-size: $chat-font-size !default;
$chat-qr-large-font-size: 20px !default;
$chat-qr-border-hover: 2px solid $background !default;
$chat-qr-text-color: $chat-font-color !default;
$chat-qr-text-color-hover: $chat-font-color !default;
$chat-qr-background: $white !default;
$chat-qr-background-hover: $background !default;
$chat-qr-padding-top-bottom: math.div($chat-margin, 1.5) !default;
$chat-qr-padding: $chat-qr-padding-top-bottom $chat-margin $chat-qr-padding-top-bottom $chat-margin !default;
$chat-qr-large-padding-top-bottom: $chat-qr-padding-top-bottom - math.div($chat-qr-large-font-size - $chat-qr-font-size, 2) !default;
$chat-qr-large-padding: $chat-qr-large-padding-top-bottom $chat-margin $chat-qr-large-padding-top-bottom $chat-margin !default;
$chat-qr-border-radius: $chat-radius !default;

$button-icon: 'emoji' !default;
$button-icon-color: black !default;

$svg-icons: (
    chat-bubble-oval-left-outline: '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"><path stroke-linecap="round" stroke-linejoin="round" d="M12 20.25c4.97 0 9-3.694 9-8.25s-4.03-8.25-9-8.25S3 7.444 3 12c0 2.104.859 4.023 2.273 5.48.432.447.74 1.04.586 1.641a4.483 4.483 0 01-.923 1.785A5.969 5.969 0 006 21c1.282 0 2.47-.402 3.445-1.087.81.22 1.668.337 2.555.337z" /></svg>',
    chat-bubble-oval-left-ellipsis-outline: '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"><path stroke-linecap="round" stroke-linejoin="round" d="M8.625 12a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H8.25m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H12m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0h-.375M21 12c0 4.556-4.03 8.25-9 8.25a9.764 9.764 0 01-2.555-.337A5.972 5.972 0 015.41 20.97a5.969 5.969 0 01-.474-.065 4.48 4.48 0 00.978-2.025c.09-.457-.133-.901-.467-1.226C3.93 16.178 3 14.189 3 12c0-4.556 4.03-8.25 9-8.25s9 3.694 9 8.25z" /></svg>',
    chat-bubble-left-ellipsis-outline: '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"><path stroke-linecap="round" stroke-linejoin="round" d="M8.625 9.75a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H8.25m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H12m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0h-.375m-13.5 3.01c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.184-4.183a1.14 1.14 0 01.778-.332 48.294 48.294 0 005.83-.498c1.585-.233 2.708-1.626 2.708-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z" /></svg>',
    chat-bubble-bottom-center-text-outline: '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"><path stroke-linecap="round" stroke-linejoin="round" d="M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14 0 01.865-.501 48.172 48.172 0 003.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z" /></svg>',
    chat-bubble-oval-left-solid: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-6 h-6"><path fill-rule="evenodd" d="M5.337 21.718a6.707 6.707 0 01-.533-.074.75.75 0 01-.44-1.223 3.73 3.73 0 00.814-1.686c.023-.115-.022-.317-.254-.543C3.274 16.587 2.25 14.41 2.25 12c0-5.03 4.428-9 9.75-9s9.75 3.97 9.75 9c0 5.03-4.428 9-9.75 9-.833 0-1.643-.097-2.417-.279a6.721 6.721 0 01-4.246.997z" clip-rule="evenodd" /></svg>',
    chat-bubble-oval-left-ellipsis-solid: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-6 h-6"><path fill-rule="evenodd" d="M4.804 21.644A6.707 6.707 0 006 21.75a6.721 6.721 0 003.583-1.029c.774.182 1.584.279 2.417.279 5.322 0 9.75-3.97 9.75-9 0-5.03-4.428-9-9.75-9s-9.75 3.97-9.75 9c0 2.409 1.025 4.587 2.674 6.192.232.226.277.428.254.543a3.73 3.73 0 01-.814 1.686.75.75 0 00.44 1.223zM8.25 10.875a1.125 1.125 0 100 2.25 1.125 1.125 0 000-2.25zM10.875 12a1.125 1.125 0 112.25 0 1.125 1.125 0 01-2.25 0zm4.875-1.125a1.125 1.125 0 100 2.25 1.125 1.125 0 000-2.25z" clip-rule="evenodd" /></svg>',
    chat-bubble-left-ellipsis-solid: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-6 h-6"><path fill-rule="evenodd" d="M12 2.25c-2.429 0-4.817.178-7.152.521C2.87 3.061 1.5 4.795 1.5 6.741v6.018c0 1.946 1.37 3.68 3.348 3.97.877.129 1.761.234 2.652.316V21a.75.75 0 001.28.53l4.184-4.183a.39.39 0 01.266-.112c2.006-.05 3.982-.22 5.922-.506 1.978-.29 3.348-2.023 3.348-3.97V6.741c0-1.947-1.37-3.68-3.348-3.97A49.145 49.145 0 0012 2.25zM8.25 8.625a1.125 1.125 0 100 2.25 1.125 1.125 0 000-2.25zm2.625 1.125a1.125 1.125 0 112.25 0 1.125 1.125 0 01-2.25 0zm4.875-1.125a1.125 1.125 0 100 2.25 1.125 1.125 0 000-2.25z" clip-rule="evenodd" /></svg>',
);

$fs-escape-chars: (
    ' ': '%20',
    '\'': '%22',
    '"': '%27',
    '#': '%23',
    '/': '%2F',
    ':': '%3A',
    '(': '%28',
    ')': '%29',
    '%': '%25',
    '<': '%3C',
    '>': '%3E',
    '\\': '%5C',
    '^': '%5E',
    '{': '%7B',
    '|': '%7C',
    '}': '%7D',
);

/**
 * Helper to get URL-escaped inline SVG code
 */
@function svg($name) {
    // Check if icon exists
    @if not map.has-key($svg-icons, $name) {
        @return $name;
    }

    // Get icon data
    $icon-map: map.get($svg-icons, $name);

    $escaped-string: '';
    $unquote-icon: string.unquote($icon-map);
    // Loop through each character in string
    @for $i from 1 through string.length($unquote-icon) {
        $char: string.slice($unquote-icon, $i, $i);

        // Check if character is in symbol map
        $char-lookup: map.get($fs-escape-chars, $char);

        // If it is, use escaped version
        @if $char-lookup != null {
            $char: $char-lookup;
        }

        // Append character to escaped string
        $escaped-string: $escaped-string + $char;
    }

    // Return inline SVG data
    @return url('data:image/svg+xml, #{$escaped-string} ');
}

/**
 * Convert all icons into custom properties
 */

:root {
  @each $name, $code in $svg-icons {
    #{$name}: #{svg($name)};
  }
}

@if $button-icon != "emoji" {
    .wb-expand-btn .wb-animator {
        visibility: hidden;

        &::after {
            visibility: visible;
          content: "";
          /* Import inline SVG */
          -webkit-mask-image: svg($button-icon);
          mask-image: svg($button-icon);

          -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;

          -webkit-mask-size: contain;
          mask-size: contain;

          -webkit-mask-position: center;
          mask-position: center;
          position: absolute;
          top:0;
          right:0;
          left:0;
          bottom:0;
          margin: auto;
          width: 30px;
          height: 30px;
          background: currentColor;
          color: $button-icon-color;
        }
    }
}

$event-margin: 5px !default;

$chat-carousel-border-color: $light !default;
$chat-carousel-background: $white !default;
$chat-carousel-card-width: math.div($chat-width, 1.5) !default;
$chat-carousel-btn-color: $black !default;
$chat-carousel-btn-color-hover: $medium-grey !default;
$chat-carousel-border-radius: $chat-margin !default;

$state-background: $white !default;
$chat-btn-list-btn-color: $black !default;
$chat-btn-list-btn-hover-bg: $background !default;
$chat-btn-list-btn-hover-color: $black !default;

$chat-load-more-color: $link-color !default;

$chat-notification-dot-size: 24px;

$menu-button-color: $chat-font-color !default;
$menu-button-bg: $white !default;
$menu-button-padding: $chat-margin !default;
$menu-button-border: none !default;
$menu-button-radius: $chat-radius !default;

$duration: 800ms !default;
$event-appear-duration: 600ms !default;
$hover-duration: 300ms !default;
$timing: cubic-bezier(0.85, 0, 0.15, 1);

$notification-dot-color: $action-color !default;

$max-tooltip-height: 600px !default;

$circle-diameter: 12px !default;
$tracking-code-color: #da1039 !default;
$tracking-code-bg: #f5f5f5 !default;

$tooltip-bg: #454545 !default;
$tooltip-radius: 6px !default;
$tooltip-padding: 6px !default;

$meta-left-padding: $circle-diameter + ($accessory-margin * 2);

$md-font-family: Palatino, Georgia, serif !default;

$wb-online-status-fill : #1FFFB4 !default;
$wb-offline-status-fill : #454545 !default;

$persona-at-first-size: 22px !default;
$persona-at-last-size: 16px !default;
$persona-margin: 4px !default;
$persona-name-font-size: 0.7rem !default;
$persona-name-font-color: $grey !default;

$branding-color: #8D8D8D !default;

@include animate.animate;

.wb {
    @include minireset.minireset;

    img.emj {
        height: 1em;
        width: 1em;
        margin: 0 .05em 0 .1em;
        vertical-align: -0.1em;
        display: inline;
    }

    -webkit-backface-visibility: hidden; /* Safari */
    backface-visibility: hidden;

    &, button {
        font-family: $chat-font-family;
        font-weight: $chat-font-weight;
    }

    color: $chat-font-color #{ifImportant()};
    font-size: $chat-font-size;

    position: fixed;
    bottom: $chat-bottom;
    right: $chat-right;

    @media screen and (max-width: $media-mobile-threshold) {
        bottom: $chat-bottom-mobile;
        right: $chat-right-mobile;
    }

    z-index: $chat-z-index;

    background-color: $background #{ifImportant()};

    -webkit-box-shadow: $chat-box-shadow;
    box-shadow: $chat-box-shadow;

    border-radius: $chat-border-radius $chat-border-radius if(sass($chat-consistent-border-radius): $chat-border-radius; else: 0)
    $chat-border-radius;

    // linear transform with same duration as expand animation fixes hover state (longer will make a little bounce effect)
    -webkit-transition: box-shadow $duration $timing, top $duration $timing, left $duration $timing, margin-right $duration $timing,
        width $duration $timing, height $duration $timing, bottom $duration $timing, right $duration $timing,
        background-color $duration $timing, -webkit-transform $duration linear, border-radius $duration $timing;
    transition: box-shadow $duration $timing, top $duration $timing, left $duration $timing, width $duration $timing, margin-right $duration $timing,
        height $duration $timing, bottom $duration $timing, right $duration $timing, background-color $duration $timing,
        -webkit-transform $duration linear, border-radius $duration $timing;
    -o-transition: box-shadow $duration $timing, top $duration $timing, left $duration $timing, width $duration $timing, margin-right $duration $timing,
        height $duration $timing, bottom $duration $timing, right $duration $timing, background-color $duration $timing,
        transform $duration linear, border-radius $duration $timing;
    transition: box-shadow $duration $timing, top $duration $timing, left $duration $timing, width $duration $timing, margin-right $duration $timing,
        height $duration $timing, bottom $duration $timing, right $duration $timing, background-color $duration $timing,
        transform $duration linear, border-radius $duration $timing;
    transition: box-shadow $duration $timing, top $duration $timing, left $duration $timing, width $duration $timing, margin-right $duration $timing,
        height $duration $timing, bottom $duration $timing, right $duration $timing, background-color $duration $timing,
        transform $duration linear, -webkit-transform $duration linear, border-radius $duration $timing;

    &.wb-hidden {
        width: 0;
        height: 0;

        .wb-expand-btn {
            overflow: hidden;
        }

        &:not(.wb-just-initialized) {
            .wb-expand-btn {
                opacity: 0;
            }
        }
    }

    &.wb-closed,
    &.wb-hidden:not(.wb-anim-finished) {
        -webkit-transition: box-shadow $duration $timing $duration, top $duration $timing $duration, margin-right $duration $timing $duration,
            left $duration $timing $duration, width $duration $timing $duration, height $duration $timing $duration,
            bottom $duration $timing $duration, right $duration $timing $duration,
            background-color $duration $timing $duration, border-radius $duration $timing $duration;

        transition: box-shadow $duration $timing $duration, top $duration $timing $duration, margin-right $duration $timing $duration,
            left $duration $timing $duration, width $duration $timing $duration, height $duration $timing $duration,
            bottom $duration $timing $duration, right $duration $timing $duration,
            background-color $duration $timing $duration, border-radius $duration $timing $duration;

        -o-transition: box-shadow $duration $timing $duration, top $duration $timing $duration, margin-right $duration $timing $duration,
            left $duration $timing $duration, width $duration $timing $duration, height $duration $timing $duration,
            bottom $duration $timing $duration, right $duration $timing $duration,
            background-color $duration $timing $duration, border-radius $duration $timing $duration;

        transition: box-shadow $duration $timing $duration, top $duration $timing $duration, margin-right $duration $timing $duration,
            left $duration $timing $duration, width $duration $timing $duration, height $duration $timing $duration,
            bottom $duration $timing $duration, right $duration $timing $duration,
            background-color $duration $timing $duration, border-radius $duration $timing $duration;

        transition: box-shadow $duration $timing $duration, top $duration $timing $duration, margin-right $duration $timing $duration,
            left $duration $timing $duration, width $duration $timing $duration, height $duration $timing $duration,
            bottom $duration $timing $duration, right $duration $timing $duration,
            background-color $duration $timing $duration, border-radius $duration $timing $duration;
    }

    &.wb-closed {
        width: $chat-btn-width;
        height: $chat-btn-height;

        @if not $chat-square-btn {
            // the floating rounded (and colored) button
            border-radius: math.div($chat-btn-height, 2);
        }

        background-color: $chat-btn-background #{ifImportant()};
        bottom: $chat-btn-bottom;
        right: $chat-btn-right;

        @media screen and (max-width: $media-mobile-threshold) {
            width: $chat-btn-width-mobile;
            height: $chat-btn-height-mobile;
            bottom: $chat-btn-bottom-mobile;
            right: $chat-btn-right-mobile;
        }

        .wb-expand-btn {
            z-index: 1;
            background-color: $chat-btn-background #{ifImportant()};
        }

        .wb-btn-accessory-foldable:not(.wb-btn-accessory-folded) {
            width: $btn-accessory-foldable-width;
            opacity: 1;

            @media screen and (max-width: $media-mobile-threshold) {
                width: $btn-accessory-foldable-width-mobile;
            }
        }

        &.wb-anim-finished .wb-expand-btn:hover {
            -webkit-transform: scale(1.2);
            -ms-transform: scale(1.2);
            transform: scale(1.2);
        }

        &.wb-anim-finished .wb-main-menu {
            // weird chrome hover fix
            display: none;
        }
        &.wb-terminated-with-message {

            width: $chat-btn-width * 3;

            .wb-expand-btn {
                justify-content: center;
            }

            .wb-animator {
                position: absolute;
                left: 0px;
                top: 0px;
                bottom: 0;
                right: 0;
                width: auto;
                z-index: 1;

                .wb-anim-animated{
                    position: relative;
                    left: -55px;
                }
            }

            .wb-termination-message {
                height: 100%;
                display: flex;
                justify-items: center;
                align-items: center;
                color: $black;
                font-family: 'Rubik';
                font-weight: 400;
                font-size: 16px;
                position: absolute;
                left: 50%;
                margin-left: -30px;
            }
            &.is-fullscreen{

                @media screen and (max-width: $media-tablet-threshold) {
                    margin-right: 0px;
                    right: 10px;
                    left: 10px;
                    width: auto;
                }
            }
        }
    }

    &.wb-wrapped-teaser.wb-open {
        position: relative;
        width: 100%;
        height: 100%;
        box-shadow: none;
    }

    &.wb-wrapped-teaser {
        z-index: 0;

        .wb-textarea-wrapper {
            justify-content: right;
            background: none;
        }

        .wb-textarea-container {
            flex-grow: 0;
        }

        .wb-history-list {
            overflow: hidden;
        }
    }

    &.has-wrapped-teaser.wb-closed {
        &.wb-closed {
            width: 0;
            height: 0;
            box-shadow: none;
        }

        .wb-expand-btn {
            display: none;
        }
    }

    .wb-online-status {
        fill: $wb-online-status-fill
    }

    .wb-offline-status {
        fill: $wb-offline-status-fill
    }

    .wb-expand-btn {
        display: flex;
        justify-content: space-between;
        opacity: 1;

        -webkit-transition: -webkit-transform $hover-duration ease-out,
            opacity #{$duration * 0.5} $timing #{$duration * 0.5}, background-color $duration $timing $duration;
        transition: -webkit-transform $hover-duration ease-out, opacity #{$duration * 0.5} $timing #{$duration * 0.5},
            background-color $duration $timing $duration;
        -o-transition: transform $hover-duration ease-out, opacity #{$duration * 0.5} $timing #{$duration * 0.5},
            background-color $duration $timing $duration;
        transition: transform $hover-duration ease-out, opacity #{$duration * 0.5} $timing #{$duration * 0.5},
            background-color $duration $timing $duration;
        transition: transform $hover-duration ease-out, -webkit-transform $hover-duration ease-out,
            opacity #{$duration * 0.5} $timing #{$duration * 0.5}, background-color $duration $timing $duration;

        // with button at right bottom corner
        @if $chat-square-btn {
            -webkit-transform-origin: right bottom;
            -ms-transform-origin: right bottom;
            transform-origin: right bottom;
        }
    }

    .wb-expand-btn > * {
        -webkit-transition: width $duration $timing $duration, opacity $duration $timing $duration;
        -o-transition: width $duration $timing $duration, opacity $duration $timing $duration;
        transition: width $duration $timing $duration, opacity $duration $timing $duration;
    }

    .wb-expand-btn > .wb-animator {
        margin: 0 auto;
    }

    .wb-btn-accessory-foldable {
        width: 0;
        opacity: 0;
        overflow: hidden;
    }

    &.wb-open:not(.wb-anim-finished) .wb-expand-btn > .wb-btn-accessory-foldable {
        -webkit-transition: width $duration $timing, opacity $duration $timing;
        -o-transition: width $duration $timing, opacity $duration $timing;
        transition: width $duration $timing, opacity $duration $timing;
    }

    &.wb-open {
        height: $chat-height;
        width: $chat-width;
        max-width: calc(100vw - #{$chat-margin * 2});

        @media screen and (max-width: $media-mobile-threshold) {
            height: 100%;
            width: 100%;
            max-width: 100%;
        }

        .wb-expand-btn {
            background-color: transparent #{ifImportant()};

            -webkit-transition: -webkit-transform $hover-duration ease-out $hover-duration,
                opacity $duration $timing $duration, background-color $duration $timing;
            transition: -webkit-transform $hover-duration ease-out $hover-duration, opacity $duration $timing $duration,
                background-color $duration $timing;
            -o-transition: transform $hover-duration ease-out $hover-duration, opacity $duration $timing $duration,
                background-color $duration $timing;
            transition: transform $hover-duration ease-out $hover-duration, opacity $duration $timing $duration,
                background-color $duration $timing;
            transition: transform $hover-duration ease-out $hover-duration,
                -webkit-transform $hover-duration ease-out $hover-duration, opacity $duration $timing $duration,
                background-color $duration $timing;
        }
    }

    &.wb-maximized.wb-open {
        right: 50%;
        width: $chat-fullscreen-width;
        margin-right: -$chat-fullscreen-width * 0.5;

        bottom: (100% - $chat-height) * 0.5;

        @media screen and (max-width: $media-tablet-threshold) {
            bottom: 0;
            height: 100%;
            width: 100%;
            margin-right: -50%;
            max-width: 100%;
        }
        // #####
    }

    &.wb-maximizable.wb-maximized,
    &.wb-maximizable.wb-open.wb-anim-finished,
    &.is-fullscreen {
        -webkit-transform-origin: center center;
        -ms-transform-origin: center center;
        transform-origin: center center;
    }

    &.is-fullscreen {
        top: 4% * $fullscreen-vertical-koef;
        bottom: 4% * $fullscreen-vertical-koef;
        height: auto;

        &,
        &.wb-closed,
        &.wb-hidden {
            right: 50%;
            width: $chat-fullscreen-width;
            margin-right: -$chat-fullscreen-width * 0.5;
        }

        @media screen and (max-width: $media-desktop-lg-threshold) {
            top: 2% * $fullscreen-vertical-koef;
            bottom: 2% * $fullscreen-vertical-koef;
        }

        @media screen and (max-width: $media-desktop-md-threshold) {
            top: 1% * $fullscreen-vertical-koef;
            bottom: 1% * $fullscreen-vertical-koef;
        }

        @media screen and (max-width: $media-tablet-threshold) {
            top: 0;
            bottom: 0;
            width: 100%;
            margin-right: -50%;
            max-width: 100%;
        }

        @media screen and (min-width: $media-tablet-threshold) {
            .wb-text-message, .wb-btn-template-text, .wb-btn-template {
                max-width: 425px;
            }
        }

        &,
        &.wb-closed,
        &.wb-closed.wb-anim-finished:hover {
            -webkit-transform: scale(1);
            -ms-transform: scale(1);
            transform: scale(1);
        }

        &.wb-open:not(.wb-anim-finished) {
            box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, 0);
        }

        &.wb-closed,
        &.wb-hidden {
            background-color: rgba($background, 0);
            box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, 0);
            top: 40%;
            bottom: 40%;
            height: auto;
        }

        .wb-header {
            padding-left: $chat-margin-fullscreen - $chat-margin;
        }

        .wb-state-view {
            left: 70px;
        }

        .wb-header-controls {
            margin-right: $chat-margin-fullscreen - ($chat-margin * 1.3);
        }

        .wb-header-btn-minimize {
            display: none;
        }

        .wb-history-list, .wb-history-list.wb-scroll-w-0 {
            padding: 60px $chat-margin-fullscreen 0px $chat-margin-fullscreen;
        }

        .wb-textarea-wrapper {
            margin-left: $chat-margin-fullscreen;
            margin-right: $chat-margin-fullscreen;
        }
    }

    .wb-expand-btn.wb-disappear {
        opacity: 0;
    }

    .wb-composer,
    .wb-header,
    .wb-history {
        opacity: 1;
        -webkit-transition: opacity $duration $timing, -webkit-transform $duration $timing $duration;
        transition: opacity $duration $timing, -webkit-transform $duration $timing $duration;
        -o-transition: opacity $duration $timing, transform $duration $timing $duration;
        transition: opacity $duration $timing, transform $duration $timing $duration;
        transition: opacity $duration $timing, transform $duration $timing $duration,
            -webkit-transform $duration $timing $duration;
    }

    &.wb-open.wb-anim-finished .wb-history {
        // no transform delay
        -webkit-transition: opacity #{$duration * 0.25} $timing, -webkit-transform $duration $timing;
        transition: opacity #{$duration * 0.25} $timing, -webkit-transform $duration $timing;
        -o-transition: opacity #{$duration * 0.25} $timing, transform $duration $timing;
        transition: opacity #{$duration * 0.25} $timing, transform $duration $timing;
        transition: opacity #{$duration * 0.25} $timing, transform $duration $timing,
            -webkit-transform $duration $timing;
    }

    &.wb-hidden,
    &.wb-closed {
        .wb-composer,
        .wb-header {
            opacity: 0;
            -webkit-transition: opacity $duration $timing $duration, -webkit-transform $duration $timing;
            transition: opacity $duration $timing $duration, -webkit-transform $duration $timing;
            -o-transition: opacity $duration $timing $duration, transform $duration $timing;
            transition: opacity $duration $timing $duration, transform $duration $timing;
            transition: opacity $duration $timing $duration, transform $duration $timing,
                -webkit-transform $duration $timing;
        }
        .wb-composer {
            -webkit-transform: translateY($chat-composer-height + 9px);
            -ms-transform: translateY($chat-composer-height + 9px);
            transform: translateY($chat-composer-height + 9px);
        }
        .wb-header {
            -webkit-transform: translateY(-$header-height);
            -ms-transform: translateY(-$header-height);
            transform: translateY(-$header-height);
        }
    }

    &.wb-hidden .wb-history,
    &.wb-closed .wb-history,
    .wb-history.wb-slide-out,
    &.wb-open.wb-anim-finished .wb-history.wb-slide-out {
        -webkit-transition: opacity $duration $timing #{$duration * 0.5}, -webkit-transform $duration $timing;
        transition: opacity $duration $timing #{$duration * 0.5}, -webkit-transform $duration $timing;
        -o-transition: opacity $duration $timing #{$duration * 0.5}, transform $duration $timing;
        transition: opacity $duration $timing #{$duration * 0.5}, transform $duration $timing;
        transition: opacity $duration $timing #{$duration * 0.5}, transform $duration $timing,
            -webkit-transform $duration $timing;
        -webkit-transform: translateY(100vh);
        -ms-transform: translateY(100vh);
        transform: translateY(100vh);
        opacity: 0;
    }

    .wb-main-menu {
        opacity: 0;
        -webkit-transition: opacity #{$duration * 0.75} ease #{$duration * 0.25};
        -o-transition: opacity #{$duration * 0.75} ease #{$duration * 0.25};
        transition: opacity #{$duration * 0.75} ease #{$duration * 0.25};

        &.wb-is-active {
            opacity: 1;
            -webkit-transition: opacity $duration ease;
            -o-transition: opacity $duration ease;
            transition: opacity $duration ease;
        }
    }

    .wb-expand-btn {
        cursor: pointer;
        // overflow: hidden;

        width: 100%;
        height: 100%;

        background-color: transparent #{ifImportant()};
        color: $chat-btn-fill #{ifImportant()};

        @if not $chat-square-btn {
            // the floating rounded (and colored) button
            border-radius: $chat-btn-height * 0.5;
        }

        @if $chat-square-btn {
            border-radius: $chat-border-radius
                $chat-border-radius
                if(sass($chat-consistent-border-radius): $chat-border-radius; else: 0)
                $chat-border-radius;
        }

        border-style: none #{ifImportant()};
        outline: none;
        padding: 0 #{ifImportant()};

        position: absolute;

        bottom: 0;
        right: 0;

        .wb-animator {
            width: min($chat-btn-height, $chat-btn-width);
            height: 100%;
        }

        @media screen and (max-width: $media-mobile-threshold) {
            .wb-animator {
                width: min($chat-btn-height-mobile, $chat-btn-width-mobile);
            }
        }
    }

    .wb-has-cursor-pointer {
        cursor: pointer;
    }

    .wb-gen-img.wb-has-cursor-pointer:focus {
        outline: none;
    }

    .wb-chat {
        position: absolute;
        z-index: 1;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }

    .wb-teaser {
        position: absolute;
        bottom: 110%;
        right: 0;
        transition: opacity #{$duration * 1} $timing #{$duration * 0.5};

        &.wb-hidden {
            opacity: 0;
            bottom: 60%;
        }

        &.wb-open {
            opacity: 1;
        }
    }

    .wb-generic-teaser {
        display: flex;
        flex-direction: column;
        z-index: 5;
        transition: bottom $event-appear-duration ease-in-out, opacity #{$event-appear-duration * 0.6} ease-in #{$event-appear-duration * 0.2};

        &.wb-open {
            bottom: 75%;
        }

        @if $chat-square-btn {
            width: 180px;
            right: 0;
        } @else {
            width: 180px;
            right: -20px;
        }

        // show close button
        &:hover {
            .wb-teaser-button-container {
                opacity: 1;
                transition: opacity 0.3s ease-out;
            }
            // fix for button:hover animation
            bottom: 75% !important;
        }

        .wb-teaser-button-container {
            opacity: 0;
            transition: opacity 0.3s ease-out;
            text-align: right;
        }

        .wb-lb-close-btn {
            padding-right: 2em;
            padding-bottom: 8px;
            position: relative;
            right: 0;

            .wb-close-icon {
                background-color: $background;
                opacity: 0.8;
                border-radius: 100%;
                width: 30px;
                height: 30px;

                .wb-close-icon-bar {
                    top: 14px;
                    width: 21px;
                    height: 2px;
                    left: 4px;
                }
            }
        }
        .wb-event {
            position: relative;
            -webkit-animation: none;
            animation: none;
        }
        .wb-text-message,
        .wb-quick-reply {
            box-shadow: $action-shadow;
            position: relative;
        }
    }

    // button hover -> teaser animates up
    &:hover .wb-generic-teaser {
        transition: bottom #{$duration * 0.25} ease-in-out, opacity #{$event-appear-duration * 0.6} ease-in #{$event-appear-duration * 0.2};
        bottom: 115%;
    }

    @keyframes teaserClose {
        from {
            bottom: 110%;
            opacity: 1;
        }
        to {
            bottom: 250%;
            opacity: 0;
        }
    }

    .wb-teaser-is-closing {
        animation-name: teaserClose;
        animation-duration: 1s;
    }

    .wb-bot-indicator {
        width: 15px;
        height: 15px;
        background-color: $action-color;
        border-radius: 100%;
        position: absolute !important;
        left: -27px;
        bottom: 5px;
        box-shadow: $action-shadow;
    }

    &:not(.wb-hidden) .wb-chat-container {
        border-radius: $chat-border-radius $chat-border-radius
            if(sass($chat-consistent-border-radius): $chat-border-radius; else: 0) $chat-border-radius;

        // linear transform with same duration as expand animation fixes hover state (longer will make a little bounce effect)
        -webkit-transition: border-radius $duration $timing;
        transition: border-radius $duration $timing;
        -o-transition: border-radius $duration $timing;
        transition: border-radius $duration $timing;
        transition: border-radius $duration $timing;
    }

    &.wb-closed:not(.wb-anim-finished) .wb-chat-container {
        -webkit-transition: border-radius $duration $timing $duration;
        transition: border-radius $duration $timing $duration;
        -o-transition: border-radius $duration $timing $duration;
        transition: border-radius $duration $timing $duration;
        transition: border-radius $duration $timing $duration;
    }

    &.wb-closed .wb-chat-container {
        @if not $chat-square-btn {
            // the floating rounded (and colored) button
            border-radius: math.div($chat-btn-height, 2);
        }
    }

    .wb-chat-container {
        display: flex;
        flex: 1;
        flex-grow: 1;
        flex-direction: column;
        height: 100%;
        width: 100%;

        border-radius: $chat-border-radius $chat-border-radius
            if(sass($chat-consistent-border-radius): $chat-border-radius; else: 0) $chat-border-radius;

        overflow: hidden;
    }

    .wb-history {
        flex: 1;
        flex-grow: 1;
        margin: 0;
        border-radius: 0;
        position: relative;
    }

    @mixin content-behind-history {
        position: absolute;
        top: $header-height;
        left: 0;
        right: 0;
        bottom: $chat-composer-height;
    }

    .wb-main-menu, .wb-loader-wrapper {
        @include content-behind-history;

        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;

        width: 75%;
        margin: auto;
    }

    .wb-menu-btn {
        cursor: pointer;
        padding: $menu-button-padding #{ifImportant()};
        border: $menu-button-border #{ifImportant()};
        border-radius: $menu-button-radius;
        width: 90%;
        margin: math.div($chat-margin, 2) #{ifImportant()};
        cursor: pointer;

        @if $use-important {
            font-family: inherit !important;
            font-weight: normal !important;
            font-size: $chat-font-size !important;
        }

        -webkit-transition: 500ms cubic-bezier(0.33, 1, 0.68, 1);
        -o-transition: 500ms cubic-bezier(0.33, 1, 0.68, 1);
        transition: 500ms cubic-bezier(0.33, 1, 0.68, 1);

        &.wb-menu-btn-primary {
            color: $menu-button-color #{ifImportant()};
            background: $menu-button-bg #{ifImportant()};
            margin: math.div($chat-margin, 2) #{ifImportant()};
        }

        &.wb-menu-btn-secondary {
            color: $menu-button-color #{ifImportant()};
            background: transparent #{ifImportant()};
            margin: math.div($chat-margin, 1.5) #{ifImportant()};
        }

        &:hover {
            width: 100%;

            -webkit-transition: 600ms cubic-bezier(0.33, 1, 0.68, 1);
            -o-transition: 600ms cubic-bezier(0.33, 1, 0.68, 1);
            transition: 600ms cubic-bezier(0.33, 1, 0.68, 1);

            -webkit-box-shadow: $chat-box-shadow #{ifImportant()};
            box-shadow: $chat-box-shadow #{ifImportant()};
        }

        &:focus {
            outline: none;
            border-color: transparent;
            box-shadow: none;
        }
    }

    .wb-creds-container {
        margin-top: 5vh;
    }

    .wb-credit-link {
        color: $chat-font-color;
        text-decoration: none;
        font-size: math.div($chat-font-size, 1.2);
        cursor: pointer;
    }

    .wb-history-gradient {
        position: absolute;
        top: 0;
        display: flex;
        flex: 1;
        background-image: linear-gradient($chat-history-gradient-color, rgba($chat-history-gradient-color, 0));
        z-index: 2;
        height: $chat-margin * 6;
        width: 100%;
        border-radius: $chat-history-border-radius;
        pointer-events: none;
    }

    .wb-history-background {
        width: 100%;
        background: $state-background;
        position: absolute;
        right: 0;
        top: 0;
        bottom: -$chat-radius;
        padding-bottom: $chat-radius;
        display: flex;
        flex: 1;
        flex-grow: 1;
        flex-direction: column;
        justify-content: if(sass($chat-first-message-at-top): flex-start; else: flex-end);
        border-radius: $chat-history-border-radius;

        -webkit-box-shadow: $chat-box-shadow;
        box-shadow: $chat-box-shadow;
    }

    .wb-header {
        height: $header-height;
        // overflow: hidden; // to keep components inside
        position: relative;
    }

    .wb-header-logo {
        margin: 1px $chat-margin 0;
        display: flex;
        align-items: center;
        height: $header-height;

        .wb-animator {
            justify-content: flex-start;
            font-size: math.div($header-height, 2);
        }
    }

    .wb-header-controls {
        position: absolute;
        text-align: right;
        right: $chat-margin * 0.3;
        top: 50%;
        height: $header-btn-size;
        margin-top: math.div(-$header-btn-size, 2) + 1px;

        display: flex;
        align-items: center;

        button {
            color: $header-btn-color #{ifImportant()};
            background: none #{ifImportant()};
            border: none #{ifImportant()};
            cursor: pointer;
            height: $header-btn-size;
            width: $header-btn-width;
            margin: 0 1.5px 0 1.5px #{ifImportant()};
            padding: 0 #{ifImportant()};
            text-align: center;

            position: relative;
            display: inline-block;

            &:focus {
                outline: none;
                border: none;
            }

            @if $use-important {
                box-shadow: none;
                -webkit-box-shadow: none;
            }

            &.wb-header-btn-menu {
                margin-right: 4px;
            }
        }

        .wb-home-menu-icon, .wb-menu-icon {
            width: 23px;
            bottom: -2px;
            color: $black;
            vertical-align: top;

            &.disabled-home, &.disabled-menu-icon {
                color: color.adjust($black, $lightness: 20%);
                cursor: default;
            }
        }

        .wb-home-menu-icon {
            padding: 0 3px;
            width: 29px;
        }

        .wb-menu-icon-padded {
            width: 30px;
            padding: 4px;
        }
    }

    .wb-max-icon {
        padding: 4px 3px 4px 1px;
    }

    .wb-menu-icon {
        height: 15px;
        width: 20px;
        margin: 0 auto;
    }

    .wb-menu-icon-bar {
        display: block;

        width: 18px;
        height: 3px;
        background-color: $header-btn-color;
        margin: 3px auto 0;
        border-radius: $chat-border-radius;
        position: relative;

        -webkit-transition: width 0.6s cubic-bezier(0.65, 0, 0.35, 1);
        -o-transition: width 0.6s cubic-bezier(0.65, 0, 0.35, 1);
        transition: width 0.6s cubic-bezier(0.65, 0, 0.35, 1);

        &:first-child {
            margin-top: 0;
        }

        &.wb-menu-icon-minimize {
            top: 6px;
            position: relative;
        }
    }

    .wb-header.wb-with-menu-visible {
        .wb-menu-icon-bar.wb-menu-icon-bar-n1 {
            width: 8px;
            -webkit-transform: translatex(-5px);
            -ms-transform: translatex(-5px);
            transform: translatex(-5px);
            -webkit-transition: -webkit-transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
            transition: -webkit-transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
            -o-transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
            transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
            transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1),
                -webkit-transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
        }

        .wb-menu-icon-bar.wb-menu-icon-bar-n2 {
            width: 10px;
            -webkit-transform: translatex(3px);
            -ms-transform: translatex(3px);
            transform: translatex(3px);
            -webkit-transition: -webkit-transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
            transition: -webkit-transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
            -o-transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
            transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
            transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1),
                -webkit-transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
        }

        .wb-menu-icon-bar.wb-menu-icon-bar-n3 {
            width: 10px;
            -webkit-transform: translatex(-4px);
            -ms-transform: translatex(-4px);
            transform: translatex(-4px);
            -webkit-transition: -webkit-transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
            transition: -webkit-transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
            -o-transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
            transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
            transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1),
                -webkit-transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
        }
    }

    .wb-composer {
        position: relative;

        background-color: $state-background;
        border-radius: $chat-border-radius $chat-border-radius
            if(sass($chat-consistent-border-radius): $chat-border-radius; else: 0) $chat-border-radius;
    }

    .wb-composer-cta {
        flex-grow: 1;

    }

    .wb-textarea-wrapper {
        display: flex;
        align-items: center;
        position: relative;

        background-color: $chat-composer-background;
        border-radius: $chat-composer-border-radius $send-btn-border-radius
            if(sass($chat-consistent-border-radius): $chat-composer-border-radius; else: 0) $chat-composer-border-radius;
        margin: $chat-margin;

        max-height: (3 * $chat-composer-min-height) + (2 * $chat-margin);
        min-height: $chat-composer-min-height + (2 * $chat-margin);

        -webkit--transition: min-height $event-appear-duration $timing, max-height $event-appear-duration $timing;
        transition: min-height $event-appear-duration $timing, max-height $event-appear-duration $timing;

        &.type-none {
            max-height: $chat-margin;
            min-height: $chat-margin;
        }
    }

    .wb-textarea-container {
        flex-grow: 1;
        position: relative;
        margin: $chat-margin;
        padding-left: $chat-margin;
    }

    .wb-textarea {
        resize: none;
        font-family: inherit;
        color: inherit #{ifImportant()};
        display: block;
        overflow: auto;
        border: none #{ifImportant()};
        font-size: $chat-composer-font-size-in-px;
        background-color: transparent #{ifImportant()};

        width: 100%;

        line-height: #{$chat-composer-line-height}em;

        min-height: ($chat-composer-font-size-in-px * $chat-composer-line-height) + 1px;

        outline: none #{ifImportant()};
        -webkit-box-shadow: none #{ifImportant()};
        box-shadow: none #{ifImportant()};

        &:active,
        &:focus {
            outline: none;
        }
    }

    input.wb-textarea {
        height: ($chat-composer-font-size-in-px * $chat-composer-line-height) + 1px;
    }

    .wb-textarea-max-length {

        box-shadow: inset 0 0 4px 2px $chat-composer-background;
        border-radius: $chat-composer-border-radius;
        background-color: rgba(255, 0, 0, 0.3);

        animation: maxLengthGlow 0.25s ease-in-out infinite;

        @keyframes maxLengthGlow {
            0%, 100% {
                background-color: rgba(255, 0, 0, 0);
            }
            50% {
                background-color: rgba(255, 0, 0, 0.3);
            }
        }
    }

    input.wb-textarea[type=password] {
        font-family: Helvetica, Arial, sans-serif;
    }

    input::-webkit-input-placeholder, textarea::-webkit-input-placeholder {
        color: $chat-placeholder-color;
    }
    input:-moz-placeholder,
    textarea:-moz-placeholder {
        color: $chat-placeholder-color;
    }

    .wb-placeholder,
    .wb-textarea-container.wb-placeholder {
        color: $chat-placeholder-color;
    }

    .wb-textarea-container.wb-placeholder {
        cursor: pointer;
    }

    button.wb-send-btn {
        background-color: $chat-send-btn-color #{ifImportant()};
        border-style: none #{ifImportant()};
        outline: none #{ifImportant()};

        cursor: pointer;

        font-size: $chat-composer-font-size-in-px;
        border-radius: $send-btn-border-radius $send-btn-border-radius
            if(sass($chat-consistent-border-radius): $send-btn-border-radius; else: 0) $send-btn-border-radius;
        width: $chat-composer-send-btn-size;
        height: $chat-composer-send-btn-size;

        line-height: #{$chat-composer-line-height}em;

        padding: 0.3em 0 0 0 #{ifImportant()};

        text-align: center;

        -webkit-transition: 400ms ease-in;
        -o-transition: 400ms ease-in;
        transition: 400ms ease-in;

        &.wb-send-ready {
            background-color: $chat-composer-send-btn-ready-color;
            -webkit-transition: 400ms ease-in;
            -o-transition: 400ms ease-in;
            transition: 400ms ease-in;
        }

        @if $use-important {
            box-shadow: none;
            -webkit-box-shadow: none;
        }
    }

    @if $use-important {
        button.wb-send-btn:hover {
            background-color: $chat-send-btn-color #{ifImportant()};
            border-style: none #{ifImportant()};
            outline: none #{ifImportant()};
            padding: 0.3em 0 0 0 #{ifImportant()};
            box-shadow: none;
            -webkit-box-shadow: none;
        }
    }

    .wb-composer-send-btn-icon {
        fill: $send-btn-icon-color;
        margin: 0 auto;
    }

    .wb-history-list {
        padding: 60px #{$chat-history-margin - $accessory-margin - $scrollbar-width} 0px #{$chat-history-margin - $accessory-margin};
        width: 100%;
        overflow-x: hidden;
        overflow-y: auto;
        max-height: 100%;
        border-radius: $chat-radius $chat-radius 0 0;
        min-height: if(sass($chat-first-message-at-top): 100%; else: auto);
        scrollbar-width: $scrollbar-width;

        &.wb-scroll-w-0 {
            padding-right: #{$chat-history-margin - $accessory-margin};
        }

        // &.wb-has-tracking {
        //     padding-top: 60px + $max-tooltip-height;
        // }

        &::-webkit-scrollbar {
            background: transparent;
            width: $scrollbar-width;
        }

        /* background of the scrollbar except button or resizer */
        &::-webkit-scrollbar-track {
            background-color: transparent;
        }
        &::-webkit-scrollbar-track:hover {
            background-color:#f4f4f4
        }

        /* scrollbar itself */
        &::-webkit-scrollbar-thumb {
            background-color: $light;
            border-radius: $scrollbar-width * 0.5;
            border: 3px solid #fff;
        }
        &::-webkit-scrollbar-thumb:hover {
            background-color: $grey;
            border: 2px solid #f4f4f4
        }

        /* set button(top and bottom of the scrollbar) */
        &::-webkit-scrollbar-button {
            display:none
        }
    }

    .wb-event {
        text-align: left;
        margin: $event-margin 0 #{$event-margin - $accessory-margin} 0;
        -webkit-animation: event-animation-webkit $event-appear-duration;
        animation: event-animation $event-appear-duration;
        -webkit-transform-style: preserve-3d;
        -webkit-backface-visibility: hidden;
        z-index: 1;
        will-change: opacity;

        &.is-from-user {
            .wb-event-wrap {
                text-align: right;
            }

            .wb-event-cont {
                flex-direction: row-reverse;
            }

            .wb-event-acc .wb-circle {
                background-color: $msg-out-background;
            }

            .wb-meta {
                text-align: right;
                padding-left: 0;
                padding-right: $meta-left-padding;
            }
        }
    }

    .wb-persona-name {
        padding-top: 0.5rem;
        line-height: 1rem;
        padding-left: $persona-at-last-size + $persona-margin;
        font-size: $persona-name-font-size;
        color: $persona-name-font-color;
    }

    .wb-event-cont > .wb-persona-name {
        padding-top: 0;
        padding-left: 0;
    }

    .wb-name-cont.wb-event-cont {
        padding: 0.5rem 0 0;
        display: flex;
        align-items: center;

        .wb-persona-img {
            margin-bottom: 0;
        }

        .wb-event-avatar:empty {
            display: none;
        }

        .wb-persona-img {
            width: $persona-at-first-size;
            height: $persona-at-first-size;
            border-radius: $persona-at-first-size * 0.5;
            font-size: $persona-at-first-size * 0.8;
        }

        .wb-event-avatar {
            display: block;
            margin-left: 0;
            width: auto;
        }
    }

    .wb-event-avatar {
        display: block;
        width: $persona-at-last-size + $persona-margin;
        margin-left: -$persona-margin;
    }

    .wb-persona-img {
        width: $persona-at-last-size;
        height: $persona-at-last-size;
        margin-right: $persona-margin;
        border-radius: $persona-at-last-size * 0.5;
        background-size: cover;
        background-color: $msg-in-background;
        margin-bottom: $accessory-margin;
        display: flex;
        align-items: center;
        text-align: center;
        justify-content: center;
        font-size: $persona-at-last-size * 0.8;
    }

    .wb-event-acc {
        .wb-tip {
            display: block;
        }

        .wb-circle {
            background-color: $msg-in-background;
            display: block;
            margin: $accessory-margin;
        }
    }

    .wb-event-cont {
        display: flex;
        flex-direction: row;
        align-items: flex-end;
    }

    .wb-event:last-child {
        margin-bottom: 0;

        .wb-event-wrap {
            padding: 0;
        }
    }

    .wb-event-wrap {
        text-align: left;
        padding-bottom: $accessory-margin;
        max-width: 100%;

        &:empty {
            padding: 0;
            display: none;
        }
    }

    .wb-meta {
        padding-left: $meta-left-padding;
    }

    @-webkit-keyframes event-animation-webkit {
        0% {
            opacity: 0%;
        }
        95% {
            opacity: 100%;
        }
        100% {
            opacity: 100%;
        }
    }
    @keyframes event-animation {
        0% {
            opacity: 0%;
        }
        95% {
            opacity: 100%;
        }
        100% {
            opacity: 100%;
        }
    }

    .wb-text-message {
        display: inline-block;
        background: $msg-in-background;
        color: $msg-in-color;
        border-radius: $msg-border-radius;
        padding: $msg-padding;
        border-bottom-left-radius: if(sass($chat-consistent-border-radius-messages): $msg-border-radius; else: 0);
        word-break: break-word;
        overflow-wrap: break-word;
        white-space: pre-wrap;
        margin-right: $chat-message-side-margin;
        max-width: $chat-message-max-size;
        line-height: $chat-line-height;

        &.wb-is-large {
            font-size: $chat-message-large-font-size;
        }

        a, a:visited, a:active {
            color: $msg-in-color;
            text-decoration: underline;
        }

        a:hover {
            text-decoration: none;
        }
    }

    .is-from-user .wb-text-message {
        background: $msg-out-background;
        color: $msg-out-color;
        border-bottom-left-radius: $msg-border-radius;
        border-bottom-right-radius: if(sass($chat-consistent-border-radius-messages): $msg-border-radius; else: 0);
        margin-right: 0;
        margin-left: $chat-message-side-margin;

        a, a:visited, a:active {
            color: $msg-out-color;
        }
    }

    .wb-quick-replies {
        display: flex;
        padding-top: $chat-margin;
        justify-content: flex-start;
        flex-wrap: wrap;

        &.wb-qr-nums.wb-qr-6.wb-qr-l-6,
        &.wb-qr-emojis.wb-qr-l-5 {

            .wb-quick-reply {
                font-size: $chat-qr-large-font-size;
                min-width: 38px;
                padding: $chat-qr-large-padding;
            }

            img.emj {
                width: $chat-qr-large-font-size;
                height: $chat-qr-large-font-size;
            }
        }

        &.wb-qr-emojis img.emj {
            margin: 0;
        }
    }

    .wb-quick-reply {
        border: $chat-qr-border #{ifImportant()};
        background: $chat-qr-background #{ifImportant()};
        border-radius: $chat-qr-border-radius;
        color: $chat-qr-text-color #{ifImportant()};
        padding: $chat-qr-padding #{ifImportant()};
        cursor: pointer;
        margin: #{math.div($chat-margin, 2) - 1} #{ifImportant()};
        white-space: pre-line;

        font-family: $chat-font-family #{ifImportant()};
        font-size: $chat-qr-font-size #{ifImportant()};

        -webkit-transition: 300ms cubic-bezier(0.33, 1, 0.68, 1);
        -o-transition: 300ms cubic-bezier(0.33, 1, 0.68, 1);
        transition: 300ms cubic-bezier(0.33, 1, 0.68, 1);

        &:focus {
            outline: none;
        }

        &[disabled] {
            opacity: 0.5;
            cursor: default;
        }

        &:not([disabled]):hover {
            -webkit-transition: 300ms cubic-bezier(0.33, 1, 0.68, 1);
            -o-transition: 300ms cubic-bezier(0.33, 1, 0.68, 1);
            transition: 300ms cubic-bezier(0.33, 1, 0.68, 1);
            border: $chat-qr-border-hover;
            background: $chat-qr-background-hover;
            color: $chat-qr-text-color-hover;
        }

        @if $use-important {
            box-shadow: none !important;
            -webkit-box-shadow: none !important;
        }
    }

    .wb-att {
        margin-right: $chat-message-side-margin;
        max-width: $chat-message-max-size - ($chat-message-side-margin * 2);
    }

    .is-from-user .wb-att {
        margin-right: 0;
        padding-left: $chat-message-side-margin;
        margin-left: auto;
    }

    .wb-att-file {
        position: relative;
        display: block;
        border: $attachment-border;
        width: math.div($chat-width, 2.5);
        padding: $chat-margin * 2;
        border-radius: $chat-margin;
        border-bottom-left-radius: if(sass($chat-consistent-border-radius-messages): $chat-margin; else: 0);
    }

    .wb-att-ext {
        position: absolute;
        left: 35px;
        right: 35px;
        text-align: center;
        top: 50%;
        height: 18px;
        margin-top: -10px;
        display: block;
        color: #000;
        font-weight: bold;
        font-size: 16px;
        text-transform: uppercase;

        &::after {
            content: "⬇";
            position: absolute;
            top: 30px;
            right: -6px;
            width: 22px;
            height: 22px;
            border-radius: 11px;
            background-color: $action-color;
            color: $black;
            text-align: center;
            display: inline-block;

            font-weight: bold;
            font-size: 16px;
            line-height: 22px;
            font-family: BlinkMacSystemFont,-apple-system,"Segoe UI",Arial,sans-serif;
        }
    }

    .is-from-user .wb-att-file {
        border-bottom-left-radius: $chat-margin;
        border-bottom-right-radius: if(sass($chat-consistent-border-radius-messages): $chat-margin; else: 0);
    }

    .wb-att-img {
        img {
            display: block;
            width: 100%;
            border-radius: $chat-margin;
            border-bottom-left-radius: if(sass($chat-consistent-border-radius-messages): $chat-margin; else: 0);
        }
    }

    .is-from-user .wb-att-img {
        img {
            border-bottom-left-radius: $chat-margin;
            border-bottom-right-radius: if(sass($chat-consistent-border-radius-messages): $chat-margin; else: 0);
        }
    }

    .wb-att-gen {
        overflow: hidden;
        white-space: nowrap;
        margin: $chat-margin #{- $chat-margin};
        padding-left: calc((min(100vw, #{$chat-width}) - #{$chat-carousel-card-width}) / 2);
        position: relative;
    }

    .wb-gen-card {
        margin-bottom: 2px;
        display: inline-block;
        width: $chat-carousel-card-width;
        vertical-align: top;
    }

    .wb-gen-card-blur {
        filter: blur(2px);
        -webkit-filter: blur(2px);
    }

    .wb-gen-card-current {
        filter: blur(0);
        -webkit-filter: blur(0);
    }

    .wb-gen-img {
        display: block;
        border-top-left-radius: $chat-carousel-border-radius;
        border-top-right-radius: $chat-carousel-border-radius;
        border: 1px solid $chat-carousel-border-color;
        border-bottom: none;
        overflow: hidden;
        position: relative;
        width: 100%;
        background-size: cover;
        background-position-x: 50%;
        background-position-y: 50%;
        background-repeat: no-repeat;
    }

    .wb-aspect-square .wb-gen-img {
        height: $chat-carousel-card-width;
    }

    .wb-aspect-horizontal .wb-gen-img {
        height: math.div($chat-carousel-card-width, 1.91);
    }

    .wb-gen-img + .wb-gen-body {
        border-top-left-radius: 0;
        border-top-right-radius: 0;
    }

    .wb-gen-body {
        border: 1px solid $chat-carousel-border-color;
        background: $chat-carousel-background;
        border-radius: $chat-carousel-border-radius;
        padding: $chat-margin;

        color: $chat-font-color;

        word-break: break-word;
        overflow-wrap: break-word;
        white-space: pre-wrap;

        text-align: left;
    }

    .wb-gen-title {
        font-weight: bold;
        text-decoration: inherit;
        color: inherit;
    }

    .wb-gen-subtitle {
        margin-top: math.div($chat-margin, 2);
        color: inherit;

        a, a:visited, a:active {
            text-decoration: underline;
            color: inherit;
        }

        a:hover {
            text-decoration: none;
            color: inherit;
        }
    }

    .wb-gen-control {
        cursor: pointer;

        background: none;
        border: none;
        outline: none;

        &:hover {

            svg {
                fill: $chat-carousel-btn-color-hover;
            }
        }

        position: absolute;
        top: 45%;
        height: $chat-margin * 5;
        width: $chat-margin * 5;
        margin-top: -$chat-margin * 2.5;
        z-index: 1;
        font-weight: bold;
        text-align: center;

        .wb-gen-arrow {
            height: $chat-margin * 3;
            width: $chat-margin * 3;
            margin: 0 auto;

            display: flex;
            align-items: center;
            justify-content: center;
        }

        svg {
            height: $chat-margin * 1.8;
            width: $chat-margin * 1.8;
            fill: $chat-carousel-btn-color;
        }
    }

    .wb-gen-control:disabled {
        opacity: 0;
    }

    .wb-gen-left {
        left: 0;
    }

    .wb-gen-right {
        right: 0;
    }

    .wb-gen-stripe {
        -webkit-transition: -webkit-transform 300ms, filter 300ms;
        transition: -webkit-transform 300ms, filter 300ms;
        -o-transition: transform 300ms, filter 300ms;
        transition: transform 300ms, filter 300ms;
        transition: transform 300ms, -webkit-transform 300ms, filter 300ms;
    }

    @for $i from 0 through 40 {
        .wb-pos-#{$i} {
            margin: 0 auto;
            transform: translateX(#{($chat-carousel-card-width + $chat-margin) * -$i});
        }
    }

    @keyframes cssHide {
        to {
            width: 0;
            height: 0;
            overflow: hidden;
            padding: 0;
        }
    }
    @-webkit-keyframes cssHide {
        to {
            width: 0;
            height: 0;
            visibility: hidden;
            padding: 0;
        }
    }

    .wb-typing {
        position: relative;
        display: inline-block;
        background: $msg-in-background;
        border-radius: $chat-radius $chat-radius $chat-radius
            if(sass($chat-consistent-border-radius-messages): $chat-radius; else: 0);
        padding: $msg-padding;
        line-height: $chat-line-height;

        -moz-animation: cssHide 0s ease-in 19s forwards;
        /* Firefox */
        -webkit-animation: cssHide 0s ease-in 19s forwards;
        /* Safari and Chrome */
        -o-animation: cssHide 0s ease-in 19s forwards;
        /* Opera */
        animation: cssHide 0s ease-in 19s forwards;
        -webkit-animation-fill-mode: forwards;
        animation-fill-mode: forwards;
    }

    div.wb-typing-bar, div:empty.wb-typing-bar {
        display: inline-block;
        width: 7px;
        height: 7px;
        border-radius: $chat-radius;
        background-color: $chat-font-color;
        margin: 2px 4px;
    }

    @-webkit-keyframes r-bars-loading-animation {
        0% {
            -webkit-transform: scale(1);
            transform: scale(1);
        }
        20% {
            -webkit-transform: translateY(-5px);
            transform: translateY(-5px);
        }
        40% {
            -webkit-transform: scale(1);
            transform: scale(1);
        }
    }
    @keyframes r-bars-loading-animation {
        0% {
            -webkit-transform: scale(1);
            transform: scale(1);
        }
        20% {
            -webkit-transform: translateY(-5px);
            transform: translateY(-5px);
        }
        40% {
            -webkit-transform: scale(1);
            transform: scale(1);
        }
    }

    .wb-typing-n1 {
        -webkit-animation: r-bars-loading-animation 1s ease-in-out infinite;
        animation: r-bars-loading-animation 1s ease-in-out infinite;
    }
    .wb-typing-n2 {
        -webkit-animation: r-bars-loading-animation 1s ease-in-out 0.09s infinite;
        animation: r-bars-loading-animation 1s ease-in-out 0.09s infinite;
    }
    .wb-typing-n3 {
        -webkit-animation: r-bars-loading-animation 1s ease-in-out 0.18s infinite;
        animation: r-bars-loading-animation 1s ease-in-out 0.18s infinite;
    }

    .wb-animator {
        font-size: 2em;
        height: 2em;
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        align-items: center;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        justify-content: center;

        & > i {
            display: flex;
            font-style: normal;
        }

        opacity: 1;
        -webkit-transition: opacity 500ms cubic-bezier(0.65, 0, 0.35, 1), transform $duration $timing $duration;
        -o-transition: opacity 500ms cubic-bezier(0.65, 0, 0.35, 1), transform $duration $timing $duration;
        transition: opacity 500ms cubic-bezier(0.65, 0, 0.35, 1), transform $duration $timing $duration;

        &:active {
            opacity: 0.25;
            -webkit-transition-duration: 50ms;
            -o-transition-duration: 50ms;
            transition-duration: 50ms;
        }

        &:focus {
            opacity: 0.25;
            -webkit-transition-duration: 50ms;
            -o-transition-duration: 50ms;
            transition-duration: 50ms;
        }
    }

    .wb-btn-list {
        .wb-btn-list-btn {
            display: block;
            text-align: center;

            font-family: $chat-font-family;
            font-size: $chat-font-size;

            &,
            &:active,
            &:visited {
                text-decoration: none;
                color: $chat-btn-list-btn-color #{ifImportant()};
            }

            &[disabled] {
                opacity: 0.5;
                cursor: default;
            }

            &:not([disabled]):hover {
                color: $chat-btn-list-btn-hover-color #{ifImportant()};
                background: $chat-btn-list-btn-hover-bg #{ifImportant()};
            }

            &:focus {
                outline: none;
            }

            -webkit-transition: 300ms cubic-bezier(0.33, 1, 0.68, 1);
            -o-transition: 300ms cubic-bezier(0.33, 1, 0.68, 1);
            transition: 300ms cubic-bezier(0.33, 1, 0.68, 1);

            background-color: $chat-carousel-background #{ifImportant()};
            border-bottom: 0;
            outline: none #{ifImportant()};
            padding: $chat-margin #{ifImportant()};
            white-space: nowrap;
            cursor: pointer;
            display: block;
            position: relative;
            overflow: hidden;
            text-overflow: ellipsis;
            width: 100%;

            border-top: 1px solid $msg-in-background #{ifImportant()};
            border-left: none #{ifImportant()};
            border-right: none #{ifImportant()};
            border-bottom: none #{ifImportant()};
        }

        .wb-btn-list-btn:last-child {
            border-bottom-left-radius: $chat-carousel-border-radius #{ifImportant()};
            border-bottom-right-radius: $chat-carousel-border-radius #{ifImportant()};
        }
    }

    .wb-gen-button-list .wb-btn-list {
        margin: $chat-margin #{-$chat-margin} #{-$chat-margin} #{-$chat-margin};

        .wb-btn-list-btn {
            border-color: $chat-carousel-border-color;
        }
    }

    .wb-btn-template .wb-btn-list {
        border-bottom-left-radius: $chat-carousel-border-radius;
        border-bottom-right-radius: $chat-carousel-border-radius;
        border: 1px solid $msg-in-background;

        .wb-btn-list-btn:first-child {
            border-top: none;
        }
    }

    .wb-btn-template {
        margin-right: $chat-message-side-margin;
        max-width: $chat-message-max-size;
    }

    .is-from-user .wb-btn-template {
        margin-left: auto;
        margin-right: 0;
    }

    .wb-btn-template-text {
        @extend .wb-text-message;
        border-radius: $chat-margin $chat-margin 0 0;
        width: 100%;
    }

    .is-from-user .wb-btn-template-text {
        margin-left: 0;
        border-bottom-left-radius: 0;
    }

    .wb-state-view {
        font-size: 1em;
        position: absolute;
        left: $header-height;
        right: $header-height * 2; // keep space for two menu buttons
        top: calc(#{math.div($header-height, 2)} - 0.6em);

        &.is-connected.is-dissapearing {
            -webkit-animation: hide-state-status 3s forwards;
            animation: hide-state-status 3s forwards;
        }
        &.is-connecting {
            -webkit-animation: pulsate-state-status 3s infinite;
            animation: pulsate-state-status 3s infinite;
        }
    }

    @keyframes hide-state-status {
        0% {
            opacity: 1;
        }
        85% {
            opacity: 1;
        }
        100% {
            opacity: 0;
        }
    }

    @-webkit-keyframes hide-state-status {
        0% {
            opacity: 1;
        }
        85% {
            opacity: 1;
        }
        100% {
            opacity: 0;
        }
    }

    @keyframes pulsate-state-status {
        0% {
            opacity: 1;
        }
        50% {
            opacity: 1;
        }
        75% {
            opacity: 0;
        }
        100% {
            opacity: 1;
        }
    }

    @-webkit-keyframes pulsate-state-status {
        0% {
            opacity: 1;
        }
        50% {
            opacity: 1;
        }
        75% {
            opacity: 0;
        }
        100% {
            opacity: 1;
        }
    }

    .wb-expand-btn.wb-disappear .wb-notif-dot, .wb-notif-dot.wb-disappear, &.wb-hidden .wb-notif-dot {
        // opacity: 0;
        -webkit-transform: scale(0);
        -ms-transform: scale(0);
        transform: scale(0);
    }

    // &.wb-hidden .wb-notif-dot {
    //     width: 0;
    //     height: 0;

    //     &:not(.wb-just-initialized) {
    //         .wb-expand-btn {
    //             opacity: 0;
    //         }
    //     }
    // }

    .wb-notif-dot {
        width: $chat-notification-dot-size;
        height: $chat-notification-dot-size;
        border-radius: $chat-border-radius;
        background-color: $notification-dot-color;
        position: absolute;
        z-index: 1;
        right: #{$chat-btn-width - $chat-margin * 2.8};
        top: #{- (math.div($chat-notification-dot-size, 2))};

        display: flex;
        align-items: center;
        justify-content: center;

        .wb-notif-num {
            font-weight: bold;
        }

        &:not(.wb-disappear) {
            -webkit-transition: all 400ms cubic-bezier(0.47, 1.64, 0.41, 0.8) 3s;
            -o-transition: all 400ms cubic-bezier(0.47, 1.64, 0.41, 0.8) 3s;
            transition: all 400ms cubic-bezier(0.47, 1.64, 0.41, 0.8) 3s;
            -webkit-transform-origin: center center;
            -ms-transform-origin: center center;
            transform-origin: center center;
        }

        &.wb-disappear {
            -webkit-transition: all 400ms cubic-bezier(0.47, 1.64, 0.41, 0.8);
            -o-transition: all 400ms cubic-bezier(0.47, 1.64, 0.41, 0.8);
            transition: all 400ms cubic-bezier(0.47, 1.64, 0.41, 0.8);
            -webkit-transform-origin: center center;
            -ms-transform-origin: center center;
            transform-origin: center center;
        }
    }

    .wb-uploader {
        position: relative;
    }

    .wb-uploader-btn {
        display: inline-block;
        padding: $chat-margin * 0.75;
        cursor: pointer;
        width: $uploader-width;

        svg {
            width: $uploader-width - ($chat-margin * 1.5);
            height: $uploader-width - ($chat-margin * 1.5);
        }
    }

    .wb-uploader-tooltip {
        position: absolute;
        width: $chat-width - ($chat-margin * 4);
        bottom: 100%;
        right: -($chat-composer-send-btn-size);
    }

    .wb-uploader-tooltip-arrow {
        height: 10px;
        margin: 0 #{$chat-composer-send-btn-size + math.div($uploader-width, 2) - 7px} 0 auto;
        position: relative;
        text-align: center;
        width: 14px;
        z-index: 4;
    }

    .wb-uploader-tooltip-bubble {
        background: $tooltip-bg;
        color: $tooltip-text;
        padding: $chat-margin;
        border-radius: $chat-margin;
        box-shadow: $tooltip-box-shadow;
        -webkit-box-shadow: $tooltip-box-shadow;
        font-size: $tooltip-font-height-px;
        text-align: center;
    }

    .wb-triangle {
        border-color: $tooltip-bg transparent transparent transparent;
        border-style: solid;
        border-width: 10px 7px 0;
        height: 0;
        left: 0;
        position: absolute;
        top: 0;
        width: 0;
    }

    .wb-progress-bar {
        height: $chat-border-radius;
        top: 0;
        left: 0;
        right: 0;
        position: absolute;
        overflow: hidden;
        border-radius: $chat-border-radius $chat-border-radius 0 0;
    }

    .wb-progress-runner {
        background-color: $action-color;
        height: 4px;
        border-radius: 1px;
    }

    .wb-history-drop-zone,
    .wb-drop-zone-bg {
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        z-index: -100;
    }

    .wb-history-drop-zone.wb-active {
        z-index: 3;
    }

    .wb-drop-zone-bg {
        background: $white;
        opacity: 0.9;
        border-radius: $chat-border-radius;
    }

    .wb-drop-zone-text {
        position: absolute;
        border-radius: $chat-border-radius;
        border: 4px dashed $chat-font-color;
        left: $chat-margin * 2;
        top: $chat-margin * 2;
        right: $chat-margin * 2;
        bottom: $chat-margin * 2;
        text-align: center;
        display: flex;
        justify-content: center;
        flex-direction: column;
        font-size: 2em;
    }

    .wb-circle {
        width: $circle-diameter;
        height: $circle-diameter;
        border-radius: $circle-diameter * 0.5;
        background-color: $light;
        display: inline-block;
    }


    .wb-tip {
        position: relative;
        display: inline-block;
    }

    .wb-tip-cont {
        text-align: left;
        font-size: 0.75rem;
        position: absolute;
        max-height: $max-tooltip-height;
        bottom: 0px;
        // min-width: 120px;
        white-space: inherit;
        overflow: hidden auto;
        display: block;
        border: 3px solid $tooltip-bg;
        background-color: $tooltip-bg;
        border-radius: $tooltip-radius;
        margin-bottom: 6px;
        color: #fafafa;
        padding: $tooltip-padding;

        code {
            background-color: transparent;
            color: #f67785;
        }

        pre {
            font-size: 0.625rem;
            max-height: $max-tooltip-height - ($tooltip-padding * 2);
        }
    }

    .wb-tip.wb-down .wb-tip-cont {
        margin-bottom: auto;
        margin-top: 6px;
        bottom: auto;
        top: 0px
    }

    .wb-tip-wrap {
        position: absolute;
        display: block;

        bottom: 100%;
        right: 0;
        left: 0;

        z-index: 1000;

        text-align: center;
    }

    .wb-tip.wb-down .wb-tip-wrap {
        top: 100%;
        bottom: auto;
    }

    .wb-tip-arrow {
        position: absolute;
        left: 50%;
        margin-left: -6px;
        bottom: 0;

        width: 0;
        height: 0;
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-top: 6px solid $tooltip-bg;
    }

    .wb-tip.wb-down .wb-tip-arrow {
        bottom: auto;
        top: 0;
        border-top: none;
        border-bottom: 6px solid $tooltip-bg;
    }

    code {
        font-size: 0.75rem;
        background: $tracking-code-bg;
        color: $tracking-code-color;
    }

    .wb-nlp {
        display: inline-block;
        background-color: $action-color;
        color: $black;
        border-radius: $tooltip-radius;
        padding: #{$tooltip-padding * 0.5} $tooltip-padding;
        margin: 2px;
        font-size: 0.75rem;

        &:first-child {
            margin-left: 0;
        }
    }

    .wb-tip:first-child ,.wb-tip:first-child > .wb-nlp {
        margin-left: 0;
    }

    .wb-nlp.wb-intent {
        &.wb-lighter {
            background-color: $light;
            color: $dark-grey;
        }
    }

    .wb-nlp.wb-entity {
        background-color: $dark-grey;
        color: $white;
        &.wb-lighter {
            background-color: $action-color;
            color: $black;
        }
    }

    .wb-intent span {
        font-size: 1.5rem;
        line-height: 1rem;
        vertical-align: middle;
        display: inline-block;
        margin: -2px #{$tooltip-padding * 0.5} -2px 0;
        margin-right: #{$tooltip-padding * 0.5};
    }

    div:empty {
        display: block;
    }

    span:empty {
        display: inline;
    }

    .wb-load-more {
        color: $chat-load-more-color;
        cursor: pointer;
        font-size: 0.9em;

        &:hover {
            text-decoration: underline;
        }
    }

    .wb-message-section-time {
        text-align: center;
        color: $grey;
        font-size: 0.75em;
        width: 100%;
        padding-top: 8px;
    }

    .wb-branding {
        width:100%;
        text-align: center;
        margin-bottom:4px;
        margin-top:-8px;
        font-size: 0.625rem;
        color: $branding-color;
    }

    .wb-fcs:focus-visible,
    .wb-fcs-radius:focus-visible,
    button.wb-fcs:focus-visible,
    .wb-btn-list .wb-btn-list-btn.wb-fcs:focus-visible,
    button.wb-fcs-radius:focus-visible,
    .wb-up-inp:focus-visible + .wb-uploader-btn {
        outline: 2px solid $dark-grey;
        outline-offset: 2px;
    }

    .wb-fcs-radius:focus-visible,
    .wb-up-inp:focus-visible + .wb-uploader-btn {
        border-radius: 4px;
    }
}

/**
 * THERE MAIN ELEMENT ENDS
 */

.wb-void-btn {
    padding: 0;
    border: none;
    background: transparent;
    margin: 0;
    cursor: pointer;
}

.wb-lightbox {
    width: 0;
    height: 0;
    bottom: 0;
    right: 0;
    position: fixed;
    z-index: 999999;
    backdrop-filter: blur(5px);

    transition: 1ms width #{$duration * 0.25} $timing, 1ms height #{$duration * 0.25} $timing;

    &.wb-visible {
        width: 100%;
        height: 100%;

        transition: width 1ms $timing, height 1ms $timing;
    }

    .wb-lb-close-btn {
        display: block;
        position: absolute;
        right: -1px;
        top: -45px;
    }

    &.wb-hidden .wb-lb-close-btn {
        display: none;
    }

    &.wb-hidden .wb-lb-splash {
        -webkit-transition: opacity #{$duration * 0.25} ease-in-out;
        -moz-transition: opacity #{$duration * 0.25} ease-in-out;
        transition: opacity #{$duration * 0.25} ease-in-out;
    }

    .wb-lb-container {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        pointer-events: none;
    }

    .wb-lb-content {
        pointer-events: auto;
        max-width: 85%;
        max-height: 85%;
        margin-top: 40px;
        position: relative;
        text-align: center;
        display:flex;

        @media screen and (max-width: $media-mobile-threshold) {
            width: 100%;
            max-width:100%;
            max-height: 90%;
            margin-top:0;
        }
    }

    .wb-lb-img {
        text-align: center;
        max-width: 100%;
        max-height: 85vh;
        width: auto;
        height: auto;
        margin: 0 auto;
        border-radius: $chat-margin;
        border-bottom-left-radius: if(sass($chat-consistent-border-radius-messages): $chat-margin; else: 0);

        @media screen and (max-width: $media-mobile-threshold) {
            max-height: 95vh;
        }
    }

    &.wb-visible .wb-lb-container {
        opacity: 1;
    }

    &.wb-visible .wb-lb-splash {
        opacity: 0.75;
    }

    div:empty {
        display: block;
    }
}

.wb-close-icon {
    width: 20px;
    height: 20px;
    position: relative;

    .wb-close-icon-bar {
        display: block;
        top: 9px;
        width: 20px;
        margin: 0;
        position: absolute;
        background-color: $chat-font-color;
        border-radius: $chat-border-radius;
    }

    .wb-wrapped-container-elem {
        width: 100%;
        height: 100%;
        position: relative;
    }
}

.wb-close-icon.wb-large {
    width: 40px;
    height: 40px;

    .wb-close-icon-bar {
        display: block;
        top: 18px;
        width: 40px;
        height: 4px;
    }
}

.wb-close-icon-bar-n1 {
    transform: rotate(45deg);
}

.wb-close-icon-bar-n2 {
    transform: rotate(-45deg);
}

.wb-lightbox .wb-lb-splash {
    display: block;
    background: #ffffff;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.wb-max-splash {
    position: fixed;
    z-index: $chat-z-index * 0.5;
    display: block;
    background: #ffffff;
    top: 100%;
    left: 100%;
    right: 0;
    bottom: 0;
}

.wb-lightbox .wb-lb-splash,
.wb-lightbox .wb-lb-container,
.wb-max-splash  {
    opacity: 0;
    -webkit-transition: opacity $duration ease-in-out;
    -moz-transition: opacity $duration ease-in-out;
    transition: opacity $duration ease-in-out;
}

.wb.wb-maximizable.wb-maximized + .wb-max-splash {
    opacity: 0.92;
    top: 0;
    left: 0;
}

.wb.wb-maximizable + .wb-max-splash {
    opacity: 0;
}

.wb.wb-maximizable + .wb-max-splash {
    top: 100%;
    left: 100%;
}

.wb.wb-maximizable:not(.wb-closed.wb-anim-finished) + .wb-max-splash.wb-was-maximized {
    top: 0;
    left: 0;
}

.wb-if-c, .wb-md-c {
    -webkit-box-shadow: $chat-box-shadow;
    box-shadow: $chat-box-shadow;
    border-radius: 1rem;
}

.wb-if-c {
    margin: 0;
    padding: 0;
    height: 80vh;
    border: none;

    max-width: 900px;
    width:100%;
    min-width: 60vw;

    @media screen and (max-width: $media-tablet-threshold ) {
        min-width: 85vw;
    }

    @media screen and (max-width: $media-mobile-threshold) {
        min-width: 95vw;
    }

}

.wb-md-c {
    background-color: white;
    color: black;

    font-size: 16px;

    max-width: 800px;
    width:100%;
    min-width: 35vw;

    justify-content: center;
    padding: 4rem;
    padding-top: 2rem;
    box-sizing: border-box;

    @media screen and (max-width: $media-mobile-threshold) {
        padding:1rem;
    }

    overflow-y: auto;

    &,
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    p,
    li,
    td,
    i,
    b,
    strong,
    th {
        font-family: $md-font-family;
        line-height: 1.3em;
        text-align: left;
    }

    li:not(:first-child) {
        margin-top: 1rem;
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        color: $black;
        font-weight: 600;
        line-height: 1.125;
    }

    h1 {
        font-size: 2em;
        margin-bottom: 0.5em;
    }

    h1:not(:first-child) {
        margin-top: 1em;
    }

    h2 {
        font-size: 1.75em;
        margin-bottom: 0.5714em;
    }

    h2:not(:first-child) {
        margin-top: 1.1428em;
    }

    h3 {
        font-size: 1.5em;
        margin-bottom: 0.6666em;
    }

    h3:not(:first-child) {
        margin-top: 1.3333em;
    }

    h4 {
        font-size: 1.25em;
        margin-bottom: 0.8em;
    }

    h5 {
        font-size: 1.125em;
        margin-bottom: 0.8888em;
    }

    h6 {
        font-size: 1em;
        margin-bottom: 1em;
    }

    .md-cont {
        max-width: 600px;
        width:100%;
    }

    img {
        width: 100%;
        display: block;
    }

    p, ul, ol {
        margin: 1rem 0 2rem;
    }

    ul, ol {
        padding: 0 2rem;
    }

    ul li {
        list-style: disc;
    }

    ol li {
        list-style: decimal;
    }

    code, pre {
        background: $light;
    }

    code {
        padding: 0.125rem;
    }

    pre {
        padding: 0.5rem;
        font-size: 0.75em;
        line-height: 1.25em;
    }

    blockquote {
        margin: 0.5rem 0 2rem 0;
        border-left: 0.25rem solid $background;
        font-style: italic;
        padding:  0.25rem 0 0.25rem 1rem;
        font-size: 1.25rem;

        & > *:first-child {
            margin-top: 0rem;
        }

        & > *:last-child {
            margin-bottom: 0rem;
        }
    }

    a, a:visited {
        text-decoration: underline;
        color: $link-color;
    }

    a:hover {
        color: $link-color-hover;
        text-decoration: none;
    }

    /* stretches table to 100%, but keeps the overflow */
    .table-container{
        overflow-x: auto;
    }

    .table {
        width:100%;
        background-color: white;
        color: $black;
        border-spacing: 0;
    }

    .table td,
    .table th {
        border: 1px solid $background;
        border-width: 0 0 1px;
        padding: 0.75em 1em;
        vertical-align: top;
        /* explicit color, so a host framework (eg. bulma dark scheme) cannot
           recolor the cells when the OS switches to a dark theme */
        color: $black;
    }

    .table th {
        color: $black;
    }

    .table th:not([align]) {
        text-align: left;
    }

    .table thead td,
    .table thead th {
        border-width: 0 0 2px;
        color: $black;
    }

    .table tfoot {
        background-color: transparent;
    }

    .table tfoot td,
    .table tfoot th {
        border-width: 2px 0 0;
        color: $black;
    }

    .table tbody tr:last-child td,
    .table tbody tr:last-child th {
        border-bottom-width: 0;
    }

    .table.is-bordered td,
    .table.is-bordered th {
        border-width: 1px;
    }

    .table.is-bordered tr:last-child td,
    .table.is-bordered tr:last-child th {
        border-bottom-width: 1px;
    }

    .table.is-striped tbody tr:not(.is-selected):nth-child(even) {
        background-color: $light;
    }

    div:empty {
        display: block;
    }

}

.wb.prompts-info {
  height: 100%;
  position:relative;
  text-align: left;
}

.wb {
.prompts-info-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    background: none;
    font-size: 15px;
    padding: 0 6px;
}

.prompts-info-number {
    font-weight: bold;
    font-size: 13px;
    margin-left: 2px;
    color: #1fffb4;
}

.prompts-info-tooltip {
    width:75vw;
    height:900px;
    max-height:85vh;

    @media screen and (max-width: $media-mobile-threshold) {
        width:100%;
    }
    color: #fafafa;
    background-color: #454545;
    padding: 18px 16px 12px 16px;
    font-size: 13px;
    display:flex;
    flex-direction: column;
}

.prompts-info-tooltip-content {
    display: flex;
    flex-direction: row;
    gap: 8px;
    width: 100%;
    position:relative;
    height:100%;
}

.prompts-info-list {
    flex: 2 1 0;
    min-width: 0;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.vector-documents-list {
    flex: 1.5 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #eaeaea;
    padding-left: 8px;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    gap: 12px;
}

.vector-documents-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 10px;
    color: #1fffb4;
}

.vector-documents-scroll {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vector-search-prompt-group {
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    background: #333;
    overflow: hidden;
    margin-bottom: 8px;
}

.vector-search-prompt-header {
    background: #2a2a2a;
    padding: 10px 12px;
    border-radius: 8px 8px 0 0;
}

.vector-search-prompt-title {
    font-weight: 600;
    font-size: 13px;
    color: #1fffb4;
    margin-bottom: 6px;
}

.vector-search-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.vector-search-meta-item {
    background: #2a2a2a;
    color: #ccc;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.vector-documents-group {
    max-height: 300px;
    overflow-y: auto;
    padding: 8px 12px 12px 12px;
    background: #333;
}

.vector-document-card {
    padding: 8px 0;
    border-bottom: 1px solid #444;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vector-document-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.vector-document-title {
    font-weight: 600;
    font-size: 12px;
    color: #fafafa;
    line-height: 1.3;
}

.vector-document-snippet {
    font-size: 11px;
    color: #bbb;
    line-height: 1.4;
    margin-top: 2px;
}

.vector-document-source {
    font-size: 10px;
    color: #999;
    margin-top: 4px;
}

.excluded-indicator {
    color: #ff4444;
    font-weight: 600;
}


.vector-documents-empty {
    color: #888;
    font-size: 12px;
    padding: 12px;
}

.message-card {
    white-space: pre-wrap;
    background: #222;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    padding: 12px;
    margin: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.conversation-prompt-group .message-card {
  margin:0px;
  margin-bottom: 10px;
}

.single-prompt .messages .message-card {
    padding: 12px;
}

.conversation-prompt-header {
    background: #2a2a2a;
    border-radius: 6px 6px 0 0;
    padding: 10px 12px;
    margin: -8px -8px 6px -8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.conversation-prompt-header:hover {
    background: #333;
}

.conversation-prompt-title {
    font-size: 12px;
    font-weight: 600;
    color: #1fffb4;
    margin-bottom: 4px;
}

.conversation-toggle-icon {
    display: inline-block;
    transition: transform 0.2s ease;
    font-size: 10px;
    margin-right: 4px;
}

.conversation-metadata {
    display: flex;
    gap: 8px;
    font-size: 10px;
    color: #999;
}

.conversation-meta-item {
    background: #2a2a2a;
    padding: 2px 6px;
    border-radius: 3px;
}

.conversation-messages-group {
    margin-left: 0;
}

.conversation-messages-group .message-card {
    padding: 12px 14px;
}

.conversation-messages-group .message-card:last-child {
    margin-bottom: 0;
}

.conversation-prompt-group {
    margin-bottom: 10px;
    border: 1px solid #222;
    border-radius: 8px;
    padding: 8px;
}


.role-badge {
    font-size: 11px;
    font-weight: 500;
    border-radius: 6px;
    padding: 2px 0;
    margin-right: 8px;
    background: #333;
    color: #fafafa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 68px;
    max-width: 68px;
    text-align: center;
    display: inline-block;
}

.role-badge.system {
    background: #e0e7ff;
    color: #3b4cca;
}
.role-badge.user {
    background: #d1f7ff;
    color: #0077b6;
}
.role-badge.assistant {
    background: #eaffd1;
    color: #2e7d32;
}
.role-badge.result {
    background: #ffe0e0;
    color: #b71c1c;
}
.role-badge.finish {
    background: #f5f5f5;
    color: #888;
}
.prompt-duration {
    color: #aaa;
    font-size: 11px;
}

.prompt-preset-badge {
    display: inline-block;
    font-size: 11px;
    font-family: monospace;
    padding: 1px 7px;
    border-radius: 4px;
    background: #1e2a3a;
    color: #7eaed9;
    border: 1px solid #2e4a6a;
}

.prompt-header-duration {
    display: inline-block;
    font-size: 11px;
    font-family: monospace;
    font-weight: 400;
    padding: 1px 7px;
    border-radius: 4px;
    background: #2a2a2a;
    color: #aaa;
    border: 1px solid #444;
}

.prompt-model-badge {
    display: inline-block;
    font-size: 11px;
    font-family: monospace;
    padding: 1px 7px;
    border-radius: 4px;
    background: #2a2a2a;
    color: #aaa;
    border: 1px solid #444;
}

.tool-choice-badge {
    display: inline-block;
    margin-left: 8px;
    font-size: 11px;
    font-family: monospace;
    padding: 1px 7px;
    border-radius: 4px;
    background: #2a2a2a;
    color: #aaa;
    border: 1px solid #444;

    &--none {
        background: #4a1e1e;
        color: #e37e7e;
        border-color: #7a3a3a;
    }

    &--required {
        background: #1e3a1e;
        color: #7ed97e;
        border-color: #3a6a3a;
    }
}
.role-badge.tools {
    background: #e0f0e0;
    color: #2a6b2a;
}
.role-badge.options {
    background: #1e2a3a;
    color: #7eaed9;
    white-space: nowrap;
}
.role-badge.prompt-error {
    background: #4a1e1e;
    color: #e37e7e;
    border: 1px solid #7a3a3a;
    white-space: nowrap;
}
.options-preview {
    font-size: 11px;
    color: #999;
    font-family: monospace;
}
.options-kv-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.options-kv-row {
    display: flex;
    gap: 8px;
    align-items: baseline;
}
.options-kv-key {
    font-size: 11px;
    color: #7eaed9;
    font-family: monospace;
    min-width: 140px;
}
.options-kv-value {
    font-size: 11px;
    color: #ccc;
    font-family: monospace;
}
.role-badge.tool-call {
    background: #fff4d6;
    color: #9a6700;
}
.role-badge.tool {
    background: #e6e0ff;
    color: #5a3ec8;
}

.message-card.tool-call,
.message-card.tool-result {
    background: #1b1b1b;
    border-left: 2px solid #444;
}

.tool-call-name {
    display: inline-block;
    font-weight: 600;
    color: #ffd479;
    margin-bottom: 4px;
}

.tool-call-args {
    margin: 4px 0 0;
    padding: 8px;
    background: #111;
    border-radius: 6px;
    font-size: 12px;
    color: #cfcfcf;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
}

.tool-definition {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 0;

    & + & {
        border-top: 1px solid #2a2a2a;
        margin-top: 4px;
    }
}

.tool-definition-description {
    font-size: 12px;
    color: #aaa;
}

.tool-parameters {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 5px;
    padding-left: 10px;
    border-left: 2px solid #333;

    &.nested {
        margin-top: 4px;
        padding-left: 10px;
        border-left: 2px solid #2a2a2a;
    }
}

.tool-parameter-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 12px;
    padding: 2px 0;

    & + & {
        border-top: 1px solid #222;
        padding-top: 4px;
    }
}

.tool-param-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;

    &--expandable {
        cursor: pointer;
    }
}

.tool-param-toggle {
    font-size: 10px;
    color: #666;
    width: 10px;
    flex-shrink: 0;
}

.tool-param-name {
    font-family: monospace;
    color: #e0c97f;
    font-size: 12px;
}

.tool-param-type {
    font-size: 11px;
    padding: 1px 5px;
    border-radius: 3px;
    background: #2a3a4a;
    color: #7ec8e3;

    &--string  { background: #1e3a2a; color: #7ed9a0; }
    &--number  { background: #3a2a1e; color: #e3b07e; }
    &--integer { background: #3a2a1e; color: #e3b07e; }
    &--boolean { background: #2a1e3a; color: #c07ee3; }
    &--array   { background: #2a3a4a; color: #7ec8e3; }
    &--object  { background: #3a3a1e; color: #e3de7e; }
}

.tool-param-format {
    font-size: 11px;
    padding: 1px 5px;
    border-radius: 3px;
    background: #1e2e3a;
    color: #7eb8e3;
    font-family: monospace;
}

.tool-param-required {
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 3px;
    background: #4a1e1e;
    color: #e37e7e;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}


.tool-param-description {
    color: #aaa;
    font-size: 11px;
    flex: 1 1 100%;
    padding-left: 2px;
}

.tool-param-enum {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    padding-left: 15px;
}

.tool-param-enum-value {
    font-family: monospace;
    font-size: 11px;
    padding: 1px 5px;
    border-radius: 3px;
    background: #333;
    color: #ccc;
}

.message-content {
    font-size: 13px;
    color: #fafafa;
    word-break: break-word;
    flex: 1 1 0;
}

.prompts-info-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 15px;
    color: #1fffb4;
    margin-bottom: 10px;
}

.prompts-info-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 5px;
    border: 1px solid #1fffb4;
    background: transparent;
    color: #1fffb4;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;

    &:hover {
        background: #1fffb4;
        color: #222;
    }
}

.prompts-info-count {
    font-size: 13px;
    color: #fafafa;
    background: #333;
    border-radius: 6px;
    padding: 2px 8px;
}

.prompts-info-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.prompts-info .button-icon {
	background: none;
	border: none;
	cursor: pointer;
	gap: 1px;
	padding: 0;
}

.prompts-info .popup {
	display: flex;
}

.prompts-info .single-prompt {
	display: flex;
	flex-direction: column;
	margin-top: 14px;
	padding-bottom: 6px;
	width: 100%;
}

.prompt-header {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #2a2a2a;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #1fffb4;
    transition: background-color 0.2s ease;
    user-select: none;

    &:hover {
        background: #333;
    }
}

.prompt-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 8px;
}

.prompt-section {
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    padding: 8px;
}

.prompt-section-title {
    font-size: 10px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
    padding: 0 2px;
}

.prompts-info .single-prompt.divider {
	border-bottom: solid 2px #f5f5f5;
}

.prompts-info .single-prompt .messages .message-type {
	align-items: flex-start;
	display: flex;
	justify-content: flex-end;
	margin-bottom: 8px;
	padding-top: 0;

	.prompt-name {

		background-color: white;
		border-radius: 8px;
		box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
		color: #333;
		font-size: 12px;
		margin-top: 0;
		padding: 3px 6px;
		width: fit-content;
	}

	.message {
		height: fit-content;
		margin-left: 8px;
		margin-right: 0;
		width: 580px;
	}
}

.prompts-info .history {
	margin-bottom: 10px;

	.history-roll-down {
		align-items: center;
		background-color: white;
		border: none;
		cursor: pointer;
		display: flex;
		flex-direction: row;
		font-size: 12px;
		gap: 6px;
		margin-left: 30px;
	}

	.history-board {
		display: flex;
		flex-direction: column;
		margin-left: 40px;
		margin-top: 6px;
		padding-left: 40px;
		padding-right: 10px;
		width: 630px;

		.single-message {
			align-items: flex-start;
			display: flex;
			height: fit-content;
			justify-content: flex-end;
			margin-bottom: 4px;
			padding-bottom: 0;

			.role {
				color: black;
				font-size: 13px;
				font-weight: 500;
				margin-top: 0;
				min-height: 20px;
				padding: 0;
				text-align: end;
				width: 70px;
			}

			.message {
				background: none;
				border-radius: 0;
				color: black;
				display: flex;
				font-size: 13px;
				line-height: normal;
				margin-left: 6px;
				margin-right: 0;
				min-height: 20px;
				padding: 1px 0 0;
				width: 550px;
			}
		}
	}
}
}
