/* Complex AI Workflows: an invoice email triggers a five-step pipeline (Invoice Email -> Read Invoice ->
   Match PO -> Approve -> Pay & Notify). The pipeline row lights each step in turn while the stage below shows
   that step's detail card; a "run complete" card closes the loop. Keyframe offsets are % of the cycle;
   staggered items share one keyframe and start at --ent-workflows-at (% of the cycle). */
/* ---- Frame ---- */
.ent-workflows {
  --ent-workflows-cycle: 17.18s;
  --ent-workflows-at: 0;
  --ent-workflows-step-idle: inset 0 0 0 1px var(--rule);
  --ent-workflows-step-active:
    0 0 0 4px var(--ent-accent-a12), inset 0 0 0 1.5px var(--accent);
  --ent-workflows-step-done: inset 0 0 0 1px var(--ent-green-150);
  width: 100%;
  height: 420px;
  box-sizing: border-box;
  padding: 18px;
  border-radius: 16px;
  background: var(--paper-2);
  box-shadow:
    0 16px 48px var(--ent-ink-a8),
    inset 0 0 0 1px var(--rule);
  font-family: Inter, system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  color: var(--ink-2);
}
.ent-workflows__label {
  font:
    400 10.5px/14px "Geist Mono",
    ui-monospace,
    monospace;
  letter-spacing: 0.06em;
  color: var(--ent-zinc-350);
}
.ent-workflows__icon {
  flex-shrink: 0;
  stroke: var(--accent);
}
.ent-workflows__check {
  flex-shrink: 0;
  display: block;
  stroke: var(--ent-green-700);
}
.ent-workflows__spinner {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--ent-violet-60);
  border-top-color: var(--accent);
  animation: ent-workflows-spin-free 0.8s linear infinite;
  flex-shrink: 0;
  box-sizing: border-box;
}
@keyframes ent-workflows-spin-free {
  to {
    transform: rotate(360deg);
  }
}

/* ---- Status: a spinner that gives way to its result (check or value) ---- */
.ent-workflows__status {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 14px;
  height: 16px;
  flex-shrink: 0;
}
.ent-workflows__status-spinner,
.ent-workflows__status-result {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  opacity: 0;
}
.ent-workflows__status-result {
  position: absolute;
  left: 0;
  top: 0;
  height: 16px;
}
/* Staggered tasks (fields, 3-way docs, actions): a brief spin at --at, the result 2.18% later.
   The result holds until its group's .ent-workflows__status wrapper clears them all together. */
.ent-workflows__field-value .ent-workflows__status-spinner,
.ent-workflows__doc .ent-workflows__status-spinner,
.ent-workflows__action .ent-workflows__status-spinner {
  animation: ent-workflows-spin-brief var(--ent-workflows-cycle) linear infinite;
  animation-delay: calc(
    var(--ent-workflows-cycle) * var(--ent-workflows-at) / 100
  );
}
.ent-workflows__field-value .ent-workflows__status-result,
.ent-workflows__doc .ent-workflows__status-result,
.ent-workflows__action .ent-workflows__status-result {
  animation: ent-workflows-result-in var(--ent-workflows-cycle) linear infinite;
  animation-delay: calc(
    var(--ent-workflows-cycle) * (var(--ent-workflows-at) + 2.18) / 100
  );
}
@keyframes ent-workflows-spin-brief {
  0% {
    opacity: 0;
  }
  0.66%,
  1.97% {
    opacity: 1;
  }
  2.63%,
  100% {
    opacity: 0;
  }
}
@keyframes ent-workflows-result-in {
  0% {
    opacity: 0;
  }
  0.88%,
  14% {
    opacity: 1;
  }
  14.01%,
  100% {
    opacity: 0;
  }
}

