/* CoachDIS 3-step decision flow + continuous per-athlete adaptation loop. */
.flow3 {
  --space-2: .5rem;
  --space-4: .95rem;
  --space-6: 1.6rem;
  --type-small: .89rem;
  --brand-chip: #05d4f8;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.25rem minmax(0, 1.18fr) 2.25rem minmax(0, 1fr);
  align-items: stretch;
  row-gap: 1rem;
  margin: 0;
}

.flow3-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--page);
  min-width: 0;
}

.flow3-col h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -.015em;
}

.flow3-col p {
  margin: 0;
  font-size: var(--type-small);
  line-height: 1.55;
  color: var(--muted);
}

.flow3-step {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .84rem;
  font-weight: 600;
  color: var(--muted);
}

.flow3-step b {
  display: inline-grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-size: .75rem;
  font-weight: 600;
}

.flow3-in ul {
  list-style: none;
  margin: auto 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.flow3-in li {
  padding: .48em .85em;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  font-size: .86rem;
  font-weight: 400;
  cursor: default;
}

.flow3-core {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.flow3-core .flow3-step {
  color: #c5d0cc;
}

.flow3-core .flow3-step b {
  background: var(--brand-chip);
  border-color: var(--brand-chip);
  color: #0b1614;
}

.flow3-core > img {
  width: min(152px, 56%);
  height: auto;
}

.flow3-core > p {
  color: #d7dfdc;
}

.flow3-card {
  display: grid;
  gap: .38rem;
  margin-top: auto;
  padding: .95rem 1.05rem;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  border-top: 3px solid var(--brand-chip);
}

.flow3-card b {
  font-weight: 600;
  font-size: .94rem;
  line-height: 1.4;
}

.flow3-tag {
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: #006678;
}

.flow3-why {
  font-size: .81rem;
  line-height: 1.45;
  color: var(--muted);
}

.flow3-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .45rem;
}

.flow3-actions button {
  font: inherit;
  cursor: pointer;
  min-height: 42px;
  padding: .48em .75em;
  border-radius: 8px;
  border: 1px solid var(--border-strong, #76847e);
  background: #fff;
  color: var(--ink);
  font-size: .86rem;
  font-weight: 600;
  transition: background-color .16s ease, border-color .16s ease, opacity .16s ease;
}

.flow3-actions button.is-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.flow3-actions button:hover {
  border-color: var(--ink);
  background: var(--soft);
}

.flow3-actions button.is-primary:hover {
  background: var(--ink-hover, #263533);
}

.flow3-arrow {
  position: relative;
  align-self: center;
  height: 1px;
  margin-inline: .3rem;
  background: #98a5a0;
}

.flow3-arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -4px;
  border: 4.5px solid transparent;
  border-left: 7px solid #98a5a0;
  border-right: 0;
}

/* Continuous adaptation feedback strip across the bottom of the 3-step triad */
.flow3-feedback {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: .75rem 1rem;
  padding: .85rem 1.2rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  font-size: .88rem;
  line-height: 1.5;
  color: #36443f;
}

.flow3-feedback-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  flex-shrink: 0;
  padding: .25rem .65rem;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
}

.flow3 figcaption.flow3-caption {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.flow3-replay[hidden] {
  display: none !important;
}

.flow3.is-armed .flow3-in li {
  opacity: .6;
  transition: opacity .35s ease, background-color .2s, border-color .2s;
  transition-delay: calc(var(--i, 0) * 100ms);
}

.flow3.is-armed.s1 .flow3-in li {
  opacity: 1;
}

.flow3-arrow i {
  position: absolute;
  top: -3px;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-chip);
  opacity: 0;
}

.flow3.s2:not(.s3) .flow3-arrow-in i,
.flow3.s4:not(.is-chosen) .flow3-arrow-out i {
  animation: flow3-dot 1s linear infinite;
}

.flow3-arrow i:nth-child(2) { animation-delay: .33s !important; }
.flow3-arrow i:nth-child(3) { animation-delay: .66s !important; }

@keyframes flow3-dot {
  0% { left: 0; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { left: calc(100% - 7px); opacity: 0; }
}

.flow3-status {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  color: #c5d0cc;
}

.flow3-bar {
  position: relative;
  flex: 0 0 56px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .16);
  overflow: hidden;
}

.flow3-bar i {
  position: absolute;
  inset: 0;
  width: 24%;
  background: var(--brand-chip);
  transition: width 1.4s ease;
}

.flow3.s2 .flow3-bar i,
.flow3:not(.is-armed) .flow3-bar i {
  width: 100%;
}

.flow3.is-armed .flow3-card {
  opacity: .9;
  transition: opacity .4s ease, box-shadow .4s ease;
}

.flow3.is-armed.s3 .flow3-card {
  opacity: 1;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .24);
}

.flow3.s3 .flow3-core {
  box-shadow: 0 0 0 2px rgba(5, 212, 248, .28), 0 16px 36px -20px rgba(5, 212, 248, .45);
  transition: box-shadow .5s ease;
}

.flow3.is-chosen .flow3-actions button:not(.is-chosen) {
  opacity: .55;
}

.flow3.is-chosen .flow3-actions button.is-chosen {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.flow3-col .flow3-hint {
  font-size: .83rem;
  font-weight: 500;
  color: var(--muted);
}

.flow3-col .flow3-result {
  margin: 0;
  padding: .7rem .9rem;
  border-radius: 10px;
  background: var(--soft);
  color: var(--ink);
  font-weight: 400;
}

.flow3-col .flow3-loop {
  margin-top: auto;
  font-size: .84rem;
}

.flow3.is-chosen .flow3-loop {
  color: var(--ink);
  font-weight: 500;
}

@media (max-width: 1000px) {
  .flow3 {
    grid-template-columns: 1fr;
    row-gap: .5rem;
  }
  .flow3-feedback {
    flex-direction: column;
    align-items: flex-start;
    margin-top: .5rem;
  }
  .flow3-arrow {
    justify-self: center;
    width: 1px;
    height: 1.75rem;
    margin: .15rem 0;
  }
  .flow3-arrow::after {
    right: auto;
    top: auto;
    bottom: -1px;
    left: -4px;
    border: 4.5px solid transparent;
    border-top: 7px solid #98a5a0;
    border-bottom: 0;
  }
  .flow3-arrow i { left: -3px; top: 0; }
  .flow3.s2:not(.s3) .flow3-arrow-in i,
  .flow3.s4:not(.is-chosen) .flow3-arrow-out i {
    animation-name: flow3-dot-v;
  }
}

@keyframes flow3-dot-v {
  0% { top: 0; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { top: calc(100% - 7px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .flow3 *,
  .flow3.is-armed .flow3-card,
  .flow3.is-armed .flow3-in li {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
