/* Figures in the hosted guide (portal/src/docs-figures.js). */
/* Solar order: the ESS priority runs down one rule; the brackets on the
   right mark what Phaeton counts and what a grid meter sees. The steps keep
   their width and the brackets give way, down to the stacked layout below. */
.docs-flow-frame {
  container-type: inline-size;
}
.docs-flow {
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) repeat(2, minmax(0, 11rem));
  column-gap: var(--space-4);
  margin: var(--space-2) 0;
  padding: var(--space-6);
  border: var(--size-hairline) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-surface);
}
/* The caption spans every column; it must not widen the steps column. */
.docs-flow figcaption {
  contain: inline-size;
  grid-column: 1 / -1;
  margin-bottom: var(--space-5);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}
.docs-flow .docs-flow-steps {
  grid-column: 1;
  grid-row: 2 / 5;
  display: grid;
  grid-template-rows: subgrid;
  gap: 0;
  padding: 0;
  list-style: none;
  counter-reset: flow;
}
.docs-flow-step {
  position: relative;
  display: grid;
  align-content: start;
  gap: 0.125rem;
  padding: 0 0 var(--space-6) var(--space-10);
  counter-increment: flow;
}
.docs-flow-step:last-child {
  padding-bottom: 0;
}
.docs-flow-step::before {
  content: counter(flow);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border: var(--size-rule) solid var(--color-border-strong);
  border-radius: var(--radius-full);
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 650;
  line-height: 1;
  box-sizing: border-box;
}
.docs-flow-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 1.75rem;
  bottom: 0;
  left: calc(0.875rem - 1px);
  width: var(--size-rule);
  background: var(--color-border-strong);
}
.docs-flow-step strong {
  font-family: var(--font-display);
  font-stretch: var(--wdth-display);
  font-size: var(--text-lg);
  font-weight: 650;
  line-height: 1.5;
}
.docs-flow-step span {
  font-size: var(--text-sm);
  line-height: 1.4;
}
.docs-flow .docs-flow-span {
  padding-left: var(--space-3);
  border-left: 3px solid var(--color-border-strong);
  color: var(--color-text-secondary);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.35;
  text-wrap: balance;
}
.docs-flow .is-phaeton {
  grid-column: 2;
  grid-row: 3 / 5;
  border-left-color: var(--color-energy-solar);
  color: var(--color-text-primary);
}
.docs-flow .is-meter {
  grid-column: 3;
  grid-row: 4 / 5;
}
/* Narrow columns: the brackets read on their own, so they follow the list. */
@container (max-width: 32rem) {
  .docs-flow {
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--space-2);
    padding: var(--space-5) var(--space-4);
  }
  .docs-flow figcaption {
    margin-bottom: var(--space-3);
  }
  .docs-flow .docs-flow-steps {
    grid-row: auto;
    grid-template-rows: none;
    margin-bottom: var(--space-3);
  }
  .docs-flow .is-phaeton,
  .docs-flow .is-meter {
    grid-column: 1;
    grid-row: auto;
  }
}