/* ---- Pipeline: each step rings while it runs, then turns green; everything resets at 98.68% ---- */
.ent-workflows__pipeline {
  display: flex;
  align-items: center;
}
.ent-workflows__step {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 9px;
  border-radius: 10px;
  background: var(--paper);
  box-shadow: var(--ent-workflows-step-idle);
  animation: none var(--ent-workflows-cycle) steps(1, end) infinite;
}
.ent-workflows__step-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}
.ent-workflows__step-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 13px;
}
.ent-workflows__step-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ent-workflows__step-kind {
  font:
    400 8.5px "Geist Mono",
    ui-monospace,
    monospace;
  font-style: normal;
  color: var(--ent-zinc-350);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.ent-workflows__step-status {
  position: absolute;
  top: -6px;
  right: -5px;
  background: var(--paper-2);
  border-radius: 50%;
  padding: 1px;
}
.ent-workflows__step-status .ent-workflows__status-spinner,
.ent-workflows__step-status .ent-workflows__status-result {
  animation: none var(--ent-workflows-cycle) linear infinite;
}
.ent-workflows__step--trigger {
  animation-name: ent-workflows-step-trigger;
}
.ent-workflows__step--trigger .ent-workflows__status-spinner {
  animation-name: ent-workflows-step-trigger-spin;
}
.ent-workflows__step--trigger .ent-workflows__status-result {
  animation-name: ent-workflows-step-trigger-done;
}
.ent-workflows__step--read {
  animation-name: ent-workflows-step-read;
}
.ent-workflows__step--read .ent-workflows__status-spinner {
  animation-name: ent-workflows-step-read-spin;
}
.ent-workflows__step--read .ent-workflows__status-result {
  animation-name: ent-workflows-step-read-done;
}
.ent-workflows__step--match {
  animation-name: ent-workflows-step-match;
}
.ent-workflows__step--match .ent-workflows__status-spinner {
  animation-name: ent-workflows-step-match-spin;
}
.ent-workflows__step--match .ent-workflows__status-result {
  animation-name: ent-workflows-step-match-done;
}
.ent-workflows__step--approve {
  animation-name: ent-workflows-step-approve;
}
.ent-workflows__step--approve .ent-workflows__status-spinner {
  animation-name: ent-workflows-step-approve-spin;
}
.ent-workflows__step--approve .ent-workflows__status-result {
  animation-name: ent-workflows-step-approve-done;
}
.ent-workflows__step--pay {
  animation-name: ent-workflows-step-pay;
}
.ent-workflows__step--pay .ent-workflows__status-spinner {
  animation-name: ent-workflows-step-pay-spin;
}
.ent-workflows__step--pay .ent-workflows__status-result {
  animation-name: ent-workflows-step-pay-done;
}
@keyframes ent-workflows-step-trigger {
  1.31% {
    box-shadow: var(--ent-workflows-step-active);
  }
  12.45% {
    box-shadow: var(--ent-workflows-step-done);
  }
  98.68% {
    box-shadow: var(--ent-workflows-step-idle);
  }
}
@keyframes ent-workflows-step-read {
  12.45% {
    box-shadow: var(--ent-workflows-step-active);
  }
  30.07% {
    box-shadow: var(--ent-workflows-step-done);
  }
  98.68% {
    box-shadow: var(--ent-workflows-step-idle);
  }
}
@keyframes ent-workflows-step-match {
  30.07% {
    box-shadow: var(--ent-workflows-step-active);
  }
  55.76% {
    box-shadow: var(--ent-workflows-step-done);
  }
  98.68% {
    box-shadow: var(--ent-workflows-step-idle);
  }
}
@keyframes ent-workflows-step-approve {
  55.76% {
    box-shadow: var(--ent-workflows-step-active);
  }
  74.94% {
    box-shadow: var(--ent-workflows-step-done);
  }
  98.68% {
    box-shadow: var(--ent-workflows-step-idle);
  }
}
@keyframes ent-workflows-step-pay {
  74.94% {
    box-shadow: var(--ent-workflows-step-active);
  }
  89.88% {
    box-shadow: var(--ent-workflows-step-done);
  }
  98.68% {
    box-shadow: var(--ent-workflows-step-idle);
  }
}
@keyframes ent-workflows-step-trigger-spin {
  0%,
  1.52% {
    opacity: 0;
  }
  2.18%,
  12.24% {
    opacity: 1;
  }
  12.89%,
  100% {
    opacity: 0;
  }
}
@keyframes ent-workflows-step-read-spin {
  0%,
  12.67% {
    opacity: 0;
  }
  13.33%,
  29.84% {
    opacity: 1;
  }
  30.5%,
  100% {
    opacity: 0;
  }
}
@keyframes ent-workflows-step-match-spin {
  0%,
  30.28% {
    opacity: 0;
  }
  30.94%,
  55.54% {
    opacity: 1;
  }
  56.2%,
  100% {
    opacity: 0;
  }
}
@keyframes ent-workflows-step-approve-spin {
  0%,
  55.98% {
    opacity: 0;
  }
  56.64%,
  74.72% {
    opacity: 1;
  }
  75.38%,
  100% {
    opacity: 0;
  }
}
@keyframes ent-workflows-step-pay-spin {
  0%,
  75.15% {
    opacity: 0;
  }
  75.81%,
  89.67% {
    opacity: 1;
  }
  90.32%,
  100% {
    opacity: 0;
  }
}
@keyframes ent-workflows-step-trigger-done {
  0%,
  12.45% {
    opacity: 0;
  }
  13.33%,
  97.37% {
    opacity: 1;
  }
  98.24%,
  100% {
    opacity: 0;
  }
}
@keyframes ent-workflows-step-read-done {
  0%,
  30.06% {
    opacity: 0;
  }
  30.94%,
  97.37% {
    opacity: 1;
  }
  98.24%,
  100% {
    opacity: 0;
  }
}
@keyframes ent-workflows-step-match-done {
  0%,
  55.76% {
    opacity: 0;
  }
  56.64%,
  97.37% {
    opacity: 1;
  }
  98.24%,
  100% {
    opacity: 0;
  }
}
@keyframes ent-workflows-step-approve-done {
  0%,
  74.94% {
    opacity: 0;
  }
  75.81%,
  97.37% {
    opacity: 1;
  }
  98.24%,
  100% {
    opacity: 0;
  }
}
@keyframes ent-workflows-step-pay-done {
  0%,
  89.88% {
    opacity: 0;
  }
  90.76%,
  97.37% {
    opacity: 1;
  }
  98.24%,
  100% {
    opacity: 0;
  }
}

/* Links flash accent as the run hands over to the next step */
.ent-workflows__link {
  width: 14px;
  height: 2px;
  background: var(--rule);
  position: relative;
  flex-shrink: 0;
}
.ent-workflows__link-flow {
  position: absolute;
  inset: 0;
  background: var(--accent);
  opacity: 0;
  animation: ent-workflows-link-flow var(--ent-workflows-cycle) steps(1, end)
    infinite;
  animation-delay: calc(
    var(--ent-workflows-cycle) * var(--ent-workflows-at) / 100
  );
}
.ent-workflows__link:nth-child(2) {
  --ent-workflows-at: 10.71;
}
.ent-workflows__link:nth-child(4) {
  --ent-workflows-at: 28.32;
}
.ent-workflows__link:nth-child(6) {
  --ent-workflows-at: 54.02;
}
.ent-workflows__link:nth-child(8) {
  --ent-workflows-at: 73.2;
}
@keyframes ent-workflows-link-flow {
  0% {
    opacity: 1;
  }
  4.36%,
  100% {
    opacity: 0;
  }
}

/* ---- Stage: one scene per step; each scene and its caption rise in, then fade out ---- */
.ent-workflows__stage {
  position: relative;
  flex: 1;
  min-height: 0;
}
.ent-workflows__scene {
  position: absolute;
  inset: 0;
  padding-top: 40px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.ent-workflows__scene,
.ent-workflows__caption,
.ent-workflows__mail,
.ent-workflows__schedule,
.ent-workflows__match-ok,
.ent-workflows__approved {
  opacity: 0;
  animation: none var(--ent-workflows-cycle) linear infinite;
}
.ent-workflows__caption {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 13px;
  color: var(--ent-zinc-750);
}
.ent-workflows__caption .ent-workflows__label {
  color: var(--accent);
}
.ent-workflows__scene--email,
.ent-workflows__scene--email > .ent-workflows__caption {
  animation-name: ent-workflows-scene-email;
}
.ent-workflows__scene--read,
.ent-workflows__scene--read > .ent-workflows__caption {
  animation-name: ent-workflows-scene-read;
}
.ent-workflows__scene--match,
.ent-workflows__scene--match > .ent-workflows__caption {
  animation-name: ent-workflows-scene-match;
}
.ent-workflows__scene--approve,
.ent-workflows__scene--approve > .ent-workflows__caption {
  animation-name: ent-workflows-scene-approve;
}
.ent-workflows__scene--pay,
.ent-workflows__scene--pay > .ent-workflows__caption {
  animation-name: ent-workflows-scene-pay;
}
.ent-workflows__scene--done,
.ent-workflows__scene--done > .ent-workflows__caption {
  animation-name: ent-workflows-scene-done;
}
@keyframes ent-workflows-scene-email {
  0%,
  1.31% {
    opacity: 0;
    transform: translateY(5px);
  }
  2.62%,
  11.15% {
    opacity: 1;
    transform: none;
  }
  12.45%,
  100% {
    opacity: 0;
    transform: none;
  }
}
@keyframes ent-workflows-scene-read {
  0%,
  12.45% {
    opacity: 0;
    transform: translateY(5px);
  }
  13.76%,
  28.76% {
    opacity: 1;
    transform: none;
  }
  30.07%,
  100% {
    opacity: 0;
    transform: none;
  }
}
@keyframes ent-workflows-scene-match {
  0%,
  30.06% {
    opacity: 0;
    transform: translateY(5px);
  }
  31.38%,
  54.46% {
    opacity: 1;
    transform: none;
  }
  55.76%,
  100% {
    opacity: 0;
    transform: none;
  }
}
@keyframes ent-workflows-scene-approve {
  0%,
  55.76% {
    opacity: 0;
    transform: translateY(5px);
  }
  57.07%,
  73.63% {
    opacity: 1;
    transform: none;
  }
  74.94%,
  100% {
    opacity: 0;
    transform: none;
  }
}
@keyframes ent-workflows-scene-pay {
  0%,
  74.94% {
    opacity: 0;
    transform: translateY(5px);
  }
  76.25%,
  88.58% {
    opacity: 1;
    transform: none;
  }
  89.88%,
  100% {
    opacity: 0;
    transform: none;
  }
}
@keyframes ent-workflows-scene-done {
  0%,
  89.88% {
    opacity: 0;
    transform: translateY(5px);
  }
  91.19%,
  97.37% {
    opacity: 1;
    transform: none;
  }
  98.68%,
  100% {
    opacity: 0;
    transform: none;
  }
}

/* ---- Step 1: the invoice email arrives; the schedule chip follows ---- */
.ent-workflows__mail {
  width: 460px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--paper);
  box-shadow:
    0 8px 28px var(--ent-ink-a6),
    inset 0 0 0 1px var(--rule);
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12.5px;
  animation-name: ent-workflows-mail-in;
}
.ent-workflows__mail-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ent-zinc-60);
}
.ent-workflows__mail-icon {
  width: 20px;
  height: 20px;
}
.ent-workflows__mail-inbox {
  font-size: 13px;
  color: var(--ink);
}
.ent-workflows__mail-new {
  margin-left: auto;
  font:
    500 9.5px "Geist Mono",
    ui-monospace,
    monospace;
  color: var(--on-accent);
  background: var(--accent);
  padding: 2px 6px;
  border-radius: 5px;
}
.ent-workflows__mail-row {
  display: flex;
  gap: 10px;
  color: var(--ent-zinc-750);
}
.ent-workflows__mail-key {
  font-style: normal;
  width: 52px;
  color: var(--ent-zinc-350);
}
.ent-workflows__mail-subject {
  color: var(--ink);
  font-weight: 600;
}
.ent-workflows__attachment {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1px var(--ent-zinc-50);
  font-size: 12px;
  color: var(--ink);
}
.ent-workflows__attachment-icon {
  stroke: var(--ent-red-600);
}
.ent-workflows__attachment-size {
  color: var(--ent-zinc-350);
  font-size: 11px;
}
.ent-workflows__schedule {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ent-violet-400);
  background: var(--ent-violet-100);
  padding: 5px 11px;
  border-radius: 999px;
  animation-name: ent-workflows-schedule-in;
}
@keyframes ent-workflows-mail-in {
  0%,
  2.62% {
    opacity: 0;
    transform: translateY(5px);
  }
  3.93%,
  11.15% {
    opacity: 1;
    transform: none;
  }
  12.45%,
  100% {
    opacity: 0;
    transform: none;
  }
}
@keyframes ent-workflows-schedule-in {
  0%,
  6.37% {
    opacity: 0;
    transform: translateY(5px);
  }
  7.69%,
  11.15% {
    opacity: 1;
    transform: none;
  }
  12.45%,
  100% {
    opacity: 0;
    transform: none;
  }
}

