/* desk.css — the few things the design system does not decide for us.
 *
 * Loaded AFTER the vendored Lightning Design System stylesheet, and kept this
 * small on purpose: every rule here is a place where our pages and a design
 * system somebody else maintains could drift apart, so each one has a reason
 * written beside it.
 *
 * THERE IS NO INLINE STYLE ANYWHERE IN THESE PAGES. The
 * Content-Security-Policy on every response is `style-src 'self'` with no
 * `unsafe-inline`, which blocks a `style="…"` attribute as well as a <style>
 * block. That is the reason for the progress-bar classes at the bottom of this
 * file: SLDS's own markup sets the bar's width with an inline style, and an
 * inline style is exactly what must not work here.
 *
 * REWRITTEN 2026-10-07 EVENING, after Eli looked at the preview and said the
 * screens were jumbled and a reviewer went through every page. Four of the
 * seven findings were this file's: the list did not fit a screen, tables
 * overflowed their cards, the phone layout was a sideways scrollbar, and
 * Hebrew data was laid out by the page's direction instead of its own.
 */

/* The inline icon symbols. A `style="display:none"` attribute would be
 * blocked by the policy above, so the block that holds them is hidden from
 * here. */
.desk-icon-sprite { display: none; }

/* Eli's instruction: no Salesforce logo anywhere in the interface. The design
 * system attaches one to `.slds-global-header__logo` as a background image;
 * that class is not used on any page here, and this rule means it cannot
 * quietly start working if somebody adds it. */
.slds-global-header__logo { background-image: none !important; }

/* The system font stack, stated rather than assumed. This version of the
 * design system already sets `--slds-g-font-family-base` to the system stack
 * and declares no @font-face at all — a test asserts both — so this is a
 * belt-and-braces line that would survive an upgrade that changed its mind. */
:root {
  --slds-g-font-family-base: system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji";
}

/* ==========================================================================
 * HEBREW, AND EVERY OTHER RIGHT-TO-LEFT RUN IN AN ENGLISH INTERFACE
 * ==========================================================================
 * Eli's review item 6: "user-entered text displays in its own direction, names
 * are isolated, numbers stay left to right."
 *
 * The interface is English and `dir="ltr"`, by instruction. The DATA is not:
 * families are named in Hebrew and notes are typed in it. Three separate
 * problems, and the first version of this file solved only the first.
 *
 * 1. DIRECTION. `unicode-bidi: plaintext` makes an element take its direction
 *    from its own first strong character instead of from the page, so a
 *    Hebrew name is laid out right-to-left inside a left-to-right page.
 *
 * 2. ISOLATION. This is the one the review found. `plaintext` alone sets a
 *    paragraph's direction; it does not stop a right-to-left run REORDERING
 *    the text around it. A Hebrew family name followed by a dash, a Latin
 *    place name and a date, in one cell, put the separator and the date on the
 *    wrong side of the name, because the bidirectional algorithm resolves the
 *    whole cell as a single paragraph. (No example is written out here: a
 *    stylesheet is served without a session, and a test asserts that no route
 *    which is open can contain a family name from the database. It found this
 *    comment, which is the test doing exactly its job.) The fix
 *    is `isolate`, which is what `plaintext` already implies for direction but
 *    which has to be asked for explicitly where several runs share a line — so
 *    `.desk-data` is the class on every element that holds a NAME or a piece
 *    of free text, and it isolates as well as auto-directs.
 *
 * 3. NUMBERS. A file number, a date, a postcode, an email and a phone number
 *    are left-to-right ALWAYS, even inside a Hebrew sentence and even when the
 *    surrounding paragraph is right-to-left. A file number of the form
 *    `12345/26` read as `26/12345` beside a Hebrew name. `.desk-ltr` forces
 *    it, with `isolate` so it
 *    does not reorder what is around it either.
 *
 * Both classes are applied in the TEMPLATES, per element, rather than to a
 * blanket list of selectors here. The blanket list is what the first version
 * did and it was wrong in both directions: it caught `.slds-table td`, which
 * includes cells holding only a date, and it missed `.slds-item`, which is
 * where the payers and the links are. A class on the element that holds the
 * data cannot be wrong about what it holds.
 */
.desk-data {
  unicode-bidi: isolate;
  direction: unset;          /* let the content decide, via plaintext below */
}
/* `plaintext` where the browser supports it, which is everywhere this will be
 * opened; the `isolate` above is the floor if it ever is not. */
@supports (unicode-bidi: plaintext) {
  .desk-data { unicode-bidi: plaintext; }
}
.desk-ltr { direction: ltr; unicode-bidi: isolate; }

