/* The interface's design system: one stylesheet, one scale, one component vocabulary.
 *
 * # Not one colour is written in this file
 *
 * Every colour comes from a custom property that `/ui/theme.css` sets, and that file is generated
 * from this installation's own theme. A hex value written here would be one an operator cannot
 * change without a release, and it would be found by whoever is looking at the wrong shade of blue
 * rather than by whoever wrote it. `ui_walkthrough` holds this over the file (ADR-MB-046), so the
 * rule is a mechanism and not a convention.
 *
 * The design MB26 builds to needed nine colours this theme did not have: a tint for each of the
 * four states, a stronger border, a hairline, a recessed ground, and two shadow colours. All nine
 * were added to the theme rather than written here, for exactly that reason.
 *
 * # The scale is declared, and everything uses it
 *
 * Before MB26 this file had 991 lines grown one phase at a time with no spacing scale and no type
 * scale, so every screen invented its own. There is one of each now, at the top, and no rule below
 * writes a length that is not on it. That is what makes fourteen screens look like one product.
 *
 * # It is for lawyers
 *
 * Generous line height, a serif for headings, real buttons and real links so the keyboard works
 * without anything being added for it, and no dense grids.
 */

/* -- The scale -------------------------------------------------------------------------------
 *
 * Spacing is a geometric-ish ramp in `rem`, so a person who has set a larger type size in their
 * browser gets larger spacing with it. Type is a scale of seven, and every heading and every piece
 * of small print below names one of them rather than a number of its own.
 *
 * These are not in `theme.toml` and that is deliberate: they are layout, not palette. An operator
 * replaces colours and typefaces; nobody wants to hand-tune eight spacing steps.
 */

:root {
  --sp1: 0.25rem;
  --sp2: 0.5rem;
  --sp3: 0.75rem;
  --sp4: 1rem;
  --sp5: 1.5rem;
  --sp6: 2rem;
  --sp7: 3rem;
  --sp8: 4rem;

  --t1: 0.6875rem;
  --t2: 0.75rem;
  --t3: 0.8125rem;
  --t4: 0.875rem;
  --t5: 0.9375rem;
  --t6: 1.0625rem;
  --t7: 1.35rem;
  --t8: 2rem;

  --r-sm: calc(var(--radius) / 2);

  --shadow-1: 0 1px 2px var(--shadow);
  --shadow-2: 0 16px 44px var(--shadow-strong);

  /* How wide a page of reading may get. A measure beyond about 70 characters is one the eye loses
   * its place on returning, and this product's screens are read rather than scanned. */
  --page: 74rem;
  --page-wide: 92rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: var(--t5);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  margin: 0;
}

h1 {
  font-size: var(--t8);
}
h2 {
  font-size: var(--t7);
}
h3 {
  font-size: var(--t6);
}

h4 {
  font-family: var(--font-sans);
  font-size: var(--t4);
  font-weight: 600;
  margin: 0;
}

p {
  margin: 0;
  max-width: 68ch;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

code,
pre,
.mono {
  font-family: var(--font-mono);
  font-size: var(--t2);
  color: var(--muted-foreground);
}

/* A digest is 96 characters and an identifier is 65, and both live in table cells. Without this
 * they set the table's minimum width, the table sets the page's, and the whole layout scrolls
 * sideways. Found by rendering a page and measuring it, by nothing before that. */
code {
  overflow-wrap: anywhere;
}

pre {
  overflow-x: auto;
  background: var(--sunken);
  color: var(--foreground);
  padding: var(--sp3);
  border-radius: var(--r-sm);
  margin: var(--sp2) 0 0;
  font-size: var(--t2);
  line-height: 1.5;
}

/* -- The words --------------------------------------------------------------------------------- */

.muted {
  color: var(--muted-foreground);
}

.small {
  font-size: var(--t3);
}

.hint {
  font-size: var(--t2);
  color: var(--muted-foreground);
  margin: 0;
}

.lede {
  font-size: var(--t5);
  color: var(--muted-foreground);
}

.num {
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  font-size: var(--t1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  font-weight: 600;
}

/* -- Arrangement ------------------------------------------------------------------------------- */

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--sp4);
}
.stack-1 {
  display: flex;
  flex-direction: column;
  gap: var(--sp1);
}
.stack-2 {
  display: flex;
  flex-direction: column;
  gap: var(--sp2);
}
.stack-6 {
  display: flex;
  flex-direction: column;
  gap: var(--sp6);
}
.row {
  display: flex;
  align-items: center;
  gap: var(--sp3);
  flex-wrap: wrap;
}
.row-2 {
  display: flex;
  align-items: center;
  gap: var(--sp2);
  flex-wrap: wrap;
}
.row-top {
  align-items: flex-start;
}
.between {
  justify-content: space-between;
}
.push {
  margin-left: auto;
}
.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: var(--sp4);
  align-items: start;
}

/* -- The shell --------------------------------------------------------------------------------- */

.top {
  display: flex;
  align-items: center;
  gap: var(--sp5);
  padding: var(--sp3) var(--sp6);
  background: var(--sidebar);
  color: var(--sidebar-foreground);
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-display);
  font-size: var(--t6);
  color: var(--sidebar-foreground);
}

.top__nav {
  display: flex;
  gap: var(--sp1);
  flex-wrap: wrap;
}

.top__link {
  color: var(--sidebar-foreground);
  opacity: 0.72;
  font-size: var(--t4);
  padding: var(--sp1) var(--sp3);
  border-radius: var(--r-sm);
}

.top__link:hover {
  background: var(--sidebar-accent);
  color: var(--sidebar-accent-foreground);
  opacity: 1;
  text-decoration: none;
}

.top__link[aria-current="page"] {
  background: var(--sidebar-accent);
  color: var(--sidebar-accent-foreground);
  opacity: 1;
  font-weight: 600;
}

.top__who {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--sp3);
  font-size: var(--t3);
  color: var(--sidebar-foreground);
  opacity: 0.75;
  flex-wrap: wrap;
}