/* ---- Step 2: a scan line sweeps the PDF while the fields fill in, 0.37s apart ---- */
.ent-workflows__read {
  display: flex;
  gap: 16px;
  align-items: stretch;
}
.ent-workflows__invoice {
  position: relative;
  width: 210px;
  height: 212px;
  box-sizing: border-box;
  padding: 16px;
  border-radius: 6px;
  background: var(--paper);
  box-shadow:
    0 8px 24px var(--ent-ink-a8),
    inset 0 0 0 1px var(--rule);
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow: hidden;
}
.ent-workflows__invoice-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.ent-workflows__invoice-vendor {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.ent-workflows__invoice-type {
  font:
    500 9px "Geist Mono",
    ui-monospace,
    monospace;
  color: var(--ent-red-600);
}
.ent-workflows__invoice-line {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: var(--ent-zinc-60);
}
.ent-workflows__invoice-line:nth-of-type(1) {
  width: 60%;
}
.ent-workflows__invoice-line:nth-of-type(2) {
  width: 40%;
}
.ent-workflows__invoice-line:nth-of-type(3) {
  width: 85%;
}
.ent-workflows__invoice-line:nth-of-type(4) {
  width: 70%;
}
.ent-workflows__invoice-line:nth-of-type(5) {
  width: 90%;
}
.ent-workflows__invoice-line:nth-of-type(6) {
  width: 55%;
}
.ent-workflows__invoice-line:nth-of-type(7) {
  width: 75%;
}
.ent-workflows__invoice-total {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  padding-top: 8px;
  border-top: 1px solid var(--ent-zinc-60);
}
.ent-workflows__invoice-amount {
  font-family: "Geist Mono", ui-monospace, monospace;
}
.ent-workflows__scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 34px;
  height: 26px;
  background: linear-gradient(
    180deg,
    var(--ent-accent-a0),
    var(--ent-accent-a15),
    var(--ent-accent-a0)
  );
  border-bottom: 1.5px solid var(--accent);
  animation: ent-workflows-scan var(--ent-workflows-cycle) linear infinite;
}
@keyframes ent-workflows-scan {
  0%,
  13.33% {
    top: 34px;
    opacity: 0;
  }
  13.76% {
    opacity: 1;
  }
  25.55% {
    top: 178px;
    opacity: 1;
  }
  25.99%,
  100% {
    top: 178px;
    opacity: 0;
  }
}
.ent-workflows__fields {
  width: 280px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--rule);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.ent-workflows__field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--ent-zinc-80);
}
.ent-workflows__field:nth-child(2) {
  --ent-workflows-at: 13.76;
}
.ent-workflows__field:nth-child(3) {
  --ent-workflows-at: 15.94;
}
.ent-workflows__field:nth-child(4) {
  --ent-workflows-at: 18.12;
}
.ent-workflows__field:nth-child(5) {
  --ent-workflows-at: 20.32;
}
.ent-workflows__field:nth-child(6) {
  --ent-workflows-at: 22.5;
}
.ent-workflows__field-name {
  font-style: normal;
  color: var(--muted);
}
.ent-workflows__field-value {
  min-width: 120px;
  display: flex;
  justify-content: flex-end;
}
.ent-workflows__field-value .ent-workflows__status {
  animation: ent-workflows-fields-clear var(--ent-workflows-cycle) linear
    infinite;
}
.ent-workflows__field-value .ent-workflows__status-result {
  left: auto;
  right: 0;
}
.ent-workflows__field-value b {
  font-weight: 600;
  color: var(--ink);
}
@keyframes ent-workflows-fields-clear {
  0%,
  28.76% {
    opacity: 1;
  }
  29.63%,
  100% {
    opacity: 0;
  }
}

