.duty-chain-layout {
  display: grid;
  gap: 14px;
  margin: 12px 0;
  color: #173044;
}

.duty-chain-layout:empty,
.duty-chain-layout [hidden] {
  display: none;
}

.duty-chain-layout p {
  margin-block: 0;
}

.duty-chain-lane {
  min-width: 0;
  padding: 14px;
  border: 1px solid #cfdde7;
  border-radius: 8px;
  background: #fff;
}

.duty-chain-lane--shared {
  background: #f1f6fa;
  border-color: #c4d5e3;
}

.duty-chain-title {
  margin: 0 0 9px;
  font-size: 1rem;
  line-height: 1.35;
  color: #153950;
}

.duty-chain-lane-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 5px 14px;
}

.duty-chain-lane-heading button {
  margin-bottom: 9px;
}

.duty-chain-lane > .duty-chain-step-note {
  display: block;
  margin-block-start: 9px;
  color: #255a80;
  font-size: .88em;
  font-weight: 600;
}

.duty-chain-stages {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.duty-chain-stage {
  position: relative;
  flex: 1 1 145px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #d5e3ed;
  border-radius: 6px;
  background: #f7fafc;
  overflow-wrap: anywhere;
}

.duty-chain-stage + .duty-chain-stage::before {
  content: "→" / "";
  position: absolute;
  left: -19px;
  top: calc(50% - 11px);
  color: #255a80;
  line-height: 22px;
  font-size: 17px;
}

.duty-chain-stage[data-duty-chain-scope="route"] {
  border-color: #cbd7e9;
  background: #eef3fa;
}

.duty-chain-stage[data-duty-chain-skipped="true"] {
  border-style: dashed;
  background: #f4f6f7;
}

.duty-chain-stage:is([data-duty-chain-state="declined"], [data-duty-chain-state="absent"],
  [data-duty-chain-state="missing"], [data-duty-chain-state="conflict"]) {
  border-color: #e4b3ad;
}

.duty-chain-stage:is([data-duty-chain-state="declined"], [data-duty-chain-state="absent"],
  [data-duty-chain-state="missing"], [data-duty-chain-state="conflict"]) .duty-chain-step-note {
  color: #9b2321;
}

.duty-chain-stage label {
  display: grid;
  gap: 4px;
  margin: 0;
  min-width: 0;
}

.duty-chain-stage select {
  width: 100%;
  min-width: 0;
  margin: 3px 0;
}

.duty-chain-step-label {
  display: block;
  font-weight: 650;
  color: #254d66;
}

.duty-chain-step-timing,
.duty-chain-step-note {
  display: block;
  color: #416075;
  font-size: .84em;
  line-height: 1.45;
}

.duty-chain-stage .duty-chain-step-note.duty-unavailable-label,
.duty-chain-stage .duty-unavailable-label,
.duty-chain-stage .absence-label {
  color: #9b2321;
}

.duty-chain-nonsteps {
  margin: 0;
  color: #416075;
}

@media (max-width: 650px) {
  .duty-chain-lane { padding: 11px; }
  .duty-chain-stages { flex-direction: column; flex-wrap: nowrap; gap: 23px; }
  .duty-chain-stage { flex-basis: auto; }
  .duty-chain-stage + .duty-chain-stage::before {
    content: "↓" / "";
    left: calc(50% - 5px);
    top: -23px;
  }
}
