.pipeline-page {
  --pipeline-ok: #5bc54a;
  --pipeline-progress: #f4b942;
  --pipeline-failed: #c5221f;
  --pipeline-unobserved: #a8a8ad;
}

.pipeline-page .status-page-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  margin-top: 4rem;
}

.pipeline-page .status-page-heading h1,
.pipeline-page .status-page-heading p {
  margin: 0;
}

.pipeline-updated {
  margin-left: auto !important;
  text-align: right;
}

.pipeline-controls,
.pipeline-controls-primary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.pipeline-controls {
  justify-content: space-between;
  margin: 3rem 0 2rem;
}

.pipeline-legend {
  margin: -1.2rem 0 2rem;
  color: var(--muted-text);
  font-size: 1.1rem;
}

.pipeline-controls-primary {
  justify-content: flex-start;
}

.pipeline-agencies {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
}

.pipeline-agency-dot {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: var(--pipeline-unobserved);
}

.pipeline-agencies[data-state="nominal"] .pipeline-agency-dot {
  background: var(--pipeline-ok);
}

.pipeline-agencies[data-state="advisory"] {
  color: var(--pill-degraded-fg);
  background: var(--pill-degraded-bg);
  padding: 0.2rem 0.5rem;
}

.pipeline-agencies[data-state="advisory"] .pipeline-agency-dot {
  background: currentColor;
}

.pipeline-controls button,
.pipeline-footer,
.pipeline-updated {
  font-size: 1.2rem;
}

.pipeline-ribbon:not([hidden]),
.pipeline-banner {
  margin-bottom: 1.5rem;
  padding: 0.8rem 1.2rem;
  border: 1px solid var(--pipeline-progress);
}

.pipeline-banner--error {
  border-color: var(--pipeline-failed);
}

#pipeline-history-panel {
  position: relative;
  margin: 2rem 0;
  padding-top: 2.4rem;
}

#pipeline-history-panel > span {
  position: absolute;
  top: 0;
  left: var(--thumb-pct, 50%);
  transform: translateX(-50%);
  font-size: 1.2rem;
  white-space: nowrap;
}

#pipeline-history-range {
  width: 100%;
}

#pipeline-history-panel [data-slot="return-live"] {
  float: right;
}

.pipeline-advisories {
  margin: 1.5rem 0;
  font-size: 1.2rem;
}

.pipeline-advisories p {
  margin: 0.4rem 0;
}

.pipeline-group {
  border-top: 1px solid var(--border-muted-color);
}

.pipeline-group:first-child {
  border-top: 0;
}

.pipeline-group > h3 {
  margin: 1.6rem 0 0.4rem;
  font-size: 1.5rem;
}

.pipeline-row {
  display: grid;
  grid-template-columns: 19rem minmax(0, 1fr) 16rem;
  align-items: start;
  gap: 2rem;
  padding: 1.6rem 0;
}

.pipeline-source-meta {
  overflow-wrap: anywhere;
  color: var(--muted-text);
  font-size: 1.2rem;
}

.pipeline-row-advisory {
  color: var(--pill-degraded-bg);
  font-weight: 700;
}

.pipeline-row-body {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  min-width: 0;
}

.pipeline-lead-labels {
  position: relative;
  flex: none;
  width: 2.6rem;
  height: 13rem;
  color: var(--muted-text);
  font-size: 1rem;
  line-height: 1;
}

.pipeline-lead-labels span {
  position: absolute;
  right: 0;
  transform: translateY(50%);
  white-space: nowrap;
}

.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  flex: 1;
  gap: 0.6rem;
  min-width: 0;
}

.pipeline-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.pipeline-bar-track {
  position: relative;
  width: 100%;
  height: 13rem;
  overflow: hidden;
  border: 1px solid var(--text-color);
}

.pipeline-bar-fill,
.pipeline-bar-segment,
.pipeline-bar-segment-fill {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
}

.pipeline-bar-fill {
  height: var(--fill, 0%);
}