/* ---- Step 3: the agent types the PO number, the cursor picks the row, the 3 documents check off ---- */
.ent-workflows__match {
  display: flex;
  gap: 14px;
  align-items: stretch;
}
.ent-workflows__browser {
  position: relative;
  width: 420px;
  border-radius: 10px;
  background: var(--paper);
  box-shadow:
    0 8px 24px var(--ent-ink-a8),
    inset 0 0 0 1px var(--rule);
  overflow: hidden;
}
.ent-workflows__browser-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  background: var(--paper-3);
  border-bottom: 1px solid var(--rule);
}
.ent-workflows__browser-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rule-strong);
}
.ent-workflows__browser-url {
  margin-left: 10px;
  font:
    400 10.5px "Geist Mono",
    ui-monospace,
    monospace;
  color: var(--muted);
}
.ent-workflows__browser-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ent-workflows__search {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  box-shadow: inset 0 0 0 1.5px var(--ent-violet-160);
  font:
    500 12px "Geist Mono",
    ui-monospace,
    monospace;
  color: var(--ink);
}
.ent-workflows__search-icon {
  stroke: var(--ent-zinc-350);
}
/* The query types in one character at a time and clears with its scene */
.ent-workflows__query {
  animation: ent-workflows-query-clear var(--ent-workflows-cycle) linear
    infinite;
}
.ent-workflows__query-char {
  opacity: 0;
  animation: ent-workflows-type-char var(--ent-workflows-cycle) linear infinite;
  animation-delay: calc(
    var(--ent-workflows-cycle) * var(--ent-workflows-at) / 100
  );
}
.ent-workflows__query-char:nth-child(1) {
  --ent-workflows-at: 33.56;
}
.ent-workflows__query-char:nth-child(2) {
  --ent-workflows-at: 34.08;
}
.ent-workflows__query-char:nth-child(3) {
  --ent-workflows-at: 34.61;
}
.ent-workflows__query-char:nth-child(4) {
  --ent-workflows-at: 35.12;
}
.ent-workflows__query-char:nth-child(5) {
  --ent-workflows-at: 35.64;
}
.ent-workflows__query-char:nth-child(6) {
  --ent-workflows-at: 36.17;
}
.ent-workflows__query-char:nth-child(7) {
  --ent-workflows-at: 36.69;
}
.ent-workflows__query-char:nth-child(8) {
  --ent-workflows-at: 37.22;
}
@keyframes ent-workflows-type-char {
  0% {
    opacity: 0;
  }
  0.17%,
  22% {
    opacity: 1;
  }
  22.01%,
  100% {
    opacity: 0;
  }
}
@keyframes ent-workflows-query-clear {
  0%,
  54.46% {
    opacity: 1;
  }
  54.63%,
  100% {
    opacity: 0;
  }
}
.ent-workflows__po-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.ent-workflows__po-table th {
  text-align: left;
  font-weight: 500;
  font-size: 10.5px;
  color: var(--ent-zinc-350);
  padding: 0 6px 5px;
  border-bottom: 1px solid var(--ent-zinc-60);
}
.ent-workflows__po-table td {
  padding: 0 6px;
  height: 28px;
  border-bottom: 1px solid var(--ent-zinc-80);
}
.ent-workflows__po-table td:last-child,
.ent-workflows__po-table th:last-child {
  text-align: right;
  font-family: "Geist Mono", ui-monospace, monospace;
}
.ent-workflows__po-hit {
  background: transparent;
  animation: ent-workflows-po-hit var(--ent-workflows-cycle) steps(1, end)
    infinite;
}
@keyframes ent-workflows-po-hit {
  40.55% {
    background: var(--ent-violet-100);
  }
  55.76% {
    background: transparent;
  }
}
.ent-workflows__cursor {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
}
.ent-workflows__cursor path {
  fill: var(--ink);
  stroke: var(--paper);
}
/* Cursor: into the search box, then onto the matching row (the ease-in-out also dims it while the
   3-way match runs, as in the original) */
