/* OSM Pro: the design system under MudBlazor.
 *
 * MudBlazor is the component framework; material.css gives it the Material
 * shape and this file the look. The frame around the page (top bar,
 * navigation, status bar) is shell.css; this file is everything inside the
 * page - the base every element starts from, type, surfaces, lists, status,
 * and the shared components (PageHeader, ListToolbar, FormSection, FactBox,
 * KpiTile). Bootstrap was the framework until 2026-10-05 and is gone.
 *
 * The look is an enterprise application's, because the owner asked for one
 * ("more like an enterprise based application") and because Dynamics 365,
 * Fiori and Lightning are what office staff already know: a neutral canvas,
 * white cards with hairline borders and little shadow, dense tables with
 * tabular figures, compact fields with labels above them, an 8px grid, and
 * colour kept for the accent and for status.
 *
 * NO COLOUR IS WRITTEN HERE. Every colour is a token from themes.css,
 * generated and WCAG-AA-audited by Tools/Theme/build.py, so the theme and
 * mode a person picks reach every surface. RepositoryShapeTests fails on a
 * literal colour in any stylesheet, component or script, so this stays true.
 */

/* ---------------------------------------------------------------------------
 * Typefaces
 * ---------------------------------------------------------------------------
 * The working text is the system UI face (Segoe UI on the office PCs), which
 * every machine already has. The vendored faces below are the themes' display
 * faces for page titles, and the mono for identifiers. Self-hosted from
 * wwwroot/lib/fonts, not a CDN: no third-party origin in the content security
 * policy of a system holding an energy company's rates.
 */