.top__act {
  background: none;
  border: 1px solid var(--sidebar-border);
  color: var(--sidebar-foreground);
  border-radius: var(--r-sm);
  padding: var(--sp1) var(--sp2);
  font-size: var(--t3);
  cursor: pointer;
}

.top__act:hover {
  background: var(--sidebar-accent);
  color: var(--sidebar-accent-foreground);
}

/* Where you are, and how to get back, on every screen that is not the top of one. A person who
 * cannot tell what they are looking at or how they got there cannot use an interface however good
 * the page itself is. */
.crumbs {
  display: flex;
  align-items: center;
  gap: var(--sp2);
  padding: var(--sp3) var(--sp6);
  border-bottom: 1px solid var(--border);
  background: var(--card);
  font-size: var(--t3);
  color: var(--muted-foreground);
  flex-wrap: wrap;
}

.crumbs a {
  color: var(--primary);
}

.crumbs [aria-current="page"] {
  color: var(--foreground);
  font-weight: 600;
}

.crumb-sep {
  color: var(--muted-foreground);
}

.page {
  padding: var(--sp7) var(--sp6) var(--sp8);
  max-width: var(--page);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp6);
}

.page--wide {
  max-width: var(--page-wide);
}

/* A slot a screen keeps for something that is not there yet. Every screen in this interface holds
 * one or two of these for a refusal or an answer that appears in place, and an empty flex item
 * still costs the column's whole gap: two of them put four rems of nothing in the middle of a
 * screen. */
.page > div:empty,
.panel__body > div:empty {
  display: none;
}

.head {
  display: flex;
  flex-direction: column;
  gap: var(--sp2);
}

.head__facts {
  display: flex;
  gap: var(--sp4);
  flex-wrap: wrap;
  font-size: var(--t3);
  color: var(--muted-foreground);
}

.head__facts code {
  font-size: var(--t2);
}

/* -- Controls ---------------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp2);
  font-size: var(--t3);
  padding: var(--sp1) var(--sp3);
  min-height: 2rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--foreground);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

/* **In a column, a button is the width of its own words.** Every panel body and every stack in this
 * interface is a flex column, and a flex item stretches to the cross axis by default, so a button
 * placed in one was drawn the full width of the card: "See the audit in full" came out as a
 * thousand pixel bar. Found by looking at a frame and by nothing else. */
.btn {
  align-self: flex-start;
}

.btn:hover:not(:disabled) {
  background: var(--muted);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
  font-weight: 600;
}

.btn--primary:hover:not(:disabled) {
  background: var(--primary);
  filter: brightness(1.08);
}

.btn--quiet {
  border-color: transparent;
  background: none;
  color: var(--muted-foreground);
}

.btn--quiet:hover:not(:disabled) {
  background: var(--muted);
  color: var(--foreground);
}

.btn--danger {
  border-color: var(--destructive);
  color: var(--destructive);
  background: var(--card);
}

.btn--danger:hover:not(:disabled) {
  background: var(--state-failed-fill);
}

.seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--card);
  flex-wrap: wrap;
}

.seg a,
.seg button {
  border: 0;
  background: none;
  padding: var(--sp1) var(--sp3);
  font-size: var(--t3);
  color: var(--muted-foreground);
  cursor: pointer;
  text-decoration: none;
}

.seg a + a,
.seg button + button {
  border-left: 1px solid var(--border);
}

.seg a:hover,
.seg button:hover {
  background: var(--muted);
  color: var(--foreground);
  text-decoration: none;
}

.seg [aria-current="true"],
.seg [aria-current="page"] {
  background: var(--muted);
  color: var(--foreground);
  font-weight: 600;
}

input,
select,
textarea {
  font: inherit;
  font-size: var(--t4);
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--input);
  border-radius: var(--r-sm);
  padding: var(--sp2) var(--sp3);
  width: 100%;
  max-width: 32rem;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  margin: 0;
}

input[type="file"] {
  max-width: none;
}

label {
  display: block;
  font-size: var(--t3);
  color: var(--muted-foreground);
  margin-bottom: var(--sp1);
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--sp1);
  margin-bottom: var(--sp4);
  max-width: 32rem;
}

.field label {
  margin-bottom: 0;
}

.checkline {
  display: flex;
  gap: var(--sp2);
  align-items: baseline;
  font-size: var(--t4);
  color: var(--foreground);
  margin-bottom: 0;
  max-width: none;
}

/* -- State, as a word and a colour -------------------------------------------------------------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--sp1);
  font-size: var(--t1);
  font-weight: 600;
  padding: 0.125rem var(--sp2);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--sunken);
  color: var(--muted-foreground);
  white-space: nowrap;
}

.tag--done {
  background: var(--state-done-fill);
  color: var(--state-done);
  border-color: var(--state-done);
}
.tag--running {
  background: var(--state-running-fill);
  color: var(--state-running);
  border-color: var(--state-running);
}
.tag--waiting {
  background: var(--state-waiting-fill);
  color: var(--state-waiting);
  border-color: var(--state-waiting);
}
.tag--failed {
  background: var(--state-failed-fill);
  color: var(--state-failed);
  border-color: var(--state-failed);
}

.dot {
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 50%;
  background: var(--state-stopped);
  flex: none;
}

.dot--done {
  background: var(--state-done);
}
.dot--running {
  background: var(--state-running);
}
.dot--waiting {
  background: var(--state-waiting);
}
.dot--failed {
  background: var(--state-failed);
}

/* -- The four states every screen has ------------------------------------------------------------
 *
 * Empty, loading, error and partial. They are components rather than sentences invented per screen,
 * because a screen that invents its own empty state invents its own words for it, and fourteen sets
 * of words for "there is nothing here yet" is fourteen screens that do not look like one product.
 */

.state-block {
  display: flex;
  flex-direction: column;
  gap: var(--sp2);
  padding: var(--sp6);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--card);
  align-items: flex-start;
}

.state-block h3 {
  font-family: var(--font-sans);
  font-size: var(--t5);
  font-weight: 600;
}

.state-block--loading {
  border-style: solid;
  color: var(--muted-foreground);
}