.ent-workflows__cursor--browse {
  animation: ent-workflows-cursor-browse var(--ent-workflows-cycle) ease-in-out
    infinite;
}
@keyframes ent-workflows-cursor-browse {
  0% {
    transform: translate(330px, 150px);
    opacity: 0;
  }
  30.07% {
    transform: translate(330px, 150px);
    opacity: 1;
  }
  31.81%,
  38.35% {
    transform: translate(118px, 44px);
    opacity: 1;
  }
  40.11% {
    transform: translate(150px, 112px);
    opacity: 1;
  }
  54.46% {
    transform: translate(150px, 112px);
    opacity: 0;
  }
  55.76% {
    transform: translate(150px, 112px);
    opacity: 1;
  }
  100% {
    transform: translate(150px, 112px);
    opacity: 0;
  }
}
.ent-workflows__three-way {
  width: 220px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--rule);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ent-workflows__doc {
  display: flex;
  align-items: center;
  gap: 9px;
}
.ent-workflows__doc:nth-child(2) {
  --ent-workflows-at: 42.28;
}
.ent-workflows__doc:nth-child(3) {
  --ent-workflows-at: 44.91;
}
.ent-workflows__doc:nth-child(4) {
  --ent-workflows-at: 47.52;
}
.ent-workflows__doc .ent-workflows__status {
  animation: ent-workflows-docs-clear var(--ent-workflows-cycle) linear infinite;
}
@keyframes ent-workflows-docs-clear {
  0%,
  54.46% {
    opacity: 1;
  }
  55.33%,
  100% {
    opacity: 0;
  }
}
.ent-workflows__doc-text {
  display: flex;
  flex-direction: column;
  line-height: 15px;
}
.ent-workflows__doc-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
}
.ent-workflows__doc-ref {
  font:
    400 10.5px "Geist Mono",
    ui-monospace,
    monospace;
  color: var(--muted);
}
.ent-workflows__match-ok {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ent-green-700);
  background: var(--ent-green-50);
  padding: 6px 10px;
  border-radius: 8px;
  animation-name: ent-workflows-match-ok-in;
}
@keyframes ent-workflows-match-ok-in {
  0%,
  50.14% {
    opacity: 0;
    transform: translateY(5px);
  }
  51.46%,
  54.46% {
    opacity: 1;
    transform: none;
  }
  55.76%,
  100% {
    opacity: 0;
    transform: none;
  }
}