@font-face { font-family: 'Barlow'; font-weight: 400; font-style: normal; font-display: swap;
             src: url('../lib/fonts/barlow-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 500; font-style: normal; font-display: swap;
             src: url('../lib/fonts/barlow-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 600; font-style: normal; font-display: swap;
             src: url('../lib/fonts/barlow-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 500; font-style: normal; font-display: swap;
             src: url('../lib/fonts/barlow-condensed-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-style: normal; font-display: swap;
             src: url('../lib/fonts/barlow-condensed-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-style: normal; font-display: swap;
             src: url('../lib/fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-style: normal; font-display: swap;
             src: url('../lib/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 600; font-style: normal; font-display: swap;
             src: url('../lib/fonts/ibm-plex-mono-latin-600-normal.woff2') format('woff2'); }

/* ---------------------------------------------------------------------------
 * The base: what every element starts from
 * ---------------------------------------------------------------------------
 * MudBlazor's reset takes every margin, padding and border off every element
 * ("* { margin: 0; padding: 0; border-width: 0 }"). This puts back the few
 * that pages are written against - paragraphs and lists spaced, headings close
 * to what follows, tables collapsed, form controls in the page's own type.
 * (Bootstrap's reboot did this until it went, 2026-10-05.)
 */
:root {
  --osm-body-font-size: 0.875rem;
  --osm-body-line-height: 1.45;

  /* Chart series, in the order a chart uses them. Each is a text colour
     audited at 4.5:1 on the card, so a bar or a line is never too faint. */
  --osm-chart-1: var(--osm-accent);
  --osm-chart-2: var(--osm-signal);
  --osm-chart-3: var(--osm-info);
  --osm-chart-4: var(--osm-warn);
  --osm-chart-5: var(--osm-alarm);
  --osm-chart-6: var(--osm-ink-soft);
  --osm-chart-axis: var(--osm-rule-strong);
  --osm-chart-grid: var(--osm-rule);
  --osm-chart-label: var(--osm-ink-soft);
}

/* data-bs-theme on <html> is light or dark (theme.js and ThemeService set it;
   themes.css keys every palette on it). The name is Bootstrap's and stays:
   it is only an attribute now. */
html { color-scheme: light; -webkit-text-size-adjust: 100%; }
html[data-bs-theme='dark'] { color-scheme: dark; }
@media (prefers-reduced-motion: no-preference) { :root { scroll-behavior: smooth; } }

body {
  margin: 0;
  background-color: var(--osm-ground);
  color: var(--osm-ink);
  font-family: var(--osm-font-body);
  font-size: var(--osm-body-font-size);
  font-weight: 400;
  line-height: var(--osm-body-line-height);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  /* Scrollbars in the theme's own colours, light or dark. */
  scrollbar-color: var(--osm-rule-strong) var(--osm-ground);
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { margin-top: 0; margin-bottom: 0.5rem; }
p { margin-top: 0; margin-bottom: 1rem; }
ol, ul { padding-left: 2rem; margin-top: 0; margin-bottom: 1rem; }
ol ol, ul ul, ol ul, ul ol { margin-bottom: 0; }
dl { margin-top: 0; margin-bottom: 1rem; }
dt { font-weight: 700; }
dd { margin-bottom: 0.5rem; margin-left: 0; }
blockquote { margin: 0 0 1rem; }
b, strong { font-weight: bolder; }
small { font-size: 0.875em; }
pre { display: block; margin-top: 0; margin-bottom: 1rem; overflow: auto; }
hr { margin: 1rem 0; border: 0; border-top: 1px solid var(--osm-rule); }
img, svg { vertical-align: middle; }
table { caption-side: bottom; border-collapse: collapse; }
th { text-align: inherit; text-align: -webkit-match-parent; }
label { display: inline-block; }
input, button, select, optgroup, textarea { margin: 0; font-family: inherit; font-size: inherit; line-height: inherit; }
button, select { text-transform: none; }
button, [type='button'], [type='reset'], [type='submit'] { -webkit-appearance: button; }
button:not(:disabled), [role='button'] { cursor: pointer; }
textarea { resize: vertical; }
fieldset { min-width: 0; padding: 0; margin: 0; border: 0; }
legend { float: left; width: 100%; padding: 0; margin-bottom: 0.5rem; font-size: inherit; line-height: inherit; }
legend + * { clear: left; }
summary { display: list-item; cursor: pointer; }
[hidden] { display: none !important; }

::selection { background: var(--osm-accent-soft); color: var(--osm-ink); }

/* ---------------------------------------------------------------------------
 * Type scale
 * ---------------------------------------------------------------------------
 * 14px body, a clear step to each heading. Page titles take the theme's
 * display face - the one place type carries the theme's identity; everything
 * else is the system face, which reads best at small sizes.
 */
h1, .h1 { font-size: 1.5rem; }
h2, .h2 { font-size: 1.25rem; }
h3, .h3 { font-size: 1.0625rem; }
h4, .h4 { font-size: 1rem; }
h5, .h5 { font-size: 0.9375rem; }
h6, .h6 { font-size: 0.875rem; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-weight: 600; letter-spacing: -0.005em; line-height: 1.25; color: var(--osm-ink);
}

.osm-page-title {
  font-family: var(--osm-font-display);
  font-weight: var(--osm-display-weight);
  text-transform: var(--osm-display-transform);
  letter-spacing: calc(var(--osm-label-tracking) / 4);
  font-size: 1.5rem;
  margin-bottom: 0;
}

.osm-page-lede {
  color: var(--osm-ink-soft);
  font-size: 0.875rem;
  max-width: 80ch;
  margin: 2px 0 16px;
}

.osm-section-title {
  font-size: 1rem; font-weight: 600;
  margin-top: 24px; margin-bottom: 8px;
}

/* Identifiers - load, tender, ticket and unit numbers - in mono: they are
   compared against a paper ticket, and a proportional 0/O or 1/l costs
   somebody a phone call. */
code, kbd, samp, pre, .osm-mono {
  font-family: var(--osm-font-mono);
  font-weight: 500;
  font-size: 0.9em;
  color: var(--osm-ink-soft);
}
code { background: transparent; padding: 0; }

/* Labels and eyebrows: small and quiet. */
.osm-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: var(--osm-label-tracking);
  text-transform: var(--osm-label-transform);
  color: var(--osm-ink-mute);
}


/* Numbers that line up: amounts, quantities, counts. */
.osm-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.osm-money.is-negative { color: var(--osm-alarm); }
td.osm-num, th.osm-num, td:has(> .osm-money:only-child), td:has(> .osm-num:only-child) { text-align: right; }

/* Long text in a narrow cell: one line, an ellipsis, and the page puts the
   whole text in the title attribute. */
.osm-truncate { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.osm-truncate { max-width: 24ch; display: table-cell; }
/* A cut-short column's heading stays a table cell too, or it leaves the row and
   the headings slip a column (seen on the dispatch board, 2026-10-08). */
th.osm-truncate { display: table-cell; }

/* ---------------------------------------------------------------------------
 * Focus: one visible ring, everywhere, in the accent.
 * ------------------------------------------------------------------------ */
/* Blazor's FocusOnNavigate moves focus to the page heading after every
   navigation, for screen readers. Programmatic focus on something that is
   not interactive gets no ring; real keyboard focus below still does. */
[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible { outline: none; }

:focus-visible { outline: 2px solid var(--osm-accent); outline-offset: 1px; }
a:focus-visible { outline: 2px solid var(--osm-accent); outline-offset: 1px; box-shadow: none; }

/* ---------------------------------------------------------------------------
 * Surfaces: white cards, hairline borders, almost no shadow.
 * ------------------------------------------------------------------------ */
.osm-panel {
  background: var(--osm-surface);
  color: var(--osm-ink);
  border: var(--osm-border-width) solid var(--osm-rule);
  border-radius: var(--osm-radius);
  box-shadow: var(--osm-shadow-sm);
  overflow: hidden;
}
/* A scrolling table inside a panel must still scroll: overflow:hidden on
   the panel would otherwise win over osm-table-scroll and clip the
   right-hand columns on a phone. */
.osm-panel.osm-table-scroll { overflow-x: auto; }

/* ---------------------------------------------------------------------------
 * Forms: labels above.
 * ------------------------------------------------------------------------ */

/* Field grids for FormSection: two or three across on a desk, one on a phone. */
.osm-field-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px 24px; }
/* Each column stops at a width that fits what goes in it (a host name, a
   database name), so a wide screen does not stretch one input a thousand
   pixels; the spare width stays to the right. Stacked on a phone. */
@media (min-width: 768px) {
  .osm-field-grid.osm-cols-2, .osm-field-grid.osm-cols-3 { grid-template-columns: repeat(2, minmax(0, 480px)); }
}
@media (min-width: 1200px) {
  .osm-field-grid.osm-cols-3 { grid-template-columns: repeat(3, minmax(0, 400px)); }
}
.osm-field-grid > .osm-field-wide { grid-column: 1 / -1; }
.osm-field .osm-field-label { display: block; }

/* ---------------------------------------------------------------------------
 * Tables: osm-table (material.css) - dense, scannable, numbers on the right.
 * ------------------------------------------------------------------------ */


/* Sortable column headings (SortableHeader). */
.osm-sort-button {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 0; border: 0; background: transparent;
  color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit;
}
.osm-sort-button:hover { color: var(--osm-ink); }
.osm-sort-icon { opacity: 0.55; }
.osm-sort-icon.is-current { opacity: 1; color: var(--osm-accent); }
th.osm-text-end .osm-sort-button { flex-direction: row-reverse; }

/* The toolbar above a list (ListToolbar). */
.osm-list-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  margin-bottom: 12px;
}
.osm-list-search { position: relative; flex: 0 1 320px; min-width: 200px; }
.osm-list-search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--osm-ink-mute); pointer-events: none; }
.osm-list-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.osm-list-filters > .osm-input { width: auto; }
.osm-list-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.osm-list-count { color: var(--osm-ink-soft); font-size: 0.8125rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Rows chosen for a bulk action: the bar replaces nothing, it sits under the toolbar. */
.osm-list-selection {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  flex-basis: 100%; padding: 6px 10px; border-radius: 6px;
  background: var(--osm-accent-soft); color: var(--osm-ink);
}
.osm-list-selection-count { font-weight: 600; font-variant-numeric: tabular-nums; }
.osm-select-cell { width: 2rem; }

/* ---------------------------------------------------------------------------
 * Status: pills in five meanings, and message bars.
 * ---------------------------------------------------------------------------
 * Quiet by default. A page where everything is coloured has told the reader
 * nothing about which line matters.
 */
.osm-pill, .osm-badge-quiet, .osm-badge-signal, .osm-badge-alarm, .osm-badge-info, .osm-badge-warn, .osm-badge-neutral {
  border: 1px solid transparent;
}
.osm-pill-neutral, .osm-badge-quiet, .osm-badge-neutral { background: var(--osm-sunk); color: var(--osm-ink-soft); border-color: var(--osm-rule); }
.osm-pill-muted  { background: transparent; color: var(--osm-ink-mute); border-color: var(--osm-rule-strong); }
.osm-pill-info, .osm-badge-info { background: var(--osm-info-soft); color: var(--osm-info); }
.osm-pill-success, .osm-badge-signal { background: var(--osm-signal-soft); color: var(--osm-signal); }
.osm-pill-warning, .osm-badge-warn { background: var(--osm-warn-soft); color: var(--osm-warn); }
.osm-pill-danger, .osm-badge-alarm { background: var(--osm-alarm-soft); color: var(--osm-alarm); }

/* ---------------------------------------------------------------------------
 * A dialog drawn by a page itself (the report builder's save box) dims the
 * page as MudBlazor's dialogs do.
 * ------------------------------------------------------------------------ */
.osm-dialog-backdrop { position: fixed; inset: 0; background: var(--osm-backdrop); z-index: 1080; }

/* ---------------------------------------------------------------------------
 * Dashboard tiles (KpiTile).
 * ------------------------------------------------------------------------ */
/* Tiles pack together in a compact row; they do not spread to the edges of a wide screen. */
.osm-kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 260px)); gap: 12px; }
.osm-kpi {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 16px;
  background: var(--osm-surface); color: var(--osm-ink);
  border: var(--osm-border-width) solid var(--osm-rule);
  border-left: 4px solid var(--osm-rule);
  border-radius: var(--osm-radius);
  box-shadow: var(--osm-shadow-sm);
  text-decoration: none;
}
a.osm-kpi:hover { border-color: var(--osm-rule-strong); background: var(--osm-surface); color: var(--osm-ink); box-shadow: var(--osm-shadow-md); }
.osm-kpi-label { font-size: 0.75rem; font-weight: 600; color: var(--osm-ink-soft); letter-spacing: var(--osm-label-tracking); text-transform: var(--osm-label-transform); }
.osm-kpi-value { font-size: 1.75rem; font-weight: 600; line-height: 1.15; color: var(--osm-ink); }
/* A tile holds its whole value: a long one ("18 of 150 (12%)") wraps inside
   the tile instead of running past its edge. */
.osm-kpi { min-width: 0; }
.osm-kpi-value.osm-num { white-space: normal; overflow-wrap: anywhere; }
.osm-kpi-detail { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8125rem; color: var(--osm-ink-mute); }
.osm-kpi-info    { border-left-color: var(--osm-info); }
.osm-kpi-success { border-left-color: var(--osm-signal); }
.osm-kpi-warning { border-left-color: var(--osm-warn); }
.osm-kpi-warning .osm-kpi-value { color: var(--osm-warn); }
.osm-kpi-danger  { border-left-color: var(--osm-alarm); }
.osm-kpi-danger .osm-kpi-value { color: var(--osm-alarm); }

/* ---------------------------------------------------------------------------
 * Records: FormSection, FieldList, FactBox and the record layout.
 * ------------------------------------------------------------------------ */
.osm-form-section { margin-bottom: 16px; }
.osm-form-section-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--osm-rule);
}
.osm-form-section-title { font-size: 0.9375rem; font-weight: 700; margin: 0; }
.osm-form-section-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0; border: 0; background: transparent; color: var(--osm-ink);
}
.osm-form-section-toggle[aria-expanded='false'] .osm-form-section-caret { transform: rotate(-90deg); }
.osm-form-section-caret { transition: transform 0.15s ease; color: var(--osm-ink-mute); }
.osm-form-section-summary { color: var(--osm-ink-mute); font-size: 0.8125rem; }
.osm-form-section-actions { margin-left: auto; display: flex; gap: 8px; }
.osm-form-section-body { padding: 16px; }
.osm-form-section-description { color: var(--osm-ink-soft); margin: -4px 0 12px; }