/* A refusal the node described, in the node's own words. */
.problem {
  border: 1px solid var(--destructive);
  border-left-width: 4px;
  border-radius: var(--radius);
  padding: var(--sp4);
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: var(--sp2);
}

.problem h3 {
  font-family: var(--font-sans);
  font-size: var(--t5);
  font-weight: 600;
  color: var(--destructive);
}

.problem .meta {
  font-size: var(--t2);
  color: var(--muted-foreground);
}

/* What was produced under reduced capability says so, on the output that was produced under it
 * (invariant I15). Never a footnote somewhere else on the screen. */
.partial {
  border-left: 4px solid var(--state-waiting);
  background: var(--state-waiting-fill);
  color: var(--foreground);
  padding: var(--sp3) var(--sp4);
  border-radius: var(--r-sm);
  font-size: var(--t3);
}

/* The sentence every produced artifact carries. A scope boundary fixed at kickoff, so it is a
 * component and not a footer. */
.advisory {
  border-left: 4px solid var(--accent);
  background: var(--muted);
  color: var(--foreground);
  padding: var(--sp3) var(--sp4);
  border-radius: var(--r-sm);
  font-size: var(--t3);
  max-width: none;
}

/* -- Panels and lists ---------------------------------------------------------------------------- */

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  min-width: 0;
}

.panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp3);
  padding: var(--sp3) var(--sp4);
  flex-wrap: wrap;
  cursor: pointer;
  list-style-position: outside;
}

.panel__head:hover {
  background: var(--sunken);
}

details.panel[open] > .panel__head {
  border-bottom: 1px solid var(--border);
}

/* A panel is a disclosure, and its own frame is not the generic one every other disclosure gets. */
details.panel {
  border-top: 1px solid var(--border);
  padding-top: 0;
}

.panel__body {
  padding: var(--sp4);
  display: flex;
  flex-direction: column;
  gap: var(--sp3);
  overflow-x: auto;
}

.panel__foot {
  padding: var(--sp2) var(--sp4);
  border-top: 1px solid var(--border);
  background: var(--sunken);
  font-size: var(--t3);
  color: var(--muted-foreground);
  display: flex;
  gap: var(--sp2);
  flex-wrap: wrap;
  align-items: center;
}

.list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}

/* One row of a list, which may be a link, a button or neither. */
.line {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: center;
  gap: var(--sp4);
  padding: var(--sp3) var(--sp4);
  border: 0;
  border-bottom: 1px solid var(--hairline);
  background: var(--card);
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  width: 100%;
  text-decoration: none;
}

.line:last-child {
  border-bottom: 0;
}

.line:hover {
  background: var(--sunken);
  text-decoration: none;
}

.line--static {
  cursor: default;
}

.line--static:hover {
  background: var(--card);
}

.line__t {
  font-size: var(--t5);
  color: var(--foreground);
}

.line__s {
  font-size: var(--t3);
  color: var(--muted-foreground);
}

.line:hover .line__t {
  color: var(--primary);
}

.line--static:hover .line__t {
  color: var(--foreground);
}

/* The facts of a thing, as a definition list. Most of what this product knows is shaped like this. */
.dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--sp2) var(--sp4);
  margin: 0;
  font-size: var(--t3);
  align-items: baseline;
}

.dl dt {
  color: var(--muted-foreground);
}

.dl dd {
  margin: 0;
  color: var(--foreground);
  overflow-wrap: anywhere;
}

/* -- Cases ---------------------------------------------------------------------------------------- */

/* The landing state's counts. Each one is a filter and not decoration, which is why they are links
 * and carry the current one. Before MB26 signing in landed on a table and nothing anywhere said how
 * many disputes were running or what was waiting on a person. */
.counts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: var(--sp3);
}

.count {
  display: flex;
  flex-direction: column;
  gap: var(--sp1);
  padding: var(--sp4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-1);
  text-decoration: none;
  color: inherit;
}

.count:hover {
  border-color: var(--border-strong);
  background: var(--sunken);
  text-decoration: none;
}

.count[aria-current="page"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.count__v {
  font-family: var(--font-display);
  font-size: var(--t8);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.count__l {
  font-size: var(--t3);
  color: var(--muted-foreground);
}

.count--waiting .count__v {
  color: var(--state-waiting);
}
.count--failed .count__v {
  color: var(--state-failed);
}
.count--running .count__v {
  color: var(--state-running);
}
.count--done .count__v {
  color: var(--state-done);
}

.case {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr) max-content;
  align-items: center;
  gap: var(--sp5);
  padding: var(--sp4) var(--sp5);
  border: 0;
  border-bottom: 1px solid var(--hairline);
  background: var(--card);
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-decoration: none;
}

.case:last-child {
  border-bottom: 0;
}

.case:hover {
  background: var(--sunken);
  text-decoration: none;
}

.case__name {
  font-size: var(--t6);
  color: var(--foreground);
}

.case:hover .case__name {
  color: var(--primary);
}

.case__ref {
  display: block;
}

.case__says {
  font-size: var(--t4);
  color: var(--foreground);
}

.case__when {
  font-size: var(--t3);
  color: var(--muted-foreground);
  white-space: nowrap;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: var(--sp1);
  align-items: flex-end;
}

/* -- The outcome, which is the first thing on a finished case --------------------------------------- */

.outcome {
  display: flex;
  flex-direction: column;
  gap: var(--sp4);
  padding: var(--sp6);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-1);
}

/* Two columns on a wide screen. Every child of this card used to be capped at a reading measure and
   stacked down the middle of a card twice that wide, so half of every outcome was blank. */
.outcome__cols {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: var(--sp6);
  /* The right column ends where its content ends rather than stretching to match the left. */
  align-items: start;
}

.outcome__main {
  display: flex;
  flex-direction: column;
  gap: var(--sp4);
  min-width: 0;
}

.outcome__side {
  display: flex;
  flex-direction: column;
  gap: var(--sp4);
  min-width: 0;
}

@media (max-width: 68rem) {
  .outcome__cols {
    grid-template-columns: minmax(0, 1fr);
  }
}