/* ---- Step 4: the approval request in Teams; the cursor clicks Approve ---- */
.ent-workflows__chat {
  position: relative;
  width: 520px;
  border-radius: 12px;
  background: var(--paper);
  box-shadow:
    0 8px 28px var(--ent-ink-a6),
    inset 0 0 0 1px var(--rule);
  overflow: hidden;
}
.ent-workflows__chat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--ent-zinc-70);
  border-bottom: 1px solid var(--ent-zinc-50);
}
.ent-workflows__chat-icon {
  width: 18px;
  height: 18px;
}
.ent-workflows__chat-channel {
  font-size: 12.5px;
  color: var(--ink);
}
.ent-workflows__message {
  display: flex;
  gap: 10px;
  padding: 14px;
}
.ent-workflows__avatar {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--ent-cyan-600));
}
.ent-workflows__message-meta {
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.ent-workflows__message-author {
  font-size: 12.5px;
  color: var(--ink);
}
.ent-workflows__message-time {
  font-style: normal;
  font-size: 11px;
  color: var(--ent-zinc-350);
}
.ent-workflows__message-text {
  margin: 4px 0 10px;
  font-size: 12.5px;
  line-height: 18px;
  color: var(--ent-zinc-750);
}
.ent-workflows__message-text b {
  color: var(--ink);
}
.ent-workflows__buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}
.ent-workflows__button {
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
}
.ent-workflows__button--approve {
  background: var(--accent);
  color: var(--on-accent);
  animation: ent-workflows-approve-press var(--ent-workflows-cycle)
    steps(1, end) infinite;
}
.ent-workflows__button--reject {
  box-shadow: inset 0 0 0 1px var(--rule);
  color: var(--ent-zinc-750);
}
.ent-workflows__button--link {
  color: var(--ent-violet-400);
}
@keyframes ent-workflows-approve-press {
  66.97% {
    background: var(--ent-violet-400);
  }
  74.94% {
    background: var(--accent);
  }
}
.ent-workflows__approved {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--ent-green-700);
  animation-name: ent-workflows-approved-in;
}
.ent-workflows__approver {
  color: var(--ent-green-800);
}
@keyframes ent-workflows-approved-in {
  0%,
  68.28% {
    opacity: 0;
    transform: translateY(5px);
  }
  69.58%,
  73.63% {
    opacity: 1;
    transform: none;
  }
  74.94%,
  100% {
    opacity: 0;
    transform: none;
  }
}
.ent-workflows__click {
  position: absolute;
  left: 78px;
  top: 110px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ent-accent-a25);
  opacity: 0;
  animation: ent-workflows-click var(--ent-workflows-cycle) linear infinite;
}
@keyframes ent-workflows-click {
  0%,
  66.97% {
    opacity: 0;
  }
  67.4%,
  68.5% {
    opacity: 1;
  }
  68.94%,
  100% {
    opacity: 0;
  }
}
.ent-workflows__cursor--approve {
  animation: ent-workflows-cursor-approve var(--ent-workflows-cycle) ease-in-out
    infinite;
}
@keyframes ent-workflows-cursor-approve {
  0%,
  61.3% {
    transform: translate(430px, 150px);
    opacity: 0;
  }
  62.61% {
    opacity: 1;
  }
  66.53%,
  73.2% {
    transform: translate(86px, 113px);
    opacity: 1;
  }
  73.63%,
  100% {
    opacity: 0;
  }
}

/* ---- Step 5: each action rises in 0.41s after the last and checks off; the list clears together ---- */
.ent-workflows__actions {
  width: 460px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: ent-workflows-actions-clear var(--ent-workflows-cycle) linear
    infinite;
}
.ent-workflows__action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--rule);
  font-size: 12.5px;
  opacity: 0;
  animation: ent-workflows-action-in var(--ent-workflows-cycle) linear infinite;
  animation-delay: calc(
    var(--ent-workflows-cycle) * var(--ent-workflows-at) / 100
  );
}
.ent-workflows__action:nth-child(1) {
  --ent-workflows-at: 75.81;
}
.ent-workflows__action:nth-child(2) {
  --ent-workflows-at: 78.21;
}
.ent-workflows__action:nth-child(3) {
  --ent-workflows-at: 80.61;
}
.ent-workflows__action:nth-child(4) {
  --ent-workflows-at: 83.02;
}
.ent-workflows__action .ent-workflows__status {
  animation: ent-workflows-action-checks-clear var(--ent-workflows-cycle) linear
    infinite;
}
.ent-workflows__action-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}
.ent-workflows__action-name {
  font-weight: 500;
  color: var(--ink);
}
.ent-workflows__action-ref {
  margin-left: auto;
  font:
    400 10.5px "Geist Mono",
    ui-monospace,
    monospace;
  color: var(--muted);
}
@keyframes ent-workflows-action-in {
  0% {
    opacity: 0;
    transform: translateY(5px);
  }
  1.31%,
  15% {
    opacity: 1;
    transform: none;
  }
  15.01%,
  100% {
    opacity: 0;
    transform: none;
  }
}
@keyframes ent-workflows-actions-clear {
  0%,
  88.58% {
    opacity: 1;
  }
  89.88%,
  100% {
    opacity: 0;
  }
}
@keyframes ent-workflows-action-checks-clear {
  0%,
  88.58% {
    opacity: 1;
  }
  89.45%,
  100% {
    opacity: 0;
  }
}