/* Folding sections: the whole heading line is the button; folded, the summary
   says what is inside; a section with a problem in it is marked and open. */
.osm-form-section-toggle { cursor: pointer; font: inherit; text-align: left; border-radius: 4px; }
.osm-form-section-toggle:focus-visible { outline: 2px solid var(--osm-focus, var(--mud-palette-primary)); outline-offset: 2px; }
.osm-form-section-folded > .osm-form-section-head { border-bottom: 0; }
.osm-form-section-folded .osm-form-section-summary { color: var(--osm-ink-soft); }
.osm-form-section-attention { box-shadow: inset 3px 0 0 var(--osm-warn); }
/* A search box over a list is as wide as a search needs, not the whole page. */
.mud-input-control.osm-search-field { max-width: 420px; }

/* A table of few columns sizes to what is in it, so a number sits next to its
   name rather than a screen away; numbers in their own compact right-aligned
   columns. It still scrolls sideways on a phone. */
.osm-table-fit, .mud-simple-table.osm-table-fit { width: auto; max-width: 100%; }
.mud-simple-table.osm-table-fit table { width: auto; min-width: min(100%, 420px); }
.osm-table-fit td.text-end, .osm-table-fit th.text-end { white-space: nowrap; font-variant-numeric: tabular-nums; padding-left: 24px; }

.osm-section-group-bar { display: flex; justify-content: flex-end; margin: -4px 0 4px; }

.osm-field-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px 24px; margin: 0; }
@media (min-width: 768px) {
  .osm-field-list.osm-cols-2, .osm-field-list.osm-cols-3, .osm-field-list.osm-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .osm-field-list.osm-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .osm-field-list.osm-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* A record's summary, and short lists of figures (task 07): the same columns at
   the same width on every screen, so a field sits in the same place everywhere
   (SummaryLayout gives the order). One column on a phone, two on a tablet, four
   on a desk; the spare width stays to the right. */
.osm-summary-bands { display: grid; gap: 14px; min-width: 0; }
.osm-field-grid > .osm-summary-bands { grid-column: 1 / -1; }
.osm-field-list.osm-summary, .osm-field-list.osm-cols-auto { grid-template-columns: minmax(0, 1fr); gap: 8px 24px; }
@media (min-width: 768px) {
  .osm-field-list.osm-summary, .osm-field-list.osm-cols-auto { grid-template-columns: repeat(2, minmax(0, 320px)); }
  .osm-field-pair.is-long { grid-column: span 2; }
}
@media (min-width: 1200px) {
  .osm-field-list.osm-summary, .osm-field-list.osm-cols-auto { grid-template-columns: repeat(4, minmax(0, 260px)); }
}
.osm-field-pair { min-width: 0; }
.osm-field-pair.is-wide { grid-column: 1 / -1; }
.osm-field-pair dt { font-size: 0.75rem; font-weight: 600; color: var(--osm-ink-mute); margin-bottom: 2px; }
.osm-field-pair dd { margin: 0; color: var(--osm-ink); overflow-wrap: anywhere; }

.osm-record-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 1200px) {
  .osm-record-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .osm-record-side { position: sticky; top: calc(var(--osm-sticky-top) + 16px); }
}
.osm-record-side { display: grid; gap: 16px; }

