.landing-teams [data-component="modal"] [data-slot="content"] {
  width: min(720px, 90vw);
  padding: 0;
  overflow: hidden;
}

.landing-teams [data-component="modal"] iframe {
  display: block;
  width: 100%;
  height: 600px;
  border: 0;
}

/* ── Workflow Diagram v3: items inside boxes, loop arrow ── */

.wf3 {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  min-width: 780px;
  height: 280px;
  padding: 1.5rem 0.5rem 2.5rem;
  position: relative;
}

/* Connector line */
.wf3-conn {
  flex-shrink: 0;
  width: 24px;
  height: 2px;
  margin: 14px 3px 0;
  border-radius: 1px;
  background: rgba(160, 160, 160, 0.2);
  opacity: 0.3;
  transition: opacity 0.3s ease;
}

.wf3-conn.active {
  opacity: 1;
  background: linear-gradient(90deg, rgba(160, 160, 160, 0.15), var(--color-accent-blue), rgba(160, 160, 160, 0.15));
  background-size: 200% 100%;
  animation: wf3-flow 1.1s ease-in-out infinite;
}

@keyframes wf3-flow {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

/* Prompt — always open */
.wf3-prompt {
  flex-shrink: 0;
  width: 148px;
  padding: 0.625rem 0.75rem;
  background: #fff;
  border: 1px solid rgba(160, 160, 160, 0.14);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 4px rgba(26, 26, 26, 0.05);
}

.wf3-prompt-tag {
  display: block;
  font-size: 9px;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  margin-bottom: 0.375rem;
}

.wf3-prompt-text {
  font-size: 11px;
  line-height: 1.45;
  color: var(--color-text-primary);
  margin: 0;
  min-height: 2.9em;
}

.wf3-cursor {
  display: inline-block;
  width: 1px;
  height: 11px;
  background: var(--color-text-primary);
  margin-left: 1px;
  vertical-align: -1px;
  animation: cursorBlink 0.8s steps(1) infinite;
}

@keyframes cursorBlink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

/* Step box — starts collapsed, expands when active or done */
.wf3-step {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border: 1px solid rgba(160, 160, 160, 0.14);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 4px rgba(26, 26, 26, 0.05);
  padding: 0.5rem 0.5rem;
  min-width: 86px;
  max-height: 30px;
  overflow: hidden;
  opacity: 0.55;
  transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.wf3-step.active {
  opacity: 1;
  max-height: 220px;
  border-color: rgba(34, 175, 255, 0.35);
  box-shadow: 0 2px 12px rgba(34, 175, 255, 0.1);
}

.wf3-step.done {
  opacity: 0.85;
  border-color: rgba(52, 168, 83, 0.25);
  max-height: 220px;
}

/* Ready step uses green accent */
.wf3-step-ready.active {
  border-color: rgba(52, 168, 83, 0.35);
  box-shadow: 0 2px 12px rgba(52, 168, 83, 0.1);
}

.wf3-label {
  font-size: 10px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
}

/* Items inside step */
.wf3-items {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.5rem;
  width: 100%;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.wf3-step.active .wf3-items,
.wf3-step.done .wf3-items {
  opacity: 1;
}

.wf3-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.375rem;
  border-radius: var(--radius-sm);
  font-size: 9px;
  color: var(--color-text-primary);
  border: 1px solid transparent;
  opacity: 0;
  transform: translateY(3px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    border-color 0.35s ease,
    background 0.35s ease;
  white-space: nowrap;
}

.wf3-step.active .wf3-item,
.wf3-step.done .wf3-item {
  opacity: 1;
  transform: translateY(0);
}

.wf3-step.done .wf3-item {
  border-color: rgba(52, 168, 83, 0.25);
  background: rgba(52, 168, 83, 0.04);
}

.wf3-step.done .wf3-item.fail {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.06);
}

.wf3-item-icon {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: #fff;
  border: 1px solid rgba(160, 160, 160, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-text-secondary);
}

.wf3-item-icon img {
  width: 10px;
  height: 10px;
  object-fit: contain;
}

.wf3-item-icon .wf3-conn-icon {
  width: 10px;
  height: 10px;
  padding: 0;
  border: none;
}

.wf3-item-icon svg {
  width: 10px;
  height: 10px;
}

.wf3-item-icon.amber {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.3);
}

.wf3-item-text {
  font-size: 9px;
  color: var(--color-text-primary);
}

.wf3-item-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.wf3-item-title {
  font-size: 9px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
}

.wf3-item-sub {
  font-size: 8px;
  color: var(--color-text-tertiary);
}

/* Parallel item highlight — all start together, finish at different times */
@keyframes wf3-work {
  0%,
  65% {
    border-color: rgba(34, 175, 255, 0.35);
    background: rgba(34, 175, 255, 0.06);
  }
  100% {
    border-color: rgba(52, 168, 83, 0.25);
    background: rgba(52, 168, 83, 0.04);
  }
}

.wf3-step.active .wf3-item:nth-child(1) {
  animation: wf3-work 1.2s ease forwards;
}
.wf3-step.active .wf3-item:nth-child(2) {
  animation: wf3-work 1.5s ease forwards;
}
.wf3-step.active .wf3-item:nth-child(3) {
  animation: wf3-work 0.9s ease forwards;
}
.wf3-step.active .wf3-item:nth-child(4) {
  animation: wf3-work 1.6s ease forwards;
}

/* Plan skeleton */
.wf3-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
}

