.workflow-grid {
  display: grid;
  --reel-height: clamp(312px, 28vw, 350px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: var(--grid-gap);
}
.workflow-reel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}
.workflow-video__stage {
  position: relative;
  height: var(--reel-height);
  flex-shrink: 0;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--radius);
  background: #070b0d;
  touch-action: pan-y pinch-zoom;
  cursor: grab;
}
.workflow-video__stage:active {
  cursor: grabbing;
}
.workflow-video__stage:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.workflow-video__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.workflow-video__slide[data-state='active'] {
  z-index: 2;
  opacity: 1;
}
.workflow-video__slide[data-state='outgoing'] {
  z-index: 1;
}
.workflow-video__media {
  position: absolute;
  inset: 0;
}
.workflow-video__media img,
.workflow-video__media video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
}
.workflow-video__media video {
  opacity: 0;
  transition: opacity 0.2s ease;
}
.workflow-video__slide[data-playing] video {
  opacity: 1;
}
.workflow-video__status,
.workflow-video__fallback {
  position: absolute;
  z-index: 4;
  left: 1rem;
  bottom: 1rem;
  right: 1rem;
  margin: 0;
  padding: 0.6rem 0.75rem;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 6px;
  color: #fff;
  font-size: 0.8125rem;
}
.workflow-reel__caption {
  padding-top: 1rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}