.osm-factbox-head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-bottom: 1px solid var(--osm-rule);
  background: var(--osm-sunk);
  border-radius: var(--osm-radius) var(--osm-radius) 0 0;
}
.osm-factbox-title { font-size: 0.8125rem; font-weight: 700; margin: 0; }
.osm-factbox-link { margin-left: auto; font-size: 0.8125rem; }
.osm-factbox-body { padding: 12px; }

/* A module's landing page (Pages/ModuleHome): see material.css. */

/* ---------------------------------------------------------------------------
 * The brand lockup, and theme swatches in the picker.
 * ------------------------------------------------------------------------ */
/* It is an inline <svg>, so it inherits this colour: the ring and the
   wordmark are currentColor and the accent is the theme's own. */
.osm-lockup { height: 26px; width: auto; display: block; color: var(--osm-ink); }

.osm-swatch {
  width: 1.25rem; height: 1.25rem; flex: none;
  border: 1px solid var(--osm-rule-strong);
  border-radius: var(--osm-radius);
  display: inline-block;
}
.osm-theme-list { display: grid; gap: 2px; }
.osm-theme-option {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px;
  padding: 6px 8px; border: 0; border-radius: var(--osm-radius);
  background: transparent; color: var(--osm-ink); text-align: start; text-decoration: none; white-space: normal;
}
button.osm-theme-option:hover, a.osm-theme-option:hover { background: color-mix(in srgb, var(--osm-ink) 7%, transparent); color: var(--osm-ink); }
.osm-theme-option.is-active { background: var(--osm-accent-soft); }
@media (max-width: 1023.98px), (pointer: coarse) { .osm-theme-option { min-height: 44px; } }
.osm-theme-text { min-width: 0; }
.osm-theme-menu { width: min(20rem, calc(100vw - 16px)); }
.flex-none { flex: none; }

/* ---------------------------------------------------------------------------
 * Pinned "no signal" line on the driver's screen.
 * ------------------------------------------------------------------------ */
.osm-offline-pinned {
  position: sticky; top: calc(var(--osm-frame-top) + 4px); z-index: 1010;
  background: var(--osm-warn-soft);
  color: var(--osm-ink);
  border: 1px solid var(--osm-warn);
  border-radius: var(--osm-radius);
  padding: 8px 12px;
}

/* ---------------------------------------------------------------------------
 * Toasts and the bell
 * ---------------------------------------------------------------------------
 * Bottom right on a desk, full width at the bottom on a phone. The left rule
 * carries the severity in the theme's own colours.
 */
.osm-toast-stack {
  position: fixed; right: 16px; z-index: 1090;
  display: flex; flex-direction: column; gap: 8px;
  width: min(24rem, calc(100vw - 2rem));
  /* Several at once scroll inside the stack rather than off the top of a
     phone screen, and a long load number wraps rather than widening it. */
  max-height: calc(100vh - 6rem); max-height: calc(100dvh - 6rem);
  overflow-y: auto; overscroll-behavior: contain;
  overflow-wrap: anywhere;
  pointer-events: none;
}
@media (max-width: 575.98px) {
  .osm-toast-stack { left: 8px; right: 8px; width: auto; max-height: 50vh; max-height: 50dvh; }
}
.osm-toast {
  pointer-events: auto;
  flex-shrink: 0;
  background: var(--osm-surface);
  color: var(--osm-ink);
  border: var(--osm-border-width) solid var(--osm-rule-strong);
  border-left: 4px solid var(--osm-ink-mute);
  border-radius: var(--osm-radius);
  box-shadow: var(--osm-shadow-lg);
  padding: 10px 12px;
}
.osm-toast-success { border-left-color: var(--osm-signal); }
.osm-toast-warning { border-left-color: var(--osm-warn); }
.osm-toast-alarm   { border-left-color: var(--osm-alarm); }
.osm-toast-info    { border-left-color: var(--osm-info); }
.osm-toast-body { display: block; flex: 1 1 auto; min-width: 0; background: none; border: 0; padding: 0; color: inherit; text-align: start; font: inherit; cursor: pointer; }
/* One line under the other: the kind, the title, the words, the time. */
.osm-toast-body > span, .osm-toast-body > strong { display: block; }
/* A phone shows the newest two cards and "and N more" (ToastHost.PhoneShown);
   a desk shows them all and never the line. */
.osm-toast-more { display: none; }
@media (max-width: 599.98px) {
  .osm-toast-stack > .osm-toast:nth-child(n+3) { display: none; }
  .osm-toast-more {
    display: block; pointer-events: auto; flex-shrink: 0; align-self: flex-end;
    background: var(--osm-surface); color: var(--osm-ink);
    border: var(--osm-border-width) solid var(--osm-rule-strong); border-radius: var(--osm-radius);
    box-shadow: var(--osm-shadow-lg); padding: 8px 12px; min-height: 44px;
    font: inherit; cursor: pointer;
  }
  .osm-toast-more:focus-visible { outline: 2px solid var(--osm-focus, currentColor); outline-offset: 2px; }
}

.osm-bell-menu { width: min(24rem, 92vw); }
.osm-bell-list { max-height: 60vh; overflow-y: auto; }

/* ---------------------------------------------------------------------------
 * Load chat
 * ------------------------------------------------------------------------ */
.osm-chat-message { margin: 8px 0; max-width: 85%; }
.osm-chat-message.is-mine { margin-left: auto; text-align: right; }
.osm-chat-body {
  display: inline-block; text-align: left; white-space: pre-wrap;
  background: var(--osm-sunk); color: var(--osm-ink); border-radius: var(--osm-radius);
  padding: 6px 10px; margin-top: 2px;
}
.osm-chat-message.is-mine .osm-chat-body { background: var(--osm-accent-soft); }
/* Internal messages are visibly different, so nobody mistakes who can read them. */
.osm-chat-message.is-internal .osm-chat-body { border: 1px dashed var(--osm-rule-strong); }
.osm-chat-message.is-pending { opacity: 0.65; }

