.process-motion {
  --process-accent: #fc4b49;
  --process-soft: #f9eeec;
  --process-paper: #fff;
  --process-surface: #f5f5f7;
  --process-line: #dedee2;
  display: grid;
  gap: 0;
  position: relative;
}

.process-motion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 4px;
  border-block-end: 1px solid var(--process-line);
  list-style: none;
  cursor: pointer;
  color: #535358;
  font-weight: 400;
  line-height: 1.25;
}
.process-motion summary::-webkit-details-marker { display: none; }
.process-motion summary::after {
  content: "";
  flex: 0 0 7px;
  height: 7px;
  margin-inline-end: 5px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  opacity: .62;
}
.process-motion summary:hover,
.process-motion details[open] summary { color: #202023; }
.process-motion details[open] summary { font-weight: 700; }
.process-motion details[open] summary::after { transform: rotate(225deg); color: var(--process-accent); opacity: 1; }
.process-motion summary:focus-visible { outline: 2px solid var(--process-accent); outline-offset: 3px; }

.process-demo {
  overflow: hidden;
  margin-block: 8px;
  padding: clamp(14px, 2.6vw, 32px);
  border-radius: 22px;
  background: var(--process-surface);
}
.process-motion .process-demo > p { margin: 0 0 24px; max-width: 54ch; color: #535358; }
.process-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: clamp(6px, 1.5vw, 18px);
  align-items: center;
}
.process-board {
  display: grid;
  align-content: start;
  align-self: stretch;
  min-width: 0;
  gap: 8px;
  padding: clamp(9px, 1.8vw, 20px);
  border-radius: 16px;
  background: var(--process-paper);
  overflow-wrap: anywhere;
  font-size: clamp(14px, 1.5vw, 19px);
}
.process-board > strong { margin-bottom: 5px; }
.process-board > span,
.process-bars > span {
  display: block;
  padding: 5px 7px;
  border-radius: 6px;
}
.process-board > span + span { border-block-start: 1px solid #f0f0f2; }
.process-board > .process-arrive,
.process-board > .process-sort,
.process-board > .process-status,
.process-board > .process-delta { background: var(--process-soft); }
.process-arrow { color: var(--process-accent); }
.process-bars { display: grid; gap: 6px; }
.process-bars i {
  display: block;
  height: 5px;
  background: #e74d48;
  border-radius: 10px;
  transform-origin: left;
}
.process-bars span:first-child i { background: #596673; }
.process-bars span:last-child i { width: 88%; }
@media (min-width: 820px) {
  .process-motion {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2.1fr);
    grid-template-rows: repeat(4, min-content);
    min-height: 340px;
    align-content: start;
    column-gap: 26px;
  }
  .process-motion details { grid-column: 1; }
  .process-demo {
    position: absolute;
    inset: 0 0 0 calc((100% - 26px) / 3.1 + 26px);
    margin: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .process-motion summary::after { transition: transform .2s ease, color .2s ease; }
  .process-step:nth-child(3) { --step-delay: .2s; }
  .process-step:nth-child(4) { --step-delay: .4s; }
  .is-playing .process-scan { animation: process-highlight .62s var(--step-delay, 0s) both; }
  .is-playing .process-arrive { animation: process-arrive .62s calc(var(--step-delay, 0s) + .26s) both; }
  .is-playing .process-sort { animation: process-sort .62s calc(var(--step-delay, 0s) + .15s) both; }
  .is-playing .process-sync-source { animation: process-highlight .7s both; }
  .is-playing .process-sync-link { animation: process-signal .5s .24s both; }
  .is-playing .process-sync-target { animation: process-arrive .52s .62s both; }
  .is-playing .process-bars i { animation: process-bar .65s .2s both; }
  .is-playing .process-bars span:last-child i { animation-delay: .46s; }
  .is-playing .process-delta { animation: process-sort .4s 1s both; }
}

@keyframes process-highlight {
  30%, 65% { background: #ffd7d4; }
}
@keyframes process-arrive {
  from { opacity: 0; transform: translate(var(--process-from-x, -17px), var(--process-from-y, 0px)); }
}
@keyframes process-sort {
  from { opacity: 0; transform: translate(var(--process-from-x, -13px), var(--process-from-y, 10px)); }
}
@keyframes process-signal {
  45% { transform: translateX(5px); opacity: .45; }
}
@keyframes process-bar {
  from { transform: scaleX(0); }
}

.pilot-timeline {
  --pilot-line: #dcdce1;
  display: grid;
  gap: 0;
  padding: clamp(16px, 3vw, 30px);
  margin: 0;
  border-radius: 22px;
  background: #f5f5f7;
  list-style: none;
}
.pilot-timeline li {
  position: relative;
  min-width: 0;
  padding: 0 0 18px 20px;
  border-inline-start: 1px solid var(--pilot-line);
}
.pilot-timeline li::before {
  content: "";
  position: absolute;
  inset-block-start: .53em;
  inset-inline-start: -4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fc4b49;
}
.pilot-timeline li:last-child { padding-bottom: 0; border-color: transparent; }
.ai-pilot .pilot-timeline h3 { font: 700 1em/1.25 PTSans, Arial, sans-serif; }
.ai-pilot .pilot-timeline p { margin: 5px 0 0; }
.pilot-fields {
  display: grid;
  gap: 4px;
  margin: 9px 0 0;
}
.pilot-fields > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 10px;
  padding-block: 4px;
  border-block-end: 1px solid var(--pilot-line);
}
.pilot-fields dt { color: #57575c; }
.pilot-fields dd { margin: 0; overflow-wrap: anywhere; }
.pilot-result { color: #276144; }

@media (prefers-reduced-motion: no-preference) {
  .pilot-timeline.is-playing li { animation: pilot-stage .42s ease-out both; }
  .pilot-timeline.is-playing li:nth-child(2) { animation-delay: .48s; }
  .pilot-timeline.is-playing li:nth-child(3) { animation-delay: 1.14s; }
  .pilot-timeline.is-playing .pilot-fields dd { animation: pilot-field .34s .64s ease-out both; }
  .pilot-timeline.is-playing .pilot-fields > div:nth-child(2) dd { animation-delay: .76s; }
  .pilot-timeline.is-playing .pilot-fields > div:nth-child(3) dd { animation-delay: .88s; }
}
@keyframes pilot-stage {
  from { opacity: .24; translate: 0 5px; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes pilot-field {
  from { opacity: 0; translate: -5px 0; }
  to { opacity: 1; translate: 0 0; }
}

.process-board small {
  display: block;
  margin-bottom: 2px;
  color: #57575c;
  font-size: .8em;
  line-height: 1.25;
}
@media (min-width: 820px) {
  .process-motion { min-height: 390px; }
}
