.bg__segment-header {
    border-left: 3px solid transparent;
    padding: 10px 30px 10px 7px;
    font-size: 12px;
    font-family: $fontHeading;
    cursor: pointer;
    transition: background-color 0.3s ease-out, border-color 0.3s ease-out;

    background-image: $arrowDownDarkUrl;
    background-position: right 9px center;
    background-repeat: no-repeat;
    background-size: 12px;

    &:hover {
        background-color: $clGrey;
    }

    &.active {
        background-color: $clGrey;
        background-image: $arrowUpDarkUrl;
        &:hover {
            background-color: mix($clGrey, white, 50%);
        }
    }

    &.highlight {
        border-left: 3px solid $clPrimary;
        background-color: mix($clPrimary, white, 15%) !important;
    }

    .title {
        display: inline-block;
        user-select: none;
        cursor: pointer;
        transition: opacity 0.3s ease-out;
        white-space: nowrap;
        max-width: calc(100% - 25px);
        text-overflow: ellipsis;
        overflow: hidden;

        &:hover {
            opacity: 0.8;
        }
    }

    .form {
        display: inline-block;
        // negative margins keep the segment line height intact
        margin-top: -5px;
        margin-left: -5px;
        margin-bottom: -5px;

        .delete {
            display: inline-block;
            padding: 5px 10px;
            color: $clPrimary;
            &:hover {
                text-decoration: underline;
            }
        }

        &.spatial {
            input {
                display: inline-block;
                margin-left: 5px;
                margin-right: 5px;
                max-width: 40px;
                border: 1px solid $clGreyTint;
                border-radius: 3px;
                padding: 4px;
                font-size: 13px;

                &:focus {
                    border-bottom: 1px dotted $clPrimary;
                    border-left: 0;
                }

                // hide arrow buttons
                /* Chrome, Safari, Edge, Opera */
                &::-webkit-outer-spin-button,
                &::-webkit-inner-spin-button {
                    -webkit-appearance: none;
                    margin: 0;
                }
                // FireFox
                -moz-appearance: textfield;
            }
        }
    }

    > .count {
        float: right;
        vertical-align: middle;
        font-size: 12px;
        line-height: 12px;
        color: $clDark;
        background-color: $clGrey;
        border-radius: 15px;
        padding: 3px;
        min-width: 18px;
        text-align: center;
    }
}