.workflow-reel__caption h3 {
  margin: 0;
}
/* A compact chat window with a persistent prompt and a scrollable code reply. */
.workflow-code__stage {
  height: var(--reel-height);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(145deg, #111b21, #0b1117 70%);
  box-shadow: inset 0 0 0 1px #ffffff0d;
}
.workflow-code__stage:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.workflow-chat__header {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 42px;
  padding: 0 1rem;
  border-bottom: 1px solid #ffffff0b;
  color: #e1e9ec;
  font-size: 0.75rem;
  font-weight: 500;
}
.workflow-chat__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.workflow-chat__brand > .brand-mark {
  width: 22px;
  height: 22px;
}
.workflow-chat__brand > span:first-of-type {
  font-family: 'Geist', var(--font);
  letter-spacing: -0.025em;
}
.workflow-chat__product {
  margin-left: 0.125rem;
  padding-left: 0.625rem;
  border-left: 1px solid #ffffff20;
  color: #8c9ca6;
  font-weight: 400;
}
.workflow-chat__demo {
  color: #94a2ac;
  font-size: 0.5625rem;
  line-height: 1.5;
  letter-spacing: 0.06em;
  border: 1px solid #ffffff14;
  border-radius: 4px;
  padding: 1px 5px;
}
.workflow-chat__thread {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0.75rem 1rem 0;
}
.workflow-chat__user {
  flex: none;
  margin-left: auto;
  width: fit-content;
  max-width: 94%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ffffff0a;
  border-radius: 12px 12px 3px 12px;
  color: #e0e8ec;
  background: #1c2932;
  font-size: 0.75rem;
  line-height: 1.5;
}
.workflow-chat__user p {
  margin: 0;
}
.workflow-chat__attachment {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.2rem;
  color: #9baebc;
  font: 400 0.5625rem var(--mono);
}
.workflow-chat__attachment svg {
  width: 11px;
  height: 11px;
}
.workflow-chat__assistant {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin-top: 0.75rem;
}
.workflow-chat__byline {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
  color: #d4e0e5;
  font-size: 0.6875rem;
  font-weight: 500;
}
.workflow-chat__avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 1px solid #d9f0eb20;
  border-radius: 6px;
  background: #192b2c;
}
.workflow-chat__avatar img {
  display: block;
  width: 18px;
  height: 18px;
}
.workflow-chat__status {
  margin-left: auto;
  color: #90a4ad;
  font-size: 0.5625rem;
  font-weight: 400;
}
.workflow-chat__thinking {
  display: flex;
  gap: 3px;
  margin-left: 0.125rem;
}
.workflow-chat__thinking i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #87bdb6;
}
.workflow-chat__reply {
  flex: none;
  margin: 0;
  color: #c2d0d9;
  font-size: 0.75rem;
  line-height: 1.5;
}
.workflow-chat__reply:empty {
  display: none;
}
.workflow-chat__snippet {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin-top: 0.5rem;
  border: 1px solid #28343d;
  border-radius: 7px;
  overflow: hidden;
  background: #090f15;
}
.workflow-chat__codebar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 24px;
  padding: 3px 0.625rem;
  border-bottom: 1px solid #ffffff09;
  background: #131e26;
  color: #a9b9c4;
  font: 400 0.5625rem var(--mono);
}
.workflow-chat__codebar > :last-child {
  color: #748995;
}
.workflow-chat__code {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0.375rem 0.625rem;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #2a3c45 transparent;
  color: #d7e3eb;
  font: 400 clamp(10px, 0.92vw, 11.5px)/1.65 var(--mono);
  tab-size: 2;
}
.workflow-chat__code code {
  display: block;
  font: inherit;
  counter-reset: code-line;
}
.workflow-code__line {
  display: block;
  position: relative;
  padding-left: 2.15em;
  min-height: 1.65em;
  counter-increment: code-line;
}
.workflow-code__line::before {
  content: counter(code-line);
  position: absolute;
  left: 0;
  width: 1.2em;
  color: #607180;
  text-align: right;
  user-select: none;
}
.workflow-code__keyword {
  color: #c8a8ee;
}
.workflow-code__string {
  color: #acdac1;
}
.workflow-code__literal {
  color: #eac48c;
}
.workflow-code__function {
  color: #91c7e7;
}
.workflow-chat__result {
  flex: none;
  margin: 0.375rem 0 0;
  color: #97b9ae;
  font-size: 0.625rem;
  line-height: 1.5;
}
.workflow-chat__result::before {
  content: '✓';
  margin-right: 0.35rem;
  color: #83c5b3;
}
.workflow-chat__composer {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin: 0.75rem 1rem;
  padding: 0.375rem 0.375rem 0.375rem 0.625rem;
  border: 1px solid #33434e;
  border-radius: 10px;
  background: #17232c;
  color: #91a2ae;
  font-size: 0.6875rem;
  text-decoration: none;
}
.workflow-chat__composer:hover {
  border-color: #536674;
  color: #e1eeee;
}
.workflow-chat__attach-icon {
  flex: none;
  width: 16px;
  height: 16px;
  color: #8395a3;
}
.workflow-chat__input {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.workflow-chat__send {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #d7ece6;
  color: #17382f;
}
.workflow-chat__send svg {
  width: 18px;
  height: 18px;
}
.workflow-chat__thinking[hidden],
.workflow-chat__snippet[hidden],
.workflow-chat__result[hidden] {
  display: none;
}
.workflow-code__stage[data-phase='prompt'] .workflow-chat__input {
  color: #d7e2e8;
}
.workflow-code__stage[data-phase='code'] .workflow-code__line:last-child::after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.12em;
  background: #9ddfce;
  animation: chat-caret 1s steps(1) infinite;
}
.workflow-code__stage[data-playback='paused'] .workflow-code__line::after {
  animation-play-state: paused;
}
@keyframes chat-caret {
  50% {
    opacity: 0;
  }
}
@media (max-width: 900px) {
  .workflow-grid {
    --reel-height: clamp(320px, 52vw, 380px);
    grid-template-columns: 1fr;
    gap: 2.75rem;
  }
  .workflow-chat__header {
    padding-inline: 1.125rem;
  }
  .workflow-chat__thread {
    padding-inline: 1.125rem;
  }
  .workflow-chat__composer {
    margin-inline: 1.125rem;
  }
  .workflow-chat__code {
    font-size: 11.5px;
  }
}
@media (max-width: 600px) {
  .workflow-chat__header {
    height: 36px;
  }
  .workflow-chat__thread {
    padding-top: 0.5rem;
  }
  .workflow-chat__assistant {
    margin-top: 0.5rem;
  }
  .workflow-chat__composer {
    margin-block: 0.5rem;
  }
  .workflow-chat__result {
    display: none;
  }
  .code-tabs {
    gap: 0;
    padding: 0.25rem;
  }
  .code-tab {
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
    min-height: 36px;
  }
  .copy-code {
    padding: 0.5rem;
    font-size: 0.6875rem;
    min-height: 40px;
  }
}
@media (max-width: 420px) {
  .workflow-chat__code {
    font-size: 10.5px;
  }
  .workflow-chat__header {
    padding-inline: 0.875rem;
  }
  .workflow-chat__thread {
    padding-inline: 0.875rem;
  }
  .workflow-chat__composer {
    margin-inline: 0.875rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .workflow-video__slide,
  .workflow-video__media video {
    transition: none;
  }
  .workflow-code__line::after {
    animation: none;
  }
}
