.fa-sequence-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  margin-bottom: clamp(18px, 2vw, 28px);
}
.mc-home .fa-sequence-head p {
  margin: 0; color: var(--fa-data);
  font: 700 11px/1.5 var(--fa-mono); letter-spacing: .08em; text-transform: uppercase;
}
.mc-home .mc-data-panel-dark .fa-sequence-head p { color: var(--fa-cyan); }
.fa-sequence-head button:not([hidden]) {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  min-height: 32px; padding: 4px 9px; border: 1px solid currentColor; border-radius: 5px;
  background: transparent; color: #315372; font: 600 12px/1.25 Inter,Arial,sans-serif; cursor: pointer;
}
.mc-data-panel-dark .fa-sequence-head button { color: #b2cde5; }
.fa-sequence-head button:is(:hover,:focus-visible) { color: var(--fa-data); background: #eaf3fb; }
.mc-data-panel-dark .fa-sequence-head button:is(:hover,:focus-visible) { color: #b5e8ff; background: #21374d; }
.fa-sequence-head button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

#flujo-taller .mc-mini-flow {
  position: relative; --rail-x: 8px; --node-y: 1.4em; --rail-rest: #3b5067; --rail-lit: #62ccff;
  --lead-in: 300ms; --step-pause: 270ms; --rail-travel: 600ms;
}
#flujo-taller li {
  position: relative; min-height: 4.5em; padding: .6em 0 1.05em 34px; border: 0;
  --step-index: 0;
  --hit: calc(var(--lead-in) + var(--step-index) * (var(--step-pause) + var(--rail-travel)));
}
#flujo-taller li:nth-child(2) { --step-index: 1; }
#flujo-taller li:nth-child(3) { --step-index: 2; }
#flujo-taller li:nth-child(4) { --step-index: 3; }
#flujo-taller li:last-child { min-height: 0; padding-bottom: 0; }
#flujo-taller .mc-mini-flow span::before { content: none; }
#flujo-taller li > span { color: #f4f8ff; font: 700 clamp(18px,1.4vw,22px)/1.35 var(--fa-title); }
#flujo-taller li > small { margin-top: 2px; color: #c3d6e6; font: 400 14px/1.5 Inter,Arial,sans-serif; }

/* Each segment ends at the centre of the next node, even when text wraps. */
#flujo-taller .mc-mini-flow::before, #flujo-taller .mc-mini-flow::after,
#flujo-taller li:not(:last-child)::before, #flujo-taller li:not(:last-child)::after {
  content: ""; position: absolute; left: calc(var(--rail-x) - 1px); width: 2px; pointer-events: none;
}
#flujo-taller .mc-mini-flow::before, #flujo-taller .mc-mini-flow::after { top: 0; height: var(--node-y); }
#flujo-taller li:not(:last-child)::before, #flujo-taller li:not(:last-child)::after { top: var(--node-y); height: 100%; }
#flujo-taller .mc-mini-flow::before, #flujo-taller li:not(:last-child)::before { background: var(--rail-rest); }
#flujo-taller .mc-mini-flow::after, #flujo-taller li:not(:last-child)::after { background: var(--rail-lit); transform-origin: center top; }
#flujo-taller .fa-work-node {
  position: absolute; z-index: 1; left: var(--rail-x); top: var(--node-y); transform: translate(-50%,-50%);
  width: 12px; height: 12px; box-sizing: border-box; border-radius: 50%; border: 2px solid #a6e6ff;
  background: #59c6ff; box-shadow: 0 0 0 3px #153b57;
}

