.us-story-main-data {
    margin-bottom: 2rem;
    .us-title {
        @extend %large;
        @extend %text;
        background: $whitish;
        margin-bottom: .5rem;
        padding: 1rem;
        position: relative;
        transition: all .2s linear;
        &.blocked {
            background: $red;
            transition: all .2s linear;
            vertical-align: middle;
            .us-title-text,
            input {
                margin-bottom: .5rem;
            }
            .us-number,
            .us-name,
            .us-related-task {
                color: $white;
            }
            a {
                color: $white;
                transition: color .3s linear;
            }
            a:hover {
                color: $red-light;
            }
            .unblock {
                @extend %bold;
                color: $white;
                float: right;
            }
            .unblock:hover {
                color: $red-light;
                transition: color .3s linear;
            }
        }
        p {
            margin-bottom: 0;
        }
        .us-edit-name-inner {
            display: flex;
        }
        .edit-subject {
            align-content: center;
            align-items: center;
            display: flex;
        }
        input {
            background: $white;
            flex-grow: 9;
        }
        .save-container {
            flex-grow: 1;
        }
        .us-title-text {
            align-content: center;
            align-items: center;
            display: flex;
            margin-bottom: 0;
            max-width: 94%;
        }
        .us-title-text:hover {
            .icon-edit {
                opacity: 1;
                transition: opacity .3s linear;
            }
        }
        .us-number {
            @extend %xlarge;
            @extend %title;
            color: $gray-light;
            flex-shrink: 0;
            line-height: 2.2rem;
            margin-right: .5rem;
        }
        .us-name {
            @extend %xlarge;
            color: $grayer;
            display: inline-block;
            line-height: 2.2rem;
            padding-right: 1rem;
            width: 100%;
        }
        .icon-edit,
        .icon-floppy {
            @extend %large;
            color: $gray-light;
            margin-left: .5rem;
        }
        .icon-edit {
            opacity: 0;
        }
        .us-related-task {
            @extend %small;
            color: $gray-light;
            margin-top: .5rem;
            a {
                border-left: 1px solid $gray-light;
                padding: 0 .2rem;
            }
            a:hover {
                color: $green-taiga;
            }
            a:first-child {
                border: 0;
            }
        }
        .block-desc-container {
            @extend %small;
        }
        .block-description-title {
            @extend %bold;
            color: $white;
            margin-right: .5rem;
        }
        .block-description {
            color: $white;
            display: inline-block;
            margin-right: 5rem;
        }
    }
    .loading-spinner {
        @extend %loading-spinner;
        max-height: 1.5rem;
        max-width: 1.5rem;
    }
}

.blocked-warning {
    margin-bottom: 1rem;
    .blocked {
        @extend %title;
        @extend %xlarge;
        color: $red;
        line-height: 2.5rem;
        margin-bottom: .5rem;
    }
    .icon {
        @extend %xlarge;
        vertical-align: middle;
    }
    .block-description {
        color: $grayer;
        margin: 0;
    }
}

.issue-nav {
    position: absolute;
    right: 1rem;
    top: 1rem;
    a {
        @extend %xlarge;
    }
}

.duty-content {
    position: relative;
    &:hover {
        .view-description {
            .edit {
                opacity: 1;
                top: -1.5rem;
                transition: all .2s linear;
            }
            .editable {
                background: $whitish;
                cursor: pointer;
            }
            .no-description {
                color: $grayer;
            }
        }
    }
    &.wysiwyg {
        overflow: visible;
    }
    .no-description {
        color: $gray-light;
    }
    textarea {
        background: $white;
        height: 10rem;
    }
    .save-container {
        position: absolute;
        right: 1rem;
        top: .2rem;
        &:hover {
            opacity: .3;
            transition: opacity .2s linear;
        }
        .loading-spinner {
            @extend %loading-spinner;
            max-height: 1.5rem;
            max-width: 1.5rem;
        }
    }
    .edit {
        color: $grayer;
    }
    .view-description {
        .edit {
            background: $whitish;
            left: 0;
            opacity: 0;
            padding: .2rem .5rem;
            position: absolute;
            top: 0;
            transition: all .2s linear;
        }
    }
    .edit-description {
        margin-bottom: 2rem;
        .save {
            top: .4rem;
        }
        .edit {
            position: absolute;
            right: 2.5rem;
            top: .4rem;
            transition: all .2s linear;
        }
        .preview {
            padding-top: 1.5rem;
        }
    }
}