@keyframes wf3-grow {
  0% {
    width: 0;
  }
  100% {
    width: 85%;
  }
}

@keyframes wf3-grow-short {
  0% {
    width: 0;
  }
  100% {
    width: 55%;
  }
}

.wf3-skel-line {
  height: 3px;
  border-radius: 2px;
  background: rgba(160, 160, 160, 0.14);
  width: 0;
}

.wf3-skel-line.short {
  width: 0;
}

.wf3-step.active .wf3-skel-line:nth-child(1) {
  animation: wf3-grow 0.7s ease forwards;
}
.wf3-step.active .wf3-skel-line:nth-child(2) {
  animation: wf3-grow-short 1s ease forwards;
}
.wf3-step.active .wf3-skel-line:nth-child(3) {
  animation: wf3-grow 0.5s ease forwards;
}

.wf3-step.done .wf3-skel-line {
  width: 85%;
}
.wf3-step.done .wf3-skel-line.short {
  width: 55%;
}

/* Deliver document */
.wf3-doc {
  position: relative;
  padding: 0.5rem;
  background: var(--color-surface-light);
  border-radius: var(--radius-sm);
  margin-bottom: 0.25rem;
  width: 120px;
}

.wf3-doc-bar {
  height: 3px;
  width: 20px;
  border-radius: 2px;
  background: rgba(160, 160, 160, 0.2);
  margin-bottom: 0.25rem;
}

.wf3-doc-line {
  height: 2px;
  border-radius: 2px;
  background: rgba(160, 160, 160, 0.14);
  margin-bottom: 0.2rem;
  width: 65%;
}

.wf3-doc-line.wide {
  width: 80%;
}

.wf3-doc-title {
  position: absolute;
  bottom: 0.375rem;
  left: 0.5rem;
  font-size: 8px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
}

/* Document actions */
.wf3-actions {
  display: flex;
  gap: 0.25rem;
}

.wf3-btn {
  flex: 1;
  text-align: center;
  font-size: 9px;
  font-weight: var(--font-weight-medium);
  padding: 0.2rem 0.375rem;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid rgba(160, 160, 160, 0.2);
  color: var(--color-text-secondary);
}

.wf3-btn-primary {
  background: var(--color-text-primary);
  color: #fff;
  border-color: var(--color-text-primary);
}

/* Execute ↔ Verify loop group */
.wf3-loop-group {
  display: flex;
  align-items: flex-start;
  flex-shrink: 0;
  position: relative;
}

/* Loop arrow */
.wf3-loop {
  position: absolute;
  bottom: -14px;
  left: 0;
  width: 100%;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: var(--color-text-secondary);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.wf3-loop.active {
  opacity: 1;
  color: var(--color-accent-blue);
}

.wf3-loop svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.wf3-loop-label {
  position: relative;
  z-index: 1;
  background: #fff;
  padding: 0.1rem 0.375rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(160, 160, 160, 0.12);
}

/* ── Vertical layout for small screens ── */
@media (max-width: 640px) {
  .landing-teams [data-component="modal"] iframe {
    height: min(600px, 80vh);
  }

  .wf3 {
    flex-direction: column;
    align-items: center;
    min-width: auto;
    max-width: 100%;
    height: 720px;
    padding: 1rem 0.5rem 2.5rem;
    gap: 0;
  }

  .wf3-prompt {
    width: 100%;
    max-width: 280px;
    padding: 0.625rem 0.75rem;
  }

  .wf3-conn {
    width: 2px;
    height: 16px;
    margin: 3px 0;
    background: rgba(160, 160, 160, 0.2);
  }

  .wf3-conn.active {
    background: linear-gradient(180deg, rgba(160, 160, 160, 0.15), var(--color-accent-blue), rgba(160, 160, 160, 0.15));
    background-size: 100% 200%;
    animation: wf3-flow-vertical 1.1s ease-in-out infinite;
  }

  @keyframes wf3-flow-vertical {
    0% {
      background-position: 0 100%;
    }
    100% {
      background-position: 0 -100%;
    }
  }

  .wf3-step {
    min-width: auto;
    width: 100%;
    max-width: 280px;
    padding: 0.5rem 0.625rem;
  }

  .wf3-step.active {
    max-height: 260px;
  }

  .wf3-step.done {
    max-height: 260px;
  }

  .wf3-label {
    font-size: 11px;
  }

  .wf3-item {
    font-size: 10px;
  }

  .wf3-item-icon {
    width: 18px;
    height: 18px;
  }

  .wf3-item-icon img,
  .wf3-item-icon svg,
  .wf3-item-icon .wf3-conn-icon {
    width: 12px;
    height: 12px;
  }

  .wf3-item-text,
  .wf3-item-title {
    font-size: 10px;
  }

  .wf3-item-sub {
    font-size: 9px;
  }

  .wf3-doc {
    width: 100%;
  }

  .wf3-loop-group {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .wf3-loop {
    position: relative;
    bottom: auto;
    left: auto;
    width: 80px;
    height: 40px;
    margin: -4px 0;
    transform: rotate(90deg);
  }

  .wf3-loop-label {
    transform: rotate(-90deg);
    padding: 0.1rem 0.25rem;
    font-size: 8px;
  }
}