/* ---- Run complete ---- */
.ent-workflows__done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.ent-workflows__done-badge {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--ent-green-50);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.ent-workflows__done-badge .ent-workflows__check {
  width: 26px;
  height: 26px;
}
.ent-workflows__done-title {
  font-size: 18px;
  color: var(--ink);
}
.ent-workflows__done-stats {
  font:
    400 11.5px "Geist Mono",
    ui-monospace,
    monospace;
  color: var(--muted);
}
.ent-workflows__next-run {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ent-zinc-750);
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--rule);
}
.ent-workflows__next-run-label {
  font:
    500 9.5px "Geist Mono",
    ui-monospace,
    monospace;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ---- Phones: the card stands up at a fixed height, short enough to fit on screen under the header. The
   pipeline keeps its five steps as icon tiles (the caption names the step), every scene stacks, NetSuite
   becomes a phone app whose 3-way match rises as a bottom sheet, and the pointers become touches.
   enterprise.css runs this animation unzoomed there. ---- */
.ent-workflows__phone-bar,
.ent-workflows__phone-title {
  display: none;
}
@media (max-width: 599px) {
  .ent-workflows {
    height: 520px;
    padding: 16px;
  }
  .ent-workflows__step {
    flex: none;
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    border-radius: 12px;
  }
  .ent-workflows__step-text {
    display: none;
  }
  .ent-workflows__link {
    flex: 1;
  }
  .ent-workflows__scene {
    padding-top: 60px;
  }
  .ent-workflows__caption {
    font-size: 12.5px;
    line-height: 17px;
    text-align: center;
    text-wrap: balance;
  }

  /* Step 1 */
  .ent-workflows__mail {
    width: 100%;
    box-sizing: border-box;
  }
  .ent-workflows__schedule {
    font-size: 11.5px;
  }

  /* Step 2: the invoice (shorter, so its scan ends higher) above the extracted fields */
  .ent-workflows__read {
    width: 100%;
    flex-direction: column;
    gap: 10px;
  }
  .ent-workflows__invoice {
    width: 100%;
    height: 132px;
    padding: 14px 16px;
    gap: 7px;
  }
  .ent-workflows__invoice-line:nth-of-type(n + 4) {
    display: none;
  }
  .ent-workflows__scan {
    animation-name: ent-workflows-scan-phone;
  }
  .ent-workflows__fields {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    gap: 6px;
  }
  .ent-workflows__field {
    padding-bottom: 5px;
  }

  /* Step 3: NetSuite as a phone app; the 3-way match slides up as a bottom sheet once the PO is picked */
  .ent-workflows__match {
    position: relative;
    width: 232px;
    height: 372px;
    border-radius: 22px;
    background: var(--paper);
    box-shadow:
      inset 0 0 0 1px var(--rule),
      0 8px 24px var(--ent-ink-a8);
    overflow: hidden;
  }
  .ent-workflows__browser {
    width: 100%;
    background: none;
    box-shadow: none;
    border-radius: 0;
  }
  .ent-workflows__browser-bar {
    display: none;
  }
  .ent-workflows__phone-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: 26px;
    padding: 0 14px;
  }
  .ent-workflows__phone-time {
    font:
      500 10px "Geist Mono",
      ui-monospace,
      monospace;
    color: var(--ink);
  }
  .ent-workflows__phone-host {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--paper-3);
    font:
      400 9.5px "Geist Mono",
      ui-monospace,
      monospace;
    color: var(--ent-zinc-350);
  }
  .ent-workflows__browser-body {
    padding: 4px 12px 0;
    gap: 8px;
  }
  .ent-workflows__phone-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--ink);
  }
  .ent-workflows__phone-logo {
    width: 16px;
    height: 16px;
    object-fit: contain;
  }
  .ent-workflows__search {
    height: 27px;
    border-radius: 9px;
    font-size: 10.5px;
  }
  .ent-workflows__po-table,
  .ent-workflows__po-table tbody {
    display: block;
  }
  .ent-workflows__po-table thead {
    display: none;
  }
  .ent-workflows__po-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 8px;
    padding: 5px 8px;
    border-radius: 9px;
    box-shadow: 0 1px 0 var(--ent-zinc-80);
  }
  .ent-workflows__po-table td {
    height: auto;
    padding: 0;
    border: none;
    line-height: 13px;
  }
  .ent-workflows__po-table td:first-child {
    font:
      600 10.5px "Geist Mono",
      ui-monospace,
      monospace;
    color: var(--ink);
  }
  .ent-workflows__po-table td:nth-child(2) {
    grid-row: 2;
    font-size: 10px;
    color: var(--muted);
  }
  .ent-workflows__po-table td:last-child {
    grid-column: 2;
    grid-row: 1 / span 2;
    font-size: 10.5px;
    color: var(--ink);
  }
  .ent-workflows__three-way {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    padding: 15px 13px 11px;
    gap: 6px;
    border-radius: 16px 16px 0 0;
    box-shadow:
      0 -8px 24px var(--ent-ink-a8),
      inset 0 1px 0 var(--rule);
    transform: translateY(100%);
    animation: ent-workflows-sheet-up var(--ent-workflows-cycle) ease-out
      infinite;
  }
  .ent-workflows__three-way::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 50%;
    width: 32px;
    height: 4px;
    margin-left: -16px;
    border-radius: 2px;
    background: var(--rule-strong);
  }
  .ent-workflows__doc-text {
    line-height: 13px;
  }
  .ent-workflows__doc-name {
    font-size: 11px;
  }
  .ent-workflows__doc-ref {
    font-size: 9px;
  }
  .ent-workflows__match-ok {
    margin-top: 2px;
    padding: 5px 10px;
  }

  /* The pointers become touches: a soft accent dot on the search field, then on the PO; later on Approve */
  .ent-workflows__cursor {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--ent-accent-a25);
    box-shadow: inset 0 0 0 1.5px var(--accent);
  }
  .ent-workflows__cursor path {
    display: none;
  }
  /* Touch spots (the dot's top-left, 11px up-left of its centre): the typed query, the matched PO, Approve */
  .ent-workflows__cursor--browse {
    --ent-workflows-search-at: 53px, 64px;
    --ent-workflows-row-at: 79px, 150px;
    animation: ent-workflows-touch-browse var(--ent-workflows-cycle) linear
      infinite;
  }
  .ent-workflows__cursor--approve {
    --ent-workflows-approve-at: 76px, 144px;
    animation: ent-workflows-touch-approve var(--ent-workflows-cycle) linear
      infinite;
  }
  .ent-workflows__click {
    display: none;
  }

  /* Step 4 */
  .ent-workflows__chat {
    width: 100%;
  }
  .ent-workflows__message {
    padding: 12px;
  }
  .ent-workflows__button {
    padding: 6px 12px;
    white-space: nowrap;
  }
  .ent-workflows__approved {
    font-size: 11.5px;
    white-space: nowrap;
  }

  /* Step 5: each action's reference goes under its name */
  .ent-workflows__actions {
    width: 100%;
    gap: 7px;
  }
  .ent-workflows__action {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    column-gap: 10px;
    row-gap: 1px;
    padding: 8px 12px;
  }
  .ent-workflows__action > .ent-workflows__status,
  .ent-workflows__action > .ent-workflows__action-icon,
  .ent-workflows__action > .ent-workflows__icon {
    grid-row: 1 / span 2;
  }
  .ent-workflows__action-ref {
    grid-column: 3;
    margin-left: 0;
  }

  /* Run complete */
  .ent-workflows__next-run {
    flex-direction: column;
    gap: 2px;
    padding: 8px 16px;
    border-radius: 14px;
    text-align: center;
  }
}
@keyframes ent-workflows-scan-phone {
  0%,
  13.33% {
    top: 34px;
    opacity: 0;
  }
  13.76% {
    opacity: 1;
  }
  25.55% {
    top: 92px;
    opacity: 1;
  }
  25.99%,
  100% {
    top: 92px;
    opacity: 0;
  }
}
@keyframes ent-workflows-sheet-up {
  0%,
  40.55% {
    transform: translateY(100%);
  }
  41.86%,
  100% {
    transform: none;
  }
}
@keyframes ent-workflows-touch-browse {
  0%,
  31.2% {
    transform: translate(var(--ent-workflows-search-at));
    opacity: 0;
  }
  31.81%,
  38.35% {
    transform: translate(var(--ent-workflows-search-at));
    opacity: 1;
  }
  39.2% {
    transform: translate(var(--ent-workflows-search-at));
    opacity: 0;
  }
  39.21% {
    transform: translate(var(--ent-workflows-row-at));
    opacity: 0;
  }
  40.11%,
  43.5% {
    transform: translate(var(--ent-workflows-row-at));
    opacity: 1;
  }
  44.8%,
  100% {
    transform: translate(var(--ent-workflows-row-at));
    opacity: 0;
  }
}
@keyframes ent-workflows-touch-approve {
  0%,
  66.1% {
    transform: translate(var(--ent-workflows-approve-at));
    opacity: 0;
  }
  66.53%,
  69.15% {
    transform: translate(var(--ent-workflows-approve-at));
    opacity: 1;
  }
  70.03%,
  100% {
    transform: translate(var(--ent-workflows-approve-at));
    opacity: 0;
  }
}

/* Reduced motion: hold the "run complete" frame (96.57% of the cycle). Every staggered item is hidden
   at that moment, so one shared delay is enough. */
@media (prefers-reduced-motion: reduce) {
  .ent-workflows * {
    animation-delay: calc(var(--ent-workflows-cycle) * -0.9657) !important;
    animation-play-state: paused !important;
  }
}