/* ONE LEFT-TO-RIGHT RUN INSIDE A RIGHT-TO-LEFT SENTENCE.
 *
 * The second review, R8: a German phone number inside a Hebrew next-step read
 * `4474 231 177 49+`, and it wrapped across two lines. `.desk-data` on the
 * element could not fix it, because the fault is inside one line of text: a
 * run of digits, `+` and spaces is WEAK, and a weak run is laid out in the
 * paragraph's direction. The element is right about the paragraph and has
 * nothing to say about a run inside it.
 *
 * So the run is wrapped, per run, in `<bdi dir="ltr" class="desk-run">` by the
 * `bidi` filter in app/screens.py. `<bdi>` already isolates; the direction is
 * stated anyway so the element says what it is, and `nowrap` is the second
 * half of the finding — a telephone number broken over two lines is two
 * numbers to anybody dialling it. */
.desk-run { white-space: nowrap; }

/* A textarea and an input need the same treatment and cannot take a child
 * class, so these are by element as well as by `.desk-data`. */
textarea.slds-textarea, input.slds-input { unicode-bidi: plaintext; }

/* The page's own width. SLDS has no opinion about the outer frame. */
.desk-main { max-width: 86rem; margin: 0 auto; }
.desk-narrow { max-width: 28rem; margin: 6vh auto 0; }
.desk-reading { max-width: 52rem; margin: 0 auto; }
.desk-narrow-text { max-width: 34rem; margin-left: auto; margin-right: auto; }
.desk-wide { width: 100%; justify-content: center; }
.desk-footer { text-align: center; }
.desk-whoami { justify-content: flex-end; }
.desk-gap { gap: 0.25rem; }

/* Notes and summaries keep the line breaks they were typed with. */
/* VERSION 18 adds `overflow-wrap`: a proposal comes back as paragraphs
 * with their own line breaks AND the odd long word, and keeping the
 * breaks is no use if one line then runs past the card. */
.desk-prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }

/* A six-digit code is easier to check when it is not proportional. */
.desk-code {
  font-family: var(--slds-g-font-family-monospace);
  font-size: 1.5rem; letter-spacing: 0.3em; text-align: center;
}
.desk-mono { font-family: var(--slds-g-font-family-monospace); }
.desk-selectable { user-select: all; }
.desk-break { overflow-wrap: anywhere; }
.desk-licence {
  white-space: pre-wrap; font-family: var(--slds-g-font-family-monospace);
  font-size: 0.75rem; max-height: 24rem; overflow: auto;
}

/* ==========================================================================
 * AN ACTION LOOKS LIKE A BUTTON
 * ==========================================================================
 * Eli's review item 2: "Actions are visible buttons."
 *
 * With no JavaScript, an expanding form is a <details>, and a <details>
 * summary is styled by the browser as a line of text with a triangle. So the
 * case page's twelve actions all looked like prose. SLDS's button classes are
 * put ON THE SUMMARY, and the marker is removed, so the thing a person presses
 * looks like the thing it is. It is still a <details> and still needs no
 * script.
 */
.desk-action > summary { cursor: pointer; display: inline-flex;
                         align-items: center; }
