/*
 * Portal stylesheet. Every colour, the radius and the font come from the client's
 * branding settings, emitted per request as custom properties on :root (index.cfm)
 * and refreshed after sign-in from GET /api/v1/me. The fallbacks below are neutral,
 * not any client's brand. Mobile first: breakpoints 640, 1024, 1280 (spec 11.2.11).
 */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/inter-latin-wght-normal.woff2) format('woff2-variations'), url(fonts/inter-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--c-muted-panel, #f4f4f5);
  color: var(--c-text, #111);
  font-family: var(--font, system-ui, sans-serif);
  font-size: 16px;
  line-height: 1.5;
}
img { max-width: 100%; height: auto; }
a { color: var(--c-primary, #000); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; color: var(--c-text, #111); }
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.125rem; font-weight: 650; }
p { margin: 0 0 1rem; }
:focus-visible { outline: 3px solid var(--c-focus-ring, #2b7fff); outline-offset: 2px; }
/* Headings and the main area take focus only so screen readers announce a new page: no ring. */
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus, main[tabindex="-1"]:focus, .notice[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--c-muted-text, #666); }

.skip { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--c-surface, #fff); border-radius: var(--radius, 6px); }
.skip:focus { top: 8px; }

/* ---------------------------------------------------------------- buttons and links */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .625rem 1.125rem;
  border: 1px solid transparent; border-radius: var(--radius, 6px);
  font: inherit; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn[disabled] { opacity: .65; cursor: progress; }
.btn-primary { background: var(--c-accent, #333); color: var(--c-accent-contrast, #fff); }
.btn-primary:hover:not([disabled]) { filter: brightness(.94); }
.btn-secondary { background: var(--c-secondary, #555); color: var(--c-secondary-contrast, #fff); }
.btn-outline { background: transparent; color: var(--c-primary, #000); border-color: var(--c-border, #ddd); }
.btn-outline:hover:not([disabled]) { background: var(--c-muted-panel, #f4f4f5); }
.btn-block { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--c-primary, #000); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; min-height: 44px; }

/* ---------------------------------------------------------------- forms */
.field { margin: 0 0 1.125rem; }
.field label { display: block; margin: 0 0 .375rem; font-weight: 600; font-size: .9375rem; }
.input {
  display: block; width: 100%; min-height: 44px; padding: .625rem .75rem;
  font: inherit; font-size: 1rem; /* 16px keeps iOS from zooming */
  color: var(--c-text, #111); background: var(--c-surface, #fff);
  border: 1px solid var(--c-border, #ccc); border-radius: var(--radius, 6px);
}
.input:focus { border-color: var(--c-focus-ring, #2b7fff); outline: 3px solid var(--c-focus-ring, #2b7fff); outline-offset: 0; }
.input[aria-invalid="true"] { border-color: var(--c-destructive, #c00); }
.pw { position: relative; }
.pw .input { padding-right: 4.75rem; }
.pw .reveal {
  position: absolute; right: 0; top: 0; bottom: 0; min-width: 64px; min-height: 44px; padding: 0 .75rem;
  background: transparent; border: 0; border-left: 1px solid var(--c-border, #ccc);
  border-radius: 0 var(--radius, 6px) var(--radius, 6px) 0;
  font: inherit; font-size: .875rem; font-weight: 600; color: var(--c-primary, #000); cursor: pointer;
}
.field-error { margin: .375rem 0 0; color: var(--c-destructive, #c00); font-size: .875rem; font-weight: 600; }
.hint { margin: .375rem 0 0; color: var(--c-muted-text, #666); font-size: .875rem; }

.notice { margin: 0 0 1.25rem; padding: .75rem 1rem; border-radius: var(--radius, 6px); border: 1px solid transparent; }
.notice-error { background: var(--c-surface, #fff); border-color: var(--c-destructive, #c00); color: var(--c-destructive, #c00); font-weight: 600; }
.notice-info { background: var(--c-notice-bg, #fff6e5); border-color: var(--c-border, #ddd); }
.notice-success { background: var(--c-success-bg, #eaf7ee); color: var(--c-success-text, #145c2a); border-color: var(--c-success-bg, #eaf7ee); font-weight: 600; }

/* ---------------------------------------------------------------- signed-out pages */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 24px 16px 40px; }
.auth-card {
  width: 100%; max-width: 440px; overflow: hidden;
  background: var(--c-surface, #fff); border: 1px solid var(--c-border, #ddd); border-radius: calc(var(--radius, 6px) * 1.5);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 12px 32px rgba(0, 0, 0, .06);
}
.auth-strip { height: 5px; background: linear-gradient(90deg, var(--c-header-from, #333), var(--c-header-to, #777)); }
.auth-body { padding: 24px 20px 28px; }
.auth-logo { display: block; width: auto; max-width: 220px; max-height: 96px; margin: 0 0 20px; }
.auth-portal-name { display: block; margin: 0 0 20px; font-size: 1.125rem; font-weight: 700; color: var(--c-primary, #000); }
.auth-links { margin: 1.25rem 0 0; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.auth-alt { margin: 1rem 0 0; }
.auth-or { display: flex; align-items: center; gap: .75rem; margin: 0 0 1rem; font-size: .875rem; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid var(--c-border, #ddd); }
.skip-password { margin-top: .75rem; }
.group-list-head { margin: .75rem 0 .25rem; padding: 0 .75rem; font-size: .8125rem; font-weight: 600; color: var(--c-muted-text, #71717b); }
.tp-cols { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1280px) { .tp-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } .tp-preview { position: sticky; top: 1rem; } }
.tp-parts { display: grid; gap: 1rem; min-width: 0; }
.tp-preview-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .75rem; margin: 0 0 .5rem; }
.tp-preview-tools .hint { margin: 0; }
.tp-preview-frame { display: block; width: 100%; height: 680px; border: 1px solid var(--c-border, #ddd); border-radius: .5rem; background: #fff; }
.tp-subject { font-weight: 600; margin: .5rem 0; overflow-wrap: anywhere; }
.tp-subject:empty { display: none; }
.tp-modes { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 .75rem; }
.tp-modes .is-active { background: var(--c-muted-panel, #f4f4f5); border-color: var(--c-primary, #333); }
.tp-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8125rem; line-height: 1.5; min-height: 14rem; }
.tp-insert { margin: .75rem 0 0; max-width: 28rem; }
.tp-history { margin-top: .75rem; }
.tp-history summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.tp-history li { display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: center; }
.rte-bar { display: flex; flex-wrap: wrap; gap: .375rem; margin: 0 0 .5rem; }
.rte-area { min-height: 10rem; padding: .75rem 1rem; border: 1px solid var(--c-border, #ddd); border-radius: .5rem; background: var(--c-surface, #fff); overflow-wrap: anywhere; line-height: 1.55; }
.rte-area:focus { outline: 2px solid var(--c-focus-ring, #2b7fff); outline-offset: 1px; }
.rte-area[contenteditable="false"] { background: var(--c-muted-panel, #f4f4f5); }
.rte-area p { margin: 0 0 .75rem; }
.rte-area h2 { font-size: 1.125rem; margin: 0 0 .5rem; }
.rte-area ul, .rte-area ol { margin: 0 0 .75rem 1.25rem; }
.rte-area a.button { display: inline-block; padding: .5rem 1rem; border-radius: .375rem; background: var(--c-secondary, #24ab3a); color: var(--c-secondary-contrast, #fff); text-decoration: none; font-weight: 600; }
.rte-link { border: 1px solid var(--c-border, #ddd); border-radius: .5rem; padding: .75rem; margin: 0 0 .5rem; background: var(--c-muted-panel, #f4f4f5); }
.rte-link .actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; }
.auth-links a, a.text-link { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------------------------------------------------------------- signed-in shell */
.page { max-width: var(--page-max, 1280px); margin: 0 auto; padding: 20px 16px 96px; }
.page:focus { outline: none; }
.page-head { margin: 0 0 1.25rem; }

.panel { background: var(--c-surface, #fff); border: 1px solid var(--c-border, #ddd); border-radius: var(--radius, 6px); overflow: hidden; margin: 0 0 1.25rem; }
.panel-head { background: var(--c-primary, #222); color: var(--c-primary-contrast, #fff); padding: .625rem 1rem; }
.panel-head h2 { margin: 0; color: inherit; font-size: 1rem; }
.panel-body { padding: 1rem; }
.facts { margin: 0 0 1rem; display: grid; grid-template-columns: 1fr; gap: .125rem 1rem; }
.facts dt { font-size: .8125rem; color: var(--c-muted-text, #666); font-weight: 600; }
.facts dd { margin: 0 0 .625rem; overflow-wrap: anywhere; }
/* 0063: the load page, compact: label beside answer; the lane at a glance; a pickup and a delivery side by side */
@media (min-width: 640px) {
  .load-section .facts { grid-template-columns: minmax(120px, 38%) minmax(0, 1fr); gap: 0 1rem; margin-bottom: .5rem; }
  .load-section .facts dt { padding-top: .125rem; }
  .load-section .facts dd { margin-bottom: .5rem; }
}
.load-summary { display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: center; background: var(--c-surface, #fff); border: 1px solid var(--c-border, #ddd); border-radius: var(--radius, 6px); padding: 12px 16px; margin: 0 0 1.25rem; }
.load-sum-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.load-sum-label { font-size: .75rem; font-weight: 600; color: var(--c-muted-text, #666); }
.load-sum-value { font-size: 1.0625rem; font-weight: 650; }
.load-sum-tools { margin-left: auto; }
/* 0064: the Forms screen: find a field, go to a section; a hidden field on one line */
.form-tools { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; margin: 0 0 1rem; }
@media (min-width: 640px) { .form-tools { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.form-row-compact { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-top: 8px; padding-bottom: 8px; }
.form-row-compact .form-row-name { flex: 1 1 200px; min-width: 0; color: var(--c-muted-text, #666); }
.form-row-compact select { width: auto; min-width: 160px; }
/* 0064: the audit trail, compact: when, what and which on one line; who and where under it */
.audit-tools { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
@media (min-width: 900px) { .audit-tools { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.audit-entry { padding: 10px 16px !important; }
.audit-details { margin-top: 2px; }
.audit-details > summary { font-size: .875rem; }
@media (pointer: fine) and (min-width: 1024px) { .rte-bar .btn { min-height: 34px; padding: 0 10px; font-size: .875rem; } }
.audit-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.audit-rec { font-weight: 650; overflow-wrap: anywhere; }
.audit-meta { margin: 2px 0 0 !important; font-size: .875rem; }
/* 0065: values in formatted email text as chips */
.rte-token { display: inline-block; padding: 0 .45em; margin: 0 1px; border-radius: 999px; background: var(--c-selected-bg, #eef); color: var(--c-primary, #000); font-size: .875em; font-weight: 600; line-height: 1.6; white-space: nowrap; cursor: default; user-select: all; }
.rte-token.is-section { background: var(--c-notice-bg, #fff6e5); color: var(--c-text, #111); border: 1px dashed var(--c-border, #ccc); }
.load-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 20px; }
@media (min-width: 1280px) { .load-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.load-col { min-width: 0; }
@media (min-width: 1280px) { .load-pair .load-section .facts { grid-template-columns: minmax(0, 1fr); gap: 0; } .load-pair .load-section .facts dd { margin-bottom: .5rem; } }
.form-narrow { max-width: 480px; }

/* Primary action stays in reach on phones (spec 11.2.11 rule 4). */
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.actions-sticky {
  position: sticky; bottom: 0; z-index: 10;
  margin: 1rem -1rem -1rem; padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom, 0px));
  background: var(--c-surface, #fff); border-top: 1px solid var(--c-border, #ddd);
}
.actions-sticky .btn { flex: 1 1 auto; }

.loading { padding: 48px 16px; text-align: center; color: var(--c-muted-text, #666); }

/* ---------------------------------------------------------------- menu icons, avatar, chips */
.icon { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--c-primary, #222); color: var(--c-primary-contrast, #fff); font-size: .8125rem; font-weight: 700; letter-spacing: .02em;
}
.chip { display: inline-flex; align-items: center; min-height: 24px; padding: 0 .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600;
  background: var(--c-muted-panel, #f4f4f5); color: var(--c-muted-text, #666); border: 1px solid var(--c-border, #ddd); }
.chip-here { background: var(--c-selected-bg, #eef); color: var(--c-primary, #000); border-color: transparent; }
.chip-lock { background: var(--c-notice-bg, #fff6e5); color: var(--c-text, #111); }
.chip-flag { background: var(--c-notice-bg, #fff6e5); color: var(--c-text, #111); margin-left: .25rem; min-width: 24px; justify-content: center; font-weight: 700; }
.loads-finished { margin: 0 0 .5rem; }

/* ---------------------------------------------------------------- settings (generated) */
.settings-tools { display: grid; grid-template-columns: 1fr; gap: 0 1rem; }
.settings-layout { display: block; }
.settings-aside { margin: 0 0 1rem; }
.group-list { display: none; }
.group-select { margin: 0 0 .25rem; }
.settings-main .panel-body > .muted { margin-top: -.25rem; }
.field-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem 1.5rem; }
.sfield { min-width: 0; }
.sfield > label, .sfield-label { display: block; margin: 0 0 .375rem; font-weight: 650; font-size: .875rem; }
.sfield .hint { margin: -.125rem 0 .5rem; font-size: .8125rem; }
.sfield .req { color: var(--c-destructive, #c00); }
.sfield.is-reset .input, .sfield.is-reset .switch, .sfield.is-reset .checks { opacity: .5; }
.sfield.has-error .input { border-color: var(--c-destructive, #c00); }
.setting-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; margin: .5rem 0 0; font-size: .8125rem; }
.setting-meta .linkbtn { min-height: 44px; font-size: .8125rem; }
.check { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--c-primary, #222); }
.checks { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 0 1rem; }
.input-affix { display: flex; align-items: stretch; }
.input-affix .input { flex: 1 1 auto; min-width: 0; }
.input-affix .affix { display: flex; align-items: center; padding: 0 .75rem; background: var(--c-muted-panel, #f4f4f5); border: 1px solid var(--c-border, #ccc); color: var(--c-muted-text, #666); font-weight: 600; }
.input-affix .affix:first-child { border-right: 0; border-radius: var(--radius, 6px) 0 0 var(--radius, 6px); }
.input-affix .affix:last-child { border-left: 0; border-radius: 0 var(--radius, 6px) var(--radius, 6px) 0; }
.input-affix .affix:first-child + .input { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-affix .input:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.colour-pair { display: flex; gap: .5rem; align-items: stretch; }
.colour-swatch { width: 52px; min-height: 44px; padding: 2px; border: 1px solid var(--c-border, #ccc); border-radius: var(--radius, 6px); background: var(--c-surface, #fff); cursor: pointer; }
.switch { display: inline-flex; align-items: center; gap: .75rem; min-height: 44px; cursor: pointer; position: relative; }
.switch input { position: absolute; opacity: 0; width: 44px; height: 26px; margin: 0; cursor: pointer; }
.switch-track { position: relative; display: inline-block; width: 44px; height: 26px; border-radius: 999px; background: var(--c-border, #ccc); flex: 0 0 auto; }
.switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--c-surface, #fff); box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + .switch-track { background: var(--c-secondary, #555); }
.switch input:checked + .switch-track::after { left: 21px; }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--c-focus-ring, #2b7fff); outline-offset: 2px; }
.switch input:disabled + .switch-track { opacity: .5; }
/* 0064: a value that cannot be changed here reads as a value, not as a box to type in */
.input:disabled { background: var(--c-muted-panel, #f4f4f5); border-color: transparent; color: var(--c-text, #111); -webkit-text-fill-color: var(--c-text, #111); opacity: 1; cursor: default; box-shadow: none; }
.input[readonly] { background: var(--c-muted-panel, #f4f4f5); border-color: transparent; cursor: default; }
.input:disabled::-webkit-inner-spin-button, .input:disabled::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
select.input:disabled { -webkit-appearance: none; appearance: none; background-image: none; }
.switch input:disabled, .switch input:disabled ~ * { cursor: default; }
.switch-state { font-weight: 600; }
.sfield > label.switch { display: inline-flex; margin: 0; font-size: 1rem; font-weight: 400; }
.field label.switch { display: inline-flex; margin: 0; }
.sfield > label.check { display: inline-flex; margin: 0; font-size: 1rem; font-weight: 400; }
.image-setting .actions { margin-top: .75rem; }
.image-setting .hint { margin: .5rem 0 0; }
.setting-image { display: block; max-width: 240px; max-height: 120px; width: auto; border: 1px solid var(--c-border, #ddd); border-radius: var(--radius, 6px); background: var(--c-surface, #fff); padding: 6px; }
.save-bar {
  position: sticky; bottom: 0; z-index: 15; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem;
  margin: 1rem -16px 0; padding: .75rem 16px calc(.75rem + env(safe-area-inset-bottom, 0px));
  background: var(--c-surface, #fff); border-top: 2px solid var(--c-primary, #222); box-shadow: 0 -6px 18px rgba(0,0,0,.06);
}
.save-bar .actions { flex: 1 1 auto; justify-content: flex-end; }
.save-bar .actions .btn { flex: 1 1 auto; }
.save-count { font-weight: 650; }

/* ---------------------------------------------------------------- accounts */
.btn-danger { background: transparent; color: var(--c-destructive, #c00); border-color: var(--c-destructive, #c00); }
.btn-danger:hover:not([disabled]) { background: var(--c-surface, #fff); text-decoration: underline; }
.small { font-size: .8125rem; }
h3 { font-size: 1rem; font-weight: 650; margin: 0 0 .75rem; }
legend { padding: 0; }
.accounts-layout { display: block; }
.accounts-tree .panel-body { padding: .5rem; }
.tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul ul { margin-left: 1rem; padding-left: .5rem; border-left: 1px solid var(--c-border, #ddd); }
.tree a { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; min-height: 44px; padding: .375rem .75rem; border-radius: calc(var(--radius, 6px) - 2px); text-decoration: none; color: var(--c-text, #111); }
.tree a:hover { background: var(--c-muted-panel, #f4f4f5); }
.tree a[aria-current="page"] { background: var(--c-primary, #222); color: var(--c-primary-contrast, #fff); }
.tree a[aria-current="page"] .tree-type { color: inherit; opacity: .8; }
.tree-name { font-weight: 600; }
.tree-type { font-size: .75rem; color: var(--c-muted-text, #666); }
.is-off > a .tree-name, .person.is-off .person-name strong { opacity: .6; }
.panel-head-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.panel-head-row h2 { margin-right: auto; }
.chip-on-dark { background: transparent; color: var(--c-primary-contrast, #fff); border-color: currentColor; }
.form-grid-2 { display: grid; grid-template-columns: 1fr; gap: 0 1.25rem; }
.subform { margin: 1rem 0 0; padding: 1rem 0 0; border-top: 1px solid var(--c-border, #ddd); }
.add-row { margin: 1rem 0 0; }
.people { list-style: none; margin: 1rem 0 0; padding: 0; }
.person { display: flex; flex-wrap: wrap; gap: .75rem 1rem; padding: 1rem 0; border-top: 1px solid var(--c-border, #ddd); }
.person:first-child { border-top: 0; }
.person-main { flex: 1 1 260px; min-width: 0; }
.person-main p { margin: 0 0 .25rem; overflow-wrap: anywhere; }
.person-name { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.chips { display: inline-flex; flex-wrap: wrap; gap: .25rem; }
#cd-ask-chosen .chips { list-style: none; margin: 0; padding: 0; gap: .5rem; }
#cd-ask-chosen .chip .linkbtn { margin-left: .5rem; }
.person-actions { align-items: flex-start; }
.checks > .hint, .checks > .field-error { grid-column: 1 / -1; }

/* ---------------------------------------------------------------- administration, timeout warning, strapline */
.auth-strapline { margin: -12px 0 20px; color: var(--c-muted-text, #666); font-size: .875rem; }
.admin-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 16px; }
.admin-card { display: flex; flex-direction: column; gap: .5rem; min-height: 44px; padding: 1rem 1.125rem; border: 1px solid var(--c-border, #ddd);
  border-radius: var(--radius, 6px); background: var(--c-surface, #fff); color: var(--c-text, #111); text-decoration: none; height: 100%; }
.admin-card:hover { border-color: var(--c-primary, #222); }
.admin-card:focus-visible { outline: 2px solid var(--c-focus, #2b7fff); outline-offset: 2px; }
.admin-card-head { display: flex; align-items: center; gap: .625rem; }
.admin-card-head .icon { width: 22px; height: 22px; flex: 0 0 22px; color: var(--c-primary, #222); }
.admin-card-title { font-weight: 650; font-size: 1.0625rem; }
.admin-card-hint { color: var(--c-muted-text, #666); font-size: .875rem; }
.session-warning { position: fixed; left: 0; right: 0; top: 0; z-index: 60; display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: .75rem 1rem; padding: .75rem 16px; background: var(--c-notice-bg, #fff6e5); border-bottom: 1px solid var(--c-border, #ddd);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.session-warning[hidden] { display: none; }
.session-warning p { margin: 0; }

/* ---------------------------------------------------------------- pick lists */
.group-list a .list-count { margin-left: auto; padding-left: .5rem; white-space: nowrap; font-size: .75rem; color: var(--c-muted-text, #666); font-weight: 400; }
.group-list a[aria-current="page"] .list-count { color: inherit; opacity: .8; }
.list-meta { margin: 0 0 .75rem; }
.list-items { list-style: none; margin: 0; padding: 0; }
.list-row { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "move name" "move on"; gap: .5rem .75rem;
  align-items: center; padding: .75rem 0; border-top: 1px solid var(--c-border, #ddd); }
.list-row:first-child { border-top: 0; }
.list-row.is-off .list-name .input { color: var(--c-muted-text, #666); }
.list-move { grid-area: move; display: flex; flex-direction: column; gap: .25rem; }
.list-name { grid-area: name; min-width: 0; }
.list-code { display: block; margin-top: .25rem; font-size: .75rem; color: var(--c-muted-text, #666); overflow-wrap: anywhere; }
.list-on { grid-area: on; }
.btn-icon { min-width: 44px; width: 44px; padding: 0; font-size: 1.125rem; line-height: 1; }

/* ---------------------------------------------------------------- 640px and up */
@media (min-width: 640px) {
  .list-row { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "move name on"; }
  .list-move { flex-direction: row; }
  .admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { font-size: 1.75rem; }
  .auth { justify-content: center; padding: 48px 24px; }
  .auth-body { padding: 32px 36px 36px; }
  .page { padding: 28px 24px 48px; }
  .facts { grid-template-columns: max-content 1fr; }
  .facts dd { margin: 0 0 .5rem; }
  .actions-sticky { position: static; margin: 1.25rem 0 0; padding: 0; border: 0; background: none; }
  .actions-sticky .btn { flex: 0 0 auto; }
  .settings-tools { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .save-bar { margin: 1rem -24px 0; padding-left: 24px; padding-right: 24px; }
  .save-bar .actions .btn { flex: 0 0 auto; }
  .form-grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .span-all { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------------- 1024px and up: menu in the bar */
@media (min-width: 1024px) {
  .admin-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .settings-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
  .settings-aside { position: sticky; top: calc(var(--shell-h, 68px) + 20px); margin: 0; }
  .group-select { display: none; }
  .group-list { display: flex; flex-direction: column; gap: 2px; background: var(--c-surface, #fff); border: 1px solid var(--c-border, #ddd); border-radius: var(--radius, 6px); padding: 6px; }
  .group-list a { display: flex; align-items: center; min-height: 44px; padding: 0 .75rem; border-radius: calc(var(--radius, 6px) - 2px); text-decoration: none; color: var(--c-text, #111); font-weight: 600; font-size: .9375rem; }
  .group-list a:hover { background: var(--c-muted-panel, #f4f4f5); }
  .group-list a[aria-current="page"] { background: var(--c-primary, #222); color: var(--c-primary-contrast, #fff); }
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sfield-wide { grid-column: 1 / -1; }
  .checks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .accounts-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 24px; align-items: start; }
  .accounts-tree { position: sticky; top: calc(var(--shell-h, 68px) + 20px); }
}

@media (min-width: 1280px) {
  .page { padding-top: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------- wording */
.wording-rows { list-style: none; margin: 0; padding: 0; }
.wording-row { padding: .875rem 0; border-top: 1px solid var(--c-border, #ddd); min-width: 0; }
.wording-row:first-child { border-top: 0; padding-top: 0; }
.wording-row .sfield-label { overflow-wrap: anywhere; }
.wording-row textarea.input { display: block; width: 100%; min-height: 44px; resize: vertical; font: inherit; line-height: 1.4; }
.wording-row.is-changed textarea.input { border-color: var(--c-primary, #222); }
.wording-row.is-reset textarea.input { opacity: .55; }
.wording-row.has-error textarea.input { border-color: var(--c-destructive, #c00); }
.wording-hints .hint { margin: .375rem 0 0; font-size: .8125rem; overflow-wrap: anywhere; }
.wording-row .field-error { margin: .375rem 0 0; }
@media (min-width: 1024px) {
  .wording-tools { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------------------------------------------------------------- forms */
.panel-head h3 { margin: 0; color: inherit; font-size: 1rem; }
.form-section-texts .field { margin-bottom: .5rem; }
.form-row { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "move main" "move side"; align-items: start; }
.form-row .list-move { grid-area: move; }
.form-row-main { grid-area: main; min-width: 0; }
.form-row-side { grid-area: side; min-width: 0; }
.form-row .field { margin-bottom: .5rem; }
.form-row .field .hint { margin: .25rem 0 0; font-size: .8125rem; }
.form-row.is-off .form-row-main .input { color: var(--c-muted-text, #666); }
.form-help { margin: 0 0 .5rem; }
.form-help > summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-size: .875rem; font-weight: 600; color: var(--c-primary, #222); }
.form-help > summary:focus-visible { outline: 2px solid var(--c-focus, #2b7fff); outline-offset: 2px; }
.form-help .field > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.form-notes .hint { margin: .25rem 0 0; font-size: .8125rem; }
.form-row-side .setting-meta { margin-top: .25rem; }
.form-head .setting-meta { margin-top: 0; }
@media (min-width: 768px) {
  .form-row { grid-template-columns: auto minmax(0, 1fr) minmax(220px, 280px); grid-template-areas: "move main side"; }
  .form-row .list-move { flex-direction: column; }
}

/* ---------------------------------------------------------------- roles */
.roles-new { width: 100%; margin-top: .5rem; }
.roles-new[aria-current="page"] { border-color: var(--c-primary, #222); }
.group-list a.is-off > span:first-child { color: var(--c-muted-text, #666); }
.roles-levels { margin: 0 0 .25rem; }
.roles-levels legend, .roles-group legend { padding: 0; margin: 0 0 .25rem; }
.roles-rights-head { margin: 1.25rem 0 .5rem; font-size: 1rem; }
.roles-group { border: 0; border-top: 1px solid var(--c-border, #ddd); margin: 0; padding: .75rem 0 .5rem; min-width: 0; }
.roles-right { display: flex; align-items: flex-start; padding: .375rem 0; }
.roles-right-hints { display: flex; flex-direction: column; }
.roles-right input { margin-top: .125rem; flex: 0 0 auto; }
.roles-right > span { display: flex; flex-direction: column; min-width: 0; }
.roles-right-name { font-weight: 600; }
.roles-right-hint { margin: .125rem 0 0; font-size: .8125rem; overflow-wrap: anywhere; }
.roles-right-hint.is-problem { color: var(--c-destructive, #c00); }
.roles-all { display: flex; font-size: .875rem; color: var(--c-primary, #222); }
.roles-new { display: none; }
@media (min-width: 768px) {
  .roles-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.5rem; }
  .roles-group legend { grid-column: 1 / -1; }
  .roles-group .roles-all { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
  .roles-new { display: flex; }
}

/* ---------------------------------------------------------------- audit trail */
.audit-list { list-style: none; margin: 0; padding: 0; background: var(--c-surface, #fff); border: 1px solid var(--c-border, #ddd); border-radius: var(--radius, 6px); }
.audit-entry { padding: .875rem 1rem; border-top: 1px solid var(--c-border, #ddd); min-width: 0; }
.audit-entry:first-child { border-top: 0; }
.audit-entry:focus { outline: 2px solid var(--c-focus, #2b7fff); outline-offset: -2px; }
.audit-head { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .625rem; font-size: .875rem; }
.audit-head time { color: var(--c-muted-text, #666); }
.audit-what { font-weight: 600; }
.chip.audit-added { background: var(--c-selected-bg, #eef); color: var(--c-primary, #000); border-color: transparent; }
.chip.audit-removed { background: var(--c-notice-bg, #fff6e5); color: var(--c-text, #111); }
.audit-record { margin: .375rem 0 .125rem; font-weight: 650; overflow-wrap: anywhere; }
.audit-meta { margin: 0; font-size: .8125rem; }
.audit-details { margin: .375rem 0 0; }
.audit-details > summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; font-size: .875rem; font-weight: 600; color: var(--c-primary, #222); }
.audit-details > summary:focus-visible { outline: 2px solid var(--c-focus, #2b7fff); outline-offset: 2px; }
.audit-table-wrap { overflow-x: auto; }
.audit-changes { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.audit-changes th, .audit-changes td { text-align: left; vertical-align: top; padding: .375rem .5rem; border-top: 1px solid var(--c-border, #ddd); overflow-wrap: anywhere; }
.audit-changes thead th { border-top: 0; color: var(--c-muted-text, #666); font-weight: 600; }
.audit-changes tbody th { font-weight: 600; width: 34%; }
.audit-more { margin-top: 1rem; }

/* ---------------------------------------------------------------- connections, theme presets */
.conn { padding: 1rem 0 0; margin: 1rem 0 0; border-top: 1px solid var(--c-border, #ddd); }
.panel-body > .conn:first-child, .panel-body > .muted + .conn { margin-top: .5rem; }
.conn-head { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; margin: 0 0 .25rem; }
.conn-head h3 { margin: 0; }
.conn .field { margin-bottom: .75rem; }
.conn-fields { margin: .25rem 0 0; }
.conn-secret { margin: 1.25rem 0 0; }
.conn-secret-head { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; margin: 0 0 .375rem; }
.conn-secret-head label { font-weight: 650; font-size: .875rem; }
.conn-secret-row { display: grid; grid-template-columns: 1fr; gap: .5rem; }
.conn-secret-actions { margin: 0; flex-wrap: wrap; }
.conn-none { margin: 0; font-weight: 600; }
.conn-planned { margin: .75rem 0 0; }
.theme-box { margin: 0 0 1.25rem; padding: 0 0 1.25rem; border-bottom: 1px solid var(--c-border, #ddd); }
.theme-row { display: grid; grid-template-columns: 1fr; gap: .5rem; }
.theme-box .hint { margin: .5rem 0 0; font-size: .8125rem; }
@media (min-width: 640px) {
  .conn-secret-row { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .theme-row { grid-template-columns: minmax(0, 20rem) auto; justify-content: start; }
}
@media (min-width: 1024px) {
  .conn-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .conn-fields .conn-wide { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------------- loads (Phase 2) */
.page-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1.5rem; }
.page-head-row .muted { margin-bottom: 0; }
.loads-start { width: 100%; }
.loads-start .btn { flex: 1 1 auto; }
.loads-tools { display: grid; grid-template-columns: 1fr; gap: 0 1rem; }
.load-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.load-card { background: var(--c-surface, #fff); border: 1px solid var(--c-border, #ddd); border-radius: var(--radius, 6px); padding: .5rem 1rem .875rem; min-width: 0; }
.load-card p { margin: .25rem 0 0; overflow-wrap: anywhere; }
.load-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem .5rem; }
.load-number { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; font-size: 1.0625rem; }
.load-lane { font-weight: 600; }
.table-wrap { display: none; }
.loads-table { width: 100%; border-collapse: collapse; background: var(--c-surface, #fff); }
.loads-table th, .loads-table td { text-align: left; padding: .5rem .75rem; border-top: 1px solid var(--c-border, #ddd); vertical-align: middle; }
.loads-table thead th { border-top: 0; background: var(--c-primary, #222); color: var(--c-primary-contrast, #fff); font-size: .8125rem; font-weight: 650; }
.loads-table tbody th a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.loads-table td:nth-child(4), .loads-table td:nth-child(5) { white-space: nowrap; }
.loads-more { margin-top: 1rem; }
.empty-note { padding: 1rem 0; }
.load-title { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin: 0 0 .5rem; }
.load-title h1 { margin: 0; }
.load-next { margin: 0 0 1.25rem; }
.load-layout { display: block; min-width: 0; }
/* one column (phones, tablets): the shipment status comes first (0048); two columns keep it at the top of the side */
@media (max-width: 1023.98px) {
  .load-layout { display: flex; flex-direction: column; }
  .load-layout > .load-main, .load-layout > .load-side { display: contents; }
  .load-layout #load-timeline { order: -1; }
}
.view-row { padding: .75rem 0 0; margin: .75rem 0 0; border-top: 1px solid var(--c-border, #ddd); }
.view-row:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.doc-list, .history-list { list-style: none; margin: 0; padding: 0; }
.doc-list li, .history-list li { display: flex; flex-direction: column; gap: .125rem; padding: .5rem 0; border-top: 1px solid var(--c-border, #ddd); min-width: 0; }
.doc-list li:first-child, .history-list li:first-child { border-top: 0; padding-top: 0; }
.history-list li { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; }
.doc-name { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; overflow-wrap: anywhere; }
.repeat-row { padding: 1rem 0 0; margin: 1rem 0 0; border-top: 1px solid var(--c-border, #ddd); }
.panel-body > .repeat-row:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.repeat-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin: 0 0 .75rem; }
.repeat-head h3 { margin: 0; }
.load-form .panel-body > .field-error { margin: 0 0 .75rem; }
.load-form .sfield.has-error .input, .load-form .sfield.has-error .checks { border-color: var(--c-destructive, #c00); }
.file-field .hint { margin: .5rem 0 0; overflow-wrap: anywhere; }
.load-form-actions { margin: 1rem -16px 0; padding: .75rem 16px calc(.75rem + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -6px 18px rgba(0, 0, 0, .06); }
@media (min-width: 640px) {
  .loads-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .loads-start { width: auto; }
  .loads-start .btn { flex: 0 0 auto; }
  .load-form-actions { position: sticky; bottom: 0; margin: 1rem -24px 0; padding: .75rem 24px; background: var(--c-surface, #fff); border-top: 1px solid var(--c-border, #ddd); }
  .load-form-actions .btn { flex: 0 0 auto; }
}
@media (min-width: 1024px) {
  .loads-tools { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
  .load-cards { display: none; }
  .load-cards.carrier-list { display: grid; }   /* carriers have no table view: the cards stay at every width */
  .table-wrap { display: block; overflow-x: auto; border: 1px solid var(--c-border, #ddd); border-radius: var(--radius, 6px); }
  .load-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
  .load-side.fits { position: sticky; top: calc(var(--shell-h, 68px) + 20px); }   /* 0102: only when it fits the window (fitSides) */
}

/* ---------------------------------------------------------------- load desk (Phase 3) */
.queue-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 24px; align-items: start; }
.queue-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem .75rem; }
.queue-head .chip { background: var(--c-surface, #fff); color: var(--c-primary, #000); border-color: transparent; flex: 0 0 auto; }
.queue-head { flex-wrap: nowrap; }
.queue-head h2 { min-width: 0; }
.status-chip, .nowrap { white-space: nowrap; }
.loads-table th.num { text-align: right; }
.queue-section.is-empty .panel-body { padding-top: .625rem; padding-bottom: .625rem; }
.queue-list { list-style: none; margin: 0; padding: 0; }
.queue-item { padding: .5rem 0; border-top: 1px solid var(--c-border, #ddd); min-width: 0; }
.queue-item:first-child { border-top: 0; padding-top: 0; }
.queue-item p { margin: .125rem 0 0; overflow-wrap: anywhere; }
.queue-item-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 .75rem; }
.queue-more { margin: .5rem 0 0; }
.panel-status:empty { display: none; }
.panel-status .notice { margin: 0 0 1rem; }
.desk-moves { margin: 0 0 .25rem; }
.move-wrap { display: inline-flex; flex-direction: column; align-items: flex-start; gap: .25rem; max-width: 100%; }
.move-wrap .hint { margin: 0; }
.desk-tools { margin: 1rem 0 0; padding: 1rem 0 0; border-top: 1px solid var(--c-border, #ddd); }
.desk-panel .muted { margin: 0; }
.charge-list { display: grid; gap: .75rem; margin: 1rem 0 0; }
.charge-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .5rem .75rem; padding: .75rem; border: 1px solid var(--c-border, #ddd); border-radius: var(--radius, 6px); min-width: 0; }
.charge-row-head { display: none; }
.charge-row.is-system { background: var(--c-muted-panel, #f4f4f5); }
.charge-system-chip { display: inline-block; margin-top: 2px; white-space: nowrap; }
.charge-cell { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.charge-cell:nth-child(1), .charge-cell:nth-child(2) { grid-column: 1 / -1; }
.charge-label { margin: 0 0 .25rem; font-weight: 650; font-size: .8125rem; color: var(--c-muted-text, #666); }
.charge-cell .field-error { margin: .25rem 0 0; }
.charge-cell.has-error .input { border-color: var(--c-destructive, #c00); }
.charge-tag { display: flex; align-items: center; justify-content: flex-end; grid-column: 2; }
.charge-remove { min-width: 44px; padding: .5rem; font-size: 1.25rem; line-height: 1; }
.input.num, .num { text-align: right; font-variant-numeric: tabular-nums; }
.charge-cell.num { align-items: stretch; }
.charge-actions { margin: 1rem 0 0; align-items: center; }
.charge-dirty { background: var(--c-notice-bg, #fff6e5); color: var(--c-text, #111); }
.charge-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem .75rem; margin: 1rem 0 0; padding: .75rem; border-radius: var(--radius, 6px); background: var(--c-muted-panel, #f4f4f5); }
.charge-totals div { min-width: 0; }
.charge-totals dt { font-size: .8125rem; color: var(--c-muted-text, #666); }
.charge-totals dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.approval { margin: 1rem 0 0; padding: 1rem 0 0; border-top: 1px solid var(--c-border, #ddd); }
.approval-state { margin: 0 0 .75rem; }
.approval .field { margin: 0 0 .75rem; }
.revisions { margin: 1rem 0 0; padding: 1rem 0 0; border-top: 1px solid var(--c-border, #ddd); }
.revisions h3 { margin: 0 0 .5rem; font-size: .9375rem; }
.revision-list { list-style: none; margin: 0; padding: 0; }
.revision-list li { display: flex; flex-direction: column; gap: .125rem; padding: .5rem 0; border-top: 1px solid var(--c-border, #ddd); min-width: 0; }
.revision-list li:first-child { border-top: 0; padding-top: 0; }
.revision-line { font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.revision-reason, .history-reason { overflow-wrap: anywhere; }
.history-reason { flex-basis: 100%; }
.note-list { list-style: none; margin: 0; padding: 0; }
.contact-list { list-style: none; margin: 0 0 .75rem; padding: 0; }   /* 0088 */
.contact-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; padding: .5rem 0; border-top: 1px solid var(--c-border, #ddd); min-width: 0; }
.contact-list li:first-child { border-top: 0; padding-top: 0; }
.contact-email { font-weight: 600; overflow-wrap: anywhere; }
.te-picks { border: 0; margin: 0 0 1rem; padding: 0; min-width: 0; }   /* 0090 */
.te-picks legend { font-weight: 600; margin-bottom: .5rem; padding: 0; }
.te-picks .check { display: flex; align-items: flex-start; gap: .5rem; padding: .375rem 0; min-height: 44px; }
.te-picks .check input { margin-top: .25rem; flex: none; }
#te-actions .hint + .actions { margin-top: .75rem; }
#te-actions .actions + .actions { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--c-border, #ddd); }   /* the two choices kept apart */
#te-actions .actions .btn { flex: 1 1 100%; justify-content: center; text-align: center; }
.note { padding: .75rem 0; border-top: 1px solid var(--c-border, #ddd); min-width: 0; }
.note:first-child { border-top: 0; padding-top: 0; }
.note-body { margin: .375rem 0 .25rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.note .muted.small { margin: 0; }
.note-actions { margin: .5rem 0 0; }
.note-form .field { margin: 0 0 .75rem; }
.note-form h3 { margin: 0 0 .75rem; font-size: .9375rem; }
.note-form textarea.input, #desk-reason textarea.input { min-height: 5rem; resize: vertical; }
@media (min-width: 768px) {
  .charge-list { gap: 0; border: 1px solid var(--c-border, #ddd); border-radius: var(--radius, 6px); overflow: hidden; }
  .charge-row { grid-template-columns: minmax(8rem, 1.2fr) minmax(8rem, 2fr) minmax(6.5rem, 1fr) minmax(6.5rem, 1fr) minmax(6rem, .9fr) 44px; align-items: start; gap: .5rem; padding: .5rem .75rem; border: 0; border-top: 1px solid var(--c-border, #ddd); border-radius: 0; }
  .charge-row-head { display: grid; border-top: 0; background: var(--c-primary, #222); color: var(--c-primary-contrast, #fff); font-size: .8125rem; font-weight: 650; padding-top: .5rem; padding-bottom: .5rem; }
  .charge-row-head + .charge-row { border-top: 0; }
  .charge-cell:nth-child(1), .charge-cell:nth-child(2) { grid-column: auto; }
  .charge-label { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .charge-cell.num > span { display: flex; align-items: center; justify-content: flex-end; min-height: 44px; }
  .charge-cell > span { min-height: 44px; display: flex; align-items: center; }
  .charge-tag { grid-column: auto; min-height: 44px; }
  .charge-totals { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .queue-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- carriers (0039 / 0040) */
.notice-warning { background: var(--c-notice-bg, #fff6e5); border-color: var(--c-border, #ddd); font-weight: 600; }
.text-danger { color: var(--c-destructive, #c00); font-weight: 600; }
.error-list { margin: .5rem 0 0; padding-left: 1.25rem; }
.error-list li { margin: .25rem 0; overflow-wrap: anywhere; }
.map-rows { display: grid; gap: .75rem; margin: .75rem 0 1rem; }
.map-row { display: grid; grid-template-columns: 1fr; gap: .375rem; padding-bottom: .75rem; border-bottom: 1px solid var(--c-border, #ddd); }
.map-label { font-weight: 650; font-size: .875rem; }
.record-section + .record-section { margin-top: 1.25rem; }
.quote-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .75rem; }
.quote-row { background: var(--c-surface, #fff); border: 1px solid var(--c-border, #ddd); border-radius: var(--radius, 6px); padding: .625rem 1rem .875rem; min-width: 0; }
.quote-row p { margin: .25rem 0 0; overflow-wrap: anywhere; }
.quote-selected { border-color: var(--c-accent, #333); box-shadow: inset 4px 0 0 var(--c-accent, #333); }
.quote-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem .5rem; min-height: 44px; }
.quote-amount { font-size: 1.25rem; font-weight: 700; margin: .25rem 0 0; }
.quote-actions { margin-top: .5rem; }
.pick-list { list-style: none; margin: .5rem 0; padding: 0; display: grid; gap: .5rem; }
.pick-list .pick { width: 100%; justify-content: flex-start; text-align: left; flex-wrap: wrap; height: auto; min-height: 44px; }
.award-block { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--c-border, #ddd); }
/* 0070 / 0074: the carrier's terms and its rate changes, below the award buttons; the terms on CONFIRM LOAD */
.award-block > .carrier-terms, .award-block > .rate-changes { margin-top: 1.5rem; }
.carrier-terms h3, .rate-changes h3 { margin: 0 0 .5rem; }
.carrier-card .carrier-terms { margin: 1.25rem 0; }
.carrier-card .carrier-terms h2 { font-size: 1.125rem; margin: 0 0 .375rem; }
.carrier-card { max-width: 40rem; }
.carrier-card .facts { margin: 1rem 0; }
@media (min-width: 768px) {
  .map-row { grid-template-columns: minmax(10rem, 1fr) 2fr 1fr; align-items: center; }
}

/* the quote board (0045) */
.board-sub { font-size: 1rem; margin: 1rem 0 .5rem; }
.board-cards { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: 1fr; gap: .75rem; }
.board-card { background: var(--c-surface, #fff); border: 1px solid var(--c-border, #ddd); border-radius: var(--radius, 6px); padding: .75rem 1rem; min-width: 0; }
.board-card.is-selected { border: 2px solid var(--c-secondary, #24ab3a); background: var(--c-selected-bg, #e9f7ec); }
.board-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem .5rem; }
.board-card-head h4 { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.board-card p { margin: .25rem 0 0; overflow-wrap: anywhere; }
.board-amount { font-size: 1.25rem; font-weight: 700; }
.board-checks { list-style: none; margin: .5rem 0 0; padding: 0; font-size: .875rem; }
.board-checks li { padding: .125rem 0; overflow-wrap: anywhere; }
.board-checks li.is-failing { color: var(--c-destructive, #c00); font-weight: 600; }
.board-total { font-size: 1.375rem; font-weight: 700; }
.board-answer { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--c-border, #ddd); }
.board-ask { font-weight: 600; }
/* 0110: the note under a carrier's quote or the price, the standard wording, the customer's note */
.board-note { margin: .5rem 0; padding: .375rem .625rem; border-left: 3px solid var(--c-secondary, #24ab3a); background: var(--c-selected-bg, #e9f7ec); overflow-wrap: anywhere; white-space: pre-line; }
.board-note p { margin: 0; }
.board-wording, .board-answer-note, .quote-cnote { overflow-wrap: anywhere; white-space: pre-line; }
@media (min-width: 768px) {
  .board-cards { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
  .board-sum { grid-template-columns: max-content 1fr; align-items: baseline; }
}

/* invoices (0047) */
.invoice-lines { width: 100%; border-collapse: collapse; margin: .5rem 0 1rem; }
.invoice-lines th, .invoice-lines td { text-align: left; padding: .5rem .5rem; border-bottom: 1px solid var(--c-border, #ddd); vertical-align: top; overflow-wrap: anywhere; }
.invoice-lines thead th { font-size: .8125rem; color: var(--c-muted-text, #666); }
.invoice-lines .num, .loads-table .num { text-align: right; white-space: nowrap; }
.invoice-lines tfoot th, .invoice-lines tfoot td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }
.invoice-facts dd { white-space: pre-line; }
.invoice-basis { display: block; margin-top: .125rem; }
/* shipment status (0048) */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-step { position: relative; display: flex; gap: .75rem; padding: 0 0 .875rem; min-height: 44px; }
.timeline-step:last-child { padding-bottom: 0; }
.timeline-step::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--c-border, #ddd); }
.timeline-step:last-child::before { display: none; }
.timeline-dot { flex: 0 0 16px; width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--c-border, #bbb); background: var(--c-surface, #fff); position: relative; z-index: 1; }
.timeline-step.is-done .timeline-dot { background: var(--c-secondary, #0f766e); border-color: var(--c-secondary, #0f766e); }
.timeline-step.is-done::before { background: var(--c-secondary, #0f766e); }
.timeline-step.is-current .timeline-dot { background: var(--c-accent, #2563eb); border-color: var(--c-accent, #2563eb); box-shadow: 0 0 0 4px var(--c-selected-bg, #eff6ff); }
.timeline-text { display: flex; flex-direction: column; gap: .125rem; min-width: 0; }
.timeline-label { font-weight: 600; }
.timeline-step.is-upcoming .timeline-label, .timeline-step.is-none .timeline-label, .timeline-step.is-skipped .timeline-label { color: var(--c-muted-text, #666); font-weight: 500; }
.history-update { overflow-wrap: anywhere; }
.shipments-tools { align-items: flex-end; }
.shipments-fresh { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.shipments-fresh p { margin: 0; }
.cell-note { display: block; margin-top: .125rem; }
.shipment-update, .shipment-update-cell { overflow-wrap: anywhere; }
.shipment-update-cell { max-width: 22rem; }
/* reports (0049) */
.report-fields { display: grid; grid-template-columns: 1fr; gap: 0 1rem; }
@media (min-width: 768px) { .report-fields { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); } .report-fields .report-pick { grid-column: 1 / -1; } }
@media (min-width: 1024px) { .report-fields { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr); } .report-fields .report-pick { grid-column: auto; } }
.report-head h2 { margin: 0 0 .25rem; font-size: 1.25rem; }
.report-head h2:focus { outline: none; }
/* 0137: vendors */
.charge-vendor { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .375rem; }
.charge-vendor .input { width: auto; max-width: 100%; }
.charge-vendor-note { display: block; }
.bill-vendors { margin: 0 0 .75rem; padding-left: 1.25rem; }
.vendor-list { list-style: none; margin: 0; padding: 0; }
.vendor-item { border-bottom: 1px solid var(--c-border, #eee); padding: .5rem 0; }
/* 0136: custom reports */
.report-custom { margin: .5rem 0 1rem; border: 1px solid var(--c-border, #ddd); border-radius: var(--radius, 6px); padding: .25rem .75rem .75rem; background: var(--c-surface, #fff); }
.report-custom > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
.report-custom h3 { font-size: 1rem; margin: 1rem 0 .25rem; }
.report-cols { list-style: none; margin: 0; padding: 0; }
.report-col { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; border-bottom: 1px solid var(--c-border, #eee); padding: .25rem 0; }
.report-col > label { flex: 1 1 12rem; }
.report-col .input { width: auto; }
.report-col-moves { display: inline-flex; gap: .25rem; }
.report-filter { display: grid; grid-template-columns: 1fr; gap: 0 .75rem; align-items: end; border-bottom: 1px solid var(--c-border, #eee); padding-bottom: .5rem; margin-bottom: .5rem; }
@media (min-width: 768px) { .report-filter { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.5fr) auto; } }
.report-save { margin-top: 1rem; border-top: 1px solid var(--c-border, #eee); padding-top: .5rem; }
.report-wrap { overflow-x: auto; border: 1px solid var(--c-border, #ddd); border-radius: var(--radius, 6px); background: var(--c-surface, #fff); margin: .75rem 0; }
.report-wrap:focus-visible { outline: 3px solid var(--c-focus-ring, #2563eb); outline-offset: 2px; }
.report-table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.report-table th, .report-table td { padding: .625rem .75rem; text-align: left; border-bottom: 1px solid var(--c-border, #ddd); vertical-align: top; white-space: nowrap; }
.report-table thead th { background: var(--c-primary, #1e293b); color: var(--c-primary-contrast, #fff); font-size: .8125rem; font-weight: 600; position: sticky; top: 0; }
.report-table tbody tr:nth-child(even) { background: var(--c-muted-panel, #f8fafc); }
.report-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.report-table tfoot th, .report-table tfoot td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--c-border, #ccc); }
.report-table tbody th a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.report-table tbody th, .report-table tbody td:not(.num) { white-space: normal; min-width: 7rem; max-width: 16rem; overflow-wrap: anywhere; }
#report-range-hint { margin: .25rem 0 .75rem; }
/* admin tooling (0050) */
.profile-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--c-border, #ddd); }
.profile-line .facts { margin: 0; }
.access-elsewhere { border: 0; padding: 0; margin: .5rem 0 0; min-width: 0; }
.access-list { list-style: none; margin: .25rem 0 .75rem; padding: 0; }
.access-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .375rem 0; border-top: 1px solid var(--c-border, #ddd); }
.access-list li:first-child { border-top: 0; }
.access-list li > span { overflow-wrap: anywhere; min-width: 0; }
.access-add { display: grid; grid-template-columns: 1fr; gap: 0 1rem; align-items: end; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--c-border, #ddd); }
@media (min-width: 768px) { .access-add { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; } .access-add .field-error { grid-column: 1 / -1; } }

/* ---------------------------------------------------------------- the top bar (0052)
   One row: logo, the menu (its groups open as menus), then help and the account menu. The current page is
   marked by a bar in the brand's second colour along the bottom edge, joining the strip under the bar. Below
   1024px the menu folds into a panel under the bar and its groups open in place. */
:root { --shell-h: 68px; --page-max: 1280px; }
.topbar { position: sticky; top: 0; z-index: 30; background: var(--c-surface, #fff); box-shadow: 0 1px 0 var(--c-border, #ddd); }
.topbar-in { max-width: var(--page-max); margin: 0 auto; padding: 0 16px; min-height: 64px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 0; text-decoration: none; color: var(--c-primary, #000); margin-right: auto; }
.brand-logo { display: block; width: auto; height: 48px; max-width: 160px; object-fit: contain; }
.brand-name { font-weight: 700; font-size: 1rem; }
.brand-logo + .brand-name { display: none; }
.brand-strip { height: 4px; background: linear-gradient(90deg, var(--c-header-from, #333), var(--c-header-to, #777)); }
.topbar-tools { display: flex; align-items: center; gap: 4px; order: 2; }
.nav { order: 3; flex-basis: 100%; padding: 4px 0 12px; }
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav-list > li { position: relative; }
.nav-link { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--radius, 6px);
  background: none; font: inherit; font-weight: 600; text-align: left; text-decoration: none; color: var(--c-text, #111); cursor: pointer; }
.nav-link:hover { background: var(--c-muted-panel, #f4f4f5); }
.nav-link[aria-current="page"], .nav-group.is-current > .menu-wrap > .nav-link { background: var(--c-selected-bg, #eef); color: var(--c-primary, #000); }
.nav-link .icon { color: var(--c-muted-text, #666); }
.nav-link[aria-current="page"] .icon, .nav-group.is-current .nav-link .icon { color: var(--c-primary, #000); }

.menu-toggle, .help-btn, .account-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 0 10px;
  border: 1px solid transparent; border-radius: var(--radius, 6px); background: none; font: inherit; font-weight: 600; color: var(--c-primary, #000); cursor: pointer; }
.menu-toggle:hover, .help-btn:hover, .account-btn:hover { background: var(--c-muted-panel, #f4f4f5); }
.help-btn[aria-expanded="true"] { background: var(--c-selected-bg, #eef); }
.help-btn .icon { width: 22px; height: 22px; }
.help-btn-text { display: none; }
.menu-toggle span { display: none; }
.account-btn { padding: 0 4px; }
.caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; opacity: .6; margin-left: 2px; }

.menu-wrap { position: relative; }
.menu { display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 240px; padding: 6px;
  background: var(--c-surface, #fff); border: 1px solid var(--c-border, #ddd); border-radius: var(--radius, 6px); box-shadow: 0 10px 28px rgba(0, 20, 40, .14); }
.menu-end { left: auto; right: 0; }
.menu-wrap.is-open > .menu { display: block; }
.menu-wrap.is-open > .menu-btn .caret { transform: rotate(180deg); }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: calc(var(--radius, 6px) - 2px);
  background: none; font: inherit; font-weight: 500; color: var(--c-text, #111); text-align: left; text-decoration: none; cursor: pointer; white-space: nowrap; }
.menu-item:hover, .menu-item:focus-visible { background: var(--c-muted-panel, #f4f4f5); }
.menu-item[aria-current="page"] { background: var(--c-selected-bg, #eef); font-weight: 650; }
.menu-item .icon { color: var(--c-muted-text, #666); }
.menu-item-all { margin-top: 4px; border-top: 1px solid var(--c-border, #ddd); border-radius: 0; color: var(--c-primary, #000); font-weight: 600; }
.menu-who { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--c-border, #ddd); font-size: .875rem; }
.menu-who span { color: var(--c-muted-text, #666); overflow-wrap: anywhere; }
.menu-who strong { font-size: 1rem; }

/* In the folded menu (phones and tablets) a group's items are listed under it. */
@media (max-width: 1023.98px) {
  .nav-group > .menu-wrap > .nav-link { cursor: default; pointer-events: none; color: var(--c-muted-text, #666); font-size: .8125rem; margin-top: 4px; }
  .nav-group > .menu-wrap > .nav-link .caret, .nav-group > .menu-wrap > .nav-link .icon { display: none; }
  .nav-group > .menu-wrap > .menu { display: block; position: static; box-shadow: none; border: 0; padding: 0; min-width: 0; }
  .nav-group.is-current > .menu-wrap > .nav-link { background: none; }
}

@media (min-width: 640px) {
  .topbar-in { padding: 0 24px; }
  .brand-logo + .brand-name { display: inline; padding-left: 12px; border-left: 1px solid var(--c-border, #ddd); color: var(--c-muted-text, #666); font-weight: 600; }
  .menu-toggle span { display: inline; }
}

@media (min-width: 1024px) {
  .topbar-in { flex-wrap: nowrap; min-height: 64px; gap: 4px; }
  .brand { margin-right: 20px; }
  .brand-logo + .brand-name { display: none; }
  .menu-toggle { display: none; }
  .nav, .nav[hidden] { display: block !important; order: 0; flex: 1 1 auto; min-width: 0; padding: 0; }
  .nav-list { display: flex; align-items: stretch; gap: 2px; }
  .nav-list > li { display: flex; }
  .nav-link { position: relative; width: auto; min-height: 64px; padding: 0 10px; border-radius: 0; font-size: .9375rem; white-space: nowrap; }
  .nav-link .icon { display: none; }
  .nav-link:hover { background: none; color: var(--c-primary, #000); }
  .nav-link[aria-current="page"], .nav-group.is-current > .menu-wrap > .nav-link { background: none; }
  .nav-link::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: transparent; }
  .nav-link:hover::after { background: var(--c-border, #ddd); }
  .nav-link[aria-current="page"]::after, .nav-group.is-current > .menu-wrap > .nav-link::after { background: var(--c-header-to, #777); }
  .nav-group { margin-left: auto; }
  .nav-group .menu { left: auto; right: 0; }
  .topbar-tools { order: 1; margin-left: 8px; padding-left: 8px; border-left: 1px solid var(--c-border, #ddd); }
}
@media (min-width: 1280px) {
  .nav-link { padding: 0 12px; }
  .nav-link .icon { display: block; width: 16px; height: 16px; }
  .nav-link::after { left: 12px; right: 12px; }
  .help-btn-text { display: inline; }
}

/* ---------------------------------------------------------------- help panel (0052) */
.help-panel { position: fixed; z-index: 50; inset: 0; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; padding: 16px 16px 32px;
  background: var(--c-surface, #fff); }
.help-panel:focus { outline: none; }
.help-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.help-head h2 { margin: 0; font-size: 1.25rem; }
.help-close { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: var(--radius, 6px); background: none; color: var(--c-text, #111); cursor: pointer; }
.help-close:hover { background: var(--c-muted-panel, #f4f4f5); }
.help-search { position: relative; }
.help-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--c-muted-text, #666); pointer-events: none; }
.help-search .input { width: 100%; padding-left: 40px; }
.help-group { margin: 12px 0 4px; font-size: .8125rem; font-weight: 650; color: var(--c-muted-text, #666); }
.help-topic { border-bottom: 1px solid var(--c-border, #ddd); }
.help-topic > summary { display: flex; align-items: center; min-height: 48px; padding: 6px 0; font-weight: 650; cursor: pointer; list-style: none; }
.help-topic > summary::-webkit-details-marker { display: none; }
.help-topic > summary::after { content: ''; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); opacity: .5; flex: 0 0 auto; }
.help-topic[open] > summary::after { transform: rotate(225deg); }
.help-body { padding: 0 0 14px; font-size: .9375rem; line-height: 1.55; }
.help-body p, .help-body ul, .help-body ol { margin: 0 0 .625rem; }
.help-body ul, .help-body ol { padding-left: 1.25rem; }
.help-body li { margin: 0 0 .25rem; }
.help-body h4 { margin: .75rem 0 .375rem; font-size: .9375rem; }
.help-foot { margin: 8px 0 0; font-size: .875rem; }
@media (min-width: 768px) {
  .help-panel { inset: var(--shell-h) 0 0 auto; width: 420px; border-left: 1px solid var(--c-border, #ddd); box-shadow: -12px 0 32px rgba(0, 20, 40, .08); padding: 20px 24px 40px; }
}

/* ---------------------------------------------------------------- home (0052) */
.home-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.home-head p { margin: 0; }
.home-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* The stages as one route line: a stop for each stage, the count above it. */
.home-pipeline { margin: 0 0 20px; }
.home-pipeline .panel-body { padding: 12px 16px 10px; }
.stage-scroll { overflow-x: auto; margin: 0 -16px; padding: 0 16px; scroll-snap-type: x proximity; }
.stage-line { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(100px, 1fr); position: relative; }
.stage { scroll-snap-align: start; }
.stage a { display: grid; grid-template-rows: auto 22px auto; justify-items: center; gap: 4px; padding: 6px 0 8px; border-radius: var(--radius, 6px);
  text-decoration: none; color: var(--c-text, #111); position: relative; }
.stage a:hover { background: var(--c-muted-panel, #f4f4f5); }
.stage-count { font-size: 1.875rem; font-weight: 750; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--c-primary, #000); }
.stage-dot { position: relative; width: 100%; display: flex; align-items: center; justify-content: center; }
.stage-dot::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 3px; margin-top: -1.5px; background: var(--c-header-to, #777); opacity: .45; }
.stage:first-child .stage-dot::before { left: 50%; }
.stage:last-child .stage-dot::before { right: 50%; }
.stage-dot::after { content: ''; position: relative; width: 14px; height: 14px; border-radius: 50%; background: var(--c-header-to, #777); box-shadow: 0 0 0 3px var(--c-surface, #fff); }
.stage-label { font-size: .8125rem; font-weight: 600; text-align: center; line-height: 1.25; color: var(--c-muted-text, #666); padding: 0 6px; }
.stage.is-empty .stage-count { color: var(--c-border, #ccc); }
.stage.is-empty .stage-dot::after { background: var(--c-surface, #fff); border: 2px solid var(--c-border, #ccc); }

.home-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.home-grid > .panel { margin: 0; min-width: 0; }
.home-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.home-col > .panel { margin: 0; }
.home-invoices { margin-top: 12px; }
.home-amount { font-weight: 650; white-space: nowrap; }
.home-late { color: var(--c-destructive, #c00); font-weight: 600; }
.home-empty { margin: 4px 0 0; }
.home-foot { margin: 10px 0 0; font-size: .875rem; }
.attention { list-style: none; margin: 0; padding: 0; }
.attention > li { border-top: 1px solid var(--c-border, #ddd); }
.attention > li:first-child { border-top: 0; }
.attention-link { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 6px 0; text-decoration: none; color: var(--c-text, #111); }
.attention-link:hover .attention-text { text-decoration: underline; }
.attention-count { min-width: 2.25rem; font-size: 1.5rem; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--c-primary, #000); text-align: right; }
.is-urgent .attention-count { color: var(--c-destructive, #c00); }
.attention-text { font-weight: 600; }
.attention-loads { list-style: none; margin: 0 0 10px; padding: 0 0 0 calc(2.25rem + 14px); font-size: .875rem; }
.attention-loads li { margin: 0 0 4px; }
.home-list { list-style: none; margin: 0; padding: 0; }
.home-list > li { padding: 10px 0; border-top: 1px solid var(--c-border, #ddd); }
.home-list > li:first-child { border-top: 0; padding-top: 2px; }
.home-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.home-num { font-weight: 650; display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
.load-number { min-width: 44px; }
.home-lane { margin: 2px 0 0; font-size: .875rem; color: var(--c-muted-text, #666); }
.home-update { margin: 6px 0 0; padding-left: 10px; border-left: 3px solid var(--c-header-to, #777); font-size: .9375rem; }
.home-when { margin: 4px 0 0; font-size: .8125rem; color: var(--c-muted-text, #666); }
.home-billing-main { margin: 0; font-size: 1.125rem; font-weight: 650; }
.home-billing-late { margin: 4px 0 0; font-weight: 650; color: var(--c-destructive, #c00); }
@media (min-width: 768px) {
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
}

/* 0067: second pass */
.group-list a { padding-top: 8px; padding-bottom: 8px; line-height: 1.3; }
.stage-line { grid-auto-columns: minmax(92px, 1fr); }   /* 10-25: wide enough that "Confirmed" and "Tendered" do not run together on a phone */
textarea.input { field-sizing: content; }
textarea.input:disabled { resize: none; }
.list-move.is-hidden { visibility: hidden; }
.switch input:disabled:checked + .switch-track { background: var(--c-muted-text, #888); }
.form-row-compact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(8.5rem, 12rem) auto; align-items: center; }
.form-row-compact select { width: 100%; min-width: 0; }
.form-row-compact > .chip { grid-column: 1 / -1; justify-self: start; }
.meta-part { display: inline-block; max-width: 100%; }
.loads-table .cell-note { display: block; white-space: nowrap; }
.shipments-fresh { margin-bottom: 1rem; }
.doc-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.doc-review { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.doc-review-form { flex-basis: 100%; }
/* ---------------------------------------------------------------- video lessons (0102) */
.lesson-list { list-style: none; margin: 0; padding: 0; }
.lesson-item + .lesson-item { border-top: 1px solid var(--c-border, #ddd); }
.lesson-link { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; color: inherit; text-decoration: none; min-height: 48px; }
.lesson-link:hover .lesson-title { text-decoration: underline; text-decoration-thickness: 2px; }
.lesson-play { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; background: var(--c-primary, #111); position: relative; margin-top: 2px; }
.lesson-play::after { content: ''; position: absolute; left: 14px; top: 11px; border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent var(--c-primary-contrast, #fff); }
.is-watched .lesson-play { background: var(--c-muted-text, #666); }
.lesson-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.lesson-title { font-weight: 650; color: var(--c-primary, #000); }
.lesson-summary { color: var(--c-muted-text, #666); font-size: .875rem; }
.lesson-meta { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: .875rem; color: var(--c-muted-text, #666); white-space: nowrap; }
.chip-ok { background: var(--c-success-bg, #e8f5ec); color: var(--c-success-text, #146c2e); }
.chip-updated { background: var(--c-notice-bg, #fff6e5); color: var(--c-text, #111); }   /* 0169: a lesson re-recorded since it was watched */
.chip-alert { background: var(--c-error-bg, #fdecec); color: var(--c-error-text, #a01818); margin-left: .25rem; }   /* 0124 */
.drafts-list { list-style: none; margin: 0; padding: 0; }   /* 0125 */
.draft-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .5rem 0; border-bottom: 1px solid var(--c-border, #e5e7eb); }
.draft-row:last-child { border-bottom: 0; }
.draft-row p { margin: .125rem 0 0; }
.holiday-hint { color: var(--c-notice-text, #7a4b00); font-weight: 600; }   /* 0127 */
.holiday-chip { font-weight: 600; }
.invoice-summary { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin: 0 0 1rem; font-weight: 600; }   /* 0128 */
.lesson-back { margin: 0 0 .5rem; }
.lesson-stage { background: #000; border-radius: var(--radius, 6px); overflow: hidden; margin: 0 0 1rem; }
.lesson-video { display: block; width: 100%; max-height: 78vh; background: #000; }
.lesson-video::cue { background: rgba(15, 23, 42, .85); color: #fff; font-size: 1.05rem; line-height: 1.35; }
.lesson-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 8px 12px; background: var(--c-surface, #fff); }
.lesson-tools label { font-size: .875rem; color: var(--c-muted-text, #666); }
.lesson-tools .input { width: auto; min-width: 90px; }
.lesson-next { font-weight: 650; }
.lesson-chapters, .lesson-transcript { margin: 0; padding: 0; list-style: none; }
.lesson-chapters li, .lesson-transcript li { padding: 6px 0; }
.lesson-transcript li.is-now { background: var(--c-notice-bg, #fff6e5); }
.lesson-seek { border: 0; background: none; padding: 0; font: inherit; color: var(--c-primary, #000); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; min-height: 24px; }
.lesson-time { font-variant-numeric: tabular-nums; }
.lesson-words-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.lesson-words-tools .input { flex: 1 1 220px; }
.help-lessons { list-style: none; margin: 0 0 8px; padding: 0; }
.help-lessons a { display: flex; flex-direction: column; padding: 8px 0; min-height: 44px; border-bottom: 1px solid var(--c-border, #ddd); text-decoration: none; }
.help-lesson-title { font-weight: 650; text-decoration: underline; text-underline-offset: 2px; }
.help-lesson-meta { font-size: .8125rem; color: var(--c-muted-text, #666); }
.carrier-lesson { margin: 1rem 0 0; font-size: .9375rem; }
.lesson-public { min-height: 100vh; padding: 16px; }
.lesson-public-main { max-width: 1100px; margin: 0 auto; }
.lesson-public-main .auth-logo { max-height: 56px; margin: 0 0 12px; }
/* 0131: the Search page */
.search-form { margin: 0 0 1rem; }
.search-form label { display: block; font-weight: 600; margin-bottom: .25rem; }
.search-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.search-row .input { flex: 1 1 240px; min-width: 0; }
/* 0129: notes and follow-ups on customer accounts */
.note-list { list-style: none; margin: 0; padding: 0; }
.note-list li { padding: .75rem 0; border-top: 1px solid var(--c-border, #ddd); min-width: 0; }
.note-list li:first-child { border-top: 0; padding-top: 0; }
.note-head { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; }
.note-text { margin: .25rem 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-list .actions { margin-top: .25rem; }
@media print {
  .lesson-stage, .lesson-tools, .lesson-words-tools, .lesson-next, .lesson-back, .lesson-chapters, .topbar, .help-panel { display: none !important; }
  .lesson-transcript li { padding: 2px 0; break-inside: avoid; }
  .lesson-seek { color: #000; text-decoration: none; }
}

/* 0138: tracking on the load page, a connection's address for updates */
.track-head { font-size: 0.95rem; margin: 0.75rem 0 0.25rem; }
.track-list { list-style: none; margin: 0; padding: 0; }
.track-list li { padding: 0.25rem 0; border-top: 1px solid var(--c-border, #ddd); }
.track-list li:first-child { border-top: 0; }
/* 0144: the map, drawn by the portal */
.map-box { border: 1px solid var(--c-border, #ddd); border-radius: var(--radius, 6px); overflow: hidden; background: #eef3f7; }
.map-svg { display: block; width: 100%; height: auto; }
.map-water { fill: #eef3f7; }
.map-land { fill: #f4f4f2; stroke: #b9c2cb; }
.map-state { fill: #fff; stroke: #cfd6dd; }
.map-nation { fill: none; stroke: #9aa6b2; }
.map-lane { stroke: var(--c-accent, #e8562a); stroke-linecap: round; opacity: 0.8; }
.map-path { fill: none; stroke: #2b7bb9; stroke-linejoin: round; stroke-linecap: round; }
.map-pin { stroke: #fff; }
.map-pin-pickup { fill: var(--c-primary, #0b2a4a); }
.map-pin-delivery { fill: #1f9d55; }
.map-pin-last { fill: #2b7bb9; }
.map-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; list-style: none; margin: 0.5rem 0 0; padding: 0; }
.map-legend li { display: inline-flex; align-items: center; gap: 0.35rem; }
.map-key { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.map-key.map-pin-pickup { background: var(--c-primary, #0b2a4a); }
.map-key.map-pin-delivery { background: #1f9d55; }
.map-key.map-pin-last { background: #2b7bb9; }
#shipments-map { margin: 0.75rem 0; }
.conn-hook-url { display: block; overflow-wrap: anywhere; word-break: break-all; font-size: 0.85rem; padding: 0.35rem 0.5rem; background: var(--c-muted-panel, #f4f4f5); border-radius: 4px; }

/* Oct 31 layout: a checkbox and its label on one line (Receivables, Commissions, lane rates); number headers may wrap so wide tables fit */
.field.field-check { display: flex; align-items: center; gap: .5rem; min-height: 44px; }
.field.field-check > label { margin: 0; font-weight: 400; }
.loads-table thead th.num { white-space: normal; }
