.view-subject-with-nested-timeline {
    --main-histogram-height: 30px;

    position: relative;
    padding-top: 15px;
    margin-bottom: 2px;
}
.view-subject-with-nested-timeline::before {
    content: "TOTAL TIME";
    display: block;
    position: absolute;
    width: calc(2 * var(--main-histogram-height) + 1px);
    top: 16.5px;
    left: -5px;
    transform: translate(-100%, -100%) translateX(-15.5px) rotate(-90deg);
    transform-origin: bottom right;
    padding: 3px 0;
    font-size: 8px;
    text-align: center;
    letter-spacing: .75px;
    color: #888;
    background-color: color-mix(in srgb, var(--discovery-color) 10%, var(--discovery-background-color));
}
.view-subject-with-nested-timeline .view-time-ruler {
    margin-left: 1px;
    --overlay-offset-top: -1px;
    --overlay-offset-bottom: -1px;
}
.view-subject-with-nested-timeline .view-time-ruler .interval-marker:first-child {
    margin-left: -1px;
}
.view-subject-with-nested-timeline .view-timeline-segments {
    border-top: 1px solid #0004;
    margin-left: 1px;
}
.view-subject-with-nested-timeline .nested-work::before {
    content: "Nested time distributed by category";
    display: block;
    margin-left: 1px;
    padding: 2px 0;
    font-size: 10px;
    text-align: center;
    background-color: #0004;
    color: color-mix(in srgb, var(--discovery-color) 80%, var(--discovery-background-color));
    opacity: .5;
    pointer-events: none;
}
.view-subject-with-nested-timeline .nested-work .view-timeline-segments {
    border-top: none;
    transform: scaleY(-1);
    margin-block: 0;
}
.view-subject-with-nested-timeline .view-timeline-segments-bin.nested-time {
    transform: scaleY(-1);
    margin-top: -1px;
    border-bottom: none;
    border-top: none;
}
.view-subject-with-nested-timeline > .view-timeline-segments-bin::before {
    content: "SELF";
    display: block;
    position: absolute;
    width: 30px;
    bottom: 0;
    left: -2px;
    transform: rotate(-90deg);
    transform-origin: bottom left;
    padding: 2px 0;
    font-size: 9px;
    text-align: center;
    letter-spacing: .5px;
    color: #888;
    background-color: color-mix(in srgb, var(--discovery-color) 10%, var(--discovery-background-color));
}
.view-subject-with-nested-timeline > .view-timeline-segments-bin.self-time::before {
    padding-left: .5px;
}
.view-subject-with-nested-timeline > .view-timeline-segments-bin.nested-time::before {
    content: "NEST";
    transform: rotate(-90deg) scaleX(-1) translate(-100%);
}

/**
* Function codes
**/
.view-subject-with-nested-timeline .function-codes {
    position: absolute;
    inset: -8.5px 0 auto;
    height: 7.5px;
    margin-left: 1px;
    pointer-events: none;
    contain: paint;
    z-index: 1;
}
.view-subject-with-nested-timeline .function-codes .tick {
    --tier-color: #aaaaaaa0;
    position: absolute;
    box-sizing: border-box;
    top: 0;
    left: calc(100% * var(--pos));
    height: 7.5px;
    border-left: .75px solid var(--tier-color);
    border-color: color(from var(--tier-color) srgb r g b / 1);
    border-right: .5px solid transparent;
    width: calc(100% * var(--duration));
    pointer-events: all;
}
.view-subject-with-nested-timeline .function-codes .tick::before {
    content: '';
    position: absolute;
    inset: 0;
    border-top: 3px solid transparent;
    border-color: color-mix(in srgb, var(--tier-color) 20%, var(--discovery-background-color));
    height: 1.5px;
    bottom: auto;
    background-color: var(--tier-color);
    transition: 150ms ease-in;
    transition-property: border-top-width, height;
}
.view-subject-with-nested-timeline .function-codes .tick:hover::before {
    border-top-width: 2px;
    height: 3.5px;
}

.subject-with-nested-timeline__code-segment-tooltip .view-code-tier-badge {
    margin: -1px .8ex 0 0;
    vertical-align: middle;
}