/* Dispatch and a driver, directly (V0550): the office's thread list, and the
   phone's large compose box. */
.osm-direct-row {
  display: block; border: 0; background: transparent; color: var(--osm-ink);
  border-bottom: 1px solid var(--osm-rule); cursor: pointer; min-height: 48px;
}
.osm-direct-row:hover, .osm-direct-row:focus-visible { background: var(--osm-sunk); }
.osm-direct-row.is-selected { background: var(--osm-accent-soft); }
.osm-direct-thread.is-large .osm-direct-input { font-size: 1.05rem; min-height: 6rem; }
.osm-direct-thread.is-large .osm-chat-message { max-width: 95%; }

/* ---------------------------------------------------------------------------
 * Sign-in: one card in the middle of the canvas, as every enterprise sign-in is.
 * ------------------------------------------------------------------------ */
.osm-auth { max-width: 28rem; padding-top: 48px; padding-bottom: 48px; }
.osm-auth-card { padding: 28px 32px; box-shadow: var(--osm-shadow-md); }
@media (max-width: 575.98px) {
  .osm-auth { padding-top: 16px; }
  .osm-auth-card { padding: 20px; }
}

/* ---------------------------------------------------------------------------
 * Small helpers pages use instead of inline colours.
 * ------------------------------------------------------------------------ */
.osm-qr-surface { background: var(--osm-qr-bg); color: var(--osm-qr-ink); padding: 8px; display: inline-block; border: 1px solid var(--osm-rule); }
.osm-sticky-below-header { position: sticky; top: calc(var(--osm-sticky-top) + 8px); z-index: 2; }
.osm-surface-bg { background: var(--osm-surface); }
.osm-sunk-bg { background: var(--osm-sunk); }

/* ===========================================================================
 * Theme identity, inside the page
 * ===========================================================================
 * Chad, 2026-10-03: "noticeably different between the options in light and
 * dark" and "should still follow the oil and natural gas industries". The
 * identity now lives mostly in the frame (shell.css, themes.css); inside the
 * page each theme keeps a little of its character without heavy blocks.
 */

/* Rule weight follows the theme: fine on Mesquite, heavy on Night Haul. */
.osm-panel, .osm-toast { border-width: var(--osm-border-width); }

/* Mesquite: the run ticket - square, ruled, mono headings. */
:root[data-theme='mesquite'] .osm-module-heading,
:root[data-theme='mesquite'] .osm-form-section-title,
:root[data-theme='mesquite'] .osm-factbox-title {
  font-family: var(--osm-font-mono); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8125rem;
}

/* Pipeline: softer - rounder corners and a gentle lift. */
:root[data-theme='pipeline'] .osm-panel { box-shadow: var(--osm-shadow-md); }

/* Night Haul: heavy rules, roomier rows for gloves and sunlight, bigger type,
   underlined links, nothing decorative. */
:root[data-theme='nighthaul'] { --osm-body-font-size: 0.9375rem; }
:root[data-theme='nighthaul'] .osm-table > :not(caption) > * > * { padding-top: 10px; padding-bottom: 10px; }
:root[data-theme='nighthaul'] .osm-kpi { border-left-width: 6px; }
:root[data-theme='nighthaul'] .osm-main a:not(.mud-button-root):not(.mud-nav-link):not(.mud-menu-item):not(.osm-kpi):not(.osm-module-link) {
  text-decoration: underline; text-underline-offset: 2px;
}
:root[data-theme='nighthaul'] .osm-panel { box-shadow: none; }

/* Support cases (V0273): one message in a case's conversation. A quiet rule
   on the left, the words as they were typed. An internal note (CYOPS only)
   wears the warning colour, so it is never mistaken for a reply. */
.osm-support-message {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-left: 3px solid var(--osm-rule-strong);
  padding: .25rem 0 .25rem .75rem;
}
.osm-support-message.is-internal {
  border-left-color: var(--osm-warn);
  background: var(--osm-warn-soft);
}

/* An email template's preview: the message as a mail program shows it. */
.osm-email-preview {
  width: 100%;
  min-height: 32rem;
  border: 1px solid var(--osm-rule);
  border-radius: var(--osm-radius);
  background: var(--osm-surface);
}

/* Respect the setting. Somebody who has asked for less motion has usually
   asked for a reason. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------------------------
   Dispatch board (V0320, V0498), laid out like the legacy Dispatch Dashboard:
   the loads, the fleet and the chosen truck's run. From 1280px the three side
   by side (loads about half, fleet and run a quarter each); from 768px two
   columns, the loads beside the fleet over the run; below that they stack.
   Side by side, each pane fills the window below the board's top
   (--osm-dispatch-top, measured by dispatch-board.js's fit) and scrolls on its
   own, so a load is dragged onto a truck without scrolling the page.
   --------------------------------------------------------------------------- */
.osm-dispatch-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem 1rem;
}
.osm-dispatch-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0.25rem 0.25rem 0.75rem;
    background: var(--osm-sunk);
    border: 1px solid var(--osm-rule);
    border-radius: var(--osm-radius);
    color: var(--osm-ink-soft);
}
.osm-dispatch-hint > span { flex: 1 1 auto; min-width: 0; }
/* Live or not: a small dot by Refresh, its words on pointing. */
.osm-live-dot {
    display: inline-block;
    flex: none;
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 50%;
    align-self: center;
    background: var(--osm-warn);
}
.osm-live-dot.is-live { background: var(--osm-signal); }