.outcome__answer {
  font-family: var(--font-display);
  font-size: 1.75rem;
  line-height: 1.2;
  max-width: 34ch;
}

/* What the answer rests on, under the answer.
 *
 * The deciding step ends its one sentence with the findings it comes from, and inside display type
 * those are half the headline. They are lifted out and set here: small, quiet, and each one still a
 * link to the step that made the finding. Wrapping rather than scrolling, because on a narrow
 * screen there can be four of them. */
.outcome__rests {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp1) var(--sp3);
  margin: 0;
  font-size: var(--t3);
  color: var(--muted-foreground);
}

.outcome__restshead {
  font-size: var(--t1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

/* The findings the answer rests on, inside the answer.
 *
 * The deciding step grounds this sentence like every other sentence it writes, so the headline
 * carries two or three references to earlier steps. Set at the headline's own size they are half
 * the sentence and the answer is lost in them; taken out altogether the one sentence a customer
 * reads would be the only ungrounded thing on the screen. So they are set small and quiet in the
 * body face, still links, and still saying which step and which finding. */
.outcome__answer .cite-link,
.outcome__answer .cite-inline,
.outcome__answer .cite,
.outcome__answer .cite-what {
  font-family: var(--font-sans);
  font-size: var(--t3);
  line-height: 1.4;
  color: var(--muted-foreground);
}

/* How sure the outcome is. Sits between the answer and the quotation, because a person reading a
   decision wants to know how much weight it carries before they read what it says. */
.outcome__conf {
  margin: 0;
  padding: var(--sp4) var(--sp5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--muted);
}

.outcome__conf--none {
  font-size: var(--t2);
  color: var(--muted-foreground);
  padding: var(--sp3) var(--sp4);
}

.outcome__confhead {
  display: flex;
  align-items: baseline;
  gap: var(--sp3);
  margin: 0;
}

.outcome__confnum {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  color: var(--accent);
}

.outcome__conflabel {
  font-size: var(--t3);
  color: var(--foreground);
}

.outcome__confwhy {
  margin: var(--sp3) 0 0;
  font-size: var(--t3);
  line-height: 1.5;
  color: var(--foreground);
}

.outcome__confsrc {
  margin: var(--sp3) 0 0;
  font-size: var(--t2);
  line-height: 1.45;
  color: var(--muted-foreground);
}

/* What the file was missing, printed on the decision. Warm rather than alarming: an acknowledged
   gap is the process working, not a failure. */
.outcome__short {
  margin: 0;
  padding: var(--sp4) var(--sp5);
  border: 1px solid var(--border);
  border-left: 3px solid var(--warn, var(--accent));
  border-radius: var(--radius);
  background: var(--muted);
}

.outcome__shorthead {
  margin: 0;
  font-size: var(--t3);
  font-weight: 600;
}

.outcome__shortlist {
  margin: var(--sp3) 0 0;
  padding-left: var(--sp5);
  display: flex;
  flex-direction: column;
  gap: var(--sp3);
}

.outcome__shortlist li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.outcome__shortwhat {
  font-size: var(--t3);
  color: var(--foreground);
}

.outcome__shortwhy,
.outcome__shortack {
  font-size: var(--t2);
  color: var(--muted-foreground);
}

.outcome__shortsrc {
  margin: var(--sp3) 0 0;
  font-size: var(--t2);
  color: var(--muted-foreground);
}

.veil {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--background) 78%, transparent);
  backdrop-filter: blur(2px);
}

.veil__box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp3);
  max-width: 34rem;
  padding: var(--sp6);
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-1);
}

.veil__spin {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  animation: veil-spin 0.9s linear infinite;
}

@keyframes veil-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .veil__spin { animation: none; }
}

.veil__t {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--t5);
}

.veil__s {
  margin: 0;
  min-height: 2.6em;
  font-size: var(--t3);
  color: var(--muted-foreground);
}

.veil__bar {
  display: block;
  width: 16rem;
  max-width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}

.veil__barfill {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 1s linear;
}

.veil__c {
  margin: 0;
  font-size: var(--t2);
  color: var(--muted-foreground);
}

.ready {
  display: flex;
  flex-direction: column;
  gap: var(--sp3);
  align-items: flex-start;
  padding: var(--sp4);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--muted);
}

.ready__said {
  margin: 0;
  font-size: var(--t4);
}

.docs__cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--sp5);
  align-items: start;
}

@media (max-width: 68rem) {
  .docs__cols { grid-template-columns: minmax(0, 1fr); }
}

.docs {
  display: flex;
  flex-direction: column;
  gap: var(--sp3);
}

.docs__doc {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp3) var(--sp4);
}

.docs__head {
  display: flex;
  align-items: center;
  gap: var(--sp3);
  flex-wrap: wrap;
}

.docs__name {
  font-size: var(--t4);
  flex: 1 1 auto;
}

.docs__who {
  font-size: var(--t2);
  color: var(--muted-foreground);
}

.docs__words {
  display: flex;
  flex-direction: column;
  gap: var(--sp3);
}

.docs__words:not(:empty) {
  margin-top: var(--sp3);
  padding-top: var(--sp3);
  border-top: 1px solid var(--border);
  max-height: 32rem;
  overflow-y: auto;
}

.docs__passage {
  margin: 0;
  font-size: var(--t3);
  line-height: 1.5;
  white-space: pre-wrap;
}

.docs__cite {
  display: block;
  font-size: var(--t1);
  color: var(--muted-foreground);
}

.must {
  margin: 0;
  font-weight: 600;
  /* The theme's own refusal colour, so it moves with the palette in both light and dark. */
  color: var(--state-failed);
  white-space: nowrap;
}

.reason {
  width: 100%;
  max-width: 52ch;
  min-height: 5rem;
  padding: var(--sp3);
  font: inherit;
  font-size: var(--t3);
  line-height: 1.5;
  color: var(--foreground);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  resize: vertical;
}

