.timeline-page { padding-left: 1.25rem; padding-right: 1.25rem; }
.timeline-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.timeline-toolbar > .btn-group { justify-self: end; }
.timeline-period { font-size: 1.25rem; margin: 0; text-align: center; }
.timeline-status {
  min-height: 1.5rem;
  color: var(--bs-secondary-color);
  margin-bottom: .5rem;
}
.timeline-grid {
  --timeline-resource-width: 12rem;
  border: 1px solid var(--bs-border-color);
  border-radius: .5rem;
  overflow: auto;
  max-height: min(70vh, 52rem);
  background: var(--bs-body-bg);
}
.timeline-table { position: relative; width: max-content; min-width: 100%; }
.timeline-header,
.timeline-row { display: grid; grid-template-columns: var(--timeline-resource-width) auto; }
.timeline-header { position: sticky; top: 0; z-index: 8; }
.timeline-resource-heading,
.timeline-resource-cell {
  position: sticky;
  left: 0;
  z-index: 5;
  width: var(--timeline-resource-width);
  border-right: 1px solid var(--bs-border-color);
  border-bottom: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
}
.timeline-resource-heading {
  z-index: 10;
  padding: .65rem .75rem;
  font-weight: 700;
}
.timeline-resource-cell {
  display: flex;
  align-items: center;
  padding: .55rem .75rem;
  font-weight: 600;
}
.timeline-resource-cell a {
  overflow: hidden;
  color: var(--bs-body-color);
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.timeline-resource-cell a:hover { color: var(--bs-link-color); text-decoration: underline; }
.timeline-resource-cell--unassigned {
  color: var(--bs-secondary-color);
  font-style: italic;
}
.timeline-axis,
.timeline-lane {
  position: relative;
  border-bottom: 1px solid var(--bs-border-color);
  background-color: var(--bs-body-bg);
  background-image:
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent calc(var(--timeline-slot-width) - 1px),
      color-mix(in srgb, var(--bs-border-color) 45%, transparent)
        calc(var(--timeline-slot-width) - 1px),
      color-mix(in srgb, var(--bs-border-color) 45%, transparent)
        var(--timeline-slot-width)
    ),
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent calc(var(--timeline-hour-width) - 1px),
      var(--bs-border-color) calc(var(--timeline-hour-width) - 1px),
      var(--bs-border-color) var(--timeline-hour-width)
    );
}
.timeline-axis { height: 3.3rem; background-color: var(--bs-tertiary-bg); }
.timeline-day-band {
  position: absolute;
  top: 0;
  height: 1.55rem;
  padding: .15rem .4rem;
  border-right: 1px solid var(--bs-border-color);
  font-size: .78rem;
  font-weight: 700;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
}
.timeline-hour-label {
  position: absolute;
  bottom: .2rem;
  transform: translateX(-50%);
  color: var(--bs-secondary-color);
  font-size: .72rem;
  white-space: nowrap;
}
.timeline-row:nth-child(even) .timeline-lane { background-color: color-mix(in srgb, var(--bs-tertiary-bg) 35%, var(--bs-body-bg)); }
.timeline-event {
  position: absolute;
  height: 1.75rem;
  padding: .22rem .4rem;
  border: 1px solid color-mix(in srgb, var(--bs-primary) 48%, transparent);
  border-radius: .3rem;
  background: color-mix(in srgb, var(--bs-primary) 18%, var(--bs-body-bg));
  color: var(--bs-body-color);
  font-size: .78rem;
  line-height: 1.2rem;
  overflow: hidden;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.timeline-event:hover,
.timeline-event:focus-visible {
  z-index: 4;
  background: color-mix(in srgb, var(--bs-primary) 30%, var(--bs-body-bg));
  outline: 2px solid color-mix(in srgb, var(--bs-primary) 45%, transparent);
  outline-offset: 1px;
}
.timeline-event-time { font-weight: 700; margin-right: .3rem; }
.timeline-now {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 3;
  width: 2px;
  pointer-events: none;
  background: var(--bs-danger);
}
.timeline-empty { padding: 2rem; text-align: center; color: var(--bs-secondary-color); }
@media (max-width: 720px) {
  .timeline-page { padding-left: .75rem; padding-right: .75rem; }
  .timeline-toolbar { grid-template-columns: 1fr; }
  .timeline-toolbar > .btn-group { justify-self: start; }
  .timeline-period { text-align: left; }
  .timeline-grid { --timeline-resource-width: 9rem; }
}
