.decision-loop {
  overflow: hidden;
  border: 1px solid rgba(88, 183, 226, 0.19);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(14, 35, 54, 0.94), rgba(8, 21, 35, 0.94));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}

.decision-head {
  min-height: 62px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.decision-head > div {
  text-align: center;
}

.decision-head strong,
.decision-head small {
  display: block;
}

.decision-head strong {
  color: #bdcedc;
  font: 600 0.76rem ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.04em;
}

.decision-head small {
  margin-top: 3px;
  color: #60788c;
  font: 500 0.62rem ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.loop-status {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #f2c453;
  font: 650 0.66rem ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
}

.loop-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.loop-status.is-online {
  color: var(--mint);
}

.loop-status.is-offline {
  color: #ff7a82;
}

.phase-track {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  padding: 38px 24px 34px;
}

.phase {
  position: relative;
  min-width: 0;
  padding: 0 13px;
  text-align: center;
  color: #62798c;
  transition: color 0.35s ease, transform 0.35s ease;
}

.phase:not(:last-child)::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 28px;
  left: calc(50% + 17px);
  width: calc(100% - 34px);
  height: 1px;
  background: var(--line);
}

.phase.is-complete:not(:last-child)::after {
  background: linear-gradient(90deg, var(--mint), rgba(73, 246, 189, 0.25));
}

.phase-number {
  display: block;
  margin-bottom: 8px;
  font: 500 0.6rem ui-monospace, SFMono-Regular, Menlo, monospace;
}

.phase-node {
  position: relative;
  z-index: 1;
  display: block;
  width: 13px;
  height: 13px;
  margin: 0 auto 18px;
  border: 2px solid #31495c;
  border-radius: 50%;
  background: #0a1b2c;
  transition: border-color 0.35s ease, background 0.35s ease, box-shadow 0.35s ease;
}

.phase h3 {
  margin: 0 0 10px;
  color: inherit;
  font: 700 clamp(0.62rem, 1vw, 0.75rem) ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
}

.phase p {
  margin: 0 auto;
  max-width: 145px;
  color: #71879a;
  font-size: 0.68rem;
  line-height: 1.55;
}

.phase.is-active {
  color: #74ccff;
  transform: translateY(-2px);
}

.phase.is-active .phase-node {
  border-color: #5fc8ff;
  background: #5fc8ff;
  box-shadow: 0 0 0 6px rgba(95, 200, 255, 0.1), 0 0 20px rgba(95, 200, 255, 0.7);
  animation: decision-pulse 1.25s ease-in-out infinite;
}

.phase.is-active p {
  color: #a3b6c6;
}

.phase.is-complete {
  color: var(--mint);
}

.phase.is-complete .phase-node {
  border-color: var(--mint);
  background: var(--mint);
  box-shadow: 0 0 14px rgba(73, 246, 189, 0.32);
}

.loop-console {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  border-top: 1px solid var(--line);
  background: rgba(4, 14, 24, 0.42);
}

.loop-readout {
  min-height: 120px;
  padding: 27px 30px;
  border-right: 1px solid var(--line);
}

.loop-readout strong {
  display: block;
  margin-top: 12px;
  color: #c8d8e5;
  font: 600 0.91rem ui-monospace, SFMono-Regular, Menlo, monospace;
}

.loop-readout p {
  margin: 8px 0 0;
  color: #7890a3;
  font-size: 0.75rem;
  line-height: 1.55;
}

.loop-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  padding: 20px 14px;
}

.loop-metrics div {
  min-width: 0;
  padding: 0 14px;
  text-align: center;
}

.loop-metrics div + div {
  border-left: 1px solid var(--line);
}

.loop-metrics span,
.loop-metrics strong {
  display: block;
}

.loop-metrics span {
  margin-bottom: 8px;
  color: #5f778a;
  font: 500 0.58rem ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.loop-metrics strong {
  overflow: hidden;
  color: #a9bdcc;
  font: 600 0.75rem ui-monospace, SFMono-Regular, Menlo, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loop-noscript {
  margin: 0;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  color: #f2c453;
  font-size: 0.72rem;
  text-align: center;
}

@keyframes decision-pulse {
  50% { box-shadow: 0 0 0 9px rgba(95, 200, 255, 0.04), 0 0 25px rgba(95, 200, 255, 0.85); }
}

@media (max-width: 900px) {
  .phase-track {
    grid-template-columns: repeat(3, 1fr);
    row-gap: 34px;
  }

  .phase:nth-child(3)::after {
    display: none;
  }
}

@media (max-width: 620px) {
  .decision-head {
    grid-template-columns: 1fr auto;
  }

  .decision-head .lights {
    display: none;
  }

  .decision-head > div {
    text-align: left;
  }

  .phase-track {
    grid-template-columns: 1fr;
    padding: 28px 22px;
    row-gap: 0;
  }

  .phase {
    display: grid;
    grid-template-columns: 28px 22px 1fr;
    grid-template-rows: auto auto;
    column-gap: 9px;
    min-height: 76px;
    padding: 0;
    text-align: left;
  }

  .phase-number {
    grid-row: 1 / 3;
    padding-top: 2px;
  }

  .phase-node {
    grid-row: 1 / 3;
    margin: 1px 0 0;
  }

  .phase h3 {
    margin-bottom: 5px;
  }

  .phase p {
    max-width: none;
    margin: 0;
  }

  .phase:not(:last-child)::after,
  .phase:nth-child(3)::after {
    display: block;
    top: 15px;
    bottom: 0;
    left: 41px;
    width: 1px;
    height: 61px;
  }

  .loop-console {
    grid-template-columns: 1fr;
  }

  .loop-readout {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (prefers-reduced-motion: reduce) {
  .phase,
  .phase-node {
    transition: none;
  }

  .phase.is-active .phase-node {
    animation: none;
  }
}