.osm-dispatch-board {
    --osm-dispatch-h: max(22rem, calc(100vh - var(--osm-dispatch-top, 16rem) - 1.5rem));
    --osm-dispatch-h: max(22rem, calc(100dvh - var(--osm-dispatch-top, 16rem) - 1.5rem));
    display: grid;
    gap: 1rem;
    align-items: start;
    grid-template-columns: minmax(0, 1fr);
}
.osm-dispatch-fleet-pane { display: grid; gap: 1rem; align-items: start; min-width: 0; grid-template-columns: minmax(0, 1fr); }
.osm-dispatch-pane { min-width: 0; }
.osm-dispatch-loads {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
@media (min-width: 768px) {
    /* Loads | fleet over run, each pane its own scroll. */
    .osm-dispatch-board { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }
    .osm-dispatch-loads { height: var(--osm-dispatch-h); overflow: auto; }
    .osm-dispatch-loads > .osm-dg { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
    .osm-dispatch-board .osm-dispatch-loads > .osm-dg > .osm-dg-scroll { flex: 1 1 auto; min-height: 8rem; max-height: none; overflow: auto; }
    .osm-dispatch-fleet-pane { height: var(--osm-dispatch-h); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }
    .osm-dispatch-pane { min-height: 0; overflow: auto; }
    .osm-dispatch-pane:has(> .osm-fleet) { display: flex; flex-direction: column; }
    .osm-dispatch-pane > .osm-fleet { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
    .osm-dispatch-pane .osm-fleet-scroll { flex: 1 1 auto; min-height: 0; max-height: none; }
}
/* Three side by side once the board itself has room (the menu open or not):
   loads about half, the fleet and the run a quarter each. */
.osm-dispatch-page { container-type: inline-size; }
@container (min-width: 1150px) {
    .osm-dispatch-board { grid-template-columns: minmax(0, 12fr) minmax(0, 13fr); }
    .osm-dispatch-fleet-pane { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
}
/* The "not signed in" warning: one summary line with Show / Hide and Dismiss
   for today; the drivers below it when open. The buttons wrap under the
   sentence on a phone. */
.osm-dispatch-not-signed-in .mud-alert-message { width: 100%; min-width: 0; }
.osm-dispatch-not-signed-in-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.5rem; }
.osm-dispatch-not-signed-in-summary { flex: 1 1 16rem; min-width: 0; }
.osm-dispatch-not-signed-in-actions { display: inline-flex; flex-wrap: wrap; gap: 0 0.25rem; margin-inline-start: auto; }
.osm-dispatch-not-signed-in-list { max-height: min(40vh, 320px); overflow: auto; overflow-wrap: break-word; }
.osm-dispatch-not-signed-in-list a { white-space: nowrap; }
.osm-dispatch-not-signed-in-driver + .osm-dispatch-not-signed-in-driver { margin-top: 0.125rem; }
/* Stacked (a phone): the fleet is a small window that scrolls both ways. */
.osm-fleet-scroll { max-height: min(45vh, 420px); overflow: auto; }
.osm-fleet-scroll .osm-fleet-table thead th { position: sticky; top: 0; z-index: 1; background: var(--osm-surface); }
.osm-tender-bar {
    background: var(--osm-sunk);
    border: 1px solid var(--osm-rule);
    border-radius: var(--osm-radius);
    padding: 0.375rem 0.75rem;
}
.osm-dispatch-loads .osm-dg-c-actions { width: 1%; white-space: nowrap; }

/* The fleet: every row one line of a fixed height, shaded by its open loads
   with a 4px left edge in the same colour - one amber, more than one green,
   off the road grey, none without loads. In a dark theme the theme's soft
   tones are too close to the surface to tell apart, so the tints are mixed
   stronger from the same tokens. */
.osm-dispatch-board,
.osm-fleet {
    --osm-fleet-one: var(--osm-warn-soft);
    --osm-fleet-many: var(--osm-signal-soft);
    --osm-fleet-off: var(--osm-sunk);
}
:root[data-bs-theme='dark'] .osm-dispatch-board,
:root[data-bs-theme='dark'] .osm-fleet {
    --osm-fleet-one: color-mix(in srgb, var(--osm-warn) 28%, var(--osm-surface));
    --osm-fleet-many: color-mix(in srgb, var(--osm-signal) 28%, var(--osm-surface));
    --osm-fleet-off: color-mix(in srgb, var(--osm-ink-mute) 22%, var(--osm-surface));
}
.osm-fleet-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.75rem;
    margin-bottom: 0.375rem;
}
.osm-fleet-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.osm-fleet-legend li { display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap; }
/* A round dot in the row edge's colour (hollow: no loads). */
.osm-fleet-dot {
    display: inline-block;
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 50%;
    border: 1.5px solid var(--osm-rule-strong);
    background: transparent;
}
.osm-fleet-dot.is-one { background: var(--osm-warn); border-color: var(--osm-warn); }
.osm-fleet-dot.is-many { background: var(--osm-signal); border-color: var(--osm-signal); }
.osm-fleet-dot.is-off { background: var(--osm-ink-mute); border-color: var(--osm-ink-mute); }

.osm-fleet-table { width: 100%; min-width: 15rem; table-layout: fixed; }
.osm-fleet-table col.osm-fleet-col-on { width: 2.5rem; }
.osm-fleet-table col.osm-fleet-col-truck { width: 22%; }
.osm-fleet-table col.osm-fleet-col-driver { width: 24%; }
.osm-fleet-table col.osm-fleet-col-loads { width: 2.25rem; }
.osm-fleet-table col.osm-fleet-col-msg { width: 2.5rem; }
.osm-fleet-table td.osm-fleet-msg { padding-top: 0; padding-bottom: 0; text-overflow: clip; }
.osm-fleet-table th,
.osm-fleet-table td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.osm-fleet-table > tbody > tr { height: 2.25rem; }
.osm-fleet-table.is-compact > tbody > tr { height: 2rem; }
.osm-fleet-table.is-compact td,
.osm-fleet-table.is-compact th { padding-top: 0.125rem; padding-bottom: 0.125rem; }
@media (pointer: coarse) {
    .osm-fleet-table > tbody > tr,
    .osm-fleet-table.is-compact > tbody > tr { height: 2.75rem; }
}
/* "Now": the state cut to the cell, the last step's time small at its right. */
.osm-fleet-table td.osm-fleet-now { padding-right: 0.5rem; }
.osm-fleet-now > .osm-fleet-state { display: inline-block; max-width: calc(100% - 2.75rem); overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.osm-fleet-now > .osm-fleet-time { float: right; margin-left: 0.25rem; font-variant-numeric: tabular-nums; }

.osm-fleet-table > tbody > tr.osm-fleet-row { cursor: pointer; --osm-fleet-edge: transparent; }
.osm-fleet-table > tbody > tr.is-one { --osm-fleet-edge: var(--osm-warn); }
.osm-fleet-table > tbody > tr.is-many { --osm-fleet-edge: var(--osm-signal); }
.osm-fleet-table > tbody > tr.is-off { --osm-fleet-edge: var(--osm-ink-mute); }
.osm-fleet-table > tbody > tr.is-one > * { background-color: var(--osm-fleet-one); }
.osm-fleet-table > tbody > tr.is-many > * { background-color: var(--osm-fleet-many); }
.osm-fleet-table > tbody > tr.is-off > * { background-color: var(--osm-fleet-off); color: var(--osm-ink-mute); }
.osm-fleet-table > tbody > tr.is-not-on > * { color: var(--osm-ink-mute); }
.osm-fleet-table > tbody > tr.osm-fleet-row > *:first-child { box-shadow: inset 4px 0 0 var(--osm-fleet-edge); }
.osm-fleet-table > tbody > tr.is-selected > * { box-shadow: inset 0 2px 0 var(--osm-accent), inset 0 -2px 0 var(--osm-accent); }
.osm-fleet-table > tbody > tr.is-selected > *:first-child { box-shadow: inset 4px 0 0 var(--osm-fleet-edge), inset 0 2px 0 var(--osm-accent), inset 0 -2px 0 var(--osm-accent); }
.osm-fleet-table > tbody > tr.is-selected > *:last-child { box-shadow: inset -2px 0 0 var(--osm-accent), inset 0 2px 0 var(--osm-accent), inset 0 -2px 0 var(--osm-accent); }
.osm-fleet-table > tbody > tr:focus-visible { outline: 2px solid var(--osm-accent); outline-offset: -2px; }

/* The chosen truck's run: the place in the load's cell, the route about
   180px with origin and destination one line each, compact icon actions. */
.osm-run-table { width: 100%; }
.osm-run-table td { white-space: normal; overflow-wrap: anywhere; }
.osm-run-table .osm-nowrap { white-space: nowrap; overflow-wrap: normal; }
.osm-run-place {
    display: inline-block;
    min-width: 1.25rem;
    margin-right: 0.25rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
    color: var(--osm-ink-soft);
}
.osm-run-table .osm-run-where { width: 180px; max-width: 180px; }
.osm-run-table .osm-run-cut { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; max-width: 180px; }
.osm-run-table .osm-run-actions { width: 1%; }
.osm-run-table .osm-run-actions .mud-icon-button { width: 32px; height: 32px; padding: 4px; }
.osm-run-pinned { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; }
.osm-run-table > tbody > tr[draggable="true"] { cursor: grab; -webkit-touch-callout: none; user-select: none; }
.osm-run-table > tbody > tr.is-running > * { background-color: var(--osm-fleet-many, var(--osm-signal-soft)); }
.osm-truck-run-empty {
    border: 1px dashed var(--osm-rule-strong);
    border-radius: var(--osm-radius);
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
}
.osm-dispatch-choices { max-height: 40vh; overflow-y: auto; }

/* The fleet legend sits under the grid, as its foot. */
.osm-fleet-foot { padding: 0.375rem 0.25rem 0; flex: none; }
.osm-fleet-foot .osm-fleet-legend { margin: 0; }

/* Side by side, the three panes' heading bars are one height, so the grids'
   tops line up (the owner's rule). Each bar's text stays on one line and cuts
   with an ellipsis rather than pushing its grid down. */
.osm-dispatch-loads > .osm-dg > .osm-dg-bar,
.osm-fleet-head,
.osm-run-head {
    box-sizing: border-box;
    height: 2.5rem;
    flex: none; /* never squeezed by a short pane */
    margin: 0 0 0.5rem;
    align-items: center;
    flex-wrap: nowrap;
    overflow: hidden;
    white-space: nowrap;
}
.osm-fleet-head > *, .osm-run-head > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* The loads bar holds the Columns menu, which opens below it: it must not clip
   the menu, and the menu must sit above the grid (its sticky header included). */
.osm-dispatch-loads > .osm-dg > .osm-dg-bar { overflow: visible; position: relative; z-index: 20; }
.osm-dispatch-loads > .osm-dg > .osm-dg-bar .osm-section-title,
.osm-fleet-head .osm-section-title,
.osm-run-head .osm-section-title { margin: 0; }

/* ---------------------------------------------------------------------------
   The dispatch board on a phone (below 768px): one part at a time behind the
   tabs Loads / Trucks / Run order; each load a short card (the grid's
   PhoneSummary columns) with More for the rest; the toolbar one row - Pending,
   Assigned, the hub menu and Filters; every target at least 44px; the fleet
   and run rows stacked so nothing scrolls sideways. A tablet or desk shows
   every part and none of this.
   --------------------------------------------------------------------------- */
.osm-dispatch-tabs { display: none; }
.osm-dispatch-phone { display: none; }
.osm-dispatch-filter-sheet { display: flex; flex-direction: column; gap: 0.75rem; }
.osm-dispatch-filter-sheet .mud-switch { min-height: 44px; }
@media (max-width: 767.98px) {
    .osm-dispatch-desk { display: none; }
    .osm-dispatch-phone { display: flex; flex-wrap: nowrap; min-width: 0; }
    .osm-dispatch-toolbar { flex-wrap: wrap; gap: 0.5rem; }
    .osm-dispatch-toolbar .mud-button-root,
    .osm-dispatch-toolbar .mud-icon-button { min-height: 44px; min-width: 44px; }
    .osm-dispatch-hub-menu .mud-button-root { max-width: 9rem; }
    .osm-dispatch-hub-menu .mud-button-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    /* The how-to line folded to one line; the (?) still hides and shows it. */
    .osm-dispatch-hint > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    .osm-dispatch-tabs {
        display: flex;
        position: sticky;
        top: 0;
        z-index: 25;
        margin: 0 0 0.75rem;
        background: var(--osm-surface);
        border-bottom: 1px solid var(--osm-rule);
    }
    .osm-dispatch-tab {
        flex: 1 1 0;
        min-height: 48px;
        padding: 0 0.5rem;
        border: 0;
        border-bottom: 2px solid transparent;
        background: transparent;
        color: var(--osm-ink-soft);
        font: inherit;
        font-weight: 600;
        white-space: nowrap;
        cursor: pointer;
    }
    .osm-dispatch-tab.is-on { color: var(--osm-accent); border-bottom-color: var(--osm-accent); }
    .osm-dispatch-tab:focus-visible { outline: 2px solid var(--osm-accent); outline-offset: -2px; }

    /* One pane at a time. */
    .osm-dispatch-board[data-phone-tab='loads'] .osm-dispatch-fleet-pane,
    .osm-dispatch-board[data-phone-tab='trucks'] .osm-dispatch-loads,
    .osm-dispatch-board[data-phone-tab='trucks'] .osm-dispatch-pane-run,
    .osm-dispatch-board[data-phone-tab='run'] .osm-dispatch-loads,
    .osm-dispatch-board[data-phone-tab='run'] .osm-dispatch-pane-trucks { display: none; }

    /* A load's short card: Dispatch... (or Reassign...) and More share the last line. */
    .osm-dispatch-loads .osm-grid > tbody > tr > td.osm-dg-c-actions { order: 2; justify-content: flex-start; flex-wrap: wrap; }
    .osm-dispatch-loads .osm-grid > tbody > tr > td.osm-dg-c-actions .osm-dg-label { display: none; }
    .osm-dispatch-loads .osm-grid > tbody > tr > td.osm-dg-c-actions .osm-dg-value { flex: 1 1 auto; text-align: start; }
    .osm-dispatch-loads .osm-grid .mud-button-root,
    .osm-dispatch-loads .osm-grid .mud-icon-button { min-height: 44px; min-width: 44px; }
    .osm-dispatch-loads .osm-tap-link { display: inline-flex; align-items: center; min-height: 44px; }

    /* The fleet: each truck a block - On | truck, # loads, message; then the
       driver; then what it is doing - instead of a table to scroll sideways. */
    .osm-fleet-scroll { max-height: none; overflow: visible; }
    .osm-fleet-table { min-width: 0; table-layout: auto; }
    .osm-fleet-table > colgroup,
    .osm-fleet-table > thead { display: none; }
    .osm-fleet-table,
    .osm-fleet-table > tbody { display: block; width: 100%; }
    .osm-fleet-table > tbody > tr,
    .osm-fleet-table.is-compact > tbody > tr {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) auto 44px;
        grid-template-areas: "on truck loads msg" "on driver driver driver" "on now now now";
        align-items: center;
        height: auto;
        margin-bottom: 0.5rem;
        border: 1px solid var(--osm-rule);
        border-radius: var(--osm-radius);
        overflow: hidden;
    }
    .osm-fleet-table > tbody > tr > td { display: block; border: 0; padding: 0.25rem 0.5rem; }
    .osm-fleet-table > tbody > tr > td:nth-child(1) { grid-area: on; align-self: stretch; display: flex; align-items: center; justify-content: center; padding: 0; }
    .osm-fleet-table > tbody > tr > td:nth-child(2) { grid-area: truck; }
    .osm-fleet-table > tbody > tr > td:nth-child(3) { grid-area: driver; }
    .osm-fleet-table > tbody > tr > td:nth-child(4) { grid-area: msg; padding: 0; }
    .osm-fleet-table > tbody > tr > td:nth-child(5) { grid-area: loads; }
    .osm-fleet-table > tbody > tr > td:nth-child(5)::before { content: "Loads "; color: var(--osm-ink-soft); font-size: 0.75rem; }
    .osm-fleet-table > tbody > tr > td:nth-child(6) { grid-area: now; }
    .osm-fleet-table .osm-load-message,
    .osm-fleet-table .mud-icon-button { min-width: 44px; min-height: 44px; }
    .osm-fleet-table > tbody > tr.is-selected { border-color: var(--osm-accent); box-shadow: inset 0 0 0 1px var(--osm-accent); }
    .osm-fleet-table > tbody > tr.is-selected > * { box-shadow: none; }
    .osm-fleet-table > tbody > tr.osm-fleet-row > *:first-child,
    .osm-fleet-table > tbody > tr.is-selected > *:first-child { box-shadow: inset 4px 0 0 var(--osm-fleet-edge); }

    /* The run: each load a block - the load and its actions, then from and to, then the step. */
    .osm-run-table > thead { display: none; }
    .osm-run-table,
    .osm-run-table > tbody { display: block; width: 100%; }
    .osm-run-table > tbody > tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "load actions" "where where" "step step";
        align-items: center;
        margin-bottom: 0.5rem;
        border: 1px solid var(--osm-rule);
        border-radius: var(--osm-radius);
    }
    .osm-run-table > tbody > tr > td { display: block; border: 0; padding: 0.25rem 0.5rem; }
    .osm-run-table > tbody > tr > td.osm-run-load { grid-area: load; }
    .osm-run-table > tbody > tr > td.osm-run-where { grid-area: where; width: auto; max-width: none; }
    .osm-run-table > tbody > tr > td:nth-child(3) { grid-area: step; }
    .osm-run-table > tbody > tr > td.osm-run-actions { grid-area: actions; width: auto; }
    .osm-run-table .osm-run-cut { max-width: none; }
    .osm-run-table .osm-run-actions .mud-icon-button,
    .osm-run-table .mud-icon-button,
    .osm-run-pinned { width: 44px; height: 44px; }
}

/* Phone: the desk's toolbar row gives way to the phone row (hub menu and
   Filters) - the d-flex utility would otherwise keep it showing - and the
   loads grid's bar wraps instead of keeping the desk's one-line height. */
@media (max-width: 767.98px) {
    .osm-dispatch-toolbar .osm-dispatch-desk { display: none !important; }
    .osm-dispatch-loads > .osm-dg > .osm-dg-bar { height: auto; flex-wrap: wrap; row-gap: 0.5rem; }
}

/* Contract signing (V0730). A typed signature shown in a handwriting face where
   the device has one (no font is downloaded: the CSP allows only our own), and
   the long SHA-256 fingerprints broken wherever they must to fit a phone. */
.osm-typed-signature {
    font-family: "Segoe Script", "Brush Script MT", "Lucida Handwriting", "Apple Chancery", cursive;
    font-style: italic; font-size: 1.75rem; line-height: 1.25; color: var(--osm-ink);
    border-bottom: 1px solid var(--osm-rule-strong); padding: 4px 8px 2px; max-width: 32rem; overflow-wrap: anywhere;
}
.osm-hash { font-family: var(--osm-font-mono); word-break: break-all; }
.osm-contract-document { max-height: 60vh; overflow: auto; border: 1px solid var(--osm-rule); border-radius: 6px; padding: 12px 16px; background: var(--osm-surface); }

/* A count on a tab sits beside its name, never over it: "Gaps 27". */
.osm-tab-count {
  display: inline-block; min-width: 1.5em; margin-left: 6px; padding: 0 6px;
  border-radius: 999px; font-size: 0.75rem; line-height: 1.5; text-align: center;
  font-variant-numeric: tabular-nums;
  background: var(--osm-rule); color: var(--osm-ink);
}
