.production-flow {
  background: var(--background);
  border-bottom: 1px solid var(--line);
  padding-block: clamp(3rem, 7vw, 6rem);
}
.flow-intro h2 {
  margin: 0 0 .6rem;
  max-width: 24ch;
  font-size: clamp(2rem, 5vw, 4rem);
}
.flow-intro > p { color: var(--soft); }
.flow-panel {
  margin-top: 1.75rem;
  border: 1px solid #674862;
  border-radius: 1rem;
  background: var(--background);
}
.flow-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  padding: .8rem;
  border-bottom: 1px solid var(--line);
}
.flow-scenes, .flow-zoom { display: flex; align-items: center; gap: .4rem; }
.flow-scenes { flex-wrap: wrap; }
.flow-toolbar button, .flow-dialog button {
  min-height: 2.65rem;
  padding: .4rem .7rem;
  border: 1px solid var(--line);
  border-radius: .45rem;
  background: #231a2b;
  color: var(--white);
  font: 650 .85rem/1.2 Inter, system-ui, sans-serif;
}
.flow-scenes button[aria-pressed="true"] {
  border-color: var(--peach);
  background: var(--peach);
  color: #201421;
}
.flow-toolbar button:enabled:hover, .flow-dialog button:hover { border-color: var(--pink); }
.flow-zoom output { min-width: 3rem; text-align: center; font-size: .8rem; font-variant-numeric: tabular-nums; }
.flow-zoom button { min-width: 2.65rem; }
.flow-zoom button:disabled { opacity: .48; }
.flow-viewport {
  overflow: auto;
  border-radius: 0 0 1rem 1rem;
  scrollbar-color: #947298 #18121e;
  background: var(--dots) 0 0 / 24px 24px, var(--background);
}
.flow-viewport:focus-visible { outline: 2px solid var(--violet); outline-offset: -3px; }
.flow-board {
  position: relative;
  isolation: isolate;
  width: calc(max(100%, 64rem) * var(--flow-scale, 1));
  padding: 2rem clamp(1rem, 2.4vw, 2.25rem) 6.5rem;
}
.flow-cards {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, .9fr)) minmax(0, 1.02fr) minmax(0, 1.14fr);
  align-items: start;
  gap: clamp(1.3rem, 3vw, 3rem);
}
.flow-card {
  position: relative;
  z-index: 2;
  min-width: 0;
  display: grid;
  gap: .55rem;
}
.flow-card:nth-child(2) { margin-top: 1.1rem; }
.flow-card:nth-child(3) { margin-top: 2.05rem; }
.flow-card:nth-child(4) { margin-top: .45rem; }
.flow-card[data-kind="result"] { margin-top: 2.85rem; }
.flow-card-heading { display: grid; gap: .17rem; min-height: 2.15rem; }
.flow-card-type {
  color: var(--violet);
  font-size: .66rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .045em;
  line-height: 1.25;
}
.flow-card[data-kind="prompt"] .flow-card-type { color: var(--peach); }
.flow-card[data-kind="result"] .flow-card-type { color: var(--pink); }
.flow-card-title { margin: 0; font-size: .9rem; line-height: 1.25; }
.flow-card-media {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  aspect-ratio: 9 / 16;
  border: 1px solid #62455f;
  border-radius: .42rem;
  background: #19131f;
}
.flow-card-media:is(button):hover { border-color: var(--violet); }
.flow-card[data-kind="result"] .flow-card-media {
  border-color: var(--pink);
  box-shadow: 0 0 1.35rem #fe5ed73b;
}
.flow-card:nth-child(4) .flow-card-media { aspect-ratio: 4 / 5; }
.flow-card-media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }
.flow-prompt {
  aspect-ratio: auto;
  padding: .85rem;
  border-left: 2px solid var(--peach);
  background: var(--background);
  color: var(--soft);
  font-size: .8rem;
  line-height: 1.48;
}
.flow-prompt p + p { margin-top: .7rem; }
.flow-read {
  justify-self: start;
  min-height: 2.2rem;
  padding: .25rem .1rem;
  border: 0;
  background: transparent;
  color: var(--peach);
  font: 700 .75rem/1.2 Inter, system-ui, sans-serif;
  text-decoration: underline;
  text-underline-offset: .22em;
}
.flow-play {
  position: absolute;
  inset: 50% auto auto 50%;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  width: 2.5rem;
  aspect-ratio: 1;
  border: 1px solid #fff7;
  border-radius: 50%;
  color: #fff;
  background: #180f21cc;
}
.flow-play::before {
  content: "";
  margin-left: .14rem;
  border-block: .4rem solid transparent;
  border-left: .62rem solid var(--white);
}
.flow-connections {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.flow-connections path {
  fill: none;
  stroke: var(--violet);
  stroke-width: 1.4;
  stroke-opacity: .65;
}
.flow-connections path:first-child { stroke: var(--peach); }
.flow-connections path:nth-of-type(4) { stroke: var(--pink); }
.flow-connections circle { fill: #18111e; stroke: var(--pink); stroke-width: 1.5; }
.flow-dialog {
  width: min(calc(100% - 2rem), 38rem);
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 1px solid #815989;
  border-radius: .8rem;
  background: var(--surface);
  color: var(--white);
}
.flow-dialog::backdrop { background: #09060dea; }
.flow-dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--line);
}
.flow-dialog h3 { margin: 0; font-size: 1.1rem; letter-spacing: 0; }
.flow-detail { padding: 1rem; color: var(--soft); }
.flow-detail > p + p { margin-top: .8rem; }
.flow-prompt-label { color: var(--peach); font-size: .8rem; font-weight: 700; }
.flow-detail img, .flow-detail video {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 9rem);
  margin: auto;
}
html:has(.flow-dialog[open]) { overflow: hidden; }
@media (max-width: 650px) {
  .flow-board { padding-inline: .75rem; }
}
