/* Testing (packs/testing; docs/reset_plan.md section 8): the little the persona chooser and the Test environment page add to the shared components. Both pages are
   arrangements of PageSectionComponent, CardComponent, DataTableComponent, FigureStripComponent, BadgeComponent, EmptyStateComponent and the form system
   (Forms::*), which bring their own look; these rules only lay out what is between them. The banner every page shows during a persona session is the layout's,
   in 13-persona-banner.css.

   * The chooser (Testing::PersonaChoicesComponent): "Return to yourself" first, while a session is live, in the persona banner's accent tone with a thick edge
     at the start; then a grid of cards, as many columns as fit and one at 320 CSS px. A card's heading is the persona's roles in words, its body the person
     ("Lena Ortiz (made up)"), its footer the one button, which wraps a long name onto more lines instead of widening the card. The persona already chosen has
     the accent edge, and "Acting now" in words in place of its button, so the edge is never the only signal (WCAG 1.4.1).
   * The Test environment page (Testing::EnvironmentStatusComponent, ResetHistoryComponent, ResetPreviewComponent, ResetFormComponent): sections one under the
     other; what is kept is a short list under the counts. Tables of sessions, resets and counts are drawn as cards where there is little room (DataTableComponent
     `cards: true`).
   * The result (Testing::ResetResultComponent): one live region, a box in a callout's tone (the callout's own rules, 35-components.css) with the sentences, and
     the table of what was removed under it.

   Tokens only and logical properties only, both enforced (test/styles/tokens_test.rb, test/styles/components_test.rb), so it reads on the light shell and the
   console, in light and in dark, and mirrors in a right-to-left language. Nothing pinned to an edge or sticky (WCAG 2.4.11), no height in vh, and everything that
   holds words may shrink and wrap, so a language 40% longer never widens the page (WCAG 1.4.10). */

/* ── The persona chooser ─────────────────────────────────────────────────── */
.persona-choices__current {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
  min-inline-size: 0;
  padding: 0.6rem 1rem;
  border: 1px solid var(--tone-accent-line);
  border-inline-start-width: 4px;
  border-radius: var(--radius-md);
  background: var(--tone-accent-bg);
  color: var(--tone-accent-fg);
  overflow-wrap: anywhere;
}

.persona-choices__current-reading {
  flex: 1 1 18rem;
  min-inline-size: 0;
  max-inline-size: 72ch;
  margin-block: 0;
}

.persona-choices__return {
  flex: 0 1 auto;
  min-inline-size: 0;
  margin: 0;
}

.persona-choices__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: var(--space-3);
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.persona-choices__card {
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

/* The footer sits at the foot of the card whatever the length of the roles above it, so the buttons of a row line up. */
.persona-choices__card > .card-body {
  flex: 1 1 auto;
}

.persona-choices__card[data-current] {
  border-color: var(--tone-accent-line);
  border-inline-start-width: 4px;
}

.persona-choices__person {
  margin-block: 0;
}

/* A persona's name is a span with dir="auto": an isolate in its own direction, as a bdi is, said here as well as by the browser's own rule for [dir]. The one
   in "You are acting as ..." is set in the heavier weight, as the banner's is. */
.persona-choices__name {
  unicode-bidi: isolate;
}

.persona-choices__name--strong {
  font-weight: 600;
}

.persona-choices__choose {
  min-inline-size: 0;
  max-inline-size: 100%;
  margin: 0;
}

.persona-choices__choose .btn,
.persona-choices__return .btn {
  max-inline-size: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}

/* ── The Test environment page ───────────────────────────────────────────── */
.environment-status {
  display: grid;
  gap: var(--space-5);
  min-inline-size: 0;
}

.environment-status__mode {
  max-inline-size: 72ch;
  margin-block: 0;
  overflow-wrap: anywhere;
}

/* What the installation is marked, in the heavier weight; a persona's name in a session row, an isolate in its own direction (a span with dir="auto"). */
.environment-status__environment {
  font-weight: 600;
}

.environment-status__persona-name {
  unicode-bidi: isolate;
}

.reset-history td,
.reset-history th {
  overflow-wrap: anywhere;
}

.reset-preview__real {
  max-inline-size: 72ch;
  margin-block: 0;
  color: var(--fg2);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.reset-preview__kept {
  display: grid;
  gap: var(--space-1);
  min-inline-size: 0;
}

.reset-preview__kept-lead {
  margin-block: 0;
  font-size: var(--text-sm);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.reset-preview__kept-list {
  min-inline-size: 0;
  margin-block: 0;
  padding-inline-start: var(--space-5);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* The totals, the last row of a table of counts, read as the sum they are. */
.reset-counts tbody tr:last-child > * {
  font-weight: 600;
}

/* ── The result ──────────────────────────────────────────────────────────── */
.reset-result {
  display: grid;
  gap: var(--space-3);
  min-inline-size: 0;
}

.reset-result__summary {
  display: grid;
  gap: var(--space-1);
  max-inline-size: 72ch;
}

.reset-result__reading {
  margin-block: 0;
  font-weight: 600;
}

.reset-result__line {
  margin-block: 0;
  font-variant-numeric: tabular-nums;
}
