/* /demos/rust-borrow-lab — the parts of this page that are only this page's.
 *
 * THE STEP COMPONENT IS NOT HERE. The tab strip, the caret gutters, the
 * suggested-fix diffs and the provenance list are rust-diag-steps.css, shared
 * with /demos/rust-lifetime-lab and /demos/rust-move-lab, and this file loads
 * AFTER it so a rule here wins.
 *
 * WHAT IS HERE is the one thing neither sibling has: a step with NO DIAGNOSTIC.
 * Two of this page's three steps are ordinary refusals and use the shared
 * component unchanged; the third is a program the compiler ACCEPTED, so there is
 * no caret to draw and no message to print, and what it shows instead is the
 * recorded source. It has to read as a different KIND of panel without reading
 * as a broken one — a reader who thinks the diagnostic failed to load has
 * learned the opposite of the page's point.
 *
 * The scene blocks below are the same shape rust-move-lab uses, for the same
 * reason, and are not shared: emphasis and order are what these rules carry, and
 * neither page's Go half is the other's.
 */

.rbl__lede {
  max-width: 62rem;
}

.rbl__captured,
.rbl__tally,
.rbl__silence,
.rbl__whole,
.rbl__prov,
.rbl__steps {
  margin: 2.5rem 0;
}

.rbl__captured p,
.rbl__tally p,
.rbl__silence p,
.rbl__whole p,
.rbl__prov p,
.rbl__sequence {
  max-width: 62rem;
}

/* ---- the two panels that carry a finding --------------------------------- */

/* The tally and the silence panel are both FINDINGS rather than preamble, and
 * both are read out of the capture rather than asserted in copy. They are set
 * off from the page so a reader who skips them does not spend the rest of it
 * wondering why only one language has diagnostics, or why a build that exited
 * non-zero is being presented as correct. */
.rbl__tally,
.rbl__silence {
  border-left: 3px solid var(--border-color, #d0d7de);
  padding-left: 1.25rem;
}

.rbl__tally-list,
.rbl__silence-list {
  font-size: 0.95rem;
}

/* ---- the accepted step --------------------------------------------------- */

/* THE ACCENT IS SUCCESS-COLORED AND THE REFUSALS ARE NOT, which is the whole
 * job of this rule. The shared component draws a primary caret in the danger
 * color, so two of the three steps carry red; a third panel with no accent at
 * all would read as a step whose diagnostic failed to arrive rather than as one
 * that never had a diagnostic to arrive. */
.rbl__accepted {
  border-left: 3px solid var(--success-color, #1a7f37);
  padding-left: 1rem;
  margin: 1.25rem 0;
}

.rbl__accepted-head {
  max-width: 62rem;
}

/* The listing has no caret gutter under it, so the line numbers are the only
 * alignment that matters and the block can afford to be slightly quieter than a
 * diagnostic. */
.rbl__accepted-source {
  border-style: solid;
}

/* ---- a scene of program output ------------------------------------------- */

.rbl__go {
  border-left: 3px solid var(--border-color, #d0d7de);
  padding-left: 1rem;
  margin: 1.5rem 0 0.5rem;
}

.rbl__go h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.rbl__go-note,
.rbl__go-caption {
  max-width: 60rem;
}

.rbl__go-caption {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

/* EACH LINE IS ITS OWN BLOCK, not one <pre> with newlines in it, and that is
 * what makes a single line emphasizable at all. The cost is the gap between
 * consecutive lines, removed here so a scene still reads as one run of output
 * rather than as a list. */
.rbl__scene {
  margin: 0.75rem 0;
}

.rbl__scene-line {
  margin: 0;
  border-radius: 0;
  border-bottom-width: 0;
}

.rbl__scene-line:first-child {
  border-radius: 8px 8px 0 0;
}

.rbl__scene-line:last-child {
  border-radius: 0 0 8px 8px;
  border-bottom-width: 1px;
}

/* THE LINE WHERE THE BEHAVIOR TURNS. In the first scene these are the append
 * that moved the array out from under a pointer, and the write through that
 * pointer which succeeded and changed nothing. Marked with a left rule and a
 * weight change rather than a background, so the monospace grid is undisturbed
 * and the line is still legible when the accent color is not available. */
.rbl__scene-line--key {
  border-left: 4px solid var(--link-color, #0969da);
  font-weight: 600;
}

/* A line whose content the program MEASURED — an address comparison — rather
 * than one it merely narrated. The marker is a suffix rather than a color,
 * because the distinction is a claim about provenance and has to survive being
 * read aloud, printed, or seen without color. */
.rbl__scene-line[data-measured="true"] code::after {
  content: "  \2190 measured";
  opacity: 0.6;
  font-weight: 400;
}

/* ---- the whole run ------------------------------------------------------- */

.rbl__whole-raw {
  font-size: 0.85rem;
}
