/* Job execution timeline: one bar covering creation to the right edge.
 *
 * Bands tile the bar contiguously, so they are laid out with flex and sized
 * in percent — no absolute positioning to drift. The attempt brackets below
 * do need absolute offsets, because they mark windows rather than tile.
 */

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.timeline__stack {
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
  background: var(--bg-hl);
}

.timeline__bar {
  display: flex;
  width: 100%;
  height: 2rem;
}

.timeline__band {
  min-width: 1px;
  height: 100%;
  border-right: 1px solid var(--bg-card);
}

.timeline__band:last-child {
  border-right: none;
}

/* Each level below a stage is a strip on the same axis, so a band and what
 * its time went to line up; what a strip leaves transparent is local work. */
.timeline__lane {
  position: relative;
  height: 0.7rem;
  border-top: 1px solid var(--bg-card);
}

.timeline__mark {
  position: absolute;
  top: 0;
  height: 100%;
  min-width: 1px;
}

.timeline__band--yellow  { background-color: var(--yellow); }
.timeline__band--cyan    { background-color: var(--cyan); }
.timeline__band--blue    { background-color: var(--blue); }
.timeline__band--green   { background-color: var(--green); }
.timeline__band--violet  { background-color: var(--violet); }
.timeline__band--red     { background-color: var(--red); }
.timeline__band--orange  { background-color: var(--orange); }
.timeline__band--magenta { background-color: var(--magenta); }

/* Waiting for capacity is the absence of work, so it reads as a hatch rather
 * than a solid: the eye stops counting it as another thing that happened. */
.timeline__band--hatched {
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 4px,
    var(--bg-card) 4px,
    var(--bg-card) 6px
  );
}

.data-table .timeline__row-label--1 { padding-left: 1.6rem; }
.data-table .timeline__row-label--2 { padding-left: 3rem; }

.timeline__attempts {
  position: relative;
  height: 1.1rem;
}

.timeline__attempt {
  position: absolute;
  top: 0;
  height: 100%;
  min-width: 2px;
  overflow: hidden;
  border-left: 2px solid var(--text-muted);
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  box-sizing: border-box;
}

.timeline__attempt--open {
  border-right-style: dashed;
}

.timeline__attempt-label {
  position: absolute;
  top: 0.1rem;
  left: 0.25rem;
  font-size: 0.66rem;
  color: var(--text-faint);
  white-space: nowrap;
}

.timeline__ends {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-faint);
}

.timeline__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  font-size: 0.78rem;
}

.timeline__key {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.timeline__swatch {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
  border: 1px solid var(--border);
}

/* Which job each stretch of the bar belongs to, when dependencies took part. */
.timeline__owners {
  display: flex;
  width: 100%;
  height: 1.1rem;
  font-size: 0.7rem;
}

.timeline__owner {
  min-width: 1px;
  overflow: hidden;
  padding: 0 0.3rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.1rem;
  border-top: 3px solid var(--owner-tone);
  color: var(--owner-tone);
}