.comment-list {
    padding: 1rem;
}

.us-detail-status {
    @extend %large;
    color: $green-taiga;
    vertical-align: middle;
}

.us-detail-progress-bar {
    background: $grayer;
    height: 26px;
    margin-bottom: 1rem;
    position: relative;
    .current-progress {
        background: $fresh-taiga;
        height: 26px;
        left: 0;
        position: absolute;
        top: 0;
        width: 60%;
    }
    .tasks-completed {
        @extend %small;
        color: $white;
        left: 10px;
        position: absolute;
        top: 2px;
    }
}

.points-per-role {
    display: flex;
    flex-wrap: wrap;
    position: relative;
    > li {
        background: rgba($gray-light, .1);
        border-radius: 2px;
        color: rgba($grayer, .3);
        flex-basis: 80px;
        flex-grow: 1;
        flex-shrink: 0;
        margin: .1rem;
        max-width: 50%;
        padding: .5rem 0 .1rem;
        position: relative;
        text-align: center;
        transition: color .3s linear;
        &.active {
            background: rgba($fresh-taiga, .9);
            color: $whitish;
        }
        &:first-child {
            background: rgba($grayer, .5);
            color: $whitish;
        }
        &:last-child {
            border: 0;
        }
    }
    .points {
        @extend %xlarge;
        @extend %title;
        display: block;
        margin-bottom: .3rem;
        text-align: center;
    }
    .role {
        @extend %small;
        @include ellipsis(90%);
        display: inline-block;
        line-height: 1rem;
        text-align: center;
    }
    .popover {
        @include popover(200px, $top: 105%, $left: 35%, $arrow-width: 10px, $arrow-top: -5px, $arrow-left: 10px, $arrow-height: 10px);
        li {
            display: inline-block;
            width: 23%;
        }
        a {
            display: block;
            text-align: center;
            &:hover,
            &.active {
                background: $fresh-taiga;
                color: $white;
            }
        }
        &.fix {
            @include popover(200px, $top: 105%, $left: -160px, $arrow-width: 10px, $arrow-top: -5px, $arrow-left: 90%, $arrow-height: 10px);
        }
    }

}

.duty-data-container {
    @extend %small;
    margin-bottom: 1rem;
    .duty-data {
        margin-bottom: .5rem;
        &:last-child {
            margin: 0;
        }
        div {
            background: darken($whitish, 5%);
            padding: .5rem;
            padding-right: 1rem;
            transition: background .2s ease-in;
        }
        .clickable {
            &:hover {
                background: darken($whitish, 10%);
                transition: background .2s ease-in;
            }
        }
    }
    .level {
        display: inline-block;
        margin-right: .5rem;
        vertical-align: top;
    }
    .level-name {
        color: darken($whitish, 20%);
        float: right;
        text-transform: lowercase;
    }
}

.us-detail-settings {
    margin-top: 2rem;
    .button {
        color: $white;
        display: block;
        margin-bottom: .5rem;
        text-align: center;
        width: 100%;
    }
    .button-gray {
        background: $gray-light;
        &:hover {
            background: $gray-light;
        }
        &.editable {
            &:hover {
                background: $grayer;
                cursor: pointer;
            }
        }
        &.active {
            background: $green-taiga;
        }
    }
    .item-block {
        &.editable {
            &:hover {
                background: $red;
                cursor: pointer;
            }
        }
    }
    .button-red {
        &:hover,
        &.active {
            background: $red;
        }
    }
    label {
        &.editable {
            cursor: pointer;
        }
        +input {
            display: none;
        }
    }
    span {
        &.button-gray,
        &.button-gray:hover {
            background: $gray-light;
            &.active {
                background: $gray;
            }
        }
        &.button-red,
        &.button-red:hover {
            background: $red-light;
            &.active {
                background: $red;
            }
        }
    }
    .loading-spinner {
        @extend %loading-spinner;
    }
}

.us-status {
    .type-data {
        position: relative;
        .pop-type {
            @include popover(150px, '', 30px, '', '');
        }
    }
    .severity-data {
        position: relative;
        .pop-severity {
            @include popover(150px, '', 30px, '', '');
        }
    }
    .priority-data {
        position: relative;
        .pop-priority {
            @include popover(150px, '', 30px, '', '');
        }
    }
    .status-data {
        position: relative;
        .pop-status {
            @include popover(150px, '', 30px, '', '');
        }
    }
}