.demand {
  display: flex;
  flex-direction: column;
  gap: var(--sp2);
  padding: var(--sp4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.demand__top {
  display: flex;
}

.demand__what {
  font-size: var(--t4);
  margin: 0;
}

.demand__why,
.demand__ack {
  font-size: var(--t3);
  color: var(--muted-foreground);
  margin: 0;
}

.demand__act {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp3);
  margin-top: var(--sp2);
}

.outcome__money {
  display: flex;
  align-items: baseline;
  gap: var(--sp2);
  flex-wrap: wrap;
  margin: 0;
  font-size: var(--t4);
}

.outcome__turns {
  flex-basis: 100%;
  font-size: var(--t3);
  color: var(--muted-foreground);
}

.outcome__todo {
  display: flex;
  flex-direction: column;
  gap: var(--sp2);
  padding: var(--sp4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.outcome__todohead {
  margin: 0;
  font-size: var(--t2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.outcome__todorow {
  margin: 0;
  font-size: var(--t3);
  line-height: 1.5;
}

.outcome__quote {
  font-family: var(--font-display);
  font-size: var(--t6);
  line-height: 1.45;
  color: var(--foreground);
  max-width: 62ch;
  margin: 0;
}

.outcome__src {
  display: block;
  margin-top: var(--sp2);
  font-family: var(--font-sans);
  font-size: var(--t2);
  color: var(--muted-foreground);
}

.figures {
  display: flex;
  gap: var(--sp6);
  flex-wrap: wrap;
  padding-top: var(--sp4);
  border-top: 1px solid var(--border);
}

.fig {
  display: flex;
  flex-direction: column;
}

.fig__v {
  font-size: var(--t6);
  font-variant-numeric: tabular-nums;
}

.fig__l {
  font-size: var(--t2);
  color: var(--muted-foreground);
}

/* -- Tables ----------------------------------------------------------------------------------------
 *
 * A table is for a grid of comparable values and nothing else. Anything carrying a sentence is a
 * list of rows, because a sentence does not belong in a cell.
 */

.table-scroll {
  overflow-x: auto;
  max-width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t3);
}

th,
td {
  text-align: left;
  padding: var(--sp2) var(--sp3);
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}

th {
  font-size: var(--t1);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-foreground);
  font-weight: 600;
  white-space: nowrap;
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: var(--sunken);
}

/* -- Disclosures ------------------------------------------------------------------------------------
 *
 * Detail is earned by clicking and never by scrolling past, so every raw structure in this product
 * is behind one of these and is never the primary view of anything.
 */

details {
  border-top: 1px solid var(--hairline);
  padding-top: var(--sp2);
}

summary {
  cursor: pointer;
  font-size: var(--t3);
  color: var(--muted-foreground);
}

summary:hover {
  color: var(--foreground);
}

/* -- The run, drawn as the process it is ------------------------------------------------------------
 *
 * Bands are the phases the graph declares, in the order it declares them. A node's position is
 * computed in script and set through the style object rather than as a `style` attribute: this
 * interface is served with `style-src 'self'` and no `unsafe-inline`, so an attribute is dropped by
 * the browser before it does anything (lesson MB12-09).
 */

.runbar {
  display: flex;
  align-items: center;
  gap: var(--sp4);
  flex-wrap: wrap;
  padding: var(--sp3) var(--sp4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-1);
}

.runbar__says {
  font-size: var(--t5);
}

.runsplit {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp4);
  align-items: start;
}

/* **The step is read over the picture, not beside it, and this is the change MB30 turned on.**
 * Beside it, the panel takes 27rem off the graph's frame, and there are only two things the picture
 * can do about that: lay itself out again at a smaller scale, which moves all sixty eight boxes the
 * instant somebody clicks one, or keep its size and be scrolled sideways, which is the one thing a
 * graph must never ask of a reader. Over it, neither happens: the frame keeps its width, the boxes
 * keep their positions, and closing the panel puts the reader back exactly where they were. */
.runsplit--open {
  grid-template-columns: minmax(0, 1fr);
}

.graphwrap {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  min-width: 0;
}

.graphbar {
  display: flex;
  align-items: center;
  gap: var(--sp4);
  flex-wrap: wrap;
  padding: var(--sp2) var(--sp4);
  border-bottom: 1px solid var(--border);
  background: var(--sunken);
}

.legend {
  display: flex;
  gap: var(--sp3);
  font-size: var(--t2);
  color: var(--muted-foreground);
  flex-wrap: wrap;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: var(--sp1);
}

/* No sideways scrolling. The picture is scaled to the width it is given instead, because a graph a
 * person has to scroll sideways to read is a graph they cannot read. */
.graphscroll {
  overflow: hidden;
}

/* The picture keeps its frame while a step is open, because the panel is drawn over the page rather
 * than out of the graph's width. */
.runsplit--open .graphscroll {
  overflow: hidden;
}

.graphzoom {
  position: relative;
}

.graphzoom > .graph {
  transform-origin: top left;
}

.graph {
  position: relative;
}

/* **Behind the boxes, not in front of them.** This layer was above them, so every arrow was drawn
 * across the face of whatever box it passed, and the picture read as a net thrown over the steps
 * rather than as steps joined by arrows. A box sits above the lines; a box being dragged sits above
 * everything. */
.graph__edges {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* The three columns the two cases are built in. The heading sits at the top of the picture and the
 * rule runs the whole way down, because the point being made is that the claimant's case and the
 * defendant's are built apart and meet in the middle. */
.lanehead {
  position: absolute;
  top: 0;
  text-align: center;
  font-size: var(--t2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  padding-bottom: var(--sp2);
}

.lanerule {
  position: absolute;
  width: 1px;
  background: var(--hairline);
}

/* The picture scrolls sideways and the phase names do not, so a reader always knows which phase
 * they are looking at and the name is never on top of a box. */
.graphbody {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  max-height: 48rem;
  overflow-y: auto;
}

.phaserail {
  position: relative;
  border-right: 1px solid var(--hairline);
}

.bandslot {
  position: absolute;
  left: var(--sp4);
  right: var(--sp3);
}

.band {
  position: sticky;
  top: var(--sp2);
  display: flex;
  align-items: baseline;
  gap: var(--sp2);
}

/* Where one phase ends and the next begins. */
.bandrule {
  position: absolute;
  left: 0;
  height: 1px;
  background: var(--hairline);
}

.band__n {
  font-family: var(--font-mono);
  font-size: var(--t1);
  color: var(--muted-foreground);
}

.band__name {
  font-size: var(--t2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.node {
  position: absolute;
  z-index: 1;
  touch-action: none;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--sp2);
  align-items: center;
  padding: var(--sp2) var(--sp3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--foreground);
  text-align: left;
  cursor: pointer;
  font: inherit;
  box-shadow: var(--shadow-1);
  transition: opacity 120ms linear, border-color 120ms linear;
}

.node:hover {
  border-color: var(--primary);
}

/* A box being moved. The cursor says it can be, before it is. */
.node {
  cursor: grab;
}

.node.is-held {
  cursor: grabbing;
  z-index: 3;
  box-shadow: var(--shadow-2);
}

/* The label on an arrow: what the graph says travels along it. Drawn in the layer above the boxes
 * so a long one is readable, and never in the way of a click. */
.edgelabel {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -50%);
  padding: 0.0625rem var(--sp1);
  border-radius: var(--r-sm);
  background: var(--card);
  border: 1px solid var(--border);
  font-size: var(--t1);
  color: var(--muted-foreground);
  white-space: nowrap;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.node__name {
  font-size: var(--t3);
  line-height: 1.25;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.node__side {
  font-size: 0.625rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.node--completed {
  background: var(--state-done-fill);
  border-color: var(--state-done);
}
.node--running,
.node--dispatched {
  background: var(--state-running-fill);
  border-color: var(--state-running);
  font-weight: 600;
}
.node--failed {
  background: var(--state-failed-fill);
  border-color: var(--state-failed);
}
.node--parked {
  background: var(--state-waiting-fill);
  border-color: var(--state-waiting);
}
.node--pending,
.node--ready,
.node--skipped {
  background: var(--card);
  color: var(--muted-foreground);
  border-style: dashed;
}

.node.is-picked {
  border-color: var(--foreground);
  box-shadow: 0 0 0 2px var(--foreground);
}

.node.is-kin {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

.node.is-dim {
  opacity: 0.22;
}

/* A step that is working, breathing gently, so a person can see which of sixty eight is busy. */
.node--running {
  animation: node-working 1.8s ease-in-out infinite;
}

@keyframes node-working {
  0%,
  100% {
    border-color: var(--state-running);
  }
  50% {
    border-color: var(--border);
  }
}

.node.just-moved {
  animation: node-moved 700ms ease-out;
}

@keyframes node-moved {
  0% {
    transform: translateX(0);
  }
  30% {
    transform: translateX(2px);
  }
  100% {
    transform: translateX(0);
  }
}

/* -- The step, docked beside the graph and never over it ---------------------------------------------- */

.pop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  width: min(28rem, 92vw);
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: none;
  border-left: 1px solid var(--border-strong);
  border-radius: 0;
  box-shadow: var(--shadow-2);
  min-width: 0;
}

/* **The head, the tabs and the foot never shrink, and this is the defect MB27 was opened on.**
 * `.pop` is a flex column with a bounded height. A flex item's default is `flex-shrink: 1`, so a
 * step whose answer is long enough to overflow the panel made the browser take the space back from
 * whatever it could: the tabs collapsed to nothing, and on a long enough answer the heading and the
 * footer went with them. It is content dependent, which is why it read as happening to "some
 * agents". The body is the one part that may give, and it gives by scrolling. */
.pop__head,
.pop__tabs,
.pop__foot {
  flex: none;
}

.pop__body {
  min-height: 0;
}

.pop__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: var(--sp2);
  align-items: start;
  padding: var(--sp4) var(--sp4) var(--sp3);
  border-bottom: 1px solid var(--border);
}

.pop__title {
  font-family: var(--font-display);
  font-size: var(--t7);
  line-height: 1.2;
}

.pop__sub {
  font-size: var(--t2);
  color: var(--muted-foreground);
}

.pop__tabs {
  display: flex;
  gap: var(--sp1);
  padding: 0 var(--sp3);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.pop__tab {
  border: 0;
  background: none;
  padding: var(--sp2);
  font-size: var(--t3);
  color: var(--muted-foreground);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.pop__tab:hover {
  color: var(--foreground);
}

.pop__tab[aria-current="true"] {
  color: var(--foreground);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.pop__body {
  padding: var(--sp4);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp4);
}

.pop__foot {
  margin-top: auto;
  padding: var(--sp2) var(--sp4);
  border-top: 1px solid var(--border);
  background: var(--sunken);
  display: flex;
  gap: var(--sp2);
  flex-wrap: wrap;
}

/* What a step said, quoted. Set in the display face because it is a sentence somebody wrote and not
 * a value this screen computed. */
.said {
  font-family: var(--font-display);
  font-size: var(--t6);
  line-height: 1.4;
  margin: 0;
  max-width: 60ch;
}

.said__src {
  display: block;
  margin-top: var(--sp2);
  font-family: var(--font-sans);
  font-size: var(--t2);
  color: var(--muted-foreground);
}

.quote {
  padding: var(--sp3);
  background: var(--sunken);
  border-left: 2px solid var(--accent);
  border-radius: var(--r-sm);
  font-size: var(--t3);
}

.rows {
  display: flex;
  flex-direction: column;
  gap: var(--sp2);
}

.rowitem {
  padding: var(--sp2) var(--sp3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: var(--t3);
}

.rowitem__when {
  display: block;
  font-size: var(--t1);
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

.kin {
  display: flex;
  flex-direction: column;
  gap: var(--sp2);
}

.kinrow {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--sp3);
  align-items: start;
  border: 0;
  background: none;
  padding: var(--sp2) 0;
  border-bottom: 1px solid var(--hairline);
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  width: 100%;
}

.kinrow:hover .kinrow__n {
  color: var(--primary);
}

.kinrow__step {
  font-size: var(--t1);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  padding-top: 0.1875rem;
}

.kinrow__n {
  font-size: var(--t4);
}

.kinrow__f {
  font-size: var(--t2);
  color: var(--muted-foreground);
}

/* -- The live log ------------------------------------------------------------------------------------ */

.log {
  max-height: 20rem;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--card);
}

.log ul {
  margin: 0;
  padding: 0;
}

.log li {
  list-style: none;
  padding: var(--sp2) var(--sp3);
  border-bottom: 1px solid var(--hairline);
  font-size: var(--t3);
  display: flex;
  gap: var(--sp3);
}

.log li:last-child {
  border-bottom: 0;
}

/* Four lines, and the rest scrolls. Computed from the row rather than guessed: each row is one line
   of `--t3` at 1.5, plus its two paddings and its hairline, so four of them is four rows exactly and
   the fifth is half visible, which is what tells a person there is more. */
.log--live {
  max-height: calc(4 * (var(--t3) * 1.5 + var(--sp2) * 2 + 1px));
}

.log time {
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: var(--t2);
  white-space: nowrap;
}

/* -- Citations, findings and prose ----------------------------------------------------------------- */

/* A citation, resolved. The words a person cites are the face of it and the identifier sits under
 * them, so `c_ga2005_0083_000000000083` is available and never the thing a lawyer has to read. */
.cite {
  display: inline-flex;
  flex-direction: column;
  gap: 0.1rem;
  vertical-align: top;
}

.cite-what {
  line-height: 1.35;
  color: var(--foreground);
}

.cite code {
  font-size: var(--t1);
  background: none;
  padding: 0;
}

.cite.unresolved .cite-what {
  color: var(--muted-foreground);
  font-style: italic;
}

/* A reference to a finding an earlier step made. It is a link, because the point of a reference is
 * that it can be followed: the words say which step and which of its findings, and following it
 * opens that step. The label the record holds is on the link's title. */
.cite-link {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

.cite-link:hover {
  text-decoration-style: solid;
}

/* A citation inside a sentence, on one line: the words, then the identifier in brackets. The
 * brackets are in the text rather than drawn by this file, because content drawn by CSS is absent
 * from what a person copies and from what a screen reader says. */
.cite-inline {
  white-space: normal;
}

.cite-ref {
  font-size: var(--t3);
  color: var(--muted-foreground);
}

.cite-ref code {
  font-size: inherit;
  color: inherit;
  background: none;
  padding: 0;
}

code.passage {
  font-size: var(--t3);
}

.cell-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp1);
}

.cell-object {
  display: block;
  overflow-wrap: anywhere;
}

.cell-name {
  color: var(--muted-foreground);
}

.findings {
  display: flex;
  flex-direction: column;
  gap: var(--sp3);
}

.findings-title {
  font-family: var(--font-sans);
  font-size: var(--t5);
  font-weight: 600;
  margin: 0;
}

.findings-list {
  margin: 0;
  padding-left: var(--sp5);
  font-size: var(--t3);
}

.findings-list li {
  margin: var(--sp1) 0;
}

/* What one step said to another: the ask, then the points, then the objections, because that is
 * what the message actually contains. */
.turn {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: var(--sp3) var(--sp4);
  background: var(--card);
}

.turn header {
  display: flex;
  gap: var(--sp2);
  align-items: baseline;
  margin-bottom: var(--sp2);
  font-size: var(--t3);
  color: var(--muted-foreground);
  flex-wrap: wrap;
}

.turn .who {
  font-weight: 600;
  color: var(--foreground);
}

.message-ask {
  margin: var(--sp1) 0 var(--sp3);
  line-height: 1.55;
}

.message-heading {
  margin: var(--sp3) 0 var(--sp1);
}

.message-list {
  margin: var(--sp1) 0 var(--sp2);
  padding-left: var(--sp5);
  font-size: var(--t4);
}

.message-list li {
  margin: var(--sp1) 0;
  line-height: 1.5;
}

/* -- The dispute, read from beginning to end ---------------------------------------------------------
 *
 * A narrative down the page rather than a dashboard, because this is the screen somebody prints and
 * takes to a meeting. Each phase is a disclosure so a person can close what they have read.
 */

.story-phase {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-1);
  padding: var(--sp4) var(--sp5);
}

.story-phase > summary {
  cursor: pointer;
  font-size: var(--t5);
  color: var(--foreground);
  list-style-position: outside;
}

.story-phase-title {
  font-family: var(--font-display);
  font-size: var(--t7);
}

.story-phase-said {
  display: block;
  margin-top: var(--sp2);
  font-weight: 400;
  color: var(--muted-foreground);
  line-height: 1.5;
  font-size: var(--t4);
  max-width: 68ch;
}

.story-step {
  border-top: 1px solid var(--hairline);
  padding: var(--sp3) 0;
}

.story-step > header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp2);
  margin-bottom: var(--sp1);
}

.story-step-name {
  font-weight: 600;
}

.story-said {
  margin: var(--sp1) 0;
  line-height: 1.55;
  max-width: 68ch;
}

.count-chip {
  display: inline-block;
  margin-right: var(--sp2);
}

/* The audit's verdict. Two states, both of them the theme's own colours, so an operator who
 * replaced the palette gets their colours here too. */
.verdict {
  border-left: 4px solid var(--border);
}

.verdict--holds {
  border-left-color: var(--state-done);
}

.verdict--broken {
  border-left-color: var(--state-failed);
}

/* The proportion of a limit that has been spent. Decoration only: the figure it draws is in the
 * list beside it, so this carries `aria-hidden` and nothing depends on it being read. */
.meter {
  height: 0.5rem;
  border-radius: var(--radius);
  background: var(--muted);
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  background: var(--primary);
}

/* -- Signing in ------------------------------------------------------------------------------------- */

.signin {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--sp6);
  background: var(--background);
}

.signin .panel {
  max-width: 28rem;
  width: 100%;
}

/* -- Narrow ------------------------------------------------------------------------------------------
 *
 * A laptop is the stated target, so this is two breakpoints and not a mobile design.
 */

/* The panel is drawn over the page at every width now, so there is nothing here to undo: it was
 * taking a column out of the grid above this breakpoint and giving it back below it. */
@media (max-width: 1220px) {
  .pop {
    width: 100vw;
    border-left: none;
  }
}

@media (max-width: 60rem) {
  .top {
    gap: var(--sp3);
    padding: var(--sp3) var(--sp4);
  }
  .top__who {
    margin-left: 0;
    width: 100%;
  }
  .crumbs {
    padding: var(--sp2) var(--sp4);
  }
  .page {
    padding: var(--sp5) var(--sp4) var(--sp7);
    gap: var(--sp5);
  }
  .case {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp2);
  }
  .case__when {
    text-align: left;
    align-items: flex-start;
  }
  .line {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp2);
  }
  .outcome {
    padding: var(--sp4);
  }
  .outcome__answer {
    font-size: var(--t7);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* -- Print --------------------------------------------------------------------------------------------
 *
 * What comes out of a printer is an A4 document with the shell, the tabs and every control removed:
 * the dispute, its outcome, and the record it rests on. The screen is a workspace and the page is a
 * document, and they are not the same artifact.
 */

@media print {
  .top,
  .crumbs,
  .graphwrap,
  .pop,
  .btn,
  .seg,
  .counts,
  .log,
  .no-print {
    display: none !important;
  }

  body {
    background: transparent;
    font-size: 10.5pt;
  }

  .page {
    padding: 0;
    max-width: none;
    gap: 1.5rem;
  }

  .panel,
  .list,
  .outcome,
  .story-phase {
    box-shadow: none;
    break-inside: avoid;
  }

  /* Every section opens, because a disclosure a printer closed is a page of the dispute that is
   * missing from the document somebody is holding. */
  details {
    display: block;
  }

  details > summary {
    list-style: none;
  }

  details > *:not(summary) {
    display: revert !important;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  .advisory {
    border: 1px solid var(--border);
  }
}

/* -- How a step got its data, drawn ------------------------------------------------------------ */

/* The lineage diagram inside the step panel. It is the answer to one question, "which steps fed
 * this one, and which fed those", and the answer to that question is a picture. It was a list
 * labelled `gave it this` and `further back`, which are this product's own words for a distance in
 * a graph and mean nothing to the person reading them. */
/* The panel runs the full height of the window, so the diagram has room to be a diagram. It was
 * bounded at 26rem, which cut the box for the step being read in half at the bottom edge. */
.dag {
  overflow: auto;
  padding: var(--sp2) 0 var(--sp3);
  max-height: 62vh;
}

.dag__zoom {
  position: relative;
}

.dag__canvas {
  position: relative;
}

.dag__lines {
  position: absolute;
  inset: 0;
  color: var(--accent);
  pointer-events: none;
  z-index: 0;
}

.dag__box {
  position: absolute;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.125rem;
  padding: var(--sp1) var(--sp2);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}

.dag__box:hover {
  border-color: var(--primary);
}

/* The step whose panel this is. It is not a link to itself. */
.dag__box.is-here {
  border-color: var(--foreground);
  border-left-color: var(--foreground);
  box-shadow: 0 0 0 2px var(--foreground);
  cursor: default;
}

.dag__name {
  font-size: var(--t2);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dag__side {
  font-size: var(--t1);
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The same four states the boxes in the run's own picture carry, so a step reads the same in both. */
.dag__box--completed {
  background: var(--state-done-fill);
  border-left-color: var(--state-done);
}

.dag__box--failed {
  background: var(--state-failed-fill);
  border-left-color: var(--state-failed);
}

.dag__box--parked {
  background: var(--state-waiting-fill);
  border-left-color: var(--state-waiting);
}

.dag__box--running,
.dag__box--dispatched {
  background: var(--state-running-fill);
  border-left-color: var(--state-running);
}

.dag__box--pending,
.dag__box--ready,
.dag__box--skipped {
  color: var(--muted-foreground);
  border-style: dashed;
}

/* -- Asking for one line, in the page ---------------------------------------------------------- */

/* This product's own dialog, in place of the browser's `prompt()`. The reason the question is being
 * asked stays on screen while it is answered, which the browser's box has no room for, and it is
 * built out of the same field and the same buttons as every other question this product asks. */
.dialog__back {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp4);
  background: var(--scrim);
}

.dialog {
  width: min(34rem, 100%);
  max-height: calc(100vh - 4rem);
  overflow: auto;
  padding: var(--sp5);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-2);
}

.dialog__title {
  margin: 0 0 var(--sp2);
  font-size: var(--t5);
}

.dialog__said {
  margin: 0 0 var(--sp4);
  color: var(--muted-foreground);
  font-size: var(--t3);
}

.dialog__acts {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp2);
  margin-top: var(--sp4);
}

/* Where a disclosure bundle is on this installation. A path has to be reproduced exactly, so it is
 * drawn as the machine string it is rather than set in the sentence around it, and it wraps rather
 * than pushing the row sideways. */
.path {
  display: block;
  font-family: var(--font-mono, monospace);
  font-size: var(--t1);
  color: var(--muted-foreground);
  word-break: break-all;
  line-height: 1.4;
}

/* The two controls on a disclosure row: taking the bundle away, and giving its disk back. */
.acts {
  display: flex;
  gap: var(--sp2);
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* The entry number on a row of the sealed record. It is the number a person quotes when they ask
 * this installation, or an auditor, about one particular entry. */
.recordno {
  font-family: var(--font-mono, monospace);
  font-size: var(--t2);
  color: var(--muted-foreground);
  white-space: nowrap;
}

/* A case in the list, with the one act that is not "open it" beside the row rather than inside it:
 * the row is a link, and a button inside an anchor is neither valid nor clickable as expected. */
.caserow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: var(--sp2);
}

.caserow > .case {
  min-width: 0;
}

.caserow__act {
  display: flex;
  align-items: center;
  gap: var(--sp2);
  padding-right: var(--sp3);
}
