.workflow-map {
  margin: 26px 0;
  padding: 26px;
}

.workflow-title,
.workflow-title > div,
.workflow-summary,
.workflow-detail,
.flow-canvas header,
.step-top,
.step-agent,
.directory-agent,
.directory-agent > div > div,
.flow-legend {
  display: flex;
  align-items: center;
  gap: 14px;
}

.workflow-title {
  justify-content: space-between;
}

.workflow-title > div {
  align-items: flex-start;
}

.workflow-title > div > span {
  color: #b18331;
  font-family: Georgia, serif;
  font-weight: 800;
}

.workflow-title small,
.flow-canvas header small,
.agent-directory header small {
  color: #a87824;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.workflow-title h3,
.flow-canvas h4,
.agent-directory h4 {
  margin: 3px 0;
  color: #123f68;
  font-family: Georgia, serif;
}

.workflow-title p,
.flow-canvas header p,
.agent-directory header p {
  margin: 4px 0 0;
  color: #64798a;
}

.workflow-title > b {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 20px;
  background: #e6f5ee;
  color: #197255;
  white-space: nowrap;
}

.workflow-title > b i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #27a778;
}

.workflow-summary {
  margin: 22px 0;
  background: #f2f6f8;
}

.workflow-summary span {
  display: grid;
  flex: 1;
  padding: 15px;
  border-right: 1px solid #dbe4e9;
}

.workflow-summary b {
  color: #153f64;
  font-family: Georgia, serif;
  font-size: 1.5rem;
}

.workflow-summary small {
  color: #718492;
}

.flow-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.flow-tabs button {
  display: flex;
  align-items: center;
  flex: 0 0 210px;
  gap: 9px;
  min-height: 58px;
  padding: 9px 12px;
  border: 1px solid #d8e1e7;
  background: white;
  color: #456074;
  text-align: left;
  cursor: pointer;
}

.flow-tabs button.active {
  border-color: #174b77;
  background: #174b77;
  color: white;
}

.flow-tabs button b {
  color: #b88a35;
}

.flow-tabs button span {
  font-size: 0.75rem;
  font-weight: 700;
}

.workflow-detail {
  align-items: flex-start;
  margin-top: 14px;
}

.flow-canvas {
  min-width: 0;
  flex: 1;
  border: 1px solid #d8e1e7;
  background: #f8fafb;
}

.flow-canvas header {
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px;
  background: white;
}

.flow-canvas header > span {
  color: #697e8d;
  font-size: 0.72rem;
  white-space: nowrap;
}

.flow-trigger {
  display: flex;
  gap: 15px;
  padding: 13px 20px;
  border-top: 1px solid #e3e9ed;
  border-bottom: 1px solid #e3e9ed;
  background: #fff8e9;
  color: #5a6872;
  font-size: 0.8rem;
}

.flow-trigger b {
  color: #8a651f;
}

.phase-list {
  padding: 17px;
}

.phase-group + .phase-group {
  margin-top: 22px;
}

.phase-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
  color: #173f62;
}

.phase-label span {
  color: #788995;
  font-size: 0.72rem;
}

.step-chain {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 24px;
}

.flow-step {
  position: relative;
  min-height: 168px;
  padding: 14px;
  border: 1px solid #dbe3e8;
  border-top: 3px solid #7b95a8;
  background: white;
}

.flow-step.mode-agent {
  border-top-color: #208565;
}

.flow-step.mode-hybrid {
  border-top-color: #b3842f;
}

.flow-step::after {
  position: absolute;
  right: -19px;
  top: 50%;
  content: '→';
  color: #9bacb8;
  font-size: 1.2rem;
}

.flow-step:nth-child(2n)::after,
.flow-step:last-child::after {
  display: none;
}

.step-top {
  justify-content: flex-start;
}

.step-top > span {
  color: #a77929;
  font-family: Georgia, serif;
  font-weight: 800;
}

.step-top > b {
  color: #6f818e;
  font-size: 0.66rem;
  letter-spacing: 0.05em;
}

.step-top > i {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  margin-left: auto;
  border-radius: 50%;
  background: #eaf0f4;
  color: #174973;
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 800;
}

@media (max-width: 1050px) {
  .workflow-detail {
    flex-direction: column;
  }
  .agent-directory {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .workflow-title,
  .workflow-summary {
    align-items: stretch;
    flex-direction: column;
  }
  .step-chain {
    grid-template-columns: 1fr;
  }
  .flow-step::after {
    display: none;
  }
}
