/* ===== sp_flow_band_html (HTML form, scoped) =====
   Loaded eagerly from anvil.yaml native_deps.head_html, which is also what styles the
   designer canvas. The root rule is bare and everything under it is wrapped :where(.sp-flow) - zero added
   specificity, so no rule changes which declaration wins.

   No shared px-* class appears anywhere in this file, so there is no tie with theme.css
   or with the dependency's runtime-injected sheet to buy back with a second class.

   .sp-stage-value keeps color at (0,1,0) ON PURPOSE. specials.css declares
   .sp-dashboard .sp-good / .sp-warn / .sp-bad at (0,2,0) precisely to out-specify it on
   the Profit headline, and :where() preserves that relationship exactly.

   The root gets no position/flex/min-height rule: this is a leaf inside the shell's
   section container, not a screen root.

   No designer gate: nothing here hides content until JavaScript runs. The band is empty
   on the canvas because its cards are data, not because a rule hides them. */

.sp-flow {
  display: flex;
  align-items: stretch;
  gap: 0;
}

:where(.sp-flow) .sp-stage {
  flex: 1 1 0;
  min-width: 0;
  background: var(--px-bg-card);
  border: 1px solid var(--px-border);
  padding: 1.25rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
:where(.sp-flow) .sp-stage:first-child { border-radius: 16px 0 0 16px; }
:where(.sp-flow) .sp-stage:last-child {
  border-radius: 0 16px 16px 0;
  border-color: var(--px-spec-accent);
  background:
    linear-gradient(180deg, var(--accent-subtle), transparent 55%),
    var(--px-bg-card);
}

/* The top half of each card is the hero: name, headline number and
   its one-line meaning, all centred. The problem ledger below stays a
   left/right table — those rows are for scanning, not for show. */
:where(.sp-flow) .sp-stage-name {
  font-family: var(--px-mono);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--px-text-secondary);
  text-align: center;
}
:where(.sp-flow) .sp-stage-value {
  font-family: var(--px-mono);
  font-size: clamp(2.3rem, 3vw, 3.1rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--px-text-primary);
  text-align: center;
}
:where(.sp-flow) .sp-stage-sub {
  font-size: 0.74rem;
  color: var(--px-text-muted);
  text-align: center;
}
:where(.sp-flow) .sp-stage-facts { margin-top: 0.55rem; }
:where(.sp-flow) .sp-stage-facts div {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.28rem 0;
  border-top: 1px dashed var(--px-border);
  font-size: 0.72rem;
}
/* The label gives up width before the money figure does. */
:where(.sp-flow) .sp-stage-facts span {
  color: var(--px-text-secondary);
  min-width: 0;
}
:where(.sp-flow) .sp-stage-facts b {
  font-family: var(--px-mono);
  flex: 0 0 auto;
  white-space: nowrap;
}

:where(.sp-flow) .sp-arrow {
  align-self: center;
  padding: 0 0.4rem;
  color: var(--px-spec-accent);
  font-size: 1.4rem;
}

@media (max-width: 900px) {
  /* Stacked on narrow screens: the band becomes five cards in a
     column and the connecting arrows are dropped rather than rotated,
     because a vertical arrow reads as a separate row of content. */
  .sp-flow { flex-direction: column; gap: 0.6rem; }
  :where(.sp-flow) .sp-arrow { display: none; }
  :where(.sp-flow) .sp-stage,
  :where(.sp-flow) .sp-stage:first-child,
  :where(.sp-flow) .sp-stage:last-child { border-radius: 12px; }
  :where(.sp-flow) .sp-stage-value { font-size: 2.1rem; }
}
