.ai-operations {
  --ai-ops-rule: #c7b797;
  --ai-ops-forest: #173b30;
  --ai-ops-muted: #4e6056;
  --ai-ops-brass: #775923;
}

.ai-ops-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 26px 0 0;
  padding: 0;
  border-block: 1px solid var(--ai-ops-rule);
  list-style: none;
}

.ai-ops-flow li {
  position: relative;
  min-width: 0;
  padding: 20px clamp(12px, 1.5vw, 22px);
  border-inline-end: 1px solid var(--ai-ops-rule);
}
.ai-ops-flow li:last-child { border-inline-end: 0; }

.ai-ops-flow li::before {
  position: absolute;
  inset: -1px 0 auto;
  height: 2px;
  background: #8b6e37;
  content: "";
  opacity: 0;
  pointer-events: none;
}
.ai-ops-flow[data-sequence] li::before {
  animation: ai-ops-sequence .5s cubic-bezier(.17, .7, .27, 1) both;
  animation-delay: calc(var(--ai-ops-step, 0) * 150ms);
}
.ai-ops-flow li:nth-child(2) { --ai-ops-step: 1; }
.ai-ops-flow li:nth-child(3) { --ai-ops-step: 2; }
.ai-ops-flow li:nth-child(4) { --ai-ops-step: 3; }
.ai-ops-flow li:nth-child(5) { --ai-ops-step: 4; }

@keyframes ai-ops-sequence {
  from { clip-path: inset(0 100% 0 0); opacity: 0; }
  55% { opacity: 1; }
  to { clip-path: inset(0); opacity: .36; }
}

.ai-ops-step-number {
  display: block;
  color: var(--ai-ops-brass);
  font-size: .75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ai-ops-flow strong {
  display: block;
  margin: 3px 0;
  color: var(--ai-ops-forest);
  font: 500 clamp(1.5rem, 2.2vw, 1.9rem)/1.05 var(--serif);
}
.ai-ops-step-description {
  display: block;
  color: var(--ai-ops-muted);
  font-size: .875rem;
  line-height: 1.35;
}
.ai-ops-flow .ai-ops-human { background: #eae2cd; }
.ai-ops-human .ai-ops-step-description { color: #694b1d; font-weight: 650; }
.ai-ops-external .ai-ops-step-description { color: var(--ai-ops-forest); font-weight: 600; }

.ai-ops-outcome {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(14px, 3vw, 36px);
  margin-top: 24px;
  padding: clamp(14px, 2.5vw, 30px);
  border-inline-start: 1px solid #927541;
  background: #eae2cc;
}
.ai-ops-outcome .ai-ops-outcome-value {
  color: var(--ai-ops-forest);
  font: 400 clamp(2.2rem, 5.9vw, 5.25rem)/1 var(--serif);
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -.045em;
  white-space: nowrap;
}
.ai-ops-outcome h4 {
  margin: 0;
  color: var(--ai-ops-forest);
  font: 500 clamp(1.4rem, 2.5vw, 2rem)/1.08 var(--serif);
  text-wrap: balance;
}
.ai-ops-outcome p { margin-block-start: 5px; }
.ai-ops-outcome .ai-ops-outcome-note {
  margin-block-start: 8px;
  color: var(--ai-ops-muted);
  font-size: .8rem;
  line-height: 1.45;
}

.ai-ops-details {
  margin-block-start: 15px;
  border-block: 1px solid var(--ai-ops-rule);
}
.ai-ops-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 7px 3px;
  color: var(--ai-ops-forest);
  font-size: .875rem;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}
.ai-ops-details summary::-webkit-details-marker { display: none; }
.ai-ops-details summary span {
  position: relative;
  flex: 0 0 14px;
  height: 14px;
  color: var(--ai-ops-brass);
}
.ai-ops-details summary span::before,
.ai-ops-details summary span::after {
  position: absolute;
  inset: 6px 2px auto;
  border-block-start: 1px solid;
  content: "";
}
.ai-ops-details summary span::after { transform: rotate(90deg); }
.ai-ops-details[open] summary span::after { display: none; }
.ai-ops-details summary:focus-visible { outline: 2px solid var(--ai-ops-brass); outline-offset: 2px; }
.ai-ops-details-body {
  max-inline-size: 68ch;
  padding: 0 3px 14px;
  color: var(--ai-ops-muted);
  font-size: .9rem;
}
.ai-ops-details-body p + p { margin-block-start: 8px; }

@media (max-width: 650px) {
  .ai-ops-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-ops-flow li { padding-block: 14px; }
  .ai-ops-flow li:nth-child(even) { border-inline-end: 0; }
  .ai-ops-flow li:nth-child(-n+4) { border-block-end: 1px solid var(--ai-ops-rule); }
  .ai-ops-flow li:last-child { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-ops-flow[data-sequence] li::before { animation: none; }
}
