.c-chat {
    $width-sm       = 56px;
    $height-sm      = $width-sm;
    $width-lg       = 137px;
    $height-lg      = 44px;
    $pos-h          = 10px;
    $pos-v          = $pos-h;
    $padding        = 20px;

    position: fixed;
    bottom: $pos-v;
    right: $pos-h;
    z-index: $level--chat;
    width: $width-sm;
    height: $height-sm;
    padding-top: @height;
    overflow: hidden;
    background-color: $color--main;
    border-radius: ($height-sm / 2);
    transition: .4s ease-out, width .4s .4s;

    &:hover {
        background-color: #1b68ff;
    }

    @media (min-width: $screen--md) {
        width: $width-lg;
        height: $height-lg;
        padding-top: @height;
        border-radius: 4px;
    }

    &.is-open {
        bottom: 0;
        right: 0;
        z-index: $level--menu + 1;
        width: 100%;
        height: 100%;
        padding-top: 0;
        background-color: #fff;
        border-radius: 0;
        transition: .4s .4s ease-out, width .4s 0s ease-out

        &:hover {
            background-color: @background-color;
        }

        @media (min-width: $screen--md) {
            bottom: $pos-v;
            right: $pos-h;
            width: 300px;
            height: 480px;
            max-height: 'calc(100% - %s)' % ($pos-v * 2);
            box-shadow: 0 2px 15px 0 rgba(0,0,0,.15);
            border-radius: 4px;
        }

        .c-chat {
            &__float {
                transform: translate(0, 100%);
            }

            &__dialog {
                opacity: 1;
            }
        }
    }

    &__float {
        position: absolute;
        bottom: 0;
        right: 0;
        width: $width-sm;
        height: $height-sm;
        color: #fff;
        transition: .4s ease-out;

        @media (min-width: $screen--md) {
            flexbox();
            align-items: center;
            width: $width-lg;
            height: $height-lg;
            padding: 0 18px;
        }

        &-icon {
            font-size: 24px;

            @media (min-width: $screen--md) {
                margin-right: 14px;
                font-size: 22px;
            }
        }

        &-txt {
            position: relative;
            display: none;
            font-size: 16px;

            @media (min-width: $screen--md) {
                display: inline-block;
            }
        }

        &-num {
            display: block;
            position: absolute;
            top: -4px;
            right: -24px;
            min-width: 16px;
            height: @min-width;
            background-color: #ff6145;
            border-radius: (@height / 2);
            color: #fff;
            font-size: 10px;
            line-height: @height;
            text-align: center;
        }
    }

    &__dialog {
        flexbox();
        flex-direction: column;
        height: 100%;
        opacity: 0;
        transition: .4s ease-out;
    }

    &__header {
        flexbox();
        align-items: center;
        padding: $padding;
    }

    &__close {
        order: 1;
        margin-left: 10px;
    }

    &__title {
        flex: 1 0 auto;
        margin: 0;
        font-size: 1.75em;
        line-height: 1;
        text-ellipsis();
    }

    &__timeline {
        reset-list();
        flex: 1 0 0;
        overflow: auto;
        padding-left: $padding;
        padding-right: @padding-left;

        scrollbar();
    }

    &__form {
        position: relative;
        margin: $padding;

        .c-input {
            resize: none;
            padding-top: 19px;
            padding-bottom: @padding-top;

            &:focus, 
            &:not(:placeholder-shown) {
                & ~ .c-input__label {
                    opacity: 0;
                }
            }
        }
    }

    &__message {
        clear: both;
        padding-right: 20%;

        & + & {
            margin-top: $vertical--element-sm;
        }

        &--by-me {
            padding-right: 0;
            padding-left: 20%;
            text-align: right;

            .c-chat__txt {
                background-color: #f1f1f1;
                color: inherit;
            }
        }
    }

    &__author {
        margin-bottom: 4px;
        font-size: 16px;
        color: $color--main;
        font-weight: $font--bold;
    }

    &__txt {
        padding: 18px;
        background-color: $color--main;
        border-radius: 8px;
        color: #fff;
        text-align: left;
    }

    &__hour {
        margin-top: 4px;
        font-size: .9em;
        color: $color--gray-1;
    }
}