.pipeline-bar-segment {
  bottom: var(--band-bottom, 0%);
  height: var(--band-height, 0%);
}

.pipeline-bar-segment + .pipeline-bar-segment:not(:last-child) {
  border-top: 1px solid var(--text-color);
}

.pipeline-bar-segment-fill {
  height: var(--fill, 0%);
}

.pipeline-bar[data-status="complete"] .pipeline-bar-fill,
.pipeline-bar-segment.g-complete .pipeline-bar-segment-fill {
  background: var(--pipeline-ok);
}

.pipeline-bar[data-status="complete"][data-timing="delayed"] .pipeline-bar-fill,
.pipeline-bar[data-status="in_flight"] .pipeline-bar-fill,
.pipeline-bar-segment.g-complete[data-timing="delayed"] .pipeline-bar-segment-fill,
.pipeline-bar-segment.g-in_flight .pipeline-bar-segment-fill {
  background: var(--pipeline-progress);
}

.pipeline-bar[data-status="in_flight"][data-timing="on_time"] .pipeline-bar-fill,
.pipeline-bar-segment.g-in_flight[data-timing="on_time"] .pipeline-bar-segment-fill {
  background: var(--pipeline-ok);
}

.pipeline-bar[data-status="failed"] .pipeline-bar-fill,
.pipeline-bar-segment.g-failed .pipeline-bar-segment-fill {
  height: 100%;
  background: var(--pipeline-failed);
}

.pipeline-bar[data-status="unobserved"] .pipeline-bar-track,
.pipeline-bar-segment.g-pending {
  border-style: dotted;
  border-color: var(--pipeline-unobserved);
}

.pipeline-bar[data-status="unobserved"] .pipeline-bar-fill,
.pipeline-bar[data-status="unobserved"] .pipeline-bar-segment,
.pipeline-bar-segment.g-pending .pipeline-bar-segment-fill,
.pipeline-bar-segment.g-unobserved .pipeline-bar-segment-fill {
  display: none;
}

.pipeline-bar-label {
  min-height: 2.4em;
  color: var(--muted-text);
  font-size: 1rem;
  line-height: 1.2;
  text-align: center;
}

.pipeline-bar-label strong {
  display: block;
  color: var(--text-color);
}

.pipeline-stats {
  color: var(--muted-text);
  font-size: 1.2rem;
  text-align: right;
}

.pipeline-stats strong,
.pipeline-stats span {
  display: block;
}

.pipeline-stats strong {
  color: var(--text-color);
}

.pipeline-stats [data-timing="on_time"] {
  color: var(--pipeline-ok);
}

.pipeline-stats [data-timing="delayed"] {
  color: var(--pipeline-progress);
}

.pipeline-details-button {
  margin-top: 0.8rem;
  padding: 0;
  border: 0;
  color: var(--link-color);
  background: none;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.pipeline-row-details {
  grid-column: 1 / -1;
  max-width: 100%;
  overflow-x: auto;
}

.pipeline-row-details table {
  width: 100%;
  min-width: 64rem;
  border-collapse: collapse;
  font-size: 1.2rem;
}

.pipeline-row-details th,
.pipeline-row-details td {
  padding: 0.4rem 1.2rem;
  border: 1px dotted var(--border-muted-color);
  text-align: right;
  white-space: nowrap;
}

.pipeline-row-details th:first-child,
.pipeline-row-details td:first-child {
  text-align: left;
}

.pipeline-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-muted-color);
  color: var(--muted-text);
}

.pipeline-time-local .pipeline-time-utc,
body:not(.pipeline-time-local) .pipeline-time-local-only {
  display: none;
}

@media (max-width: 900px) {
  .pipeline-row {
    grid-template-columns: 1fr;
  }

  .pipeline-stats {
    text-align: left;
  }
}

@media (max-width: 680px) {
  .pipeline-updated {
    flex-basis: 100%;
    text-align: left;
  }

  .pipeline-grid {
    gap: 0.3rem;
  }

  .pipeline-bar-label {
    font-size: 0.8rem;
  }
}