@media screen and (prefers-reduced-motion: no-preference) {
  #flujo-taller:is([data-sequence-state="waiting"],[data-sequence-state="playing"]) :is(.mc-mini-flow, li)::after { transform: scaleY(0); }
  #flujo-taller:is([data-sequence-state="waiting"],[data-sequence-state="playing"]) .fa-work-node {
    background: #15273a; border-color: #52677c; box-shadow: none;
  }
  #flujo-taller:is([data-sequence-state="waiting"],[data-sequence-state="playing"]) li > :is(span, small) { opacity: 0; }
  #flujo-taller[data-sequence-state="playing"] .mc-mini-flow::after { animation: fa-draw-rail var(--lead-in) ease-out forwards; }
  #flujo-taller[data-sequence-state="playing"] li:not(:last-child)::after {
    animation: fa-draw-rail var(--rail-travel) cubic-bezier(.4,0,.35,1) calc(var(--hit) + var(--step-pause)) forwards;
  }
  #flujo-taller[data-sequence-state="playing"] .fa-work-node { animation: fa-light-node 500ms ease-out var(--hit) forwards; }
  #flujo-taller[data-sequence-state="playing"] li > span { animation: fa-work-step-in 380ms ease-out var(--hit) forwards; }
  #flujo-taller[data-sequence-state="playing"] li > small { animation: fa-work-step-in 450ms ease-out calc(var(--hit) + 70ms) forwards; }
  [data-story-sequence][data-sequence-paused] *,
  [data-story-sequence][data-sequence-paused] *::before,
  [data-story-sequence][data-sequence-paused] *::after { animation-play-state: paused !important; }
  @keyframes fa-draw-rail { to { transform: scaleY(1); } }
  @keyframes fa-light-node {
    0% { background: #d5f6ff; border-color: #c6f2ff; box-shadow: 0 0 0 2px #66cdff80, 0 0 10px #58c8ffa0; }
    48% { background: #93dfff; border-color: #c6f2ff; box-shadow: 0 0 0 7px #66cdff24, 0 0 15px #58c8ff50; }
    100% { background: #59c6ff; border-color: #a6e6ff; box-shadow: 0 0 0 3px #153b57; }
  }
  @keyframes fa-work-step-in { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }
}
@media print { .fa-sequence-head button { display: none !important; } }

.mc-home .mc-context-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px clamp(28px, 4vw, 64px);
  padding: 18px var(--fa-gutter);
  background: #e7eff9;
  border-block: 1px solid #c8d7e9;
  white-space: normal;
}
.mc-context-strip .fa-sequence-head { justify-content: flex-start; gap: 10px; margin: 0; }
.mc-context-strip strong { color: var(--fa-ink); }
.mc-context-strip .fa-sequence-head button {
  justify-content: center; width: 32px; padding: 0;
  border-color: #b5c8df; border-radius: 50%;
}
.fa-area-flow {
  --step-time: 740ms;
  --travel-time: 520ms;
  --rail-start: 0, 1;
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr auto;
  margin: 0; padding: 0; list-style: none;
}
.fa-area-flow li {
  --step: 0;
  --arrival: calc(180ms + var(--step) * var(--step-time));
  position: relative; min-width: 0; padding: 16px 10px 0 0;
  color: #153859; font: 650 14px/1.4 var(--fa-display);
}
.fa-area-flow li:nth-child(2) { --step: 1; }
.fa-area-flow li:nth-child(3) { --step: 2; }
.fa-area-flow li:last-child { --step: 3; padding-right: 0; }
.fa-area-flow li:not(:last-child)::before,
.fa-area-flow li:not(:last-child)::after {
  content: ""; position: absolute; top: 4px; left: 5px; width: 100%; height: 2px;
  background: #b5c9df; transform-origin: top left;
}
.fa-area-flow li:not(:last-child)::after { background: #2277c6; }
.fa-area-flow span::before {
  content: ""; position: absolute; z-index: 1; left: 0; top: 0;
  box-sizing: border-box; width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid #2277c6; background: #2277c6; box-shadow: 0 0 0 3px #e7eff9;
}
@media (max-width: 1050px) {
  .mc-home .mc-context-strip { grid-template-columns: 1fr; }
  .mc-context-strip .fa-sequence-head { justify-content: space-between; }
}
@media (max-width: 600px) {
  .fa-area-flow { --rail-start: 1, 0; grid-template-columns: 1fr; }
  .fa-area-flow li { padding: 0 0 15px 24px; }
  .fa-area-flow li:last-child { padding-bottom: 0; }
  .fa-area-flow span::before { top: calc(.7em - 5px); }
  .fa-area-flow li:not(:last-child)::before,
  .fa-area-flow li:not(:last-child)::after { top: .7em; left: 4px; width: 2px; height: 100%; }
}
@media screen and (prefers-reduced-motion: no-preference) {
  #flujo-empresa:is([data-sequence-state="waiting"], [data-sequence-state="playing"]) li::after {
    transform: scale(var(--rail-start));
  }
  #flujo-empresa:is([data-sequence-state="waiting"], [data-sequence-state="playing"]) span::before {
    background: #e7eff9; border-color: #899fb7;
  }
  #flujo-empresa[data-sequence-state="waiting"] li { color: #51677d; }
  #flujo-empresa[data-sequence-state="playing"] li:not(:last-child)::after {
    animation: fa-area-connect var(--travel-time) ease-in-out calc(var(--arrival) + var(--step-time) - var(--travel-time)) forwards;
  }
  #flujo-empresa[data-sequence-state="playing"] span::before {
    animation: fa-area-pulse 440ms ease-out var(--arrival) forwards;
  }
  #flujo-empresa[data-sequence-state="playing"] span {
    animation: fa-area-label 460ms ease-out var(--arrival) both;
  }
  @keyframes fa-area-connect { to { transform: scale(1); } }
  @keyframes fa-area-pulse {
    0% { background: #e7eff9; border-color: #899fb7; }
    40% { background: #4db9f3; border-color: #167bc6; box-shadow: 0 0 0 6px #49a9e436; }
    100% { background: #2277c6; border-color: #2277c6; box-shadow: 0 0 0 3px #e7eff9; }
  }
  @keyframes fa-area-label { from { color: #51677d; } 40% { color: #075bd7; } to { color: #153859; } }
}
