/*
 * .seq-dominant — the one dominant element of a full-page view (docs/plans/seq-redesign.md
 * § One dominant element per page). It is the first thing after the page header, at the top
 * of the primary column and its full width. Inside it, the figure is set in the gem's
 * .headline-lg (32px, the only use of that composite on the page) as .seq-dominant__figure,
 * and its label in .body-md below it as .seq-dominant__label; the rest of the block, usually
 * the rows the reader comes for, is .body-md or an .admin-table.
 *
 * The figure is never a bare state word (Martin's review of 2026-09-24, rule 4 of § The
 * composition system): it is a sentence with the record's identity and its state, sentence
 * cased, and the state colour is on the one state word inside it, .seq-dominant__state, not
 * on the whole heading. A count is a sentence too ("3 runs in flight", "4 stages").
 *
 *   <section class="seq-dominant" aria-labelledby="run-state">
 *     <div class="stack-8">
 *       <p class="seq-dominant__figure headline-lg" id="run-state">Run 4123 <span class="seq-dominant__state" data-state="failed">failed</span> at Calls</p>
 *       <p class="seq-dominant__label body-md">4 of 5 steps succeeded, 41 min, 1 issue</p>
 *     </div>
 *     <div class="o-scroll" tabindex="0"><table class="admin-table">…</table></div>
 *   </section>
 *
 * .seq-dominant__state takes its colour from data-state, the same roles the .seq-state mark
 * reads (_state.css): emerald for succeeded, golden for queued and running, cardinal for
 * failed and blocked, the text colour for pending and cancelled. The word is always present;
 * the colour never carries the meaning alone. An index with no rows keeps the block and says,
 * in one .body-md sentence inside it, what would appear there.
 */

.seq-dominant {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-24);
  min-width: 0;
}

.seq-dominant__figure {
  margin: 0;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.seq-dominant__state[data-state="succeeded"] {
  color: var(--state-succeeded);
}
.seq-dominant__state[data-state="queued"],
.seq-dominant__state[data-state="running"] {
  color: var(--state-working);
}
.seq-dominant__state[data-state="failed"],
.seq-dominant__state[data-state="blocked"] {
  color: var(--state-failed);
}

.seq-dominant__label {
  margin: 0;
  color: var(--text-secondary);
}

.seq-dominant__empty {
  margin: 0;
  color: var(--text-secondary);
}

/* ---------- Touch: a link inside the figure ----------
   The figure is a sentence that may name a record ("Calls failed in run 4123"); its link is
   one 32px line, and on a coarse pointer a transparent ::before makes it at least 44 by 44
   without moving it. The configurations index's dominant row names its configuration in
   .headline-sm (a 26px line) and gets the same. A link in the label or the empty sentence is a word in a sentence in
   .body-md and is exempt as inline prose (TouchTargetTest::INLINE_PROSE_LINKS). */
@media (pointer: coarse) {
  .seq-dominant__figure a,
  .seq-dominant .headline-sm a {
    position: relative;
  }
  .seq-dominant__figure a::before,
  .seq-dominant .headline-sm a::before {
    content: "";
    position: absolute;
    inset: min(0px, calc((100% - 44px) / 2));
  }
}
