/* TimelineWidget: lanes of bars on one time axis (widgets2/timeline). Bars sit in percentages of
   the range; a lane is as tall as its most overlapping moment (--na-timeline-rows). */
.na-timeline {
    --na-timeline-title-width: 12rem;
    --na-timeline-row-height: 1.6rem;
    --na-timeline-row-gap: .2rem;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    font-size: .75rem;
}

.na-timeline-lane {
    display: flex;
    align-items: stretch;
    min-width: 0;
    border-bottom: 1px solid var(--cui-border-color-translucent, rgba(0, 0, 0, .08));
}

.na-timeline-lane-title {
    display: flex;
    align-items: center;
    gap: .55rem;
    flex: 0 0 var(--na-timeline-title-width);
    padding: .35rem .5rem .35rem .25rem;
    min-width: 0;
    border-right: 1px solid var(--cui-border-color-translucent, rgba(0, 0, 0, .08));
}

.na-timeline-axis-title {
    font-weight: 600;
    color: var(--cui-secondary-color, #6c757d);
}

.na-timeline-axis {
    background: var(--cui-tertiary-bg, rgba(0, 0, 0, .03));
    border-radius: .35rem .35rem 0 0;
}

.na-timeline-avatar {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    overflow: hidden;
    font-size: .7rem;
    font-weight: 700;
    color: var(--cui-primary, #5856d6);
    background: color-mix(in srgb, var(--cui-primary, #5856d6) 14%, transparent);
}

.na-timeline-avatar-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.na-timeline-lane-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.na-timeline-lane-name {
    font-weight: 600;
    color: var(--cui-body-color, #212529);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.na-timeline-lane-subtitle {
    font-size: .7rem;
    color: var(--cui-secondary-color, #6c757d);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.na-timeline-done {
    opacity: .55;
}

.na-timeline-track,
.na-timeline-scale {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.na-timeline-track {
    height: calc(var(--na-timeline-rows, 1) * (var(--na-timeline-row-height) + var(--na-timeline-row-gap)) + .4rem);
    min-height: 2.6rem;
}

.na-timeline-axis {
    border-bottom-color: var(--cui-border-color, #d8dbe0);
}

.na-timeline-scale {
    height: 1.4rem;
}

.na-timeline-tick {
    position: absolute;
    top: .2rem;
    transform: translateX(-50%);
    white-space: nowrap;
    color: var(--cui-secondary-color, #6c757d);
}

.na-timeline-tick-day {
    font-weight: 700;
    color: var(--cui-body-color, #212529);
}

.na-timeline-now {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 0;
    border-left: 2px solid var(--cui-danger, #e55353);
    opacity: .7;
    pointer-events: none;
}

.na-timeline-now[data-label]::after {
    content: attr(data-label);
    position: absolute;
    top: .15rem;
    left: .25rem;
    font-weight: 700;
    color: var(--cui-danger, #e55353);
}

.na-timeline-bar {
    position: absolute;
    top: calc(.2rem + var(--na-timeline-row, 0) * (var(--na-timeline-row-height) + var(--na-timeline-row-gap)));
    height: var(--na-timeline-row-height);
    padding: 0 .4rem;
    border: 1px solid transparent;
    border-radius: .45rem;
    font: inherit;
    font-weight: 600;
    line-height: calc(var(--na-timeline-row-height) - 2px);
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--na-timeline-text);
    background: var(--na-timeline-fill);
    border-color: var(--na-timeline-edge);
}

button.na-timeline-bar {
    cursor: pointer;
}

button.na-timeline-bar:hover,
button.na-timeline-bar:focus-visible {
    filter: brightness(.95);
    outline: 2px solid var(--na-timeline-edge);
    outline-offset: 1px;
}

/* A projection is hatched: queued work and the expected rest of a running run. */
.na-timeline-projected {
    background: repeating-linear-gradient(135deg, var(--na-timeline-fill) 0 6px, transparent 6px 10px);
    border-style: dashed;
}

.na-timeline-marker {
    position: absolute;
    top: calc(.05rem + var(--na-timeline-row, 0) * (var(--na-timeline-row-height) + var(--na-timeline-row-gap)));
    height: calc(var(--na-timeline-row-height) + .3rem);
    width: 0;
    border-left: 2px dotted var(--cui-body-color, #212529);
    pointer-events: auto;
}

.na-timeline-tone-primary { --na-timeline-fill: color-mix(in srgb, var(--bs-primary) 18%, transparent); --na-timeline-edge: var(--bs-primary); --na-timeline-text: var(--cui-body-color, #212529); }
.na-timeline-tone-info { --na-timeline-fill: color-mix(in srgb, var(--bs-info) 18%, transparent); --na-timeline-edge: var(--bs-info); --na-timeline-text: var(--cui-body-color, #212529); }
.na-timeline-tone-success { --na-timeline-fill: color-mix(in srgb, var(--bs-success) 18%, transparent); --na-timeline-edge: var(--bs-success); --na-timeline-text: var(--cui-body-color, #212529); }
.na-timeline-tone-warning { --na-timeline-fill: color-mix(in srgb, var(--bs-warning) 22%, transparent); --na-timeline-edge: var(--bs-warning); --na-timeline-text: var(--cui-body-color, #212529); }
.na-timeline-tone-danger { --na-timeline-fill: color-mix(in srgb, var(--bs-danger) 18%, transparent); --na-timeline-edge: var(--bs-danger); --na-timeline-text: var(--cui-body-color, #212529); }
.na-timeline-tone-secondary { --na-timeline-fill: color-mix(in srgb, var(--bs-secondary) 14%, transparent); --na-timeline-edge: color-mix(in srgb, var(--bs-secondary) 60%, transparent); --na-timeline-text: var(--cui-secondary-color, #6c757d); }

.na-timeline-empty {
    padding: 1rem 0;
    text-align: center;
    color: var(--cui-secondary-color, #6c757d);
}