.desk-action > summary::-webkit-details-marker { display: none; }
.desk-action > summary::marker { content: ""; }
.desk-action > summary:focus-visible {
  outline: 2px solid var(--slds-g-color-brand-base-50, #0176d3);
  outline-offset: 2px;
}
/* An open action's button reads as pressed, so it is obvious which form the
 * one below belongs to. */
.desk-action[open] > summary { box-shadow: inset 0 0 0 2px
  var(--slds-g-color-brand-base-50, #0176d3); }
.desk-action_wide > summary { width: 100%; justify-content: center; }
/* ==========================================================================
 * AN EDIT FORM HAS ITS OWN FULL-WIDTH PLACE
 * ==========================================================================
 * R1: "the payer edit form is about 2,266 px wide and spills under the next
 * card; half the fields cannot be reached. The applicant edit form opens
 * inside a clipped table cell; its Change button shows as Chang."
 *
 * One cause for both. The <details> holding the form sat inside the row's
 * right-hand action cell — a flex item with `flex: 0 0 auto`, or a table cell
 * sized by the other rows. A flex item that may not shrink takes its content's
 * NATURAL width, and the natural width of a thirteen-field grid is however
 * wide thirteen fields want to be: 2,267 pixels, measured. The previous
 * attempt at this was `min-width: min(26rem, 100%)` on the form, which asks
 * for a minimum and says nothing about a maximum, so it changed nothing.
 *
 * The fix is in the MARKUP, not here: the form now sits on its own line
 * underneath the row rather than inside the row's action cell, and the
 * applicants are a list rather than a table. These two rules are what make
 * that line behave — the form fills it and never exceeds it.
 */
.desk-action > form { display: block; width: 100%; max-width: 100%; }
.desk-action_row { display: block; width: 100%; max-width: 100%; }
.desk-action_row > form { margin-left: 0; }

/* The one line a refused form says for itself, and the thing `autofocus`
 * brings the reader back to. `outline: none` because it is focused by the
 * browser and not by the reader, and a focus ring round a sentence nobody
 * tabbed to reads as a mistake. */
.desk-form-error { font-weight: 700; }
.desk-form-error:focus { outline: none; }

/* A flex item that holds text has to be allowed to shrink, or it pushes its
 * neighbour off the row. `min-width: auto` is the default on a flex item and
 * it means "as wide as my content". */
.desk-min0 { min-width: 0; }
.desk-wrap { white-space: normal; overflow: visible; text-overflow: clip;
             overflow-wrap: anywhere; }

/* A BADGE HOLDING FREE TEXT HAS TO WRAP. The design system's badge is one
 * line, which is right for a word somebody chose off a list — "Main payer",
 * "Filed" — and wrong for a contact's role, which is a sentence somebody
 * typed. One role of forty characters made the whole page 442 pixels wide in
 * a 390-pixel window.
 *
 * Only the ones marked `.desk-data`, which is exactly the class on elements
 * holding a name or free text, so the badges that are a word off a list keep
 * their single line. Found 2026-10-10, on the first run of the check at a
 * real 390 — see `CHROME_MINIMUM_WIDTH` in `test/visual_check.py`.
 *
 * VERSION 17 adds `.desk-wrap` to the same rule. The money overview's
 * warning column holds a SENTENCE off a list — "With the lawyer, second
 * payment short" — which is neither free text nor one word, and it measured
 * 253 pixels in a 332-pixel cell on the first run of the new page. A badge
 * is one line until somebody says otherwise, and now there are two ways to
 * say it. */
.slds-badge.desk-data,
.slds-badge.desk-wrap { white-space: normal; max-width: 100%;
                        overflow-wrap: anywhere; height: auto; }
.desk-nowrap { white-space: nowrap; }
/* Two lines, then an ellipsis. For the one cell that genuinely holds a
 * sentence — "what is next" — where wrapping without limit would make one
 * row four times the height of the others. The full text is in the `title`. */
.desk-clamp {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; overflow-wrap: anywhere;
  /* SLDS's `slds-table_fixed-layout` sets `white-space: nowrap` on every cell,
   * which is what made `slds-truncate` work in it — and which silently turns
   * a two-line clamp into a one-line cut. Every cell that is meant to wrap
   * has to say so. */
  white-space: normal;
}

/* A <details> used as a plain disclosure rather than as an action: "everything
 * else on this filing", the stage history. These SHOULD look like text. */
.desk-subform > summary { cursor: pointer; padding: 0.25rem 0;
                          color: var(--slds-g-link-color, #0176d3); }
.desk-subform > summary:focus-visible {
  outline: 2px solid var(--slds-g-color-brand-base-50, #0176d3); }

.desk-submission { border-left: 3px solid var(--slds-g-color-border-base-4, #c9c9c9); }
.desk-stage-line + .desk-stage-line { margin-top: 0.25rem; }

/* A LIST OF ANSWERS STACKS. The guided add flow asks one question with five
 * or more answers, and the design system's `.slds-radio` is inline — so they
 * ran together on a line and each one's hidden input overlapped its
 * neighbour's wrapper. The visual check reported thirty of them as covered on
 * 2026-10-10, which was a real overlap wearing a boring name.
 *
 * Stacking is also simply how a list of answers should read: one per line,
 * each with room for the sentence that says what it means. */
.desk-answers .slds-radio {
  display: block;
  margin-bottom: 0.4rem;
}
/* AND THE SENTENCE INDENTS UNDER ITSELF, not under the circle. At 390 pixels
 * every one of these answers wraps — each carries a clause explaining what it
 * means — and the second line was starting at the left margin, beneath the
 * radio button, so a list of five answers read as ten half-sentences.
 *
 * Nothing measured it: it is not clipped, not wider than the window and not
 * covered. It was found by looking at the screenshot, which is what the
 * screenshots are for. */
.desk-answers .slds-radio__label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.desk-answers .slds-radio_faux { flex: 0 0 auto; margin-top: 0.15rem; }
.desk-answers .slds-form-element__label { min-width: 0; }

/* A STAGE NAME WRAPS. Found 2026-10-10 by a measurement that did not exist
 * before that day: the badge "Submitted, awaiting the file number" is 234
 * pixels wide and `td.desk-col-stage` is 17% of the table — 213 at a 1280px
 * window. The badge painted 29 pixels across the Hold column next to it, on
 * nine of the fifty-six rendered pages.
 *
 * It is NOT a new defect. R4's fix on 8 October widened this column and said
 * it was "wide enough for the longest of the nine names on two lines" — but
 * the design system puts `white-space: nowrap` on `.slds-badge`, so there was
 * never a second line to use. Two runs of the visual check reported zero,
 * because `visual_measure.js` asked whether an element's own content overflows
 * its own box and this badge's does not: the badge sized itself to its text.
 * What is too narrow is its parent.
 *
 * So: inside a stage line the badge wraps, and it keeps its shape by having a
 * sensible line height rather than a fixed one. The `hold` badge is left
 * alone — "On hold" is two short words and has never needed a second line. */
.desk-stage-line .slds-badge,
.desk-col-stage .slds-badge {
  white-space: normal;
  line-height: 1.25;
  text-align: start;
}
.desk-track-name { font-weight: 400; }
/* A DONE TASK'S WORDS ARE DIMMED, ITS BUTTONS ARE NOT. R18: "a completed
 * task's Change or reopen looks disabled." It was not disabled; the dimming
 * was on the whole row and took the button with it, and a button that looks
 * disabled is a button nobody presses. The class is on the text now. */
.desk-done { opacity: 0.6; }

/* AN OVERDUE ROW IS WHITE. R2: "overdue rows have a solid red background with
 * blue links and grey text."
 *
 * That is what `--slds-g-color-error-container-1` resolves to in this version
 * of the design system — a full-strength red, not the pale wash the name
 * suggests — and the link colour, the body colour and the weak-text colour
 * are all chosen for a white background. Three unreadable things, from one
 * declaration.
 *
 * Overdue is now said three ways, each of which works on white: a badge that
 * says the word (and therefore reaches a screen reader, which sees no colour
 * at all), the date in the error colour, and a red rule down the left of the
 * row so the eye can find it in a list. */
.desk-overdue {
  border-left: 3px solid var(--slds-g-color-error-base-40, #ba0517);
  padding-left: 0.5rem;
}
.desk-late { color: var(--slds-g-color-error-base-40, #ba0517); }
.desk-badge { margin-right: 0.25rem; }
/* ==========================================================================
 * THE HIGHLIGHTS PANEL MUST NOT SIT ON TOP OF THE BUTTON UNDER IT
 * ==========================================================================
 * R5: "the highlights panel covers the top half of 'Change the next step, the
 * owner, the priority'; the covered part does not click."
 *
 * Measured, not guessed: the hit test found that button covered at two of its
 * five sample points by `ul.slds-page-header__detail-row`. The design system's
 * rule is
 *
 *     .slds-page-header__detail-row { margin: .75rem -1rem -1rem; z-index: 2 }
 *
 * — a NEGATIVE bottom margin that pulls the row down over whatever follows,
 * and a stacking order that puts it on top. That is right for its own design,
 * where the row is the last thing in the header. Here there is a row of
 * actions after it, so the overlap is real and the top of the button is
 * genuinely not clickable.
 *
 * Both are undone, and the blocks are allowed to wrap: at 390 pixels the
 * fixed-width detail blocks ran off the right-hand edge of the page. */
.desk-header-facts {
  margin-bottom: 0;
  z-index: auto;
  flex-wrap: wrap;
  row-gap: 0.5rem;
}
.desk-header-facts > .slds-page-header__detail-block {
  max-width: 100%;
  padding-right: 1.5rem;
}

.desk-filters { gap: 0.5rem 0; align-items: flex-end; }
.desk-filter { min-width: 11rem; }
.desk-filter-actions { align-self: flex-end; padding-bottom: 0.1rem; }
/* THE VIEW BUTTONS WRAP. R19: this row measured 487 pixels inside a 390
 * pixel window and pushed the whole page sideways, because SLDS's
 * `slds-button-group-row` is an `inline-flex` with no wrapping — it is the
 * markup for buttons joined into one control, and these are four separate
 * links. So the group classes are gone from the markup and this is a plain
 * wrapping row. `.desk-controls` undoes the right-alignment and the
 * no-shrink that the page-header control wrappers impose. */
.desk-views {
  display: flex; flex-wrap: wrap; gap: 0.25rem; list-style: none;
  margin: 0; padding: 0;
}
.desk-views > li { margin: 0; }
.desk-controls { flex-wrap: wrap; min-width: 0; max-width: 100%; }

/* AND THE PAGE HEADER'S OWN ROW WRAPS, at every width and on every page.
 *
 * VERSION 20, and the visual check's own words for it: *h1 is 10px holding
 * 15px.* `slds-page-header__row` is a flex row of a title column and an
 * actions column, and the actions column does not shrink — so a page with
 * two wide buttons in it squeezed the title to ONE CHARACTER WIDE at 390
 * and printed "The lawyer's list" down the left edge, one letter per line,
 * for forty lines.
 *
 * Every page on this Desk has that header. The three that have two buttons
 * are the reports, which is why it took until version 20 to appear and why
 * the fix is here rather than on one page. */
.slds-page-header__row { flex-wrap: wrap; row-gap: 0.5rem; }
.slds-page-header__col-title { min-width: 0; flex: 1 1 14rem; }
.slds-page-header__col-actions { flex: 0 1 auto; min-width: 0; }
.slds-page-header__controls { flex-wrap: wrap; min-width: 0; }
/* The two boxes beside each other — "to leave this stage" and the hold —
 * should be the same height whichever has more text in it. */
.desk-fill { height: 100%; }
/* The right-hand action in a list row never shrinks to nothing: its button
 * has to stay pressable. Eli's review item 5. */
.desk-row-action { flex: 0 0 auto; margin-left: 0.5rem; }
/* Two columns that do not share a height, so the timeline can be longer than
 * the record without leaving a gap beside it. */
.desk-column { align-self: flex-start; }
/* A timeline entry's heading wraps instead of truncating, and a long one is
 * readable without hovering. Review item 2: "each entry openable in full." */
.desk-timeline-title { overflow-wrap: anywhere; }

/* ==========================================================================
 * THE CASE LIST FITS ONE SCREEN
 * ==========================================================================
 * Eli's review item 1, and the reason it did not: with `table-layout: auto` a
 * browser sizes every column to its widest cell, so one long next-step
 * sentence made that column 40% of the page and pushed `Due` off the right.
 * `slds-table_fixed-layout` is SLDS's own class for the other behaviour, and
 * once it is on, the widths below are what the columns actually get — and
 * `slds-truncate` in the cells, which does nothing under `auto`, starts
 * working.
 *
 * The percentages add up to 100 for the widest case (all eight columns). When
 * `_drop_empty_columns` removes one, the browser shares the leftover out, which
 * is the right behaviour: a narrower list is a roomier one.
 */
/* THE WIDTHS, MEASURED THIS TIME.
 *
 * R4: "List: Stage cells (‘Submitted, awaiting the f’) and every Due date
 * (‘2026-…’)." The visual check measured each one: the stage cell got 160
 * pixels and the longest stage name needs 244; the Due cell got 84 and a date
 * with its overdue icon needs 97; the `Priority` HEADER itself got 27 of the
 * 48 its own word needs.
 *
 * Two changes, and the second is the one that matters. The columns that hold
 * a NAME or a DATE are wide enough for the longest one there is — and the
 * cells in them no longer truncate, so if a name is ever longer than the
 * column it wraps onto a second line instead of being cut. Truncation is kept
 * for exactly one column, `next_step`, which holds a typed sentence with no
 * longest case; it is clamped to two lines, with the whole of it in the title.
 *
 * The percentages add up to 100. Since R9 the same eight columns are drawn in
 * every view, so these are the widths every view gets. */
.desk-list { width: 100%; }
.desk-list .desk-col-internal_file { width: 9%; }
.desk-list .desk-col-name           { width: 16%; }
.desk-list .desk-col-stage          { width: 15%; }
.desk-list .desk-col-hold           { width: 7%; }
.desk-list .desk-col-owner          { width: 8%; }
.desk-list .desk-col-ball_with      { width: 10%; }
.desk-list .desk-col-next_step      { width: 19%; }
.desk-list .desk-col-next_step_date { width: 9%; }
.desk-list .desk-col-priority       { width: 7%; }
.desk-list th, .desk-list td { vertical-align: top; }
/* ==========================================================================
 * A SORTABLE HEADER IS THE WHOLE CELL
 * ==========================================================================
 * R15: "only the header text clicks and the icon is a left arrow."
 *
 * The anchor was inline, so its box was the width of the words and the rest of
 * the header cell did nothing. It fills the cell now, in both directions, and
 * every header carries an arrow — faint when that column is not the one in
 * use, solid when it is — so that a header LOOKS like something to press
 * rather than only behaving like one when found.
 *
 * The arrow was `chevronright`, which points sideways. An order is up or down.
 */
.desk-list .slds-th__action,
.desk-th-link {
  display: flex; align-items: center; gap: 0.25rem;
  width: 100%; height: 100%; padding: 0.25rem 0.5rem;
}
.desk-th-label { overflow-wrap: anywhere; }
.desk-th-arrow { flex: 0 0 auto; }
.desk-th-arrow_off { opacity: 0.4; }
.desk-th-arrow_on { opacity: 1; }

/* A BADGE ON A STRIPED ROW. R17: "the Lead badge disappears on striped rows."
 * The design system's badge background and its striped-row background are the
 * same light grey, so on every second row the badge was invisible. White with
 * a border reads on both.
 *
 * `:not([class*="slds-theme_"])` is load-bearing and the first version of this
 * rule did not have it: a badge that carries a theme — the red "On hold", the
 * orange "Urgent" — has WHITE TEXT, so painting its background white made it
 * an empty white pill. Measured by nothing and seen immediately in the
 * screenshot, which is the argument for looking at them. */
.desk-list .slds-badge:not([class*="slds-theme_"]):not(.slds-badge_inverse) {
  background-color: var(--slds-g-color-neutral-base-100, #fff);
  border: 1px solid var(--slds-g-color-border-base-1, #e5e5e5);
}

/* AN ICON ON A BUTTON HAS TO BE A COLOUR. R16: "buttons like Add an applicant
 * have an empty gap: the icon is white on white." The design system's default
 * icon fill is white, which is right inside a brand (blue) button and
 * invisible inside a neutral (white) one. The call sites now pass
 * `slds-icon-text-default` for a neutral button; this is the other half, for
 * the one icon that is on a brand button and must stay white. */
.desk-icon-inverse { fill: var(--slds-g-color-neutral-base-100, #fff); }

/* ==========================================================================
 * EVERY STAGE NAME ON THE PATH IS READABLE
 * ==========================================================================
 * R4: "Path: finished stages show only a tick, current and later names are
 * cut (‘Submitted, a…’); on one case five of nine."
 *
 * Both halves are the design system's own behaviour, and both are deliberate
 * there. A finished step's title is rotated out of sight —
 * `transform: rotateX(180deg)` — and a tick rotated in behind it, with a
 * `:hover` rule that flips it back. That is a nice effect on a page driven by
 * a mouse. It is useless on a page somebody is reading, and on a phone there
 * is no hover at all. And every title is `white-space: nowrap; overflow:
 * hidden` inside an item that is `flex: 1`, so nine equal columns cut every
 * name longer than a ninth of the card — which, measured, was five of nine.
 *
 * So: the flip is off and the tick is drawn beside the name in the markup; the
 * titles do not truncate; and the path WRAPS onto as many rows as the names
 * need, because a row of nine readable names does not fit a card and a row of
 * nine unreadable ones is not a diagram.
 */
.desk-path .slds-path__nav {
  flex-wrap: wrap; overflow: visible; row-gap: 0.25rem;
}
.desk-path .slds-path__item {
  flex: 0 1 auto; min-width: 0; max-width: 100%; text-align: left;
}
/* The scroller is a horizontal scrollbar by design and there is nothing left
 * to scroll: the path wraps. Three pixels of the current step were being cut
 * off at 390 without this. */
.desk-path .slds-path__scroller,
.desk-path .slds-path__scroller-container,
.desk-path .slds-path__track { overflow: visible; max-width: 100%; }
.desk-path__link {
  display: flex; align-items: center; gap: 0.25rem;
  padding-left: 0.75rem; padding-right: 0.75rem;
}
.desk-path__title {
  overflow: visible; text-overflow: clip; white-space: nowrap;
  max-width: none;
  transform: none !important; -webkit-transform: none !important;
}
.desk-path__tick { flex: 0 0 auto; }
/* The tick and the title used to share one box and take turns in it. They sit
 * side by side now, so the absolutely-positioned stage marker is not used. */
.desk-path .slds-path__stage { display: none; }

/* A table inside a card — the tracks, the applicants, the payments — must not
 * be wider than the card. `slds-table` has no width of its own, so a long
 * cell used to push the card's own border off the screen. Review item 5. */
.desk-inner-table { width: 100%; max-width: 100%; }

/* ==========================================================================
 * A PHONE
 * ==========================================================================
 * Eli's review item 5: "A real phone layout: compact rows for the list, the
 * path reduced to the current stage, a menu for navigation."
 *
 * Below 48em every row of a wide table becomes a stacked block with its header
 * beside each value, which is why every <td> on a list page carries a
 * data-label. "Usable on a phone" is a requirement, and a table that scrolls
 * sideways is not usable, it is merely present.
 */
.desk-scroll { overflow-x: auto; }

/* THE NAVIGATION: a plain row of tabs at every width. See the note in
 * base.html for why it is no longer a <details> held open by CSS.
 *
 * Every one of these stretches, and that is not tidiness. The design system
 * marks the current tab with a 3px bar drawn at the TOP of the item,
 * absolutely positioned, with the label on top of it at `z-index: 1`. When
 * the item is only as tall as its own text the bar lands on the same line as
 * the words and shows as two short dashes either side of them — which is
 * exactly what the screenshot showed. The item has to be the height of the
 * bar for the marker to be above the text. */
.desk-nav,
.desk-nav > nav,
.desk-nav__list,
.desk-nav__list > li { display: flex; align-items: stretch; }
.desk-nav__list { margin: 0; padding: 0; list-style: none; }

/* An inner table — the five tracks, the payments — is bounded by its card at
 * every width. R19 measured two of them at 500 and 401 pixels inside a 390
 * pixel window: `slds-table` has no width of its own and `table-layout: auto`
 * sizes a column to its widest cell, so a track name and a note were as wide
 * as they wanted to be. */
.desk-inner-table { table-layout: fixed; }
.desk-inner-table th, .desk-inner-table td {
  overflow-wrap: anywhere;
  /* `slds-table` sets `white-space: nowrap` on every cell. With a fixed
   * layout that does not clip the text — it PAINTS IT OUTSIDE THE CELL, over
   * whatever is in the next column. At 390 the five tracks read
   * "Archival researchNot started", two columns written on top of each other.
   * Nothing was wider than the window and nothing was clipped, so the first
   * three measurements all passed and the screenshot is what found it. There
   * is a fourth measurement now. */
  white-space: normal;
  vertical-align: top;
}

@media (max-width: 48em) {
  .desk-scroll { overflow-x: visible; }
  .desk-scroll table, .desk-scroll tbody, .desk-scroll tr, .desk-scroll td,
  .desk-scroll th { display: block; width: auto; }
  .desk-scroll thead { display: none; }
  .desk-scroll tr {
    border-bottom: 1px solid var(--slds-g-color-border-base-1, #e5e5e5);
    padding: 0.5rem 0;
  }
  .desk-scroll td[data-label]::before {
    content: attr(data-label) ": ";
    font-weight: 700; color: var(--slds-g-color-neutral-base-50, #747474);
  }
  /* The fixed widths are for a wide screen. On a phone the rows are stacked
   * blocks and a width per column would fight the stacking. */
  .desk-list td, .desk-list th { width: auto !important; }
  /* COMPACT ROWS. A stacked block per row with eight labelled lines is a very
   * tall list; the buffer SLDS puts around a cell is what makes it tall. */
  .desk-list.slds-table_cell-buffer td, .desk-list.slds-table_cell-buffer th {
    padding-top: 0.125rem; padding-bottom: 0.125rem;
  }
  .desk-list tr { padding: 0.375rem 0; }

  .desk-filter { min-width: 100%; }
  .desk-code { font-size: 1.25rem; letter-spacing: 0.2em; }

  /* THE CONTEXT BAR GROWS INSTEAD OF OVERLAPPING. R19: at 390 pixels the
   * app name, the tabs and the account were drawn on top of one another,
   * because SLDS fixes the bar at `height: 2.5rem` and it had three things
   * to fit on one line. It wraps and takes the height it needs. See the note
   * in base.html for why the tabs are no longer inside a <details>. */
  .desk-bar {
    flex-wrap: wrap; height: auto; padding-left: 0.75rem;
    row-gap: 0.25rem;
  }
  .desk-whoami { justify-content: flex-start; flex-wrap: wrap; }
  .desk-nav__list { flex-wrap: wrap; }

  /* THE PATH REDUCES TO THE CURRENT STAGE. Nine steps in a 320-pixel-wide
   * scroller is a horizontal scrollbar pretending to be a diagram. The
   * current step is the one that answers the question, so it is the one that
   * stays; the rest are still in the page for a screen reader, and the full
   * path is on a wider screen. */
  .desk-path .slds-path__item { display: none; }
  .desk-path .desk-path__current { display: block; width: 100%; }

  /* An action and the row it belongs to STACK rather than squeeze.
   *
   * `width: 100%` was not enough and the hit test found out why: on a flex
   * item whose basis is `auto`, a width is a preference and not a line break,
   * so the action took the whole line AND the text beside it stayed on the
   * same line at zero width — measured — with its link overflowing a
   * zero-width box and the action's form drawn on top of it. The link was
   * covered at three of five points. `flex-basis: 100%` is the thing that
   * forces the wrap. */
  .desk-row-action { margin-left: 0; margin-top: 0.25rem; flex: 1 0 100%; }
  /* AND THE TEXT BESIDE IT TAKES A LINE OF ITS OWN.
   *
   * `flex-basis: 100%` on the action alone still did not wrap, which the hit
   * test caught and the measurements explain: the text column is
   * `flex: 1 1 auto; min-width: 0`, so rather than pushing the action onto a
   * second line the browser SHRANK IT TO ZERO — nought pixels wide, measured
   * — and both items fitted on one line with the link overflowing its own
   * box underneath the action. Both items need a basis of 100% for the row to
   * become two rows. */
  .desk-min0 { flex: 1 1 100%; }
  .desk-action_small > summary { width: 100%; justify-content: center; }

  /* The page header's own text wraps rather than being cut. R19 measured the
   * file-number line showing 160 of the 376 pixels it needed — so on a phone
   * the authority's file number, which is the one number an authority asks for
   * on the telephone, was not on the page at all. The same rule covers the
   * Hebrew family name in the title, which was showing 152 of 189. */
  .slds-page-header__name-meta, .slds-page-header__title {
    white-space: normal; overflow: visible; text-overflow: clip;
    overflow-wrap: anywhere;
  }
  .desk-header-facts > .slds-page-header__detail-block {
    width: 100%; max-width: 100%; padding-left: 0; padding-right: 0;
  }
}

/* The progress bar's width, as classes rather than an inline style. See the
 * note at the top of this file: `style="width:55%"` is what SLDS's own markup
 * does and it is blocked by this application's Content-Security-Policy. One
 * class per whole percent, generated, because the number shown next to the bar
 * is the exact figure and the bar should not disagree with it. */
.desk-bar-0 { width: 0%; }
.desk-bar-1 { width: 1%; }
.desk-bar-2 { width: 2%; }
.desk-bar-3 { width: 3%; }
.desk-bar-4 { width: 4%; }
.desk-bar-5 { width: 5%; }
.desk-bar-6 { width: 6%; }
.desk-bar-7 { width: 7%; }
.desk-bar-8 { width: 8%; }
.desk-bar-9 { width: 9%; }
.desk-bar-10 { width: 10%; }
.desk-bar-11 { width: 11%; }
.desk-bar-12 { width: 12%; }
.desk-bar-13 { width: 13%; }
.desk-bar-14 { width: 14%; }
.desk-bar-15 { width: 15%; }
.desk-bar-16 { width: 16%; }
.desk-bar-17 { width: 17%; }
.desk-bar-18 { width: 18%; }
.desk-bar-19 { width: 19%; }
.desk-bar-20 { width: 20%; }
.desk-bar-21 { width: 21%; }
.desk-bar-22 { width: 22%; }
.desk-bar-23 { width: 23%; }
.desk-bar-24 { width: 24%; }
.desk-bar-25 { width: 25%; }
.desk-bar-26 { width: 26%; }
.desk-bar-27 { width: 27%; }
.desk-bar-28 { width: 28%; }
.desk-bar-29 { width: 29%; }
.desk-bar-30 { width: 30%; }
.desk-bar-31 { width: 31%; }
.desk-bar-32 { width: 32%; }
.desk-bar-33 { width: 33%; }
.desk-bar-34 { width: 34%; }
.desk-bar-35 { width: 35%; }
.desk-bar-36 { width: 36%; }
.desk-bar-37 { width: 37%; }
.desk-bar-38 { width: 38%; }
.desk-bar-39 { width: 39%; }
.desk-bar-40 { width: 40%; }
.desk-bar-41 { width: 41%; }
.desk-bar-42 { width: 42%; }
.desk-bar-43 { width: 43%; }
.desk-bar-44 { width: 44%; }
.desk-bar-45 { width: 45%; }
.desk-bar-46 { width: 46%; }
.desk-bar-47 { width: 47%; }
.desk-bar-48 { width: 48%; }
.desk-bar-49 { width: 49%; }
.desk-bar-50 { width: 50%; }
.desk-bar-51 { width: 51%; }
.desk-bar-52 { width: 52%; }
.desk-bar-53 { width: 53%; }
.desk-bar-54 { width: 54%; }
.desk-bar-55 { width: 55%; }
.desk-bar-56 { width: 56%; }
.desk-bar-57 { width: 57%; }
.desk-bar-58 { width: 58%; }
.desk-bar-59 { width: 59%; }
.desk-bar-60 { width: 60%; }
.desk-bar-61 { width: 61%; }
.desk-bar-62 { width: 62%; }
.desk-bar-63 { width: 63%; }
.desk-bar-64 { width: 64%; }
.desk-bar-65 { width: 65%; }
.desk-bar-66 { width: 66%; }
.desk-bar-67 { width: 67%; }
.desk-bar-68 { width: 68%; }
.desk-bar-69 { width: 69%; }
.desk-bar-70 { width: 70%; }
.desk-bar-71 { width: 71%; }
.desk-bar-72 { width: 72%; }
.desk-bar-73 { width: 73%; }
.desk-bar-74 { width: 74%; }
.desk-bar-75 { width: 75%; }
.desk-bar-76 { width: 76%; }
.desk-bar-77 { width: 77%; }
.desk-bar-78 { width: 78%; }
.desk-bar-79 { width: 79%; }
.desk-bar-80 { width: 80%; }
.desk-bar-81 { width: 81%; }
.desk-bar-82 { width: 82%; }
.desk-bar-83 { width: 83%; }
.desk-bar-84 { width: 84%; }
.desk-bar-85 { width: 85%; }
.desk-bar-86 { width: 86%; }
.desk-bar-87 { width: 87%; }
.desk-bar-88 { width: 88%; }
.desk-bar-89 { width: 89%; }
.desk-bar-90 { width: 90%; }
.desk-bar-91 { width: 91%; }
.desk-bar-92 { width: 92%; }
.desk-bar-93 { width: 93%; }
.desk-bar-94 { width: 94%; }
.desk-bar-95 { width: 95%; }
.desk-bar-96 { width: 96%; }
.desk-bar-97 { width: 97%; }
.desk-bar-98 { width: 98%; }
.desk-bar-99 { width: 99%; }
.desk-bar-100 { width: 100%; }

/* VERSION 11. A second ancestor on the ancestors card needs a line between
   it and the first: a case can have two and the two blocks are otherwise
   one run of text. One hairline, the design system's own border colour. */
.desk-rule { border-top: 1px solid #e5e5e5; }
