/* TMS styles. Rules in DESIGN.md: calm, dense, predictable, and rounded (YY, 27 Oct: round icons, pills and soft
   cards, as in Apple's apps; tables stay dense).
   One blue accent for actions and selection; red only for what needs action;
   amber for warnings, green for done. Every status also has a word. */
:root {
  --bg: #f2f2f7;
  --surface: #ffffff;
  --text: #1c1c1e;
  --muted: #5e5e63;
  --border: #e3e3e8;
  --border-strong: #c9c9cf;
  --hover: rgba(28, 28, 30, .06);
  --accent: #0a64d6;
  --accent-hover: #0852b0;
  --accent-soft: #e5effc;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05);
  /* Pop-ups float (YY, 7 Nov: "shadows for the pop up options, so the app doesn't look flat"): lists, menus, the calendar. */
  --shadow-pop: 0 2px 6px rgba(0, 0, 0, .08), 0 14px 36px rgba(0, 0, 0, .18), 0 0 0 .5px rgba(0, 0, 0, .08);
  --on-accent: #ffffff;
  --success: #1e7a46;
  --success-soft: #e3f3e9;
  --warning: #9a5b00;
  --warning-soft: #fdf0d9;
  --warning-dot: #e0a000;
  --dot-new-fill: #ffffff;
  --danger: #c2331f;
  --danger-soft: #fbe9e6;
  --on-danger: #ffffff;
  --radius: 10px;
  --radius-lg: 16px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Cascadia Mono", Consolas, ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
/* Each person picks Light, Dark or their computer's choice on My settings (YY, 27 Oct). */
:root[data-theme="light"] { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e10;
    --surface: #1c1c1e;
    --text: #f2f2f7;
    --muted: #a1a1a8;
    --border: #2c2c2e;
    --border-strong: #3d3d42;
    --hover: rgba(242, 242, 247, .07);
    --accent: #5aa2ff;
    --accent-hover: #7ab4ff;
    --accent-soft: #14284a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-pop: 0 2px 6px rgba(0, 0, 0, .4), 0 16px 40px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .1);
    --on-accent: #0f1217;
    --success: #5cc48b;
    --success-soft: #16301f;
    --warning: #e8a64b;
    --warning-soft: #33260f;
    --warning-dot: #e8a64b;
    --dot-new-fill: #e6e9ee;
    --danger: #ff7462;
    --danger-soft: #3a1f1c;
    --on-danger: #1d0b08;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0e10;
  --surface: #1c1c1e;
  --text: #f2f2f7;
  --muted: #a1a1a8;
  --border: #2c2c2e;
  --border-strong: #3d3d42;
  --hover: rgba(242, 242, 247, .07);
  --accent: #5aa2ff;
  --accent-hover: #7ab4ff;
  --accent-soft: #14284a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-pop: 0 2px 6px rgba(0, 0, 0, .4), 0 16px 40px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .1);
  --on-accent: #0f1217;
  --success: #5cc48b;
  --success-soft: #16301f;
  --warning: #e8a64b;
  --warning-soft: #33260f;
  --warning-dot: #e8a64b;
  --dot-new-fill: #e6e9ee;
  --danger: #ff7462;
  --danger-soft: #3a1f1c;
  --on-danger: #1d0b08;
  color-scheme: dark;
  }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--font);
}
a { color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
abbr[title] { text-decoration: none; cursor: help; }

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 10;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}
.skip:focus { left: 8px; }

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--text);
  color: var(--surface);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
}

.content { width: 100%; max-width: 1200px; padding: 24px; display: flex; flex-direction: column; gap: 20px; }

/* Page parts */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.head-text { min-width: 0; }
.head-text .muted { margin-top: 4px; }
.head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.item-title { font-size: 20px; font-weight: 600; overflow-wrap: anywhere; }
.back { align-self: flex-start; margin-bottom: -10px; font-size: 13px; font-weight: 500; text-decoration: none; }
.result-count { font-variant-numeric: tabular-nums; }
/* The Orders list's totals (step 16a): one line above the table, numbers lined up like the columns. */
.list-totals { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; font-variant-numeric: tabular-nums; }
.list-totals .tag { margin-left: 0; }

/* Messages after an action */
.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow);
  font-weight: 500;
}
.flash::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.flash-success::before { background: var(--success); }
.flash-error::before { background: var(--danger); }
.flash-warning::before { background: var(--warning); }
.flash-info::before { background: var(--accent); }  /* information: blue (DESIGN.md), the carrier page's Read only */

/* Pills and tags */
.pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text);
}
.pill.role-admin { background: var(--text); border-color: var(--text); color: var(--surface); }
.pill.role-other { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.pill.status-new { color: var(--muted); }
.pill.status-ok { background: var(--success-soft); border-color: transparent; color: var(--success); }
.pill.status-warning { background: var(--warning-soft); border-color: transparent; color: var(--warning); }
.pill.status-blocked { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.tag {
  display: inline-block;
  margin-left: 4px;
  padding: 0 6px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
  color: var(--muted);
  vertical-align: 1px;
}
.tag-action { border-color: var(--danger); color: var(--danger); }
.tag-warn { border-color: var(--warning); color: var(--warning); }
.pill.rule-warn { background: var(--warning-soft); border-color: transparent; color: var(--warning); }
.pill.rule-block { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
/* !important: a field's own width and padding (.field select is more specific) must never widen a hidden box, or the
   select kept behind a typed box stretches the page sideways (found on the truck and site forms, 28 Oct). */
.visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important;
  margin: -1px !important; border: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}
.nowrap { white-space: nowrap; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: 600 13px/1.25 var(--font);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.btn:hover { border-color: var(--muted); }
.btn:active { background: var(--hover); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-quiet { background: transparent; border-color: transparent; }
.btn-quiet:hover { background: var(--hover); border-color: transparent; }
.btn-quiet.is-current { color: var(--accent); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }
.btn-danger:hover { filter: brightness(.94); border-color: var(--danger); }
.btn-block { width: 100%; height: 36px; }

/* Home */
.date { font-size: 13px; color: var(--muted); }
.hello h2 { margin-top: 2px; font-size: 20px; font-weight: 600; }
.hello p { margin-top: 4px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tile, .panel {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.panel-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.panel > p, .panel-row p { margin-top: 2px; }
.panel-quiet { background: transparent; }
/* Folded panels (YY, 18 Oct): Documents and History open when asked for. */
.fold > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; cursor: pointer; list-style: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin: 0 4px 3px auto;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .15s ease;
}
.fold[open] > summary::after { margin-bottom: -3px; transform: rotate(-135deg); }
.fold > summary:hover h3 { text-decoration: underline; }
.fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
.fold[open] > summary { margin-bottom: 4px; }
.fold > summary .tag { margin-left: 0; }
.counts { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0; list-style: none; }
.counts a { display: inline-flex; align-items: center; gap: 6px; color: var(--text); text-decoration: none; }
.counts a:hover .pill { border-color: var(--muted); }
.count-num { font-weight: 600; font-variant-numeric: tabular-nums; }
.needs-action, .rule-line { margin-top: 10px; padding-top: 10px; }
.rule-line { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.rule-line a { display: inline-flex; align-items: center; gap: 6px; color: var(--text); text-decoration: none; }
.rule-line + .needs-action { margin-top: 6px; padding-top: 0; border-top: 0; }
.needs-action + .needs-action { margin-top: 6px; padding-top: 0; }
.needs-action a { color: var(--danger); font-weight: 600; }

/* Filters and tables */
.filters { display: flex; flex-wrap: wrap; }
.control {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: 400 13px/1.25 var(--font);
}
.control-search { width: 240px; max-width: 100%; padding: 0 10px; }
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: clip; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
  position: sticky;
  top: var(--topbar-h);
  z-index: 1;
  padding: 8px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
}
/* The rounded corners come from the frame (.table-wrap clips them): a header stuck under the top bar stays square,
   so no row shows through its corners while scrolling (YY, 26 Oct). Clipping isn't scrolling: the header still sticks. */
.table td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* A table whose names grow (a status pill opening, tags): the name column takes the spare room and the other columns
   keep their width, so opening a pill never moves another column. */
.table-names th, .table-names td { white-space: nowrap; }
/* Column titles that sort the list (YY, 26 Oct): A–Z, then Z–A; the arrow shows the sorted column and its way. */
.sort-link { display: inline-flex; align-items: center; gap: 4px; color: inherit; text-decoration: none; }
th[aria-sort] .sort-link { color: var(--text); }
.sort-arrow { font-size: 9px; line-height: 1; }
.table-names .cell-name { width: 100%; } /* an open pill (22 px) never touches the line below */
.cell-name { font-weight: 600; overflow-wrap: anywhere; }
.cell-name a { color: var(--text); text-decoration: none; }
.cell-name a:hover { color: var(--accent); text-decoration: underline; }
.is-inactive td { color: var(--muted); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; }
.empty {
  padding: 32px 24px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  text-align: center;
}
.empty p + p { margin-top: 4px; }
.empty .btn { margin-top: 14px; }

/* Partner page */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-areas: "main side";
  gap: 16px;
  align-items: start;
}
.detail-side { grid-area: side; display: flex; flex-direction: column; }
/* The parts of the order page redrawn while typing (the live preview): no box of their own. */
.live { display: contents; }
.detail-main { grid-area: main; display: flex; flex-direction: column; min-width: 0; }
.facts { display: grid; margin: 12px 0 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.proposal { margin-top: 10px; padding: 10px 12px; background: var(--danger-soft); border-radius: var(--radius); }
.proposal blockquote { color: var(--text); }
.proposal > .muted { margin-top: 4px; }
.thread { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.thread > li { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); min-width: 0; }
.thread-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 13px; }
.thread-head time { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.thread-text { margin-top: 2px; overflow-wrap: anywhere; }
.attachment { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; margin-top: 6px; font-size: 13px; overflow-wrap: anywhere; }
.attachment-word { font-size: 11.5px; font-weight: 700; color: var(--muted); }
blockquote {
  margin: 6px 0 0;
  padding: 2px 0 2px 10px;
  border-left: 3px solid var(--border-strong);
  color: var(--muted);
  overflow-wrap: anywhere;
}
.checks { margin: 8px 0 0; padding: 0; list-style: none; }
.check { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 8px; padding: 8px 0; border-top: 1px solid var(--border); }
.check:first-child { border-top: 0; }
.check-word { font-size: 12px; font-weight: 700; }
.check-ok .check-word { color: var(--success); }
.check-warning .check-word { color: var(--warning); }
.check-later .check-word { color: var(--muted); }
.check-block .check-word { color: var(--danger); }
.btn:disabled { opacity: .6; cursor: progress; }
.check-now { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.answers { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.answers > summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.answers > summary:hover { color: var(--text); }
.answers > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.answer-list { margin: 8px 0 0; padding: 0; list-style: none; font-size: 12.5px; }
.answer-list li { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 8px; padding: 6px 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.answer-list li:first-child { border-top: 0; }
.answer-list time { color: var(--muted); }
.history { margin: 8px 0 0; padding: 0; list-style: none; }
.history > li { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.history > li:first-child { border-top: 0; }
.history time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.changes { margin: 4px 0 0; padding-left: 18px; }
.changes del { color: var(--muted); }
.changes ins { text-decoration: none; font-weight: 600; }

/* Forms */
.form-page { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.form-narrow { max-width: 420px; }
.form-wide { max-width: 980px; }
.section-head { margin-top: 12px; }
.field-narrow { max-width: 360px; }
.table-plain { margin-top: 8px; border: 0; background: transparent; }
.table-plain .table th { position: static; background: transparent; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-tight { margin-top: 12px; gap: 12px; }
.form-section { margin: 0; padding: 14px 16px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.form-section > legend { padding: 0 4px; margin-left: -4px; font-size: 14px; font-weight: 600; }
fieldset.field { margin: 0; padding: 0; border: 0; min-width: 0; }
.row-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.row-postcode { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .field .label { padding: 0; font-size: 13px; font-weight: 600; }
.optional { margin-left: 4px; font-weight: 400; color: var(--muted); }
.field :is(input:not([type=checkbox]):not([type=radio]), select, textarea) {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: 400 14px/1.25 var(--font);
}
.field textarea { height: auto; min-height: 76px; padding: 8px 10px; line-height: 1.45; resize: vertical; }
.field input[type=file] { height: auto; padding: 5px 6px; font-size: 13px; line-height: 1.4; }
.field input[type=file]::file-selector-button {
  margin-right: 10px;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: 600 12.5px/1.25 var(--font);
  cursor: pointer;
}
.field input[type=file]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.field input.mono { font-family: var(--font-mono); }
/* Same weight as the rule above, or it would win: hover and disabled must show. */
.field :is(input:not([type=checkbox]):not([type=radio]), select, textarea):hover { border-color: var(--muted); }
.field :is(input:not([type=checkbox]):not([type=radio]), select, textarea):disabled {
  background: var(--bg);
  border-color: var(--border);
  color: var(--muted);
  cursor: not-allowed;
}
/* A box that stops the Save (YY, 3 Nov): tinted red with a red edge, the same in light and dark, and still red on hover. */
.field.has-error :is(input:not([type=checkbox]):not([type=radio]), select, textarea),
.field.has-error :is(input:not([type=checkbox]):not([type=radio]), select, textarea):is(:hover, :focus) { border-color: var(--danger); background-color: var(--tint-red); box-shadow: inset 0 0 0 1px var(--danger); }
.field-help { font-size: 12.5px; color: var(--muted); }
.field-help ul { margin: 2px 0 0; padding-left: 18px; }
.field-error { font-size: 13px; font-weight: 600; color: var(--danger); }
.field.has-error { margin-bottom: 6px; }  /* its error never touches the next box's label (screen check, wave 4) */
.choices { display: flex; flex-direction: column; margin-top: 2px; }
.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
.choice:hover { border-color: var(--border-strong); background: var(--hover); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { margin: 3px 0 0; accent-color: var(--accent); }
.choice-text { display: flex; }
.choice-label { font-weight: 600; }
.choice-hint { font-size: 12.5px; color: var(--muted); }
.choices-inline { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 2px; }
.choice-inline { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.choice-inline input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
/* Copy order's ticks (DOMAIN.md section 27): one per line, in the dialog and on its own page. */
.copy-ticks { display: flex; flex-direction: column; gap: 10px; padding: 2px 0; }
.is-disabled { opacity: .6; cursor: not-allowed; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.facts + .form-actions { margin-top: 16px; } /* a panel's facts, then its button: room between (Give a new link) */
.secret { padding: 2px 8px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); font-family: var(--font-mono); font-size: 16px; user-select: all; }

/* Login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card {
  width: 100%;
  max-width: 360px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.auth-brand { margin: 0 0 18px; font-weight: 700; letter-spacing: .04em; }
.auth-card > .muted + .muted { margin-top: 8px; }
.error-actions { margin-top: 18px; }
.auth-card h1 { font-size: 20px; font-weight: 600; }
.auth-card > .muted { margin: 4px 0 0; }
.auth-card > .error-ref { margin-top: 14px; font-size: 12px; }
.auth-card .form { margin-top: 18px; gap: 12px; }
.auth-link { margin: 14px 0 0; text-align: center; font-size: 13.5px; }
.demo-logins { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 4px 8px; }
.demo-logins > .muted { flex-basis: 100%; margin: 0 0 4px; padding-left: 12px; font-size: 12.5px; }
.demo-logins .btn { padding: 0 12px; } /* the names on the labels' edge, their hover on the boxes' edge (S3) */
.demo-logins form { display: contents; }
.alert { padding: 8px 10px; border-radius: var(--radius); font-size: 13px; }
.auth-card .alert { margin-top: 14px; }
.alert-error { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.alert-success { background: var(--success-soft); color: var(--success); font-weight: 600; }

/* Laptop and smaller */
@media (max-width: 1080px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "side" "main"; }
  /* The order page: the stops first on a narrow window (the design round, wave 5; the review's suggestion 4). */
  .detail-grid.order-grid { grid-template-areas: "main" "side"; }
}

/* Phone and small windows */
@media (max-width: 860px) {
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .table th { position: static; }
  .hide-sm { display: none; }
  .table td, .table th { padding: 8px 10px; }
  .row-2, .row-postcode { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .facts dd { margin-bottom: 8px; }
  .history > li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .field :is(input, select, textarea) { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}

/* Status dots (YY, 17 Oct): colour plus shape, so red and green can't be confused.
   Hovered (or tapped), its word opens in a pill (YY, 18 Oct): a border of the dot's colour, empty inside, a small dot and
   the word, floating above the dot since YY's walk of 13 Nov (below). */
.status {
  --status-dot: var(--muted);
  --status-text: var(--muted);
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: none;
  height: 12px;
  /* Centred on the text (YY, 26 Oct). */
  vertical-align: middle;
  top: -1px;
}
.status-ok { --status-dot: var(--success); --status-text: var(--success); }
.status-warning { --status-dot: var(--warning-dot); --status-text: var(--warning); }
.status-blocked { --status-dot: var(--danger); --status-text: var(--danger); }
.status::before { content: ""; position: absolute; inset: -5px -3px; } /* a larger target than the dot */
.status-pill {
  display: inline-flex;
  flex: none;
  align-items: center;
  height: 12px;
  margin-left: 0;
  padding: 0;
  white-space: nowrap;
  pointer-events: none;
}
.status-word {
  color: var(--status-text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  opacity: 0;
}
.dot {
  position: relative;
  display: inline-block;
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  vertical-align: -1px;
  transition: width .18s ease, height .18s ease;
}
.dot-ok { background: var(--success); }
.dot-warning { background: var(--warning-dot); }
.dot-blocked { background: var(--danger); }
.dot-blocked::after { content: ""; position: absolute; left: 18%; right: 18%; top: calc(50% - 1px); height: 2px; border-radius: 1px; background: var(--surface); }
/* New (YY, 18 Oct): an empty ring, white inside. */
.dot-new { border: 2px solid var(--muted); background: var(--dot-new-fill); }

/* Open (hovered, tapped or focused), the word floats in its pill just above the dot, centred on it (YY's walk, 13 Nov:
   the pill growing in its line covered the next column's name and the truck's plate, and sat off its dot): the line
   moves nothing and nothing in it is covered. Fixed, placed on the dot by the script (controls.js), so no list's clip
   cuts it. */
.status-word {
  position: fixed;
  left: var(--word-x, -999px);
  top: var(--word-y, -999px);
  z-index: 75;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: none;
  padding: 2px 10px 2px 8px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--status-dot), 0 2px 6px rgba(0, 0, 0, .12);
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 1px)) scale(.96);
  transition: opacity .12s ease, transform .12s ease;
}
.status-word::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--status-dot); }
.dot-new + .status-word::before, .order-dot-draft .status-word::before { border: 1.5px solid var(--status-dot); background: var(--dot-new-fill); }
.status:hover .status-word,
.status.is-open .status-word,
a:focus-visible > .status .status-word,
.order-dot:focus-visible .status-word { opacity: 1; transform: translate(-50%, calc(-100% - 3px)); }
/* A list's first line: under the dot instead (its column titles are above it). */
.status.is-below .status-word { transform: translate(-50%, 1px) scale(.96); }
.status.is-below:hover .status-word,
.status.is-below.is-open .status-word,
a:focus-visible > .status.is-below .status-word,
.order-dot.is-below:focus-visible .status-word { transform: translate(-50%, 3px); }
@media (prefers-reduced-motion: reduce) {
  .status-pill, .status-word, .dot { transition: none; }
}
.item-title .status { height: 14px; margin-right: 2px; }
.item-title .status-pill { height: 14px; }
.item-title .dot { width: 14px; height: 14px; }
.status-line { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-weight: 600; }
.action-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.counts .status { margin-right: 2px; }

/* An order's status as a dot (YY, 12 Nov, drawing A: "status column is too wide because of the notifications").
   Its colours, named here in one place so that a later round can let a setting change them (YY's remark on A). */
:root {
  --order-draft: var(--muted);
  --order-draft-fill: var(--dot-new-fill);
  --order-sent: var(--accent);
  --order-ending: var(--warning-dot);
  --order-assigned: var(--accent);
  --order-confirmed: var(--success);
  --order-paid: var(--success);
  --order-missing: var(--danger);
  --order-cancelled: var(--muted);
  --order-notice: var(--warning-dot);
}
.order-dot-draft { --status-dot: var(--order-draft); --status-text: var(--muted); }
.order-dot-sent { --status-dot: var(--order-sent); --status-text: var(--accent); }
.order-dot-sent.is-ending { --status-dot: var(--order-ending); --status-text: var(--warning); }
.order-dot-assigned { --status-dot: var(--order-assigned); --status-text: var(--accent); }
.order-dot-confirmed { --status-dot: var(--order-confirmed); --status-text: var(--success); }
.order-dot-paid { --status-dot: var(--order-paid); --status-text: var(--success); }
.order-dot-missing { --status-dot: var(--order-missing); --status-text: var(--danger); }
.order-dot-cancelled { --status-dot: var(--order-cancelled); --status-text: var(--muted); }
[class*="order-dot-"] .dot { background: var(--status-dot); }
.order-dot-draft .dot { border: 2px solid var(--order-draft); background: var(--order-draft-fill); }
/* Sent, its "We confirm" awaited: the one looping animation, a slow halo (as the waiting dot it replaces). */
.order-dot-sent .dot { box-shadow: 0 0 0 3px var(--accent-soft); animation: order-halo 2s ease-in-out infinite; }
.order-dot-sent.is-ending .dot { box-shadow: 0 0 0 3px var(--tint-warn); }
@keyframes order-halo { 50% { box-shadow: 0 0 0 5px transparent; } }
/* Paid: a tick; Carrier missing: a bar, as Partners' Blocked (colour plus shape). */
.order-dot-paid .dot::before { content: ""; position: absolute; left: 3.6px; top: 1.6px; width: 3px; height: 6px; border: solid var(--surface); border-width: 0 1.8px 1.8px 0; transform: rotate(45deg); }
.order-dot-missing .dot::after { content: ""; position: absolute; left: 18%; right: 18%; top: calc(50% - 1px); height: 2px; border-radius: 1px; background: var(--surface); }
.order-dot-notice { position: absolute; right: -5px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--order-notice); border: 1.5px solid var(--surface); transition: opacity .12s ease; }
/* The dot is a button 12 px wide; its word floats above it (.status-word), never widening the column. */
.order-dot { width: 12px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.order-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 50%; }
.order-dot[aria-expanded="true"] { outline: 1.5px solid var(--status-dot); outline-offset: 3px; border-radius: 50%; }
.cell-status { width: 48px; text-align: center; } /* the dot under its title, in the middle of the column (YY, 12 Nov) */
/* Its small list: the status by name, its times, every notice. */
.status-pop { position: fixed; z-index: 60; display: flex; flex-direction: column; gap: 6px; min-width: 220px; max-width: min(320px, calc(100vw - 16px)); padding: 12px 14px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-pop); color: var(--text); font-size: 13px; font-weight: 400; line-height: 1.4; text-align: left; white-space: normal; overflow-y: auto; transform-origin: var(--pop-x, 0) var(--pop-y, 0); animation: status-pop .16s cubic-bezier(.23, 1, .32, 1); }
@keyframes status-pop { from { opacity: 0; transform: scale(.96); } }
.status-pop-head { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.status-pop-head .dot { display: block; }
.status-pop-time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.status-pop.status-pop, .status-pop.status-pop * { white-space: normal; overflow-wrap: anywhere; } /* doubled: above the tables' ".table td *" nowrap */ /* a phone's narrow list wraps its times (screen checker, S7) */
.status-pop-notices { display: flex; flex-direction: column; gap: 4px; }
.status-pop-notices > span { display: flex; align-items: center; gap: 8px; color: var(--warning); font-weight: 600; }
.status-pop-notices > span::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--order-notice); }
@media (prefers-reduced-motion: reduce) {
  .order-dot-sent .dot, .status-pop { animation: none; }
}

/* Things only the script needs to hide or show */
.is-hidden, [hidden] { display: none !important; }

/* Selection, row menus and the bulk bar */
.table-select .cell-select { width: 36px; }
.cell-select input, .ticket-row > input[type=checkbox], .tickets-head input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); vertical-align: middle; }
.cell-menu { text-align: right; }
.menu-button { width: 30px; height: 28px; padding: 0; font-size: 16px; letter-spacing: 1px; color: var(--muted); }
.menu-button[aria-expanded="true"] { background: var(--hover); color: var(--text); }
.menu {
  position: fixed;
  z-index: 40;
  min-width: 184px;
  padding: 4px;
  border-radius: var(--radius);
  text-align: left;
}
.menu-item {
  display: block;
  padding: 6px 10px;
  border-radius: 4px;
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--hover); outline: none; }
.menu-sep { margin: 4px 0; border: 0; border-top: 1px solid var(--border); }
.bulk-bar {
  position: sticky;
  top: calc(var(--topbar-h) + 8px);
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-lg);
}
.bulk-count { margin-right: 4px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bulk-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#results { display: flex; flex-direction: column; gap: 12px; }

/* The action dialog */
.dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 18px;
  color: var(--text);
  border-radius: var(--radius-lg);
}
.dialog.is-wide { width: min(680px, calc(100vw - 32px)); --label-w: 168px; }  /* the new site from a stop: one column, room for French labels */
.dialog .form { gap: 12px; }
.dialog-title { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
/* Who a bulk action will skip, and why, said before anything is done. */

/* Block requests: a ticket on the partner page, a list of tickets for admins */
.ticket-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ticket-state {
  padding: 0 8px;
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 12px;
  font-weight: 600;
  line-height: 22px;
}
.ticket-meta { margin-top: 6px; color: var(--muted); font-size: 13px; }
.ticket-text { margin-top: 6px; overflow-wrap: anywhere; }
.ticket > .muted { margin-top: 6px; }
.btn-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ask { margin-top: 10px; }
.ask > summary {
  display: inline-block;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.ask > summary::-webkit-details-marker { display: none; }
.ask > summary:hover { text-decoration: underline; }
.ask[open] > summary { color: var(--muted); }
.link-button { color: var(--accent); font-weight: 600; text-decoration: none; padding: 0 4px; }
.link-button:hover { text-decoration: underline; }
.tickets-head { padding: 0 2px; }
.tickets { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.ticket-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.ticket-row > input[type=checkbox] { margin-top: 3px; }
.ticket-row:has(input:checked) { background: var(--accent-soft); }
.ticket-title-line { overflow-wrap: anywhere; }
.ticket-partner { color: var(--text); font-weight: 600; text-decoration: none; }
.ticket-partner:hover { color: var(--accent); text-decoration: underline; }
.ticket-last { margin-top: 6px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.ticket-actions { display: flex; align-items: center; gap: 8px; }


/* The file picker: the TMS's own button, in English whatever the browser's language */
.file-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.field .file-picker input.file-input,
.file-picker input.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
}
.file-button { height: 30px; cursor: pointer; }
.file-input:focus-visible + .file-button { outline: 2px solid var(--accent); outline-offset: 2px; }
.file-name { min-width: 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }

@media (max-width: 860px) {
  .ticket-row { grid-template-columns: 20px minmax(0, 1fr); }
  .ticket-actions { grid-column: 2; }
  .bulk-bar { top: 8px; }
}

/* Documents (step 4d): the carrier's four documents and Other documents, each with its files, Add (and Replace), and a drop target */
a.tag { text-decoration: none; }
a.tag:hover { text-decoration: underline; }
.btn-small { height: 28px; padding: 0 10px; font-size: 12.5px; }
/* Icon buttons on documents (YY, 27 Oct): replace, add, remove, check on urssaf.fr; the word in the tooltip. */
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border-radius: 50%; list-style: none; cursor: pointer; }
.btn-icon::-webkit-details-marker { display: none; }
.btn-icon.is-done { border-color: transparent; background: var(--success-soft); color: var(--success); cursor: default; }
.doc-slots { margin: 8px 0 0; padding: 0; list-style: none; }
.doc-slot { position: relative; padding: 10px 0; border-top: 1px solid var(--border); }
.doc-slot:first-child { border-top: 0; padding-top: 4px; }
.doc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-height: 28px; }
.doc-label { font-weight: 600; }
.doc-head .tag { margin-left: 0; }
.doc-actions { display: flex; gap: 6px; margin-left: auto; }
.doc-upload { display: inline-flex; gap: 6px; }
.doc-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
}
.doc-input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.doc-files { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.doc-files li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; overflow-wrap: anywhere; }
.doc-remove > summary { color: var(--muted); font-size: 12.5px; cursor: pointer; list-style: none; }
.doc-remove > summary::-webkit-details-marker { display: none; }
.doc-remove > summary:hover { color: var(--danger); text-decoration: underline; }
.doc-remove > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.js .doc-remove[open] > summary { display: none; }
.doc-remove-form { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.doc-check { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 8px; font-size: 13px; }
.doc-status { margin-top: 6px; font-size: 13px; color: var(--muted); }
.doc-status.is-error { color: var(--danger); font-weight: 600; }
.doc-slot.is-busy { opacity: .6; pointer-events: none; }
.drop-zones { display: none; }
/* While files are dragged over the page, every document shows its drop targets; the one under the pointer is solid. */
.is-dragging .drop-zones,
.doc-slot.is-drop .drop-zones {
  position: absolute;
  inset: 4px 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 6px;
  background: var(--surface); /* hides the files underneath while the targets show */
}
.drop-zone {
  display: grid;
  place-items: center;
  padding: 0 8px;
  text-align: center;
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
.drop-zone.is-over { background: var(--accent); color: var(--on-accent); }
.is-dragging .doc-slot:not(.is-drop) .drop-zone { border-style: dotted; background: var(--surface); }
.doc-older { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.doc-older > summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.doc-older > summary:hover { color: var(--text); }
.doc-older > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.doc-older-list { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.doc-older-list li { overflow-wrap: anywhere; }
.doc-older-kind { margin-right: 4px; font-weight: 600; }
.choices-stack { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
/* Team: the rights an admin allows or refuses one person (YY, 18 Oct), folded under the roles. */
.rights-fold > summary { gap: 8px; }
.rights-fold[open] > summary { margin-bottom: 8px; }
.rights-table td { vertical-align: middle; }

/* ===== The look (YY, 27 Oct): what an Apple designer would make of an operations tool, not a copy of macOS. =====
   Hierarchy comes from type, not boxes: a large bold title, grey secondary text, few lines.
   Colour lives in one place, the round module icons in the rail; everything else is white, light grey and one blue.
   Lists and panels are plain white groups on a light-grey page, rows split by fine lines, no outlines, no shadows.
   Controls feel native: grey fields with a chevron, a segmented switch, filled and tinted buttons, tinted capsules. */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --border: rgba(60, 60, 67, .13);
  --border-strong: rgba(60, 60, 67, .22);
  --fill: rgba(118, 118, 128, .12);
  --fill-hover: rgba(118, 118, 128, .18);
  --hover: rgba(118, 118, 128, .08);
  --accent: #0066cc;
  --accent-hover: #0057ad;
  --accent-soft: rgba(0, 113, 227, .1);
  --tint-warn: rgba(255, 149, 0, .15);
  --tint-red: rgba(255, 59, 48, .12);
  --role-carrier: #1d6b3c;
  --role-forwarder: #6b3fc4;
  --role-shipper: #1f4e9e;
  --radius: 10px;
  --radius-lg: 14px;
  --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --surface: #1c1c1e;
    --text: #f5f5f7;
    --muted: #98989f;
    --border: rgba(84, 84, 88, .55);
    --border-strong: rgba(84, 84, 88, .8);
    --fill: rgba(118, 118, 128, .24);
    --fill-hover: rgba(118, 118, 128, .32);
    --hover: rgba(118, 118, 128, .14);
    --accent: #2997ff;
    --accent-hover: #47a6ff;
    --accent-soft: rgba(41, 151, 255, .18);
    --on-accent: #ffffff;
    --tint-warn: rgba(255, 159, 10, .2);
    --tint-red: rgba(255, 69, 58, .2);
    --role-carrier: #5cc282;
    --role-forwarder: #b99bff;
    --role-shipper: #79a6ff;
  }
}
:root[data-theme="dark"] {
  --bg: #000000;
  --surface: #1c1c1e;
  --text: #f5f5f7;
  --muted: #98989f;
  --border: rgba(84, 84, 88, .55);
  --border-strong: rgba(84, 84, 88, .8);
  --fill: rgba(118, 118, 128, .24);
  --fill-hover: rgba(118, 118, 128, .32);
  --hover: rgba(118, 118, 128, .14);
  --accent: #2997ff;
  --accent-hover: #47a6ff;
  --accent-soft: rgba(41, 151, 255, .18);
  --on-accent: #ffffff;
  --tint-warn: rgba(255, 159, 10, .2);
  --tint-red: rgba(255, 69, 58, .2);
  --role-carrier: #5cc282;
  --role-forwarder: #b99bff;
  --role-shipper: #79a6ff;
  }
body { font-size: 14px; letter-spacing: -.003em; -webkit-font-smoothing: antialiased; }
.content { max-width: 1440px; gap: 16px; padding: 8px 32px 40px; }

/* Large title: the page's name, set big and tight, then quiet text under it. */
.large-title { margin: 4px 0 0; font: 700 30px/1.2 var(--font-display); letter-spacing: -.022em; }
.item-title { font: 700 26px/1.2 var(--font-display); letter-spacing: -.02em; }
h2.item-title.section-head { font-size: 22px; margin-top: 12px; }
.back { font-size: 14px; text-decoration: none; }
.back:hover { text-decoration: underline; }
.result-count, .page-head .muted { color: var(--muted); }
/* The title line: the page's name, its count beside it, the main action at the far end. */
.title-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 4px; }
.title-line .large-title { margin: 0; }
.title-line .title-text { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.title-line .result-count { font-size: 15px; }


.avatar { width: 32px; height: 32px; background: linear-gradient(#8e8e93, #636366); color: #fff; }

/* Buttons: filled for the one main action, tinted for the rest, plain text when quiet. Capsules, no outlines. */
.btn { height: 32px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.btn:hover { background: var(--accent-soft); filter: brightness(.97); border: 0; }
.btn:active { filter: brightness(.93); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); filter: none; }
.btn-quiet, .btn-quiet:hover { background: transparent; color: var(--accent); }
.btn-quiet:hover { background: var(--hover); }
.btn-danger { background: var(--tint-red); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: var(--on-danger); filter: none; }
.btn-icon { width: 30px; height: 30px; padding: 0; background: var(--fill); color: var(--text); }
.btn-icon:hover { background: var(--fill-hover); filter: none; }
.btn-icon.is-done { background: var(--success-soft); color: var(--success); }

/* Fields: grey, borderless rounded rectangles; selects with a chevron; the search box with a magnifier. */
.control,
.field :is(input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea) {
  height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background-color: var(--fill);
  color: var(--text);
  font-size: 14px;
}
.field textarea { height: auto; padding: 8px 12px; }
.control:hover, .field :is(input:not([type=checkbox]):not([type=radio]), select, textarea):hover { border-color: transparent; background-color: var(--fill-hover); }
.control:focus, .field :is(input, select, textarea):focus { outline: none; border-color: var(--accent); background-color: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.field :is(input, select, textarea):disabled { background-color: transparent; border: 1px dashed var(--border-strong); color: var(--muted); }
select.control, .field select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='%238e8e93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.control-search {
  width: 220px;
  padding-left: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M16.5 16.5L21 21'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 11px center;
}
.control-search-wide { width: 290px; max-width: 100%; }  /* "Code, order no. or reference" whole (YY, 3 Nov) */

/* A choice of a few, side by side (All · Clients · Carriers): one grey track, the chosen one raised in white. */
.segmented { display: inline-flex; margin: 0; padding: 2px; border: 0; border-radius: 9px; background: var(--fill); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 16px;
  border-radius: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.segmented input:checked + label { background: var(--surface); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); }
.segmented input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Groups: white on light grey, no outline, no shadow; rows split by fine lines that start after the tick box. */
.tile, .panel, .table-wrap, .form-section { border: 0; border-radius: var(--radius-lg); box-shadow: none; }
.panel, .tile { padding: 16px 20px; }
.panel h3, .fold-head h3 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.table th { background: var(--surface); border-bottom: 1px solid var(--border); color: var(--muted); font-size: 12px; font-weight: 600; padding: 10px 12px 8px; }
.table td { border-bottom: 1px solid var(--border); padding: 9px 12px; }
.table tbody tr:hover { background: var(--hover); }
.table tbody tr:has(input[data-select]:checked) { background: var(--accent-soft); }
.sort-link:hover { text-decoration: none; color: var(--text); }
.cell-name { font-weight: 600; }
.table .mono, td.mono { font-family: var(--font); font-variant-numeric: tabular-nums; letter-spacing: .01em; color: var(--muted); }
.menu-button { border-radius: 50%; color: var(--muted); }
.menu { border-radius: 12px; }
.menu-item { border-radius: 7px; }
.bulk-bar { border-radius: 12px; }

/* Tags: tinted capsules, the colour in the fill, never an outline. */
.tag { padding: 0 9px; border: 0; border-radius: 999px; background: var(--fill); color: var(--muted); font-weight: 600; line-height: 20px; }
.tag-warn { background: var(--tint-warn); color: var(--warning); }
.tag-action { background: var(--tint-red); color: var(--danger); }

/* Messages after an action: a capsule with a coloured dot. */
.flash { border-radius: 12px; box-shadow: none; }

@media (max-width: 860px) {
  .large-title { font-size: 26px; }
  .control-search { width: 100%; }
}
/* Scrollbars: thin and quiet, no grey track with arrows (YY, 27 Oct). */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 999px; background: var(--border-strong) padding-box; }
::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
/* A setting on one line: its name on the left, the control on the right (My settings → Appearance). */
.setting-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.setting-label { font-weight: 500; }
.segmented-icons label { width: 40px; height: 32px; padding: 0; justify-content: center; }
/* Company roles, written in their signature colours under the page title (YY, 27 Oct). */
.role-line { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: -10px 0 4px; font: 600 17px/1.3 var(--font-display); letter-spacing: -.01em; }
.role-carrier { color: var(--role-carrier); }
.role-forwarder { color: var(--role-forwarder); }
.role-shipper { color: var(--role-shipper); }

/* Messages are tinted in their dot's colour, so they stand out on a light page (YY, 27 Oct). */
.flash { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.flash-info { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.flash-success { background: color-mix(in srgb, var(--success) 13%, var(--surface)); }
.flash-warning { background: color-mix(in srgb, var(--warning) 15%, var(--surface)); }
.flash-error { background: color-mix(in srgb, var(--danger) 13%, var(--surface)); }
/* Step 5b: the right postcode and town, one click away under the address. */
.place-fixes { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 0; }
.place-fixes:not(:has(button:not([hidden]))) { display: none; }
/* The TMS's own suggestion lists, under the box (YY, 27 Oct: not the browser's). */
.suggest-wrap { position: relative; display: block; }
.suggest-wrap > input { text-overflow: ellipsis; }  /* a long pick shows its … while not typed in (fix round 4, 12 Nov) */
.suggest-list {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 100%; max-height: 280px; overflow-y: auto;
  margin: 0; padding: 4px; list-style: none; border-radius: 12px;
}
/* Over the box when the window has more room above; on the box's right edge near the window's right side (7 Nov). */
.suggest-list.is-above { top: auto; bottom: calc(100% + 4px); transform-origin: bottom; }
.suggest-list.is-right { left: auto; right: 0; }
.suggest-list [role=option] {
  display: flex; justify-content: space-between; gap: 16px; padding: 7px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap;
}
.suggest-list [role=option]:hover { background: var(--hover); }
.suggest-list [role=option][aria-selected=true] { background: var(--accent-soft); color: var(--accent); }
.suggest-note { color: var(--muted); font-variant-numeric: tabular-nums; }
.suggest-list .suggest-group { padding: 6px 12px 2px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); cursor: default; }
/* The calendar on every date box (YY, 6 Nov): under the box, the box still typed. */
.calendar {
  position: fixed; z-index: 70; width: 264px; padding: 8px; background: var(--surface); color: var(--text); border-radius: 12px;
  box-shadow: var(--shadow-pop); font-variant-numeric: tabular-nums;
  animation: list-in 180ms var(--spring-quick);
}
.calendar button { font: inherit; color: inherit; background: none; border: 0; border-radius: 8px; cursor: pointer; }
.calendar button:hover { background: var(--hover); }
.calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-bottom: 4px; }
.calendar-titles { display: flex; gap: 2px; }
.calendar-titles button { padding: 5px 8px; font-weight: 600; }
.calendar-step { width: 30px; height: 30px; font-size: 18px; line-height: 1; color: var(--muted); }
.calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.calendar-weekday { padding: 4px 0; text-align: center; font-size: 12px; color: var(--muted); }
.calendar-day { height: 32px; padding: 0; }
.calendar-day.is-weekend, .calendar-weekday.is-weekend { color: var(--muted); }
.calendar-day.is-other { color: var(--muted); opacity: .55; }
/* The days before the stop ahead (YY, 11 Nov): greyed, struck through, not clickable. */
.calendar button:disabled { cursor: default; background: none; }
.calendar .calendar-day.is-before { color: var(--muted); opacity: .4; text-decoration: line-through; box-shadow: none; }
.calendar-day.is-today, .calendar-pick.is-today { color: var(--accent); font-weight: 600; box-shadow: inset 0 0 0 1px var(--accent); }
.calendar .calendar-day[aria-pressed=true], .calendar .calendar-pick[aria-pressed=true] { background: var(--accent); color: var(--on-accent); opacity: 1; }
.calendar-picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.calendar-pick { height: 40px; }
.calendar-pick.is-shown:not([aria-pressed=true]) { background: var(--accent-soft); color: var(--accent); }
.calendar-foot { display: flex; justify-content: flex-end; margin-top: 4px; }
/* Its motion (DESIGN.md): it slides down out of the box (up when it opens above), fades out in about 110 ms; ‹ › slide
   the new month in from its side, the months and years grow in. Only position, size and transparency move. */
@keyframes calendar-up { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes calendar-next { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes calendar-back { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes calendar-view { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.calendar.is-above { animation-name: calendar-up; }
.calendar .is-next { animation: calendar-next 200ms var(--spring-quick); }
.calendar .is-back { animation: calendar-back 200ms var(--spring-quick); }
.calendar .is-view { animation: calendar-view 200ms var(--spring-quick); }
.calendar.is-leaving { opacity: 0; transform: scale(.97); transition: opacity 110ms ease-in, transform 110ms ease-in; pointer-events: none; }
/* Sites (step 5c): the list beside its map, a map on each site and on its form, the usual hours. */
.sites-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 42%); gap: 16px; align-items: start; }
.site-map { height: 300px; border-radius: 14px; overflow: hidden; background: var(--fill); z-index: 0; }
.site-map-list { position: sticky; top: calc(var(--topbar-h) + 12px); height: min(560px, calc(100vh - var(--topbar-h) - 40px)); }
.map-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 0 8px; }
.hours-table, .hours-edit { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.hours-table th, .hours-table td { padding: 4px 8px 4px 0; text-align: left; font-weight: 400; }
.hours-table th { width: 3.5em; color: var(--muted); }
.hours-edit th, .hours-edit td { padding: 3px 6px 3px 0; text-align: left; }
.hours-edit thead th { font-size: 12px; color: var(--muted); font-weight: 600; }
.hours-edit .time-box { width: 100%; min-width: 72px; font-variant-numeric: tabular-nums; }
.hours-edit tr.has-error input { box-shadow: inset 0 0 0 1.5px var(--danger); }
.site-list { margin: 0; padding: 0; list-style: none; }
.site-list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--border); }
.site-list li:first-child { border-top: 0; }
@media (max-width: 900px) { .sites-layout { grid-template-columns: minmax(0, 1fr); } .site-map-list { position: static; height: 300px; order: -1; } }
.panel-title-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.panel-title-line h3 { margin: 0; }
/* Fleet (step 5d). */
.row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.choices-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 16px; }
.plate { font-variant-numeric: tabular-nums; letter-spacing: .04em; white-space: nowrap; }
/* A plate opens its truck and copies from a small icon beside it (YY, 9 Nov, DESIGN_CHECKLIST.md A8): the icon keeps
   its place when hidden, so nothing moves as it fades in under the pointer (A3). */
a.plate { color: inherit; text-decoration: none; } /* the same plate everywhere (R5): its line under the pointer */
a.plate:hover { text-decoration: underline; }
.plate-wrap { display: inline-flex; align-items: center; gap: 1px; white-space: nowrap; vertical-align: baseline; }
.plate-copy { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; padding: 0;
  border: 0; border-radius: 5px; background: none; color: var(--muted); font: inherit; font-size: 12px; line-height: 1;
  cursor: pointer; }
.plate-copy .icon { width: 13px; height: 13px; }
.plate-copy:hover { color: var(--text); background: var(--hover); }
.plate-copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (hover: hover) {
  .plate-copy { opacity: 0; transition: opacity 120ms ease-out; }
  .plate-wrap:is(:hover, :focus-within) .plate-copy { opacity: 1; }
}
.plate-box { text-transform: uppercase; letter-spacing: .04em; }
.num-box { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .row-3 { grid-template-columns: minmax(0, 1fr); } }
.table td.cell-company { max-width: 260px; }

/* Fleet rows (YY, 28 Oct): the whole row opens the truck; the trailer's plate sits under the truck's. */
.cell-plates .plate-trailer { margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.title-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.backup-failed { margin: 0; color: var(--danger); font-weight: 600; } /* Home, the company's admins (fix round 5) */
button.menu-item { width: 100%; border: 0; background: none; font: inherit; text-align: left; }
.menu-item-danger { color: var(--danger); }

/* Anything that does something shows the hand (YY, 28 Oct). */
a[href], button:not(:disabled), summary, select:not(:disabled), label[for],
input[type="checkbox"]:not(:disabled), input[type="radio"]:not(:disabled), input[type="file"]:not(:disabled),
[role="menuitem"], [role="option"], tr[data-row-link] { cursor: pointer; }
tr[data-row-link]:hover > td { background: var(--hover); }
/* Typed filters (YY, 28 Oct): they still look like the lists they replace, with the chevron and "All carriers". */
.filters input[data-suggest-on-focus] {
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='%238e8e93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.filters input[data-suggest-on-focus]::placeholder { color: var(--text); opacity: 1; }
.filters input[data-suggest-on-focus]:focus::placeholder { color: var(--muted); }

/* Fleet: Trucks · Drivers (step 5e), the segmented switch as links. */
.segmented-links { margin-bottom: 12px; }
.segmented-links a {
  display: inline-flex; align-items: center; font-size: 13px; text-decoration: none;
}
.segmented-links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.driver-phone { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.chat-link { font-size: 12px; font-weight: 600; }
.crew-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.crew-list li { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.crew-add { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.crew-add .control { min-width: 0; flex: 1 1 160px; }
.segmented-links { width: fit-content; }
/* In lists the row opens the item, so names, plates and numbers inside it read as text until hovered. */
.table td.cell-driver a, .table td a.plate, .table .driver-phone a:not(.chat-link) { color: var(--text); text-decoration: none; }
.table td.cell-driver a:hover, .table td a.plate:hover, .table .driver-phone a:hover { text-decoration: underline; }
.chat-link { text-decoration: none; }
.chat-link:hover { text-decoration: underline; }

/* A fieldset's legend is drawn on the frame's top edge by the browser; floated, it becomes an ordinary first line inside
   the white card, spaced like everything else in it (YY, 28 Oct: titles sat outside their frames). */
.form-section > legend, fieldset.field > legend { float: left; width: 100%; margin: 0; padding: 0; }
.form-section > legend { padding-top: 2px; font-size: 15px; }

/* The chosen part of a switch is blue in both themes (YY, 28 Oct: in dark mode the raised grey didn't show). */
.segmented input:checked + label,
.segmented-links a[aria-current="page"] { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.segmented-wide { display: flex; width: fit-content; }
/* Each choice of a switch on one line, its words centred (YY, 15 Nov: "Chargement et déchargement" broke onto two lines,
   off-centre); in a form's field too narrow for them all, the choices go onto a second row rather than cut a word. */
.segmented label { white-space: nowrap; justify-content: center; }
.field .segmented { flex-wrap: wrap; max-width: 100%; }
.field .segmented label { flex: 1 0 auto; }
.calc { display: flex; flex-direction: column; gap: 10px; }
.calc-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
.calc-grid .control { width: 100%; }
.calc-result { margin-top: 12px; }
.year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.alert-warn { background: var(--tint-warn); color: var(--text); margin-top: 12px; }
.prefix-box { text-transform: uppercase; letter-spacing: .04em; max-width: 160px; }

/* Orders (step 6) */
.order-number { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.order-fields { border: 0; margin: 0; padding: 0; min-width: 0; }
.detail-side.order-fields { grid-area: side; }
.detail-side > .side-fields { display: flex; flex-direction: column; gap: inherit; }
.stop-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.stop { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 8px 12px;
  border-radius: var(--radius); background: var(--surface); }
.stop.is-removed .stop-fields { opacity: .45; text-decoration: line-through; }
.stop-grip { cursor: grab; color: var(--muted); user-select: none; text-align: center; letter-spacing: -2px; }
.stop-grip:active { cursor: grabbing; }
.stop-fields { flex-direction: column; min-width: 0; }
.stop-line { display: flex; flex-wrap: wrap; align-items: flex-start; }
.stop-kind-field { width: 130px; }
.stop-site-field { flex: 1; min-width: 220px; }
.stop-site-field .field { width: 100%; }
.stop-line > .field:has(.date-box) { width: 132px; }
.stop-line > .field:has(.time-box) { width: 96px; }
.stop-line .date-box, .stop-line .time-box { width: 100%; }
.stop-refs { flex: 1; min-width: 180px; }
.stop-refs .field, .stop-refs .control { width: 100%; }
.stop-remove { display: inline-flex; gap: 4px; align-items: center; cursor: pointer; color: var(--muted); font-size: 13px; }
.stop-remove input { position: absolute; opacity: 0; pointer-events: none; }
.stop-remove:hover, .stop-remove:focus-within { color: var(--danger); }
.stop-swap { display: flex; align-items: center; height: 24px; }
.stop-swap::before, .stop-swap::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.stop-swap[hidden] { display: none; }
.btn-swap { border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 999px;
  width: 28px; height: 24px; cursor: pointer; font-size: 14px; line-height: 1; transition: background-color 150ms, color 150ms; }
.btn-swap:hover, .btn-swap:focus-visible { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .btn-swap { transition: none; } }
.add-stop-line { display: flex; gap: 16px; align-items: center; margin-top: 12px; }
.date-box { font-variant-numeric: tabular-nums; }
.message-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.message-list p { margin: 2px 0 0; }
.message-form { display: flex; gap: 8px; align-items: flex-end; }
.message-form textarea { flex: 1; height: auto; padding: 8px 12px; min-width: 0; }
[aria-busy="true"] { opacity: .55; transition: opacity 150ms; }
@media (prefers-reduced-motion: reduce) { [aria-busy="true"] { transition: none; } }
.segmented label { transition: color 150ms; } /* its blue comes with the glide, then stays without a fade */
@media (prefers-reduced-motion: reduce) { .segmented label, .segmented-links a { transition: none; } }
.tab-count { margin-left: 4px; font-size: 12px; opacity: .7; font-variant-numeric: tabular-nums; }
.column-form { margin-top: 8px; padding: 14px 16px; background: var(--surface); border-radius: var(--radius-lg); display: flex; flex-direction: column; gap: 12px; }
.column-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 12px; }
.table-scroll { overflow-x: auto; }
.table tr.is-cancelled td { color: var(--muted); }
.table tr.is-cancelled td .cell-number a { text-decoration: line-through; }
.status-draft { background: var(--fill); color: var(--text); }
.status-assigned { background: var(--accent-soft); color: var(--accent); }
.status-confirmed { background: var(--success-soft); color: var(--success); }
.status-cancelled { background: var(--tint-warn); color: var(--text); }
.tag-link { text-decoration: none; background: var(--accent-soft); color: var(--accent); }
.tag-link:hover { text-decoration: underline; }
/* A list with many columns scrolls sideways inside its own frame; its header still sticks, to the frame's top. */
.table-wrap.table-scroll { overflow: auto; max-height: calc(100vh - var(--topbar-h) - 40px); }
.table-scroll .table th { top: 0; }
.table-scroll .table td { white-space: nowrap; }
.table-scroll .table td.cell-company { white-space: normal; }
.bulk-orders { margin: 8px 0 16px; padding-left: 1.2em; display: flex; flex-direction: column; gap: 2px; }
.menu-columns { width: min(380px, calc(100vw - 16px)); padding: 0; }
.menu-columns .column-form { margin: 0; background: transparent; padding: 12px 14px; }
.menu-columns .column-choices { grid-template-columns: 1fr 1fr; }
.menu-title { margin: 0; font-weight: 600; font-size: 13px; }
.table thead tr[data-row-menu] th { cursor: context-menu; }
.table thead tr[data-row-menu] th a { cursor: pointer; }
/* Sites beside their map: the name keeps room, the other columns wrap (29 Oct: the row menu's column squeezed it). */

/* Icon buttons that grow into their word (YY, 29 Oct): the same size, shape and fill for Edit, Book, Archive, Delete.
   Only the label's width moves, 150 ms, on hover or keyboard focus; the icon stays under the pointer (the button
   grows to the left). Nothing moves for people who ask for reduced motion. */
.btn-expand {
  display: inline-flex; align-items: center; justify-content: flex-end; height: 34px; min-width: 34px; padding: 0 7px;
  border: 0; border-radius: 17px; background: var(--fill); color: var(--text); font: 500 13px/1.25 var(--font);
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn-expand .icon { width: 20px; height: 20px; flex: none; }
.btn-expand-label { max-width: 0; overflow: hidden; opacity: 0; transition: max-width 150ms ease-out, opacity 150ms ease-out, margin 150ms ease-out; }
.btn-expand:hover .btn-expand-label, .btn-expand:focus-visible .btn-expand-label { max-width: 9em; opacity: 1; margin: 0 6px 0 4px; }
.btn-expand:hover { background: var(--fill-hover); }
.btn-expand:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-expand.is-archive { color: var(--muted); }
.btn-expand.is-danger { background: var(--tint-red); color: var(--danger); }
.btn-expand.is-danger:hover { background: var(--tint-red); filter: brightness(.97); }
.btn-expand.is-accent { background: var(--accent-soft); color: var(--accent); }
.head-actions form { display: contents; }
@media (prefers-reduced-motion: reduce) { .btn-expand-label { transition: none; } }

/* One dialog to confirm a delete, a cancel or an archive, with an optional reason (YY, 29 Oct). */
.confirm-dialog { width: min(440px, calc(100vw - 32px)); }
.menu-count { padding: 6px 10px 4px; color: var(--muted); font-weight: 500; }

/* Selecting (YY, 29 Oct): the tick column shows only once selecting starts; round tick boxes. */
.js-select body:not(.is-selecting) .cell-select { display: none; }
/* The buttons the script hides in the forms it sends by itself (lists.js, maps.js, motion.js, confirm.js), hidden from
   the first frame: js-select is on <html> at once where modules run (core/templatetags/assets.py), the modules a moment
   later (the screen checker's slow load, 10 Nov). The same five kinds of form as the script's, no other. */
.js-select :is(form[data-live], form[data-autosave], [data-theme-form], [data-motion-form], form:has([data-submit-on-change]), [data-dot-colour-form]) .js-hide { display: none; }
.cell-select input[type=checkbox], .ticket-row > input[type=checkbox], .tickets-head input[type=checkbox] {
  -webkit-appearance: none; appearance: none; width: 20px; height: 20px; margin: 0; flex: none;
  border: 1.5px solid var(--border-strong); border-radius: 50%; background: var(--surface) center / 12px 12px no-repeat;
  cursor: pointer; vertical-align: middle; transition: background-color 120ms, border-color 120ms;
}
.cell-select input[type=checkbox]:hover { border-color: var(--accent); }
.cell-select input[type=checkbox]:checked, .ticket-row > input[type=checkbox]:checked, .tickets-head input[type=checkbox]:checked {
  background-color: var(--accent); border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.6l4.5-5' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.cell-select input[type=checkbox]:indeterminate {
  background-color: var(--accent); border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6h6' stroke='white' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}
.cell-select input[type=checkbox]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cell-select { width: 40px; }
tr:has(.cell-select input:checked) { background: var(--accent-soft); }
@media (prefers-reduced-motion: reduce) { .cell-select input[type=checkbox] { transition: none; } }

/* A stop's own place (YY, 29 Oct) */
.stop-place .stop-company { flex: 1 1 150px; min-width: 0; }
.stop-place .stop-street { flex: 1.5 1 170px; min-width: 0; }
.stop-place .stop-town { flex: 1 1 110px; min-width: 0; }
.stop-place .field, .stop-place .control, .stop-place input { width: 100%; }
.stop-site:empty { display: none; }
.site-book-list { margin: 0 0 12px; padding-left: 18px; }

/* Goods and money on an order (step 7) */
.goods-line { display: flex; flex-wrap: wrap; align-items: flex-start; margin-bottom: 12px; }
.goods-line > .field { width: 120px; }
.goods-line .control, .goods-line input, .goods-line select { width: 100%; }
.goods-ticks { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 12px; }
.cost-calc { margin: 4px 0 12px; }
.cost-calc > summary { cursor: pointer; color: var(--accent); }
.cost-calc[open] > summary { margin-bottom: 8px; }
.rate-facts dd strong { font-variant-numeric: tabular-nums; }
.text-danger { color: var(--danger); }

/* A partner's contacts (step 7) */
.contact-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; }
.contact-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.contact-list li:first-child { border-top: 0; }
.add-contact > summary::-webkit-details-marker { display: none; }
.add-contact[open] > summary { margin-bottom: 12px; }

/* Documents on an order (step 7) */
.document-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.document-line:first-of-type { border-top: 0; }
.document-actions { display: flex; gap: 6px; flex: none; }
.sent-list { list-style: none; margin: 8px 0 0; padding: 8px 0 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.control-small { height: 30px; padding: 0 8px; font-size: 13px; width: auto; }

/* The trip's km, days, hours and tolls: two even columns, one line of label each, boxes level (YY, 30 Oct) */
.trip-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; align-items: end; }
.trip-grid .field { margin: 0; }
.trip-grid .control, .trip-grid input { width: 100%; }
.rate-facts { column-gap: 16px; }

/* Even lines (YY, 30 Oct: no box left alone on a line): a stop's place on one row of even proportions, the documents'
   buttons under their name. */
.stop-line.stop-place { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.6fr) 84px minmax(0, 1fr) minmax(0, 1fr); }
.stop-place > div, .stop-place > .field, .stop-place .stop-country { width: auto; min-width: 0; flex: none; }
.stop-place > .field:has(.postcode-box) { width: auto; }
@media (max-width: 720px) {
  .stop-line.stop-place { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.document-line { flex-direction: column; align-items: stretch; }
.document-line .muted { overflow-wrap: anywhere; }
.document-actions { justify-content: flex-end; }

/* Motion (YY, 30 Oct): springs, like things with a little weight, never a wait. Two springs for the whole TMS: a quick
   one with a small settle for small things (menus, icons, tick boxes), a soft one for dialogs and panels. Only
   position, size and transparency move, so nothing stutters; with "reduce motion" asked by the computer, nothing moves. */
:root {
  --spring-quick: linear(0, 0.059, 0.195, 0.363, 0.531, 0.681, 0.805, 0.899, 0.965, 1.008, 1.033, 1.044, 1.046, 1.042, 1.035, 1.027, 1.02, 1.013, 1.008, 1.004, 1.001, 1, 1);
  --spring-soft: linear(0, 0.057, 0.184, 0.335, 0.483, 0.614, 0.724, 0.81, 0.875, 0.922, 0.955, 0.977, 0.991, 0.999, 1.004, 1.006, 1.006, 1.005, 1.004, 1.003, 1.002, 1.001, 1);
  --motion-quick: 220ms;
  --motion-soft: 280ms;
}

/* Menus grow out of where they were opened (the click, or their ⋯ button). */
@keyframes menu-in { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
.menu:not([hidden]) { animation: menu-in var(--motion-quick) var(--spring-quick); }

/* Dialogs rise in, the page behind fades. */
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
dialog[open] { animation: dialog-in var(--motion-soft) var(--spring-soft); }
dialog[open]::backdrop { animation: backdrop-in 180ms ease-out; }

/* The bulk bar slides in, the tick boxes pop in, a selected row tints softly. */
@keyframes bar-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes tick-in { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.bulk-bar:not([hidden]) { animation: bar-in var(--motion-quick) var(--spring-quick); }
body.is-selecting .cell-select input { animation: tick-in var(--motion-quick) var(--spring-quick); }
.table tbody tr { transition: background-color 160ms ease-out; }
.cell-select input[type=checkbox]:checked { animation: tick-in 200ms var(--spring-quick); }

/* Every button presses in like the rail's icons (YY, 2 Nov: Fleet today, Today, New order): a quick press, a soft
   spring back on release, the colour easing on hover. Still with animations off or reduced motion asked. */
.btn, .btn-expand { transition: transform var(--motion-quick) var(--spring-quick), background-color 160ms ease-out, filter 160ms ease-out, color 160ms ease-out; }
.btn:active, .btn-expand:active { transform: scale(.95); transition: transform 80ms ease-out; }

/* The order's cell when the board is opened from the order (YY, 2 Nov): outlined, with one soft pulse. */
@keyframes cell-found { 0% { box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 0 var(--accent-soft); } 50% { box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 8px var(--accent-soft); } 100% { box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 0 var(--accent-soft); } }
.board-cell[data-flash-cell] { box-shadow: inset 0 0 0 2px var(--accent); background-image: linear-gradient(var(--accent-soft), var(--accent-soft)); animation: cell-found 900ms ease-out 2; }

/* Stops: the one being dragged lifts; the others slide aside (orders/ script, FLIP). */
.stop.is-dragged { opacity: 1; position: relative; z-index: 3; border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 94%, var(--text));
  box-shadow: 0 0 0 1px var(--border-strong), 0 14px 32px rgba(0, 0, 0, .22); }
body.is-dragging-stop .stop-swap { visibility: hidden; } /* the ⇅ come back between the stops once it's dropped */
.stop-grip { touch-action: none; }
body.is-dragging-stop, body.is-dragging-stop * { cursor: grabbing !important; user-select: none; }


/* Motion on every page (YY, 30 Oct: "not just the orders"). */
/* Folds (Documents, History, the small ones on a partner) open and close by sliding their height. Where the browser
   can't (an older one), they open at once as before. */
:root { interpolate-size: allow-keywords; }
details::details-content {
  block-size: 0; overflow: clip; overflow-clip-margin: 4px; opacity: 0;
  transition: block-size var(--motion-soft) var(--spring-soft), opacity 200ms ease-out, content-visibility var(--motion-soft) allow-discrete;
}
details[open]::details-content { block-size: auto; opacity: 1; }
/* A fold holding a typed list (the order's spot truck, YY's test of 9 Nov: "they look cut off"): it slides open
   clipped as every fold does (R4), then lets go once open, so a list under or over its box shows whole (P1); closing,
   it clips again at once. */
details[open]:has(.suggest-wrap)::details-content {
  overflow: visible;
  transition: block-size var(--motion-soft) var(--spring-soft), opacity 200ms ease-out,
    content-visibility var(--motion-soft) allow-discrete, overflow 0s linear var(--motion-soft) allow-discrete;
}
.fold > summary::after { transition: transform var(--motion-quick) var(--spring-quick), margin var(--motion-quick) ease-out; }

/* Menus, suggestion lists and dialogs fade out quickly instead of vanishing in one frame. */
@keyframes list-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.suggest-list:not([hidden]) { animation: list-in 180ms var(--spring-quick); }
.menu, .suggest-list { transition: opacity 110ms ease-in, transform 110ms ease-in, display 110ms allow-discrete; }
.menu[hidden], .suggest-list[hidden] { opacity: 0; transform: scale(.97); }
dialog { transition: opacity 120ms ease-in, transform 120ms ease-in, overlay 120ms allow-discrete, display 120ms allow-discrete; }
dialog:not([open]) { opacity: 0; transform: translateY(6px) scale(.98); }
dialog::backdrop { transition: opacity 120ms ease-in, overlay 120ms allow-discrete, display 120ms allow-discrete; }
dialog:not([open])::backdrop { opacity: 0; }

/* A message after saving slides in. */
@keyframes flash-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.flash { animation: flash-in var(--motion-soft) var(--spring-soft); }

/* A switch's blue glides from the old choice to the new one (the script draws it for the time of the move). */
.segmented { position: relative; }
.segmented label, .segmented-links a { position: relative; z-index: 1; }
.segmented.is-gliding input:checked + label { background: transparent; }
.segmented > a, .segmented > button { position: relative; z-index: 1; }
.segmented.is-gliding > .is-on, .board-panel-rest .segmented.is-gliding button.is-on { background: transparent; }
.seg-glide { position: absolute; z-index: 0; border-radius: 7px; background: var(--accent); pointer-events: none; }

/* Whatever shows up when something is ticked or picked (ADR, temperature, a formula's boxes, an error, "Remove this
   file for good?") is moved in by the script: see "revealed" in motion.js. */

@media (prefers-reduced-motion: reduce) {
  .menu:not([hidden]), dialog[open], dialog[open]::backdrop, .bulk-bar:not([hidden]), .suggest-list:not([hidden]), .calendar, .calendar.is-above, .calendar .is-next, .calendar .is-back, .calendar .is-view, .flash,
  body.is-selecting .cell-select input, .cell-select input[type=checkbox]:checked { animation: none; }
  .table tbody tr, .menu, .suggest-list, .calendar, dialog, dialog::backdrop, details::details-content, .fold > summary::after { transition: none; }
  .btn:active, .btn-expand:active { transform: none; }
}

/* Animations off in My settings (YY, 30 Oct): the same as Windows asking for less, whatever the computer says. */
:root[data-motion="off"] *, :root[data-motion="off"] *::before, :root[data-motion="off"] *::after,
:root[data-motion="off"] dialog::backdrop, :root[data-motion="off"] details::details-content { animation: none !important; transition: none !important; }
:root[data-motion="off"] .btn:active, :root[data-motion="off"] .btn-expand:active { transform: none; }

/* Company settings (YY, 30 Oct): a search box that keeps only the matching settings, the matching words tinted. */
html:not(.js) .settings-search { display: none; }
.settings-search { position: sticky; top: 52px; z-index: 5; margin: 0 -8px 8px; padding: 8px; background: var(--bg); }
.settings-search .control-search { width: 100%; max-width: 420px; }
.settings-search-hit { width: fit-content; background: var(--accent-soft); color: var(--accent); border-radius: 4px; box-shadow: 0 0 0 3px var(--accent-soft); }


/* Orders filters (YY, 30 Oct): chips that add up, "+ Filter" and its little editor; saved views as tabs. */
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1 0 100%; } /* the chips' own row */
.chips-end { display: inline-flex; gap: 4px; margin-left: auto; }
.filter-chip { display: inline-flex; align-items: center; height: 30px; border-radius: 15px; background: var(--accent-soft); color: var(--accent); font-size: 13px; }
.filter-chip-text { height: 100%; padding: 0 4px 0 12px; border: 0; border-radius: 15px 0 0 15px; background: none; color: inherit; font: inherit; cursor: pointer; white-space: nowrap; max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
.filter-chip-label { font-weight: 600; }
.filter-chip-remove { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 2px; border-radius: 50%; color: inherit; text-decoration: none; font-size: 16px; line-height: 1; }
.filter-chip-remove:hover, .filter-chip-text:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.filter-chip-text:focus-visible, .filter-chip-remove:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 15px; }
.filter-add { height: 30px; border-radius: 15px; }
.filter-pop {
  position: absolute; z-index: 45; width: 320px; max-height: min(460px, 70vh); overflow-y: auto; padding: 10px; border-radius: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.filter-pop:not([hidden]) { animation: menu-in var(--motion-quick) var(--spring-quick); transform-origin: top left; }
.filter-find, .filter-input { width: 100%; }
/* "Find a field": the slim box YY liked on Orders (YY's test of 9 Nov, twice: "identical stylistically"), set on
   purpose, so a long field list never squeezes it and a short one never lets it grow: the same on every list (R5). */
.filter-pop .filter-find { flex: none; height: 20px; min-height: 0; padding-top: 0; padding-bottom: 0; }
.filter-fields { display: flex; flex-direction: column; }
.filter-group { margin: 8px 4px 2px; color: var(--accent); font-size: 12px; font-weight: 600; } /* the field groups in blue (YY, 30 Oct) */
.filter-field { text-align: left; padding: 6px 8px; border: 0; border-radius: 7px; background: none; color: var(--text); font: inherit; cursor: pointer; }
.filter-field:hover, .filter-field:focus-visible { background: var(--hover); outline: none; }
.filter-field[data-used]::after { content: " · in use"; color: var(--muted); font-size: 12px; }
.filter-title { margin: 0; font-weight: 600; }
.filter-ways { display: flex; flex-wrap: wrap; gap: 4px; }
.filter-way { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 13px; background: var(--fill); font-size: 13px; cursor: pointer; }
.filter-way:has(input:checked) { background: var(--accent); color: var(--on-accent); }
.filter-way input { position: absolute; opacity: 0; pointer-events: none; }
.filter-way:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.filter-value { display: flex; flex-direction: column; gap: 6px; }
.filter-value:empty { display: none; }
.filter-options { display: flex; flex-direction: column; max-height: 220px; overflow-y: auto; }
.filter-option { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.filter-option:hover { background: var(--hover); }
.filter-pop .form-actions { margin: 0; }
.view-tab { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 15px; background: var(--fill); color: var(--text); font-size: 13px; font-weight: 500; text-decoration: none; }
.view-tab:hover { background: var(--hover); }
.view-tab.is-active { background: var(--accent); color: var(--on-accent); }
:root[data-motion="off"] .filter-pop { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .filter-pop:not([hidden]) { animation: none; } }

/* Readiness (step 9b, YY 31 Oct): one line per check, a green or amber dot, why it's open under its name. */
.tag-ok { background: rgba(52, 199, 89, .18); color: var(--text); }
.readiness-head { display: flex; align-items: center; gap: 8px; }
/* Send at the end of Readiness's title line (YY's pick of 10 Nov, drawing A); a line that stops it says so, small. */
.readiness-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.readiness-list { list-style: none; margin: 0; padding: 0; }
.readiness-line { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; border-top: 1px solid var(--border); }
.readiness-line:first-child { border-top: 0; }
.readiness-line > .dot { margin-top: 4px; }
.readiness-note { display: block; }
.readiness-ok { margin-top: 6px; }
.confirm-dialog .readiness-list { margin: 4px 0 12px; }
/* The vehicle asked: body, size and equipment on one even line. */
.vehicle-line { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.vehicle-line .field { margin: 0; }
.vehicle-line .control, .vehicle-line select, .vehicle-line input { width: 100%; }
@media (max-width: 700px) { .vehicle-line { grid-template-columns: minmax(0, 1fr); } }
/* The list: a loading today or tomorrow not yet confirmed, its date in amber. */
td.is-soon, td.is-soon .muted { color: var(--warning); font-weight: 600; }
td.is-today, td.is-today .muted { color: var(--warning); font-weight: 600; }  /* today's day (drawing A) */
/* Send greyed on a cabotage breach (YY, 1 Nov): the reason on hover, over the wrapper (a disabled button shows none). */
.send-blocked { display: inline-flex; cursor: not-allowed; }
.send-blocked .btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
/* Send never hidden (YY, 5 Nov): with nobody's email it stays greyed, the reason written beside it in amber. */
.send-missing { align-items: center; gap: 8px; }
.document-actions { flex-wrap: wrap; }  /* in the narrow column the reason and Send go together under EN and PDF */
.send-why { color: var(--warning); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
/* Refused outright (a Blocked partner, the admin's OK, no unloading stop, the weight or LDM; YY 6 Nov): red, wrapping. */
.send-why-refused { color: var(--danger); white-space: normal; text-align: right; max-width: 240px; }
.text-warning { color: var(--warning); }
.text-success { color: var(--success); }
/* The carrier's page link to copy (YY, 5 Nov): on the order's transport order line and the carrier's partner page. */
.document-link { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 4px; }
.copy-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.copy-line a { min-width: 0; overflow-wrap: anywhere; }
/* Its label on the link's line, not 5 px above it (screen checker, 5 Nov): the row sits on the link's baseline. */
.facts dt:has(+ dd > .copy-line), .facts dd:has(> .copy-line) { align-self: baseline; }

/* The planning board (board part B2, YY's board's rules, in the TMS's look): one row per truck under its company, the
   week as columns, Saturday and Sunday in one narrow column of marks, the next Monday at the end; cells touch with 1px
   lines and square corners, their stops centred; the day headers and the truck column stay in view. Read from across
   the room (YY, 1 Nov): nothing under 16px on the board, a place 18px. A colour names a kind of thing: red a cabotage
   breach (and the carrier's rate on the truck cell) and nothing else, purple a public holiday where the truck is, the
   Inter reminder bordered and neutral. */
.week-nav { gap: 6px; }
.planning { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.planning.with-fleet { grid-template-columns: minmax(0, 1fr) 320px; }
.board-wrap { position: relative; z-index: 0; background: var(--surface); border-radius: var(--radius-lg); overflow: auto; max-height: calc(100vh - 210px); }  /* its own layer: its sticky header never paints over the top bar */
.board { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1124px; table-layout: fixed; font-size: 16px; font-variant-numeric: tabular-nums; }
.board-col-truck { width: 212px; }  /* "GE-412-TZ // GE-913-TZ" on one line */
.board-col-weekend { width: 72px; }
.board th, .board td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.board thead th { position: sticky; top: 0; z-index: 3; background: var(--surface); padding: 8px 4px; text-align: center; }
.board .board-truck { position: sticky; left: 0; z-index: 2; background: var(--surface); text-align: left; padding: 4px 10px; font-weight: 600; overflow: hidden; }
.board .board-truck-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
.board thead .board-truck { z-index: 4; white-space: nowrap; }
.board .board-truck a { color: inherit; text-decoration: none; }
.board .board-truck .plate { white-space: nowrap; }
.board-trailer { color: var(--muted); font-weight: 500; white-space: nowrap; }
.board-truck-line { display: block; font-size: 16px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-mega { font-weight: 700; letter-spacing: .04em; }
.board-rate { color: var(--danger); font-weight: 700; }
.board-km { color: var(--muted); font-weight: 500; }
.board-weekday { display: block; font-size: 16px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.board-date { display: block; font-size: 16px; font-weight: 600; }
.board-day.is-weekend, .board-cell.is-weekend { background-color: var(--fill); }
.board-group th { background: var(--bg); text-align: left; padding: 6px 10px; font-size: 16px; font-weight: 700; }
/* The company's name stays at the left edge while the week scrolls sideways (YY, 3 Nov: cut at 1280 px). */
.board-group-name { position: sticky; left: 10px; display: inline-block; white-space: nowrap; }
.board-country { display: inline-block; min-width: 28px; padding: 0 5px; border-radius: 4px; background: var(--fill); font-size: 16px; text-align: center; }
/* Every truck's row one height (YY, 3 Nov): the four lines of the truck cell at most (plate // trailer, MEGA, rate,
   km), so a cell grows only when it holds more stops than fit. */
.board-cell { position: relative; padding: 4px 3px; text-align: center; vertical-align: middle; height: 88px; }
.board-cell.is-holiday { background-color: rgba(93, 63, 211, .16); }
.board-cell.is-breach { box-shadow: inset 0 0 0 2px var(--danger); background-color: var(--tint-red); }
/* Symmetry (YY, 1 Nov): the loading and unloading arrows are one drawing, the unloading turned upside down, and in a
   cell they stand in one column whatever the towns' lengths; the block of stops is centred in the cell as a whole. */
.board-stops { display: inline-flex; flex-direction: column; align-items: stretch; max-width: 100%; text-align: left; }
.board-stop { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: start; column-gap: 4px; color: inherit; text-decoration: none; font-size: 18px; font-weight: 500; line-height: 1.3; padding: 1px 0; }
.board-stop .board-arrow { display: flex; justify-content: center; height: 1.3em; align-items: center; }
.board-stop:hover .board-place { text-decoration: underline; }
/* One line per stop (YY, 3 Nov): a long town or free text ends in "…", the whole of it on hover and in the panel; the
   time and the delay mark stay whole, so every row keeps one height. */
.board-place { display: flex; align-items: baseline; gap: .3em; min-width: 0; white-space: nowrap; }
.board-town { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.board-place .board-time, .board-place .board-delay { flex: none; }  /* only the town is cut (YY's board SPEC) */
.board-arrow { color: inherit; text-decoration: none; }
.board-arrow-mark { display: block; width: 20px; height: 20px; }
.board-arrow-mark.is-down { transform: rotate(180deg); }
.board-weekend-line .board-arrow { display: inline-flex; vertical-align: middle; margin: 0 1px; }
.board-time { font-weight: 700; }
.board-weekend-line { min-height: 24px; font-size: 16px; letter-spacing: 2px; }
.board-mark { display: flex; flex-direction: column; align-items: stretch; margin-bottom: 2px; font-size: 16px; line-height: 1.25; }
.board-mark > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }  /* one line each, whole on hover */
.board-mark.board-mark-inter { display: block; max-width: 100%; box-sizing: border-box; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-mark-breach > * { white-space: normal; }  /* a breach is read whole, even if its cell grows */
.board-mark-breach strong { display: block; width: 100%; padding: 1px 4px; border-radius: 3px; background: var(--danger); color: var(--surface); font-size: 16px; letter-spacing: .02em; }
.board-mark-breach span, .fleet-mark.board-mark-breach { color: var(--danger); font-weight: 700; }
.board-mark-inter { display: inline-flex; padding: 1px 6px; border: 1px solid var(--muted); border-radius: 4px; color: var(--text); }
.board-mark-short { position: absolute; top: 2px; right: 4px; min-width: 18px; border-radius: 4px; font-size: 16px; font-weight: 800; line-height: 18px; }
.board-mark-short.board-mark-breach { background: var(--danger); color: var(--surface); }
.board tbody tr:not(.board-group):hover > * { background-image: linear-gradient(var(--hover), var(--hover)); }
.board-day[data-flash], .board-cell[data-flash-cell] { animation: board-today 1200ms ease-out; }
@keyframes board-today { from { box-shadow: inset 0 0 0 3px var(--accent); background-color: var(--accent-soft); } }
@media (prefers-reduced-motion: reduce) { .board-day[data-flash], .board-cell[data-flash-cell] { animation: none; } }
:root[data-motion="off"] .board-day[data-flash], :root[data-motion="off"] .board-cell[data-flash-cell] { animation: none; }
/* Fleet today beside the week: per company, where each truck will be empty; [TODAY!] in red (the board's Q114). */
.fleet-today { position: sticky; top: 72px; max-height: calc(100vh - 100px); overflow: auto; font-size: 16px; }
.fleet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.fleet-day { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.fleet-company { margin: 12px 0 4px; font-size: 16px; }
.fleet-list { list-style: none; margin: 0; padding: 0; }
.fleet-list a { display: block; padding: 6px 4px; border-top: 1px solid var(--border); color: inherit; text-decoration: none; font-size: 17px; }
.fleet-list a:hover { background: var(--hover); }
@media (max-width: 1100px) { .planning.with-fleet { grid-template-columns: minmax(0, 1fr); } .fleet-today { position: static; } }
/* Editing on the board (part B3): the selected cell ringed in blue, a copied or cut cell dashed, the cell under a
   dragged stop tinted; the dragged stop itself lifts and follows the pointer. Day states fill a day with no stop
   (blue en route, grey stopped, grey ring paid waiting, dashed service); a delay is gold, on its stop and its cell's
   frame; "Client missing" and "Site missing" amber (YY, 1 Nov). */
.board-cell[data-cell]:focus { outline: none; }
[data-editable] [data-stop] { -webkit-user-drag: none; user-select: none; touch-action: none; }
.board-cell.is-selected { box-shadow: inset 0 0 0 2px var(--accent); }
.board-cell.is-clipped { outline: 2px dashed var(--accent); outline-offset: -4px; }
.board-cell.is-drop { background-image: linear-gradient(var(--accent-soft), var(--accent-soft)); }
.board.is-dragging, .board-wrap.is-dragging { cursor: grabbing; }
.board-deaf { margin: 0 0 12px; }  /* the board no longer hearing from the server (js-board-poll-silent) */
.board-stop.is-dragging, .board-arrow.is-dragging { opacity: .35; }
.board-drag { position: fixed; z-index: 50; pointer-events: none; padding: 4px 8px; border-radius: 10px; background: var(--surface); box-shadow: 0 10px 28px rgba(0, 0, 0, .22); font-size: 18px; }
:root[data-theme="dark"] .board-drag { outline: 1px solid var(--border); }
.board-state { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 4px; font-size: 16px; font-weight: 600; }
.board-state.is-en_route { background: var(--accent-soft); color: var(--accent); }
.board-state.is-stopped { background: var(--fill); color: var(--muted); }
.board-state.is-waiting { box-shadow: inset 0 0 0 2px var(--muted); color: var(--muted); }
.board-state.is-service { outline: 2px dashed var(--muted); outline-offset: -4px; color: var(--muted); }
.board-state-beside { font-size: 16px; color: var(--muted); margin-top: 2px; }
.board-state-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; }
.board-state-dot.is-en_route { background: var(--accent); }
.board-state-dot.is-stopped { background: var(--muted); }
.board-state-dot.is-waiting { box-shadow: inset 0 0 0 2px var(--muted); }
.board-state-dot.is-service { border: 2px dashed var(--muted); }
.board-cell:has(.has-delay) { box-shadow: inset 0 0 0 2px #c9a227; background-color: rgba(201, 162, 39, .12); }
.board-delay { font-size: 16px; font-weight: 700; color: #8a6d00; }
.board-delay-reported { border-bottom: 2px dashed #c9a227; }
.board-delay-confirmed { padding: 0 4px; border-radius: 3px; background: #c9a227; color: #fff; }
:root[data-theme="dark"] .board-delay { color: #e6c35c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .board-delay { color: #e6c35c; } }
.board-missing { display: block; max-width: 100%; font-size: 16px; font-weight: 600; color: var(--warning); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 72px; }
.board-side .fleet-today { position: static; }
.board-panel { font-size: 16px; }
.board-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.board-panel-days { margin-bottom: 8px; }
.board-panel-days a { padding: 4px 10px; border-radius: 999px; text-decoration: none; color: inherit; }
.board-panel-days a.is-on { background: var(--accent); color: #fff; }
.board-panel-stops { list-style: none; margin: 0 0 8px; padding: 0; }
.board-panel-stops > li { padding: 8px 0; border-top: 1px solid var(--border); }
.board-panel-stop { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 6px; align-items: start; }
.board-panel-text { display: grid; justify-items: start; gap: 2px; min-width: 0; }
/* One left edge and one height (YY, 2 Nov): every control and button in the panel stands 36px high, the two
   selects as wide as each other, labels in one style. */
.board-panel .control, .board-panel .btn { height: 36px; font-size: 15px; }
.board-panel .board-panel-line .control-small { width: 128px; }
.board-panel label { font-weight: 600; font-size: 15px; }
.board-panel-orders { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.board-panel-type, .board-panel-state { display: grid; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.board-panel-line { display: flex; gap: 6px; min-width: 0; }
.board-panel-line .control:not(.control-small) { flex: 1 1 0; min-width: 0; width: 100%; }
.board-panel-line .control-small { flex: none; width: auto; }
.board-panel-type .btn, .board-panel-state .btn { justify-self: start; }
.board-panel-sites { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.board-site-choice { width: 100%; text-align: left; padding: 6px 8px; border: 0; border-radius: 8px; background: var(--fill); color: inherit; cursor: pointer; font: inherit; }
.board-site-choice.is-on { background: var(--accent); color: #fff; }
.board-menu { position: absolute; z-index: 60; min-width: 140px; }
/* Every text box starts its text at the same place (YY, 2 Nov): one padding and one line height for all of them. */
textarea, textarea.control, .field textarea { padding: 9px 12px; line-height: 1.45; }
/* A quiet count (carriers missing a document, YY 2 Nov): grey, never red, so it reminds without nagging. */
.dot-info { background: var(--muted); opacity: .6; }
/* Side panels slide in and out (YY, 2 Nov); the hover label shows at once. */
[data-panel].is-entering { animation: panel-in 260ms var(--spring-soft, cubic-bezier(.22, 1, .36, 1)) both; }
[data-panel].is-leaving { animation: panel-out 170ms ease-in both; }
@keyframes panel-in { from { opacity: 0; transform: translateX(24px); } }
@keyframes panel-out { to { opacity: 0; transform: translateX(24px); } }
@media (prefers-reduced-motion: reduce) { [data-panel].is-entering, [data-panel].is-leaving { animation: none; } }
:root[data-motion="off"] [data-panel].is-entering, :root[data-motion="off"] [data-panel].is-leaving { animation: none; }
.fleet-head h3 { white-space: nowrap; }
.fleet-day { margin-left: auto; }
.hover-tip { position: fixed; z-index: 80; max-width: 320px; padding: 6px 10px; border-radius: 8px; background: var(--text); color: var(--surface); font-size: 14px; line-height: 1.35; pointer-events: none; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); animation: tip-in 120ms ease-out; }
/* A round button's word (YY, 6 Nov 2026: "hovering over round buttons sometimes show as if the texts are in rectangular
   textboxes": the browser's own grey rectangle, its title): data-tip instead, a capsule like the button. */
.hover-tip.is-short { padding: 4px 11px; border-radius: 999px; font-size: 13px; white-space: nowrap; }
@keyframes tip-in { from { opacity: 0; transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .hover-tip { animation: none; } }
:root[data-motion="off"] .hover-tip { animation: none; }
.board-cell.is-picked { background-image: linear-gradient(var(--accent-soft), var(--accent-soft)); box-shadow: inset 0 0 0 2px var(--accent); }

/* Typing in a board cell (YY, 2 Nov): the line covers the cell, the places offered drop below it, the first one
   marked; the site book's sites carry its pin colour. */
.board-cell.is-editing { box-shadow: inset 0 0 0 2px var(--accent); }
.board-editor { position: absolute; inset: 4px; z-index: 6; }
.board-editor-line { width: 100%; height: 40px; font-size: 16px; padding: 0 10px; box-shadow: 0 0 0 2px var(--accent); }
.board-offers { position: fixed; z-index: 30; width: max-content; max-width: 420px; margin: 0; padding: 4px;
  list-style: none; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-pop); }
.board-offer { padding: 8px 10px; border-radius: 8px; font-size: 16px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-offer.is-on, .board-offer:hover { background: var(--accent-soft); color: var(--accent); }

/* One stop picked on the board (YY, 2 Nov): Delete removes just it, a double-click corrects it. */
.board-stop.is-stop-picked, .board-arrow.is-stop-picked { text-decoration: none; border-radius: 6px; background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent); }
.board-panel-fix { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; margin-top: 6px; }
.board-panel-fix .control { flex: 1 1 140px; min-width: 0; }
/* The stop's actions in the cell's panel as round icons that grow into their word (YY, 3 Nov): "To the order" keeps
   its words. */
.board-panel-icons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.board-panel-icons form { display: contents; }
.board-panel-rest { margin: 10px 0 4px; }
.board-panel-rest .segmented button { padding: 4px 12px; border: 0; border-radius: 7px; background: none; color: inherit; font: inherit; cursor: pointer; }
.board-panel-rest .segmented button.is-on { background: var(--accent); color: #fff; font-weight: 600; }  /* blue, as every switch */
.board-rest { display: block; font-size: 16px; font-weight: 700; letter-spacing: 1px; color: var(--muted); }
/* A trailer swap on the day (YY, 10 Nov, DOMAIN.md section 28): only a small icon in the cell's corner, its plates on
   hover; one still to come drawn lighter. */
.board-swap { position: absolute; top: 2px; right: 2px; display: inline-flex; color: var(--accent); line-height: 0; }
.board-swap .icon { width: 14px; height: 14px; }
.board-swap.is-waiting { color: var(--muted); }
.swap-dialog { overflow: visible; }  /* the plate's suggestion list may reach past the dialog's edge (P7) */

/* Back to the top, on the planning (YY, 3 Nov): a round button low on the right, sliding in once the board or the
   page has scrolled down; a click brings both back to the first row. */
.to-top { position: fixed; right: 24px; bottom: 24px; z-index: 30; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--accent); color: #fff; cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, .12); transition: transform 180ms var(--spring-quick, ease-out), opacity 180ms; }
.to-top:hover { transform: translateY(-2px); }
.to-top:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.to-top[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } .to-top:hover { transform: none; } }
:root[data-motion="off"] .to-top { transition: none; }
:root[data-motion="off"] .to-top:hover { transform: none; }
.board thead .board-day.is-weekend { background: linear-gradient(var(--fill), var(--fill)), var(--surface); }  /* solid while the board scrolls under it */

/* The carrier's page (steps 10a and 10b): its orders, no login; what carriers miss comes first, the ones awaiting
   confirmation ticked with one button under them that stays in view while they scroll. */
.carrier-page { max-width: 800px; margin: 0 auto; padding: 24px 16px 48px; display: flex; flex-direction: column; gap: 16px; }
.carrier-page .panel h2 { font-size: 17px; font-weight: 600; margin: 0; }
.carrier-page .panel h3 { font-size: 14px; font-weight: 600; margin: 0; }
.carrier-head .item-title { margin-top: 2px; }
.carrier-awaiting { display: flex; flex-direction: column; gap: 16px; }
.carrier-order { display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 16px; }  /* the email's link scrolls to its order */
.carrier-tick { flex: none; width: 20px; height: 20px; accent-color: var(--accent); }
.carrier-line { margin: 0; }
.carrier-first { padding-left: 12px; border-left: 3px solid var(--accent); }
.carrier-first .facts { margin-top: 6px; }
.carrier-more .facts { margin-top: 10px; }
.carrier-stops { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
/* "We can't take this order" is a button (YY, 5 Nov); pressed in while its question is open. */
.carrier-refuse > summary { width: max-content; list-style: none; }
.carrier-refuse > summary::-webkit-details-marker { display: none; }
.carrier-refuse[open] > summary { filter: brightness(.93); }
.carrier-late { color: var(--danger); font-weight: 600; }  /* a click that came too late, said on its own order */
.carrier-refuse-form { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.carrier-confirm-bar { position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: 0 -1px 0 var(--border); }
.carrier-closed, .carrier-ask { margin: 15vh auto 0; }
/* Files and a message under each order (step 10b-2, YY 4 Nov): a dashed drop box, the carrier's own files above it. */
.carrier-pod-missing { color: var(--warning); font-weight: 600; }
.carrier-pod-ok { color: var(--success); font-weight: 600; }
.carrier-files { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.carrier-file-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.carrier-file-list li { overflow-wrap: anywhere; }
.carrier-drop-help { margin: 4px 0 0; }
.carrier-drop-error { margin: 6px 0 0; color: var(--danger); font-weight: 600; font-size: 13px; overflow-wrap: anywhere; }
.carrier-file-input { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; opacity: 0; }
.carrier-file-input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.carrier-message { display: flex; flex-direction: column; align-items: flex-start; }
.carrier-message textarea { width: 100%; }
/* The proof of delivery on the team's side (10b-2): amber while missing, green once received. */
.tag-pod-ok { background: var(--success-soft); color: var(--success); }
.pod-files { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.pod-files li { overflow-wrap: anywhere; }
/* The carrier's messages beside its files (YY, 5 Nov: in the folded History alone nobody saw them). */
.carrier-messages { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.carrier-messages blockquote { margin: 2px 0 0; border-left-color: var(--accent); color: inherit; }
/* The carrier's time to confirm on the team's side (step 10b, YY 4 Nov): the one looping animation, a blue dot pulsing
   slowly on "Sent, confirmation awaited", amber in the last five minutes; still when motion is off. */
.wait-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--accent); vertical-align: 1px; animation: wait-pulse 2s ease-in-out infinite; }
.wait-dot.is-ending { background: var(--warning); }
@keyframes wait-pulse { 0%, 100% { opacity: 1; transform: none; } 50% { opacity: .3; transform: scale(.75); } }
@media (prefers-reduced-motion: reduce) { .wait-dot { animation: none; } }
:root[data-motion="off"] .wait-dot { animation: none; }
.confirm-left { font-variant-numeric: tabular-nums; white-space: nowrap; }
.status-missing { background: var(--tint-red); color: var(--danger); }
.confirm-time { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.send-time-here { margin-top: 10px; }
.js-select .send-time-here { display: none; }  /* with the script the Send dialog holds these boxes */
.confirm-time input { width: 100%; font-variant-numeric: tabular-nums; }
/* News from the carrier on the Orders list: a blue dot before the number until someone opens the order. */
.cell-number:has(.news-dot) { position: relative; }
.news-dot { position: absolute; left: 2px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--accent); }  /* in the cell's padding: the numbers stay in line */

/* Standard remarks (step 7b): picked on the order with one click, a tinted capsule, blue while its line is in the box.
   One weight on and off, so a click never widens a capsule and re-wraps the row; a long remark wraps inside it. */
.remark-picks { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.remark-pick {
  min-height: 28px; max-width: 100%; padding: 5px 12px; border: 0; border-radius: 14px; background: var(--fill);
  color: var(--text); font: 500 12.5px/1.4 var(--font); text-align: left; cursor: pointer;
  transition: background-color .15s, color .15s;
}
.remark-pick:hover { background: var(--fill-hover); }
.remark-pick[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.remark-pick[aria-pressed="true"]::before { content: "✓ "; }
.remark-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.order-fields:disabled .remark-pick { cursor: default; opacity: .6; }
.field textarea#id_remarks { line-height: 1.45; }  /* beats .field :is(…, textarea)'s 14px/1, picked lines apart */
.remark-list { list-style: none; margin: 0 0 12px; padding: 0; }
.remark-list li + li { border-top: 1px solid var(--border); }
.remark-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 0; }
.remark-row .control { flex: 1 1 260px; min-width: 0; }
/* The same width on every row, the add row's button included, so the boxes line up. */
.remark-actions { display: flex; flex: 0 0 264px; min-width: 0; gap: 6px; }  /* room for Save, ↑, ↓ and Remove (250px; screen checker, 7 Nov), never wider */
.remark-row .btn:disabled { opacity: .35; cursor: default; }
/* A list, not a stack of forms (YY, 7 Nov: "something looks very odd"): each remark reads as plain text, a box only
   under the pointer or while typed in; Save shows while a remark is being changed; the arrows and Remove come up on
   the row under the pointer (always there on a touch screen). */
.remark-list .remark-row .control:not(:focus) { background: transparent; border-color: transparent; box-shadow: none; }
.remark-list .remark-row .control:not(:focus):hover { background: var(--hover); }
.remark-list .remark-save { visibility: hidden; }
.remark-list .remark-row:focus-within .remark-save { visibility: visible; }
.remark-list .remark-actions .btn-quiet { color: var(--muted); }
.remark-list .remark-actions .btn-quiet:hover { color: var(--accent); }
@media (hover: hover) {
  .remark-list .remark-actions .btn-quiet { opacity: 0; transition: opacity .12s; }
  .remark-list li:hover .remark-actions .btn-quiet, .remark-list li:focus-within .remark-actions .btn-quiet { opacity: 1; }
  .remark-list li:hover .remark-actions .btn-quiet:disabled { opacity: .35; }
}
@media (prefers-reduced-motion: reduce) { .remark-list .remark-actions .btn-quiet { transition: none; } }

/* Notices after an action (YY, 6 Nov 2026): small pop-ups bottom right, over the page, gone by themselves after
   5 seconds or at once with ×; the newest at the bottom. They slide in from the right and fade out (about 160 ms);
   with Animations off or reduced motion they only appear and go. On a phone: the width of the screen less 16 px a side. */
.toasts {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  width: min(380px, calc(100vw - 32px)); pointer-events: none;
}
.toasts:empty { display: none; }
.toast {
  pointer-events: auto; width: 100%; margin: 0; padding: 10px 8px 10px 14px; align-items: flex-start;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18), 0 0 0 .5px var(--border-strong);
  animation: toast-in var(--motion-soft) var(--spring-soft);
}
.toast::before { margin-top: 5px; }
.toast-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast-link { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.toast-close {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  margin: -1px 0 -1px 2px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted);
  font: 500 17px/1 var(--font); cursor: pointer;
}
.toast-close::before { content: "×"; }  /* drawn, so the notice's text stays only its words */
.toast-close:hover { background: var(--fill-hover); color: var(--text); }
.toast-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
html:not(.js-toasts) .toast-close { display: none; }  /* without the script nothing would close it */
.toast.is-leaving { opacity: 0; transform: translateX(12px); transition: opacity 160ms ease-in, transform 160ms ease-in; }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } .toast.is-leaving { transform: none; transition: none; } }
:root[data-motion="off"] .toast.is-leaving { transform: none; }

/* Order-ai, part one (YY, 6 Nov 2026): From a document on New order, then the document beside what the TMS found,
   each box with the words it came from; a box focused tints its words in the text, and a tinted word its box. */
.read-drop-box { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px; border: 2px dashed var(--border); border-radius: var(--radius); }
.read-drop-box.is-busy { opacity: .6; pointer-events: none; }
.read-drop-box.is-over, .is-dragging-files .read-drop-box { border-color: var(--accent); background: var(--accent-soft); }
.read-drop-box label.btn { cursor: pointer; }
.read-drop-words { flex: 1 1 160px; min-width: 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.read-file-input { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; opacity: 0; }
.read-file-input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.read-drop-error { margin: 0; color: var(--danger); font-weight: 600; font-size: 13px; overflow-wrap: anywhere; }
.read-drop-help { margin: 0; }
.read-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
.read-source { position: sticky; top: calc(var(--topbar-h) + 12px); min-width: 0; }
.read-source > .muted { margin-top: 8px; }
.read-scan { margin-top: 8px; }
.read-text { margin-top: 8px; max-height: calc(100vh - var(--topbar-h) - 120px); overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.55; }
.read-text:focus-visible { outline: 2px solid var(--accent); }
.read-text-small { max-height: 320px; }
.read-mark { padding: 0 1px; border-radius: 3px; background: var(--accent-soft); color: inherit; cursor: pointer; }
.read-mark.is-current { background: var(--accent); color: #fff; }
.read-found { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.read-line { display: flex; flex-wrap: wrap; align-items: flex-start; }
.read-field { display: flex; flex-direction: column; gap: 3px; flex: 1 1 130px; min-width: 0; }
.read-field.read-wide { flex: 2 1 200px; }
.read-field.read-kind { flex: 0 0 130px; }
.read-field.read-postcode { flex: 0 0 100px; }
.read-field.read-country { flex: 0 0 150px; }
.read-field.read-date { flex: 0 0 132px; }
.read-field.read-window { flex: 0 0 204px; }
.read-pair { display: flex; gap: 12px; }
.read-pair > .field { flex: 1 1 0; min-width: 0; gap: 4px; }
.read-field :is(input, select, textarea) { width: 100%; }
.read-field.is-current :is(input:not([type=hidden]), textarea) { box-shadow: 0 0 0 3px var(--accent-soft); }
.read-stops { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.read-stop { padding: 4px 0 12px; }
.read-stop + .read-stop { border-top: 1px solid var(--border); }
.read-stop:has(.read-not-stop input:checked) .read-line { opacity: .45; }
.read-not-stop input { position: static; opacity: 1; pointer-events: auto; }
.read-kept-facts { grid-template-columns: 130px minmax(0, 1fr); }
.read-kept-links:empty { display: none; }
.read-kept-links { margin: 10px 0 0; }
@media (max-width: 1080px) {
  .read-grid { grid-template-columns: minmax(0, 1fr); }
  .read-source { position: static; }
  .read-text { max-height: 360px; }
}
@media (max-width: 640px) {
  .read-field, .read-field:is(.read-wide, .read-kind, .read-postcode, .read-country, .read-date, .read-window) { flex: 1 1 100%; }
}

/* Payment history (YY, 6 and 7 Nov 2026, DOMAIN.md section 25): the order's Payments panel, the partner's, the
   chips turned red by an overdue invoice. */
/* Paid told apart from Confirmed at a glance (the design round, wave 5; the review's suggestion 8): Confirmed the
   green capsule, Paid a grey one with its green word, finished; both tinted, never outlined (DESIGN_CHECKLIST T1). */
.status-paid { background: var(--fill); color: var(--success); }
.payments .pay-half + .pay-half { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.pay-title { margin: 8px 0 6px; font-size: 14px; }
.pay-title .muted { font-weight: 400; }
.pay-line { margin: 4px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pay-line .tag { margin-left: 0; }
.pay-differs { padding: 4px 8px; border-radius: var(--radius); background: var(--tint-warn); width: fit-content; }
.pay-list { list-style: none; margin: 8px 0 0; padding: 0; }
.pay-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin-top: 10px; }
.pay-row .field { flex: 1 1 140px; min-width: 0; margin: 0; }
.pay-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 2px; }
.pay-edit { margin-top: 8px; }
.pay-edit > summary { list-style: none; display: inline-flex; }
/* Change and Change the invoice read as links on the text's left edge, not floating buttons (YY, 7 Nov: "looks very
   odd"); a payment's Change sits at the end of its row and opens its boxes on the full width under it. */
.pay-link { cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 600; padding: 2px 0; border-radius: 4px; }
.pay-link:hover { text-decoration: underline; }
.pay-link:focus { outline: none; }
.pay-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pay-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; border-top: 1px solid var(--border); padding: 6px 0; }
.pay-list li:first-child { border-top: 0; }
.pay-list .pay-what { flex: 1 1 auto; min-width: 0; }
.pay-list .pay-edit { margin: 0; }
.pay-list .pay-edit[open] { flex-basis: 100%; }
.pay-edit > summary::-webkit-details-marker { display: none; }
.filter-chip.is-alert { background: var(--tint-red); color: var(--danger); }
.filter-chip.is-alert .filter-chip-label, .filter-chip.is-alert .filter-chip-text { color: var(--danger); }
.partner-pay-total { color: var(--danger); font-weight: 600; }
.pay-row .field:has(.file-picker) { flex: 2 1 220px; }


/* ==== The new look (YY, 8 Nov 2026; DESIGN.md "The overall look"). Kept after the trial ("looks good to me for now"),
   everyone's since 9 Nov. Its rules were scoped to the pages that had it until wave 5 (10 Nov)
   folded them with the old look's into one set: what follows comes after the rules above it and wins where both set
   the same thing; an old declaration it always overrode is gone. ==== */
:root {
  --nl-edge: var(--border-strong);
  /* Glass on what floats over the content: see-through, blurred, a bright rim and a light inner edge. */
  --glass: rgba(250, 250, 252, .72);
  --glass-rim: rgba(255, 255, 255, .7);
  --glass-line: rgba(0, 0, 0, .08);
  --glass-shine: inset 0 1px 0 rgba(255, 255, 255, .85);
  --glass-blur: saturate(180%) blur(22px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --glass: rgba(30, 30, 34, .68);
    --glass-rim: rgba(255, 255, 255, .12);
    --glass-line: rgba(255, 255, 255, .1);
    --glass-shine: inset 0 1px 0 rgba(255, 255, 255, .08);
  }
}
:root[data-theme="dark"] {
  --glass: rgba(30, 30, 34, .68);
  --glass-rim: rgba(255, 255, 255, .12);
  --glass-line: rgba(255, 255, 255, .1);
  --glass-shine: inset 0 1px 0 rgba(255, 255, 255, .08);
}

/* ---- Boxes and fills (the look C, YY 14 Nov, R1): every field a real box, white with a fine grey line, filled or
   empty; the line darker under the pointer, blue with the cursor in it. ---- */
:is(.content .field, .content .filters) :is(input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea),
.content .control {
  border-color: var(--c-box);
  background-color: var(--c-field);
  box-shadow: none;
}
.content :is(.field, .filters) :is(input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea):hover,
.content .control:hover,
.remark-list .remark-row .control:hover {  /* as heavy as the rule hiding a remark's box, so the pointer still shows it */
  border-color: var(--muted);
  background-color: var(--c-field);
}
.content :is(.field, .filters) :is(input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea):focus,
.content .control:focus {
  border-color: var(--accent);
  background-color: var(--c-field);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
/* A box someone can't change shows no box at all, only its value. */
.content .field :is(input, select, textarea):disabled {
  border-color: transparent;
  background: none;
  color: var(--text);
  opacity: 1;
}
/* A box switched off by another (the order's Fleet truck or spot truck, YY's test of 9 Nov): greyed, keeping its
   value (B5), its box still drawn so it reads as "for later", not as read-only. */
.field.is-off { opacity: .45; }
.content .field.is-off :is(input, select, textarea):disabled { border-color: var(--border); }
/* A refused box keeps its red (DESIGN.md, 3 Nov). */
.content .field.has-error :is(input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea),
.content .field.has-error :is(input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea):is(:hover, :focus) {
  border-color: var(--danger);  /* heavier than the hover rule, so the red stays under the pointer (R10; job E, 8 Nov) */
  background-color: var(--tint-red);
}

/* ---- Text: labels small and grey above their value; no "optional" anywhere. ---- */
.content .field > label,
.content .field .label { font-size: 12px; font-weight: 500; color: var(--muted); padding-left: 12px; }
.content .field { gap: 2px; }
/* Boxes in a panel stand in it (the look C, 14 Nov): every box is drawn, so none reaches out into the panel's margin
   (wave 5's -12 px went with the boxes that were invisible), and boxes side by side keep their gap. */
.content .panel .calc-grid { column-gap: 12px; }
.optional-word { display: none; }
/* A panel holding one thing: its title is its only label (Client, not Client then Client). */
section[aria-labelledby="client-title"] > .field:first-of-type > label {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---- Spacing: forms grouped, tight inside a group, a clear gap between groups. ---- */
.stop-line { gap: 4px 10px; }
.stop-fields { gap: 4px; }
.goods-line, .vehicle-line { gap: 4px 10px; }
.detail-main, .detail-side { gap: 18px; }

/* ---- Item actions show on the item under the pointer or with the cursor in it (not without a pointer). ---- */
@media (hover: hover) {
  .stop :is(.stop-grip, .stop-tools),
  .stop-swap .btn-swap,
  .content [data-copy]:not(.plate-copy, [data-copy-main]) { /* a box whose main action is Copy keeps it in sight */
    opacity: 0;
    transition: opacity 120ms ease-out;
  }
  .stop:is(:hover, :focus-within) :is(.stop-grip, .stop-tools),
  .stop:hover + .stop-swap .btn-swap,
  .stop-swap:is(:hover, :focus-within) .btn-swap,
  .stop-swap:has(+ .stop:hover) .btn-swap,
  .stop.is-dragged :is(.stop-grip, .stop-tools),
  :is(.panel, li, .document-line):is(:hover, :focus-within) [data-copy]:not(.plate-copy) {
    opacity: 1;
  }
  .stop .stop-remove:has(input:checked) { opacity: 1; }
}

/* ---- The stops as sentences: closed, a stop reads as its kind, site, place, day, references and contact. ---- */
.stop.is-closed .stop-fields { display: none; }
.stop:not(.is-closed) .stop-sentence { display: none; }
.stop .stop-sentence {  /* as heavy as the new look made it, so it keeps its text cursor over button:not(:disabled) */
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: text;
}
.stop-sentence:hover { border-color: var(--border); }
.stop-sentence:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.stop-sentence-head { font-weight: 600; overflow-wrap: anywhere; }
.stop-sentence-kind {
  margin-right: 4px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.stop-sentence-line { color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stop-sentence-line + .stop-sentence-line { color: var(--muted); }
.stop.is-closed { padding: 6px 0; }
.stop.is-closed .stop-grip,
.stop.is-closed .stop-tools { padding-top: 8px; }
.stop:not(.is-closed) .stop-fields { animation: nl-open 220ms var(--spring-soft, ease-out); }
@keyframes nl-open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
[data-motion="off"] .stop .stop-fields { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .stop .stop-fields { animation: none; }
  .stop :is(.stop-grip, .stop-tools), .stop-swap .btn-swap { transition: none; }
}

/* ---- The order page's side: a readiness line is one short line, the sentence in its hover label. ---- */
.readiness-line.is-open { display: flex; align-items: center; gap: 8px; min-width: 0; }
.readiness-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A line that leads to its box (YY, 15 Nov): clickable as a list's row is, its text a plain button for Tab and Enter. */
.readiness-line[data-goto] { cursor: pointer; }
.readiness-line[data-goto]:hover { background: var(--hover); }
.readiness-go { margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.readiness-go:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 2px; }
.readiness-line .readiness-ok { flex: none; margin: 0; height: 26px; padding: 0 10px; font-size: 12.5px; }

/* ---- The Orders list's top: tabs, views, search and + Filter on one line; the chips' line only with a chip. ---- */
.filters { align-items: center; gap: 6px 14px; }
.chips:not(:has([data-chip])) { flex: 0 0 auto; }
.filters .segmented { padding: 0; background: none; gap: 2px; }
.filters .segmented label {
  height: 32px;
  padding: 0 8px;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--muted);
  font-weight: 500;
  border-bottom: 2px solid transparent;
}
.filters .segmented label:hover { color: var(--text); }
.filters .segmented input:checked + label { background: none; box-shadow: none; color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }
/* The underline glides to the tab picked, as the switches' blue does (YY, 8 Nov): the same glide, drawn as a line. */
.filters .segmented .seg-glide { top: auto !important; bottom: 0; height: 2px !important; border-radius: 1px; }
.filters .segmented.is-gliding input:checked + label { border-bottom-color: transparent; }
.filters .segmented label { transition: color 150ms; }
/* A switch of links between two lists (Trucks · Drivers, L8; YY's test of 9 Nov, R4 the fifth time): the same words
   with the blue line, which glides to the one clicked before the page changes. */
.segmented-links { padding: 0; background: none; gap: 2px; }
.segmented-links a,
.segmented-links a[aria-current="page"] {
  height: 32px; padding: 0 8px; border-radius: 0; background: none; box-shadow: none;
  color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; transition: color 150ms;
}
.segmented-links a:hover { color: var(--text); }
.segmented-links a.is-on { color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }
.segmented-links .seg-glide { top: auto !important; bottom: 0; height: 2px !important; border-radius: 1px; }
.segmented-links.is-gliding a.is-on { border-bottom-color: transparent; }

/* ---- Rows: always one line, 40 px; a long name ends in … (whole in the hover label). ---- */
.table td { font-size: 13px; }
.table td { height: 40px; padding-top: 0; padding-bottom: 0; white-space: nowrap; }
.table td * { white-space: nowrap; }
.table :is(td, th) { padding-left: 6px; padding-right: 6px; }
.table .cell-cut { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.table td .tag[class*="status-"] { display: inline-block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.table .cell-menu { width: 36px; padding: 0 4px; }
.table td.cell-company { min-width: 0; }
/* The carrier's news dot sits in the code cell's padding: every code keeps that room so the numbers stay in line. */
.table :is(td.cell-number, th.cell-number) { padding-left: 16px; }
.table td:has(.cell-cut) { display: table-cell; }
.table td:has(.cell-cut .tag) .cell-cut { display: flex; align-items: center; gap: 4px; }
.table td .muted.small { display: inline; margin-left: 4px; }
.table td.cell-company .tag { margin-left: 4px; }

/* ---- The totals: a quiet line stuck to the bottom of the list, always in view. ---- */
#results .list-totals {
  order: 2;
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: 0;
  padding: 10px 16px;
  border-radius: var(--radius-lg);
  font-size: 13px;
}
#results .table-wrap { order: 1; }
#results > :not(.list-totals):not(.table-wrap) { order: 3; }

/* ---- Glass, on the floating layer only, on every page (YY, 8 Nov: "Every page now"): the top bar, the rail, menus
   and pop-ups, the dialog, the bulk bar and the Orders list's totals line. Panels and lists stay solid. Where the
   computer asks for less transparency: solid. ---- */
:is(.menu, .suggest-list, .calendar, .filter-pop, .status-pop, .bulk-bar, .dialog, #results .list-totals) {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
:is(.menu, .suggest-list, .calendar, .filter-pop, .status-pop, .bulk-bar, .dialog, #results .list-totals) {
  border: 1px solid var(--glass-rim);
  box-shadow: var(--glass-shine), 0 0 0 .5px var(--glass-line), var(--shadow-pop);
}
.dialog::backdrop { background: rgba(10, 14, 20, .3); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
@media (prefers-reduced-transparency: reduce) {
  :is(.menu, .suggest-list, .calendar, .filter-pop, .status-pop, .bulk-bar, .dialog, #results .list-totals) {
    background: var(--surface);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* ---- The trial's screen check (8 Nov), fixed as the look became everyone's. ---- */
/* The line between two stops runs unbroken; the swap button, shown under the pointer, sits on it. */
.stop-swap { position: relative; gap: 0; }
.stop-swap .btn-swap { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
/* The driver reads as the boxes above it: the label small and grey over its value, not beside it. */
.detail-side .facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
.detail-side .facts dt { font-size: 12px; font-weight: 500; }  /* at the panel's title, as its boxes (wave 5) */
/* A panel's title, then a little room before its first label, so the label sits with its value. */
.content .panel > h3 { margin-bottom: 8px; }
/* A cell with tags (Client missing, Site missing) shows them whole. */
.table td:has(.cell-cut .tag) .cell-cut { max-width: none; }

/* ---- Company settings (YY, 8 Nov, DESIGN.md "Company settings"): its sections listed down the left, kept in view,
   the one being read lit; every add form folded into its "+ Add …" button, opening in place. ---- */
.settings-layout { display: grid; grid-template-columns: 190px minmax(0, 980px); gap: 28px; align-items: start; }
.settings-index { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.settings-index ul { margin: 0 0 10px; padding: 0; list-style: none; }
.settings-index-group { margin: 6px 0 2px; color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.settings-index-group:empty { display: none; }
.settings-index a {
  display: block;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  transition: background-color 150ms, color 150ms, opacity 150ms;
}
.settings-index a:hover { background: var(--hover); }
.settings-index a[aria-current="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.settings-index a.is-dim { opacity: .35; }
.settings-main { max-width: none; }
.settings-main .panel { scroll-margin-top: 120px; }
@media (max-width: 900px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-index { display: none; }
}
.add-fold > summary { list-style: none; width: fit-content; cursor: pointer; }
.add-fold > summary::-webkit-details-marker { display: none; }
.add-fold[open] > summary { display: none; }
.add-fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.add-fold[open] > :not(summary) { animation: nl-open 220ms var(--spring-soft, ease-out); }
[data-motion="off"] .add-fold[open] > :not(summary) { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .add-fold[open] > :not(summary), .settings-index a { animation: none; transition: none; }
}
html:not(.js) [data-fold-cancel] { display: none; }
/* An add fold opens on its own short animation, so its content is never clipped: a suggestion list opening above its
   box shows whole (DESIGN_CHECKLIST.md P1). Closed, the browser hides it as before. */
.add-fold::details-content { overflow: visible; }  /* it glides like every fold (R4); never clipped, so a list opening above shows whole (P1) */
/* Choices like Warn and Block: plain round choices on the page, the explanation on the same line, no card
   (YY, 8 Nov; its DESIGN.md part cut with the look C, the rule kept here). */
.choices { gap: 2px; }
.choice, .choice:hover, .choice:has(input:checked) {
  padding: 4px 0; border: 0; background: none; box-shadow: none;
}
.choice input { margin-top: 4px; }
.choice-text { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.choice:has(input:checked) .choice-label { color: var(--accent); }
/* A box's help line starts where its label and value do. */
.content .field .field-help { padding-left: 12px; }
.add-fold.is-folding > :not(summary) { animation: nl-close 140ms ease-in forwards; }
@keyframes nl-close { to { opacity: 0; transform: translateY(-4px); } }
.table-wrap + .add-fold, .remark-list + .add-fold { margin-top: 12px; }
/* Company details on documents: grouped two by two, the street and the email on full rows (S1, R7). */
.details-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 16px; }
.details-grid > .field:first-child, .details-grid > .field:last-child { grid-column: 1 / -1; }
@media (prefers-reduced-motion: reduce) { .add-fold.is-folding > :not(summary) { animation: none; } }
/* A box standing on its own (Find a setting, a new remark), empty: the same fine outline (B1; Codex, PR 164). */
.content .control:placeholder-shown:not(:hover):not(:focus) { border-color: var(--border); }

/* ---- Job A: Partners in the new look (8 Nov) ---- */
/* The list: one line per partner, 40 px; the dot in its own room, the name ending in … (whole in its hover label),
   the first tag whole and the others as "+1" (DESIGN.md "Spacing and density", DESIGN_CHECKLIST.md R6, R12, T1). */
.table-names .cell-name { line-height: normal; }
.partner-line { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.partner-line > .status { flex: none; }
.partner-line .partner-name { flex: 0 1 auto; min-width: 0; max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.partner-line > .tag { flex: none; }
.tag.tag-more { background: var(--fill); color: var(--muted); }
/* The partner page's details: each label small and grey above its value, two to a line (W1, R7). */
.fact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin: 0; }
.fact-grid .fact { min-width: 0; }
.fact-grid .fact-wide { grid-column: 1 / -1; }
.fact-grid dt { font-size: 12px; font-weight: 500; color: var(--muted); }
.fact-grid dd { margin: 2px 0 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .fact-grid { grid-template-columns: minmax(0, 1fr); } }
/* A contact's Edit and Remove, a document's Replace, Add and Remove: shown on the item under the pointer or with the
   cursor in it, fading in, nothing moving; always shown without a pointer (DESIGN.md "Buttons and actions", A3). */
@media (hover: hover) {
  .contact-item .item-actions,
  .declaration .item-actions,
  .doc-slot .doc-actions,
  .doc-files .doc-remove > summary {
    opacity: 0;
    transition: opacity 120ms ease-out;
  }
  .contact-item:is(:hover, :focus-within) .item-actions,
  .declaration:is(:hover, :focus-within) .item-actions,
  .declaration .item-actions:has(details[open]),
  .doc-slot:is(:hover, :focus-within) .doc-actions,
  .doc-files li:is(:hover, :focus-within) .doc-remove > summary {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  :is(.contact-item .item-actions, .doc-slot .doc-actions, .doc-files .doc-remove > summary) { transition: none; }
}
[data-motion="off"] :is(.contact-item .item-actions, .doc-slot .doc-actions, .doc-files .doc-remove > summary) { transition: none; }
/* "+ Add a contact" sits under the list with a little room, its form as wide as the contact's boxes need. */
.contact-list + .add-fold, #contacts > p.muted + .add-fold { margin-top: 4px; }
/* The partner form's Type: its tick boxes start where the boxes' values do (S3). */
.partner-type > .choices-inline { padding-left: 12px; }
/* "+ Add a contact": its four boxes two by two across the card, like the form's other groups (S1, S3, R7). */
.contact-form { max-width: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.contact-form > :is(.form-actions, .alert) { grid-column: 1 / -1; }
@media (max-width: 600px) { .contact-form { grid-template-columns: minmax(0, 1fr); } }
/* "+1" from the keyboard (Codex, PR 166): it takes the focus and grows into its words in place, as a dot grows
   into its pill, so the warnings it holds are read without a mouse (DESIGN.md: everything works from the keyboard). */
.tag-more { cursor: default; }
.tag-more .tag-more-words { display: none; }
.tag-more:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.tag-more:focus .tag-more-count { display: none; }
.tag-more:focus .tag-more-words { display: inline; }


/* ---- Job D: Repeat as DOMAIN.md section 6 (8 Nov) ---- */
/* A box copied from the previous order on the lane: a yellowish background until its value is changed (YY, 8 Nov). */
:root { --copied-fill: #fbf0c4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --copied-fill: rgba(232, 166, 75, .2); } }
:root[data-theme="dark"] { --copied-fill: rgba(232, 166, 75, .2); }
.field:not(.has-error) :is(input, select, textarea).is-copied:not(:focus),
.content .field:not(.has-error) :is(input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea).is-copied:not(:hover):not(:focus) {
  background-color: var(--copied-fill);
}
.stop-sentence.is-copied { background-color: var(--copied-fill); }
/* ---- Job C: the cabotage counter per truck (8 Nov) ---- */
/* Fleet's list: the counter beside the plate, a tag that never wraps. The board's truck row: one line under the km,
   amber once the allowance is full (3/3), red on a breach (YY, 8 Nov: nothing below 3/3). */
.cell-plates .cabotage-counter { margin-left: 6px; white-space: nowrap; }
.board-cabotage { font-weight: 700; }
.board-cabotage.is-full { color: var(--warning); }
.board-cabotage.is-breach { color: var(--danger); }

/* ---- Job B: Sites in the new look (8 Nov) ---- */
/* The list: every row one line, 40 px; a long name, client or town ends in … and is whole in its hover label (R12). */
.sites-results .table-names :is(td, th) { white-space: nowrap; }
.sites-results .table-names .cell-name { white-space: nowrap; line-height: normal; min-width: 0; }
.sites-results .table-names td:not(.cell-name):not(.cell-menu) { white-space: nowrap; }
.sites-results .table-names td.cell-name .cell-cut { display: flex; align-items: center; gap: 6px; max-width: 200px; }
.sites-results .table-names .cell-name .cell-cut a { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sites-results .table-names .cell-name .cell-cut .tag { flex: none; }
.sites-results .table-names td:not(.cell-name) .cell-cut { max-width: 130px; }
.sites-results .table-names td:last-of-type:not(.cell-menu) .cell-cut,
.sites-results .table-names td:nth-last-child(2) .cell-cut { max-width: 160px; }  /* "Loading and unloading" whole */
/* The map a little narrower, so the four columns fit beside it on a 1280 px laptop with no sideways scroll. */
@media (min-width: 901px) { .sites-layout { grid-template-columns: minmax(0, 1fr) minmax(300px, 36%); } }
/* The site's page: the On site facts share the panel's left edge with its title and the hours above (S3). */
.site-detail .detail-side .facts { gap: 0; }
.site-detail .detail-side .facts :is(dt, dd) { padding-left: 0; }
.site-detail .detail-side .facts dd + dt { margin-top: 8px; }
/* The form's hours: the column titles over the values, which sit 12 px into their boxes like every label (S3);
   a day ticked Closed greys its times, which keep their value (B5). */
.site-form .hours-edit thead th:not(:first-child) { padding-left: 12px; font-weight: 500; }
.site-form .hours-edit tr:has(input[type=checkbox]:checked) input:not([type=checkbox]) { opacity: .45; }
/* A time that stops a Save keeps its red, edge and tint, light and dark (R10; Codex, PR 165): the new look's quiet
   boxes would otherwise hide the hours table's own red. */
.site-form .hours-edit tr.has-error input.control:not([type=checkbox]) {
  border-color: var(--danger);
  background-color: var(--tint-red);
}
/* Delete or archive instead: a little room under the question (S2). */
.site-remove { display: grid; gap: 10px; }
.site-remove > * { margin: 0; }

/* ---- Job F: Fleet in the new look (8 Nov) ---- */
/* The lists: every row one line, 40 px (R12). The trailer's plate beside the truck's; a long company, driver, truck or
   list of languages ends in … and is whole in its hover label; the first tag whole, the others "+1" (T1). */
.fleet-table .cell-plates .plate { display: inline; }
.fleet-table .cell-plates .plate-trailer { margin: 0; }
.fleet-table td.cell-driver { min-width: 0; }
.fleet-table td.cell-company { min-width: 0; max-width: none; }
.fleet-table td.cell-company .cell-cut { max-width: 120px; }  /* room for the Phone column (wave 5) */
.fleet-table td.cell-kit .fleet-cut { max-width: 120px; }  /* the look C's side list: Fleet fits 1280 px in a wider font too (GitHub, PR 215) */
.fleet-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.fleet-line > :not(.fleet-cut) { flex: none; }
.fleet-cut { flex: 0 1 auto; min-width: 0; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.fleet-table td .muted { font-size: 12.5px; }
.fleet-table .driver-phone { flex-wrap: nowrap; align-items: center; }
/* A cut cell of a column hidden on a small screen stays hidden with its title (Codex, PR 172). */
@media (max-width: 860px) { .fleet-table td.hide-sm { display: none; } }
/* The truck's page and the driver's: the side panel's facts share its left edge with its title and link (S3), a
   little room between one fact and the next (S2); the truck's capacity three to a line under its equipment (R7). */
.fleet-detail .detail-side .facts { gap: 0; }
.fleet-detail .detail-side .facts :is(dt, dd) { padding-left: 0; }
.fleet-detail .detail-side .facts dd + dt { margin-top: 8px; }
.fleet-detail .detail-side .facts + p { margin: 12px 0 0; }
.truck-facts { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.truck-facts .fact { grid-column: span 2; }
.truck-facts .fact-half { grid-column: span 3; }
.truck-facts .fact-wide { grid-column: 1 / -1; }
@media (max-width: 600px) { .truck-facts { grid-template-columns: minmax(0, 1fr); } .truck-facts .fact { grid-column: 1 / -1; } }
.truck-facts dd .tag { margin: 0 4px 0 0; }
/* Cabotage today: one short line per country, the engine's sentence in its hover label (W9, W10). */
.fleet-detail [data-cabotage-country] { align-items: center; }
/* The sentence stays out of sight but read aloud; from the keyboard, or without a pointer, it shows under its line
   (as "+1" grows into its words). */
.fleet-detail .cabotage-note {
  position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.fleet-detail [data-cabotage-country]:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.fleet-detail [data-cabotage-country]:focus .cabotage-note {
  position: static; width: auto; height: auto; margin: 0; overflow: visible; clip-path: none; white-space: normal;
}
@media (hover: none) {
  .fleet-detail .cabotage-note {
    position: static; width: auto; height: auto; margin: 0; overflow: visible; clip-path: none; white-space: normal;
  }
}
/* The trip calculator: the trip's figures on one line; the margin, its unit and Calculate on the next (S1, R7). */
.fleet-detail .calc-grid { display: flex; gap: 8px; }
.fleet-detail .calc-grid .field { flex: 1 1 0; min-width: 0; }
.calc-margin { display: flex; align-items: flex-end; gap: 8px; }
.calc-margin .field { flex: 1 1 0; min-width: 0; gap: 2px; }
.calc-margin-boxes { display: flex; gap: 4px; width: 100%; }
.calc-margin-boxes input { flex: 1 1 auto; min-width: 0; }
.calc-margin-boxes select.control { flex: 0 0 64px; width: 64px; min-width: 0; }
.calc-margin .btn { flex: none; height: 36px; }
/* A driver on the truck: Take off shows on the driver under the pointer or with the cursor in it (A3); putting one
   on is one line, the list and its button (R7). */
@media (hover: hover) {
  .crew-list li form { opacity: 0; transition: opacity 120ms ease-out; }
  .crew-list li:is(:hover, :focus-within) form { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .crew-list li form { transition: none; } }
[data-motion="off"] .crew-list li form { transition: none; }
.crew-list li > div > a { text-decoration: none; }
.crew-list li > div > a:hover { text-decoration: underline; }
.crew-add { flex-wrap: nowrap; }
.crew-add > :not(.btn) { flex: 1 1 auto; min-width: 0; }
.crew-add .suggest-wrap .control { width: 100%; min-width: 0; }
.crew-add .btn { flex: none; }
/* The forms: tick boxes start where the values do (S3); the year's nine figures three to a line on a wider page, so
   each label fits on its line (W2, R7). */
.fleet-form .choices-grid { padding-left: 12px; }
.fleet-year { max-width: 1080px; }
.fleet-year .year-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .fleet-year .year-grid { grid-template-columns: minmax(0, 1fr); } }
/* Delete or archive instead: a little room under the question (S2), as on Sites. */
.fleet-remove { display: grid; gap: 10px; }
.fleet-remove > * { margin: 0; }

/* ---- Job E: My settings, Team, login, password change in the new look (8 Nov) ---- */
/* My settings: every setting one row, its name on the left and its choice on the right, rows of one height; the
   stops' choice reads as text until hovered (R1), wide enough for its longest words. */
.my-settings { max-width: 560px; }
.my-settings .setting-row { min-height: 34px; margin-top: 6px; }
.my-settings .panel > h3 + .setting-row { margin-top: 0; }
.my-settings .setting-choice { display: inline-flex; align-items: center; gap: 8px; }
.my-settings .setting-choice select { width: auto; }
.my-settings select.control:not(:hover):not(:focus) { background-image: none; }
.my-settings .panel-row h3,
.team-form .panel-row h3 { margin: 0; }
/* Dot colours (YY, 12 Nov, his pick B): each status, its dot as the lists draw it, eight swatches and Other…. */
.order-dot-notice-colour { --status-dot: var(--order-notice); }
.my-settings .fold > summary h3 { margin: 0; }
.dot-colours-reset { display: flex; justify-content: flex-end; }
.dot-colours .dot-colour-name { display: inline-flex; align-items: center; gap: 10px; }
.dot-colours .dot-colour-name .status { top: 0; }
.swatches { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; padding: 0; border: 0; }
.swatches > input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.swatches > label:not(.swatch-other) { width: 20px; height: 20px; border-radius: 50%; background: var(--swatch); cursor: pointer; transition: transform .12s ease; }
.swatches > label:not(.swatch-other):hover { transform: scale(1.12); }
.swatches > input:checked + label { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.swatches > input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 3px; }
.swatch-other { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--fill); color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.swatch-other.is-on::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--swatch); }
.swatch-other.is-on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); color: var(--text); }
.swatch-other input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.swatch-other:focus-within { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (pointer: coarse) { .swatches > label:not(.swatch-other) { width: 28px; height: 28px; } .swatch-other { height: 28px; } } /* a finger's target on a phone (screen checker) */
@media (prefers-reduced-motion: reduce) { .swatches > label { transition: none; } }
/* Team: one line per person, 40 px; the name ends in … (whole in its hover label), "You" or "Platform owner" whole;
   the first role whole and the others as "+1" (R12, T1), as on Partners. */
.team-list .table-names .cell-name { line-height: normal; }
.team-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.team-line .team-name { flex: 0 1 auto; min-width: 0; max-width: 220px; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.team-line > .tag { flex: none; margin: 0; }
.team-roles { display: flex; align-items: center; gap: 4px; }
.team-roles > * { flex: none; }
.team-list .table .cell-cut { max-width: 200px; }
/* The Team form: what can't be changed shows no box, only its value, where a box's value would be (B2, S3). */
.team-form .field-static { display: flex; align-items: center; min-height: 34px; padding: 0 13px; overflow-wrap: anywhere; }
/* The roles, the exceptions' fold and "Can log in" start where the boxes' values do (S3); "Can log in" is a choice,
   not a label (W1). */
.team-form :is(.choices, .rights-fold > summary, .rights-fold .table-wrap) { padding-left: 12px; }
.team-form .rights-table :is(td, th):first-child { padding-left: 0; }
.content .team-form .field > label.choice-inline { padding-left: 12px; font-size: 14px; font-weight: 500; color: var(--text); }
/* The temporary password: plain large text to read out, no grey box (R1); the username and it side by side. */
.team-password .secret { padding: 0; border: 0; background: none; font-size: 18px; }
.team-password .fact-grid { margin-top: 12px; }
.team-reset .form-actions { margin-top: 12px; }
/* The login page, the first screen anyone sees (YY, 8 Nov: the same fields, nothing else new): labels small and grey
   above; each box a fine outline on the card's colour until typed in (B1); the cursor in it rings blue; refused, red
   (R10). Its card sits outside the pages' content, so these rules are its own; written as strongly as the shared
   field rule they replace. */
.login-card .field { gap: 2px; }
.login-card .field > label { padding-left: 12px; font-size: 12px; font-weight: 500; color: var(--muted); }
.login-card .field input:not([type=checkbox]):not([type=radio]):not([type=hidden]) {
  border-color: var(--border);
  background-color: var(--surface);
}
.login-card .field input:not([type=checkbox]):not([type=radio]):not([type=hidden]):hover { border-color: var(--nl-edge); }
.login-card .field input:not([type=checkbox]):not([type=radio]):not([type=hidden]):focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.login-card .field.has-error input:not([type=checkbox]):not([type=radio]):not([type=hidden]) {
  border-color: var(--danger);
  background-color: var(--tint-red);
}

/* ---- Job H: Orders' other pages and the carrier's page in the new look (8 Nov) ---- */
/* New order: the Client section holds the client only, so its title is its only label (W3); readers keep the name. */
.new-order .form-section.is-one > .field > label {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
/* Without the page's script (which marks the empty boxes), New order's and the review page's boxes all keep their
   fine outline, so an empty one still shows where to type (B1; Codex, PR 171). */
html:not(.js) :is(.new-order, .read-found) .field:not(.has-error) :is(input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea) {
  border-color: var(--border);
}
/* The reading review page: the document's text on its white panel, no grey box (R1); its marks keep their tint. */
.read-text { padding: 0; background: none; border-radius: 0; }
.read-text:focus-visible { outline-offset: 4px; }
.read-field .field, .read-pair > .field { gap: 2px; }
.read-line { gap: 4px 10px; margin-top: 6px; }
.read-stop + .read-stop { padding-top: 14px; }
.read-not-stop { margin-top: 6px; padding-left: 12px; }
/* The words of the box in focus: the box's fine ring, not a filled halo (R1). */
.read-field.is-current :is(input:not([type=hidden]), textarea, select) { border-color: var(--accent); }
/* Deleted orders: a list like Orders, every row one line of 40 px, a long reason ending in … (R12). */
.deleted-list .table td .cell-cut { max-width: 220px; }
.deleted-list .table td .deleted-why { max-width: 420px; }
/* Delete, the bulk question and Send anyway without the page's script: the dialog's own card on the page (P3). */
.ask-page { width: min(520px, 100%); display: flex; flex-direction: column; gap: 12px; }
.ask-page .ask-title { margin: 0; font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.ask-page .form { gap: 12px; }
.ask-page .form-actions { margin-top: 4px; }
.ask-page .readiness-line.is-open { align-items: flex-start; padding: 6px 0; border-top: 0; }
.ask-page .readiness-line > .dot { margin-top: 5px; }
.ask-page .readiness-text { white-space: normal; overflow: visible; }
.ask-page .readiness-note { display: block; }
.ask-page .bulk-orders { margin: 0; padding: 0; list-style: none; gap: 0; }
.ask-page .bulk-orders li { display: flex; align-items: center; gap: 10px; min-height: 32px; min-width: 0; }
.ask-page .bulk-orders .mono { flex: none; }
.ask-page .bulk-client { min-width: 0; overflow-wrap: anywhere; color: var(--muted); }  /* whole: no hover label without the script */

/* The carrier's page (its own frame, no .content): the same quiet boxes, a fine outline where there is a box to type
   in (B1), its edge stronger under the pointer, blue with the cursor in it, red when refused (R10). */
.carrier-page :is(.field input:not([type=checkbox]):not([type=radio]):not([type=file]), textarea) {
  border-color: var(--border);
  background-color: transparent;
  box-shadow: none;
}
.carrier-page :is(.field input:not([type=checkbox]):not([type=radio]):not([type=file]), textarea):hover {
  border-color: var(--nl-edge);
}
.carrier-page :is(.field input, textarea):focus {
  border-color: var(--accent);
  background-color: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.carrier-page .field.has-error input:not([type=checkbox]):not([type=radio]) {
  border-color: var(--danger);
  background-color: var(--tint-red);
}
/* Labels small and grey above their value, starting where the typed text does (W1, S3). */
.carrier-page .field > label,
.carrier-message > label { font-size: 12px; font-weight: 500; color: var(--muted); padding-left: 12px; }
.carrier-page .field { gap: 2px; }
.carrier-page .field .field-help { padding-left: 12px; }
.carrier-message { gap: 2px; }
.carrier-message > .btn { margin-top: 4px; }
.carrier-tick { margin: 0; }
/* Round 2 (YY, 11 Nov): each order one line that opens, its tick beside it; the lane and day its title, our number
   small, the plate and the rate after; on a phone the plate and rate go under the title. */
.carrier-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.carrier-theme { flex: none; }
.carrier-section { margin: 8px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.carrier-others { display: flex; flex-direction: column; gap: 8px; }
.carrier-order { flex-direction: row; align-items: flex-start; gap: 12px; padding: 0 16px; }
.carrier-order > .carrier-tick { margin-top: 12px; }
.carrier-card { flex: 1 1 auto; min-width: 0; }
.carrier-summary { display: flex; align-items: center; gap: 4px 12px; min-height: 44px; cursor: pointer; list-style: none; }
.carrier-summary::-webkit-details-marker { display: none; }
.carrier-summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.carrier-summary-title { display: flex; align-items: baseline; gap: 8px; flex: 1 1 auto; min-width: 0; }
.carrier-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 600; }
.carrier-number { flex: none; }
.carrier-summary-meta { flex: none; white-space: nowrap; }
.carrier-summary .tag { flex: none; margin-left: 0; }
.carrier-summary-left { flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Each document's state on a confirmed order's closed line (Master Session, 11 Nov): there in green with a tick, the
   missing POD in the warning colour, the others grey. */
.carrier-marks { display: inline-flex; flex: none; gap: 6px; }
.carrier-mark { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.carrier-mark.is-there { color: var(--success); }
.carrier-mark.is-missing { color: var(--warning); font-weight: 600; }
.carrier-body { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 16px; }
.carrier-card[open] > .carrier-summary { border-bottom: 1px solid var(--border); }
@media (max-width: 600px) {
  .carrier-summary { flex-wrap: wrap; padding: 8px 0; }
  .carrier-summary-title { flex-basis: 100%; }
  .carrier-title { white-space: normal; overflow-wrap: anywhere; }
}
/* The four places (YY, 11 Nov): CMR, POD, Invoice, Other, two by two, one under the other on a phone; each its own
   drop box; the invoice's greyed until the POD is here. */
.carrier-places { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 600px) { .carrier-places { grid-template-columns: minmax(0, 1fr); } }
.carrier-place { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1.5px dashed var(--border); border-radius: var(--radius); min-width: 0; }
.carrier-place.is-over { border-color: var(--accent); background: var(--accent-soft); }
.carrier-place.is-busy { opacity: .6; pointer-events: none; }
.carrier-place.is-closed { border-style: solid; color: var(--muted); }
.carrier-place-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 32px; }  /* level, with or without Add (R7) */
.carrier-page .carrier-place h4 { margin: 0; font-size: 13px; font-weight: 600; }
.carrier-place .carrier-drop { display: flex; align-items: center; gap: 6px; }
.carrier-place .carrier-drop label.btn { cursor: pointer; }
.carrier-place p { margin: 0; }
/* The order page: the carrier's files under their kinds, each movable to another (YY, 11 Nov). */
.pod-kind + .pod-kind { margin-top: 6px; }
.pod-kind-title { font-weight: 600; margin-top: 4px; }
.pod-move { display: block; margin-top: 2px; }  /* on its own line under the file (screen checker) */
.pod-move > summary { list-style: none; display: inline; }
.pod-move > summary::-webkit-details-marker { display: none; }
.pod-move-to { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: 8px; vertical-align: middle; }
.pay-carrier-files { margin: 4px 0 6px; padding: 0; list-style: none; font-size: 13px; }
.pay-carrier-files li { overflow-wrap: anywhere; }
/* The last look before several orders are confirmed (YY, 11 Nov). */
.carrier-look-list { margin: 8px 0 16px; padding: 0; list-style: none; display: flex; flex-direction: column; }
.carrier-look-list li { display: flex; align-items: baseline; gap: 12px; min-height: 36px; padding: 6px 0; border-top: 1px solid var(--border); }
.carrier-look-words { display: flex; flex-direction: column; gap: 1px; min-width: 0; overflow-wrap: anywhere; }  /* every line drawn alike, phone too */
.carrier-look-list li:first-child { border-top: 0; }
.carrier-look-rate { margin-left: auto; font-weight: 600; white-space: nowrap; }
/* What to read first and the details: each label small and grey above its value (W1). */
.carrier-page .facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
.carrier-page .facts dt { font-size: 12px; font-weight: 500; }
.carrier-page .facts dd + dt { margin-top: 8px; }

/* Posting declarations (DOMAIN.md section 33, 11 Nov): the carrier's two menus, its declarations (an ended one in
   grey), the line on an order still asking and its driver picked; the panel on the carrier in Partners alike. */
.carrier-menu { display: flex; flex-wrap: wrap; gap: 6px; }
.carrier-menu-count { margin-left: 6px; font-variant-numeric: tabular-nums; }
.carrier-declarations { display: flex; flex-direction: column; gap: 8px; }
.carrier-asking, .carrier-declaration-list, .declaration-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.carrier-asking li, .carrier-declaration-list li { display: flex; flex-direction: column; gap: 2px; padding: 8px 16px; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.carrier-asking li:first-child, .carrier-declaration-list li:first-child { border-top: 0; }
.carrier-asking a { text-decoration: none; color: var(--text); }
.declaration-list { margin-bottom: 12px; }
.declaration-list > li { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
/* Replace or Remove opened: its form under the row, the row's whole width (screen checker, 11 Nov: R7). */
.declaration .item-actions:has(details[open]) { flex-basis: 100%; }
.declaration .item-actions:has(details[open]) > details:not([open]) { display: none; }
.declaration .item-actions > details[open] { flex: 1 1 100%; }
.declaration-replace .declaration-form { max-width: 420px; }
#declarations > .empty + .add-fold { margin-top: 12px; }
/* The export's two days and its button on one line: the calendar opens under a box, never over the button. */
.export-days { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.export-days .field { margin: 0; }
/* The export as a pop-up (YY, 11 Nov, night, DOMAIN.md section 34): the title, From and To side by side, the buttons
   under them; the calendar of a day may reach past the window's edge (screen checker: it was cut off). */
.dialog .export-days { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 12px; }
.dialog .export-days > :is(.dialog-title, .form-actions) { grid-column: 1 / -1; margin: 0; }
#declarations-export { overflow: visible; }
.declaration-list > li:first-child { border-top: 0; }
.declaration.is-ended, .declaration.is-ended a { color: var(--muted); }
.declaration .tag { margin-left: 6px; }
.carrier-posting-missing { color: var(--warning); font-weight: 500; }
.carrier-posting { display: flex; flex-direction: column; gap: 6px; }
.carrier-posting p { margin: 0; }
.carrier-pick { display: flex; flex-direction: column; gap: 4px; }
.carrier-pick-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.carrier-pick-row select { flex: 1 1 200px; min-width: 0; max-width: 320px; }
.carrier-declaration-form { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.carrier-declaration-days { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 600px) { .carrier-declaration-days { grid-template-columns: minmax(0, 1fr); } .carrier-pick-row select { max-width: none; } }
.posting-mark { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.posting-mark p { margin: 0; }
.posting-off .field { margin-top: 6px; }

/* ---- Job G: Home and the planning board's panels in the new look (8 Nov) ---- */
/* Home: what waits for someone is one line each, 40 px, like a list's row; a long line ends in … and is whole in its
   hover label (DESIGN_CHECKLIST.md R12, S7). Red stays for what needs acting on. */
/* Home as the morning's work (YY's pick of 10 Nov, drawing A): the counts across the top, each a link; today's stops
   beside what is waiting; partners last, on one line. */
.home-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); background: var(--surface); border-radius: 14px; overflow: hidden; }
.home-count { display: grid; gap: 2px; align-content: start; padding: 14px 18px; color: var(--text); text-decoration: none; border-left: 1px solid var(--border); }
.home-count:first-child { border-left: 0; }
.home-count:hover { background: var(--hover); }
.home-count:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.home-count-num { font-size: 28px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.home-count-label { font-size: 13px; color: var(--muted); }
.home-count-note { color: var(--danger); }
.home-count.is-red .home-count-num { color: var(--danger); }
.home-count.is-amber .home-count-num { color: var(--warning); }
.home-cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 16px; }
.home-stack { display: grid; gap: 12px; min-width: 0; }
.home-cols > *, .home-stack > * { min-width: 0; }
@media (max-width: 1080px) { .home-cols { grid-template-columns: minmax(0, 1fr); } }
/* A narrow window (Codex, PR 188; DESIGN_CHECKLIST S7): a row never runs out of its panel; the place and the truck
   go first, the time narrows, the client's name gives way. */
@media (max-width: 760px) {
  .home-place, .home-truck { display: none; }
  .home-time { width: auto; min-width: 48px; }
  .home-kind { min-width: 0; }
  .home-rows > li { flex-wrap: wrap; height: auto; min-height: 40px; padding: 6px 0; row-gap: 2px; white-space: normal; }
  .home-name { flex-basis: 100%; order: 9; }
}
.home-rows > li { overflow: hidden; }
.panel-count { margin-left: 6px; color: var(--muted); font-weight: 400; }
.panel-link { font-size: 14px; font-weight: 400; text-decoration: none; white-space: nowrap; }
.panel-link:hover { text-decoration: underline; }
.home-rows { list-style: none; margin: 4px 0 0; padding: 0; }
.home-rows > li { display: flex; align-items: center; gap: 10px; height: 40px; min-width: 0; white-space: nowrap; border-top: 1px solid var(--border); cursor: pointer; }
.home-rows > li:first-child { border-top: 0; }
.home-rows > li:hover { background: var(--hover); }
.home-time { flex: none; width: 92px; font-variant-numeric: tabular-nums; }
.home-kind { flex: none; min-width: 82px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.home-place { flex: none; width: 160px; overflow: hidden; text-overflow: ellipsis; }
.home-code { flex: none; font-variant-numeric: tabular-nums; }
.home-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.home-when { flex: none; font-variant-numeric: tabular-nums; }
.home-more { margin-top: 6px; font-size: 13px; }
.home-plates { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 4px 0 0; }
.home-partners { margin-top: 16px; }
.home-partners-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.home-partners-line h3 { margin: 0; font-size: 15px; }
.home-partners-line h3 a { color: var(--text); text-decoration: none; }
.home-partners-line .counts { margin: 0; }
.home-partners-line > a { display: inline-flex; align-items: center; gap: 6px; color: var(--text); text-decoration: none; }
.empty-small { padding: 10px 0; border: 0; background: transparent; text-align: left; }
.empty-small strong { font-weight: 400; color: var(--muted); }
.home-waiting { list-style: none; margin: 10px 0 0; padding: 0; border-top: 1px solid var(--border); }
.rule-line + .home-waiting { margin-top: 10px; }
.home-waiting > li.needs-action { display: flex; align-items: center; height: 40px; min-width: 0; margin: 0; padding: 0; border-top: 0; }
.home-waiting > li.needs-action + li.needs-action { border-top: 1px solid var(--border); }
.home-waiting-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-waiting a { text-decoration: none; }
.home-waiting a:hover { text-decoration: underline; }
/* The board's stop panel: each line of a stop on one line, a long one ending in … (whole in its hover label, S7);
   the correction box spans the panel so its Save stays inside it. */
.board-panel-one { justify-self: stretch; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-panel-text > .board-panel-fix { justify-self: stretch; }
.board-panel-text { grid-template-columns: minmax(0, 1fr); }
/* A cell's notices whole in its panel, on two lines if need be ("Town not recognised: check the order", t1116). */
.board-panel-text > .tag { max-width: 100%; margin-left: 0; white-space: normal; }
/* The correction box's text starts where the stop's place does: its box, under the pointer, steps out instead (S3). */
.board-panel-fix .control { margin-left: -9px; }
/* Labels small and grey above their box, starting where the box's text does (W1, S3); groups apart, tight inside (S1). */
.board-panel :is(.board-panel-type, .board-panel-state) > label {
  font-size: 12px; font-weight: 500; color: var(--muted); padding-left: 9px;
}
.board-panel :is(.board-panel-type, .board-panel-state) { gap: 4px; margin-top: 14px; padding-top: 12px; }
/* A select's chevron only while its box shows, as on every new-look form. */
.board-panel select.control:not(:hover):not(:focus) { background-image: none; }
/* A stop's correction box reads as its place, its box under the pointer like any field; its Save and the stop's round
   icons show on the stop under the pointer or with the cursor in it, fading in, nothing moving; always shown without a
   pointer (DESIGN.md "Buttons and actions", A3). */
@media (hover: hover) {
  .board-panel-stops > li :is(.board-panel-fix .btn-expand, .board-panel-icons) { opacity: 0; transition: opacity 120ms ease-out; }
  .board-panel-stops > li:is(:hover, :focus-within) :is(.board-panel-fix .btn-expand, .board-panel-icons) { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .board-panel-stops > li :is(.board-panel-fix .btn-expand, .board-panel-icons) { transition: none; }
}
[data-motion="off"] .board-panel-stops > li :is(.board-panel-fix .btn-expand, .board-panel-icons) { transition: none; }
/* Fleet today: every line one line of 40 px; the place ends in … (whole in its hover label), the marks after it whole;
   a long company name too (R12, S7). The board's 16 px at least stays (DOMAIN.md section 13). */
.fleet-list a,
.fleet-list > li:not(:has(a)) {
  display: flex; align-items: center; gap: 6px; height: 40px; min-width: 0; padding: 0 4px; white-space: nowrap;
}
.fleet-list > li:not(:has(a)) { display: block; line-height: 40px; overflow: hidden; text-overflow: ellipsis; border-top: 1px solid var(--border); font-size: 17px; }
.fleet-place { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.fleet-list :is(.tag, .fleet-mark) { flex: none; }
.fleet-company { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; }
.fleet-company .board-country { flex: none; }
.fleet-company-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* The delay question over the board (P3): the three answers on one line. */
.delay-dialog .form-actions { flex-wrap: wrap; }

/* ---- The map in dark (K1, the whole-TMS design check of 9 Nov): the tiles turned dark, the frame too. ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .leaflet-container { background: #1c1c1e; }
  :root:not([data-theme="light"]) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); }
}
:root[data-theme="dark"] .leaflet-container { background: #1c1c1e; }
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(.leaflet-bar a, .leaflet-control-attribution) { background: #2c2c2e; color: #e5e5ea; border-color: #3a3a3c; }
}
:root[data-theme="dark"] :is(.leaflet-bar a, .leaflet-control-attribution) { background: #2c2c2e; color: #e5e5ea; border-color: #3a3a3c; }

/* Follow-up, the dispatcher's day (YY, 11 Nov, DOMAIN.md section 31): a late line in red, a ticked one quiet, the line at now. */
.followup-table .cell-when, .followup-table .cell-phone, .followup-table .cell-tick { white-space: nowrap; }
.day-line.is-late td { color: var(--danger); }
.day-line.is-late td a { color: var(--danger); }
.day-line.is-late .tag-action { margin-left: 4px; }
.day-line.is-ticked td:not(.cell-tick):not(.cell-menu) { color: var(--muted); }
.tick-done { color: var(--success); font-weight: 600; font-size: 13px; }
.now-line td { padding: 0; border: 0; height: 0; }
.now-line td span { display: flex; align-items: center; gap: 8px; color: var(--danger); font-size: 12px; font-weight: 600; }
.now-line td span::after { content: ""; flex: 1; height: 1.5px; background: var(--danger); }
.day-table, .invoice-table { table-layout: fixed; }
/* Wide enough for French at 1280 (YY, 11 Nov, night: "Déchargement", and a dated late line's "10/11 21:02 En retard",
   ran into the next column, in English too on a dated line); measured by e2e FollowupWidthTests. */
.day-table .c-when { width: 170px; } .day-table .c-kind { width: 125px; } .day-table .c-carrier { width: 20%; }
.day-table .c-order { width: 120px; } .day-table .c-who { width: 110px; } .day-table .c-tick { width: 190px; }
.day-table td.cell-tick, .day-table td.cell-tick .tick-done { white-space: normal; line-height: 1.25; }
.day-table td.cell-when { white-space: normal; line-height: 1.25; }  /* "En retard" under the time when the font is wider (CI) */  /* "Chargé (CMR du transporteur)" on two lines, never under the ··· */
.followup-table .c-menu { width: 48px; }
.invoice-table .c-number, .invoice-table .c-order, .invoice-table .c-due { width: 120px; }
.invoice-table .c-days { width: 110px; } .invoice-table .c-amount { width: 120px; } .invoice-table .c-phone { width: 160px; }
@media (max-width: 860px) {  /* a phone: the hidden columns go, the rest share the width */
  .day-table, .invoice-table { table-layout: auto; }
  .followup-table col { width: auto !important; }
  .day-table .c-tick { width: auto; }
}
.stop-tick { grid-column: 2; margin: -4px 0 4px 10px; font-weight: 600; }
.fleet-table td.cell-phone { white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 13px; }
.fleet-table td.cell-phone a { color: var(--text); text-decoration: none; }
.fleet-table td.cell-phone a:hover { text-decoration: underline; }

/* The reading's ticks sit by their words, and its ADR boxes on an even grid (screen checker, 13 Nov: R7, S4, A6). */
.goods-ticks > .read-field { flex: 0 0 auto; }
.read-adr { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0 16px; }

/* The driver's day (DOMAIN.md section 38, YY's "A" of 13 Nov): one card per stop on his phone, everything visible.
   Its own frame (fleet/templates/fleet/_day_frame.html): the device's light or dark through the tokens above. */
.day-body { background: var(--bg); color: var(--text); -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
.day-page { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.day-top { position: sticky; top: 0; z-index: 2; background: var(--surface); border-bottom: 1px solid var(--border);
  padding: calc(14px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 10px; }
.day-read-only { margin: 0; font-size: .8rem; font-weight: 600; color: var(--accent); }
.day-who { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.day-who strong { font-size: 1.1rem; letter-spacing: -.01em; }
.day-plate { font: 600 .85rem/1.2 var(--font-mono); letter-spacing: .06em; color: var(--muted); white-space: nowrap; }
.day-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--fill, var(--hover)); border-radius: 10px; padding: 3px; }
.day-tabs a { display: flex; align-items: center; justify-content: center; min-height: 44px; text-align: center; padding: 4px; border-radius: 8px; font-weight: 600; font-size: .9rem; color: var(--muted);
  text-decoration: none; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.day-tabs a.is-on { background: var(--accent); color: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }  /* blue, as every tab (T6) */
.day-tabs a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.day-stops { flex: 1; display: flex; flex-direction: column; gap: 10px;
  padding: 12px max(12px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
.day-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 6px; }
.day-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.day-kind { display: inline-flex; gap: 4px; font-weight: 700; font-size: .75rem; letter-spacing: .05em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 6px; }
.day-kind.is-load { color: var(--accent); background: var(--accent-soft); }
.day-kind.is-unload { color: var(--success); background: var(--success-soft); }
.day-time { font-size: 1.4rem; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.day-time.is-none { font-size: .85rem; font-weight: 600; color: var(--muted); }
.day-site { margin: 0; font-size: 1rem; font-weight: 650; }
.day-address { margin: 0; color: var(--muted); font-size: .9rem; }
.day-facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 4px 0 0; font-size: .875rem; }
.day-facts dt { color: var(--muted); }
.day-facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.day-goods { margin: 2px 0 0; font-size: .9rem; border-top: 1px solid var(--border); padding-top: 8px; }
.day-adr { margin: 0; display: flex; gap: 8px; align-items: flex-start; background: var(--warning-soft); color: var(--warning);
  border-radius: 8px; padding: 7px 10px; font-size: .85rem; font-weight: 600; }
.day-adr-mark { flex: none; width: 11px; height: 11px; border: 2px solid currentColor; transform: rotate(45deg); margin: 4px 2px 0; }
.day-empty, .day-closed { color: var(--muted); text-align: center; padding: 40px 16px; }
.day-closed h1 { color: var(--text); font-size: 1.3rem; }

/* ===== The look C (YY, 14 Nov: "C", the desktop app; DESIGN.md "The overall look") =====
   A side list of the sections on the left, one toolbar line per page with its controls, white grids with stripes and
   lines between the columns, real field boxes, the selection a soft blue tint, group boxes with their title.
   The font stays the computer's own (--font, Segoe UI on Windows): nothing shipped. Its pieces: the page
   https://claude.ai/artifact/BGV1apeDaRt2s5gPn956o5, its source in office/handoff/design-c/. */
:root {
  --c-side: #e9e9eb;        /* the side list */
  --c-side-on: #d3d3d7;     /* its current line */
  --c-bar: #f5f5f6;         /* the toolbar line */
  --c-line: #dcdcde;        /* lines around */
  --c-col: #ebebed;         /* lines between columns */
  --c-stripe: #f6f6f8;      /* every second row */
  --c-select: #d6e6fb;      /* a selected row */
  --c-box: #c9c9ce;         /* a field's box */
  --c-field: #ffffff;
  --c-paid: #0e7c7b;
  --topbar-h: 52px;         /* the toolbar line: table headers stick right under it */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-side: #2a2a2d; --c-side-on: #45454a; --c-bar: #2e2e31; --c-line: #3a3a3e; --c-col: #2e2e31;
    --c-stripe: #232326; --c-select: #1e3352; --c-box: #4a4a4f; --c-field: #262629; --c-paid: #3fc1bf;
  }
}
:root[data-theme="dark"] {
  --c-side: #2a2a2d; --c-side-on: #45454a; --c-bar: #2e2e31; --c-line: #3a3a3e; --c-col: #2e2e31;
  --c-stripe: #232326; --c-select: #1e3352; --c-box: #4a4a4f; --c-field: #262629; --c-paid: #3fc1bf;
}

/* The shell: the side list, then the page. */
.shell { display: grid; grid-template-columns: 192px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: none; background: var(--c-side);
  border-right: 1px solid var(--c-line); padding: 10px 8px; display: flex; flex-direction: column; }
.side-toggle, .side-menu-button { display: none; }
/* Menu's tick box, hidden from sight but reached by Tab and Space on a narrow window (Codex, PR 215). */
.side-list { display: flex; flex-direction: column; gap: 1px; flex: 1; min-height: 0; }
.side-co { display: block; margin: 4px 8px 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; overflow-wrap: anywhere; }
.side-co:hover { color: var(--text); }
.side-head { margin: 14px 8px 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.side-item { display: flex; align-items: center; gap: 8px; min-height: 28px; padding: 3px 8px; border-radius: 5px; color: var(--text); text-decoration: none; }
.side-item .icon { width: 16px; height: 16px; flex: none; color: var(--accent); }
.side-item:hover { background: var(--hover); }
.side-item.is-active { background: var(--c-side-on); font-weight: 600; }
.side-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-count { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; } /* a quiet grey number */
.side-bottom { margin-top: auto; padding-top: 10px; display: flex; flex-direction: column; gap: 1px; }
.side-me { display: flex; align-items: center; gap: 8px; padding: 8px 8px 2px; margin-top: 6px; border-top: 1px solid var(--c-line); }
.side-me .who-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; border-radius: 5px; }
.side-me .who-link:hover .who-name { text-decoration: underline; }
.side-me .who-link.is-current .who-name { font-weight: 700; }
.side-me .who-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.side-me .who-roles { display: block; font-size: 11.5px; color: var(--muted); font-weight: 400; }
.side-me .avatar { width: 26px; height: 26px; flex: none; font-size: 11px; }
.side-me form { margin: 0; }
.side-me .btn { height: 26px; padding: 0 8px; font-size: 12.5px; }
.main-col { min-width: 0; display: flex; flex-direction: column; }
.content { max-width: none; padding: 0 24px 40px; }

/* The toolbar line: the page's title, its count and its controls on one line, under which the page scrolls. */
.toolbar { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  min-height: var(--topbar-h); margin: 0 -24px; padding: 0 24px; background: var(--c-bar); border-bottom: 1px solid var(--c-line); }
.toolbar .title-text, .toolbar .head-text { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.toolbar .large-title, .toolbar .item-title { margin: 0; font: 600 16px/1.2 var(--font); letter-spacing: 0; white-space: nowrap; }
.toolbar .muted { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toolbar .title-actions, .toolbar .head-actions { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; min-width: 0; }
.toolbar .btn { height: 28px; padding: 0 12px; border-radius: 6px; }

/* An item's page: its way back sits on the toolbar's band, right above its line. */
.content > .back:first-child { display: block; align-self: stretch; margin: 0 -24px -16px; padding: 6px 24px 0; background: var(--c-bar); font-size: 12.5px; }
.content > .back:first-child + .toolbar { top: 0; }
.side-me { flex-wrap: wrap; }
.side-me .who-link { flex-basis: 100%; }
.side-me form { padding-left: 34px; }
.side-me .btn { padding: 0; height: 22px; }

/* Lists: a white grid, every second row grey, a line between columns, the selection a soft blue. */
.shell .table-wrap { border: 1px solid var(--c-line); border-radius: 8px; }
.shell .table tbody tr:nth-child(even) > td { background: var(--c-stripe); }
.shell .table th + th, .shell .table td + td { border-left: 1px solid var(--c-col); }
.shell .table tbody tr:hover > td { background: var(--hover); }
.shell .table tbody tr:has(input[data-select]:checked) > td, .shell .table tbody tr.is-selected > td { background: var(--c-select); }

/* Fields: a real box, white, a fine grey line; blue when typed in. */
:is(.shell, .auth) .field :is(input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea) {
  background-color: var(--c-field); border: 1px solid var(--c-box); border-radius: 5px; }
:is(.shell, .auth) .field :is(input:not([type=checkbox]):not([type=radio]), select, textarea):hover { background-color: var(--c-field); border-color: var(--muted); }
:is(.shell, .auth) .field :is(input, select, textarea):focus { background-color: var(--c-field); border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

/* A box someone can't change shows its value only, no box (B2; Codex, PR 215): heavier than every rule above. */
.shell .content .field :is(input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea):disabled {
  border-color: transparent; background-color: transparent; box-shadow: none; }
.shell .content .field.is-off :is(input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea):disabled { border-color: var(--border); }

/* A list's search box, and the one inside "+ Filter": a field box like the others (R1, B3; the screen checker, 14 Nov). */
.shell :is(.control-search, .filter-pop .filter-find) { background-color: var(--c-field); border: 1px solid var(--c-box); border-radius: 5px; }
.shell :is(.control-search, .filter-pop .filter-find):hover { background-color: var(--c-field); border-color: var(--muted); }

/* A group box: a white box with a fine line and its title on top; a second label never sits on the line (C2). */
.group-box, .shell :is(.detail-grid > *, .form-page, .read-grid, .read-found, .home-cols, .home-stack, .content:has(> .home-cols)) > .panel, .shell .form-page .form-section { margin: 0; min-width: 0; padding: 10px 14px 12px; border: 1px solid var(--c-line); border-radius: 8px; background: var(--surface); }
.group-box > legend, .group-box > .group-title { padding: 0 4px; margin-left: -4px; font-weight: 600; }

/* A status mark: a dot and its word; Draft an empty ring, Paid a check (C1). */
.status-mark { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.status-mark::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--status-dot, var(--muted)); }
.status-mark.is-draft::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--status-dot, var(--muted)); }
.status-mark.is-paid { color: var(--c-paid); }
.status-mark.is-paid::before { width: 8px; height: 4px; border-radius: 0; background: transparent; border: solid var(--c-paid); border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px); }

/* What a line blocks: an aligned mark in its own column (C3). */
.effect-mark { justify-self: stretch; text-align: center; font-size: 12px; border: 1px solid var(--c-line); border-radius: 4px; padding: 1px 6px; color: var(--muted); }
.effect-mark.is-blocking { color: var(--danger); border-color: var(--danger); font-weight: 600; }

/* Pop-ups float solid on a soft shadow (C replaces the glass, R13): menus, lists, the calendar, the dialog, the bars. */
:is(.menu, .suggest-list, .calendar, .filter-pop, .status-pop, .bulk-bar, .dialog, #results .list-totals) {
  background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }

/* A narrow window: the side list folds to a menu at the top. */
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--c-line); padding: 6px 12px; }
  .side-toggle { display: block; position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
  .side { position: relative; }
  .side-menu-button { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; font-weight: 600; cursor: pointer; }
  .side-list { display: none; padding-bottom: 6px; }
  .side-toggle:checked ~ .side-list { display: flex; }
  .side-toggle:focus-visible + .side-menu-button { outline: 2px solid var(--accent); outline-offset: 2px; }
  .content { padding: 0 16px 32px; }
  .content > .back:first-child { margin: 0 -16px -16px; padding: 6px 16px 0; }
  .toolbar { position: static; margin: 0 -16px; padding: 8px 16px; }
  .shell .table th { top: 0; } /* the toolbar no longer sticks: the header sticks to the window's top */
  .toolbar .title-actions, .toolbar .head-actions { flex-wrap: wrap; }
}

/* ===== The look C, step 3: the lists (14 Nov; drawing "Orders list", DESIGN_CHECKLIST C1, C4, C8) =====
   One toolbar line holds the list's controls (page_head.html's `tools`): the status tabs as one segmented control,
   then "+ Filter" and the search at the right end before the page's buttons; the rows dense and on one line; a
   status a dot and its word; a quiet foot line "12 of 19 orders shown" (list_foot.html). */
.toolbar .toolbar-tools { flex: 1 1 320px; min-width: 0; display: flex; align-items: center; gap: 12px; }
.toolbar .toolbar-tools .filters { flex: 1; min-width: 0; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 6px 0; }
.toolbar .toolbar-tools .chips { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.toolbar .toolbar-tools .chips-end { display: contents; }
.toolbar .toolbar-tools .chips-end .is-hidden { display: none; }
.toolbar .toolbar-tools .btn, .toolbar .toolbar-tools .filter-chip { height: 28px; }
.toolbar .toolbar-tools .filter-add { border: 1px solid var(--c-line); background: var(--c-field); border-radius: 6px; padding: 0 10px; color: var(--text); }
.toolbar .toolbar-tools .control-search { height: 28px; width: 230px; }
.toolbar .toolbar-tools .control-search-wide { width: 290px; } /* its words whole (YY, 3 Nov) */
/* The status tabs: one control, a fine line around and between, the chosen one grey (the drawing's "All 19 · Draft 1"). */
.toolbar .filters .segmented { gap: 0; padding: 0; border: 1px solid var(--c-line); border-radius: 6px; overflow: hidden; background: var(--c-field); }
.toolbar .filters .segmented label { height: 26px; padding: 0 10px; border: 0; border-right: 1px solid var(--c-line); border-radius: 0; color: var(--text); font-weight: 400; }
.toolbar .filters .segmented label:last-of-type { border-right: 0; }
.toolbar .filters .segmented label:hover { background: var(--hover); }
.toolbar .filters .segmented input:checked + label,
.toolbar .filters .segmented.is-gliding input:checked + label { background: var(--c-side-on); color: var(--accent); font-weight: 600; border-bottom: 0; } /* grey as drawn, its word blue (T6: it shows in dark too) */
.toolbar .filters .segmented .seg-glide { display: none; }
.toolbar .filters .segmented .tab-count { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.toolbar .result-count { font-variant-numeric: tabular-nums; }

/* The rows: dense, one line each; the grid fills the page under the toolbar. */
.shell .table-wrap { border-radius: 6px 6px 0 0; margin-top: 0; } /* the page's own 16 px under the toolbar */
:where(.shell) .table th { height: 28px; padding: 0 6px; font-size: 12px; font-weight: 500; color: var(--muted); } /* :where: a list's own column rules still win */
:where(.shell) .table td { height: 26px; padding: 0 6px; font-size: 13px; line-height: 1.3; }
.shell .table td .muted.small { display: inline; margin-left: 6px; font-size: 12px; } /* a stop's hours beside its day, not under it */
.shell .table td .muted.small::before { content: none; }
.shell .table td.cell-select, .shell .table th.cell-select { width: 28px; padding: 0 6px; }
/* The row's own key (an order's number): quiet text, still a link. */
.shell .table a.row-key { color: var(--text); text-decoration: none; font-weight: 400; }
.shell .table a.row-key:hover, .shell .table a.row-key:focus-visible { color: var(--accent); text-decoration: underline; }
/* A loss: red in Margin (€) and Margin (%) both (C4). */
.shell .table td.is-loss { color: var(--danger); }
/* A long plate ends in … rather than leaving its column (S7). */
.shell .table td .plate { max-width: 140px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }

/* An order's status in a list: the dot (8 px) and its word (C1); Draft a ring, Paid a check; the person's own colours
   (--order-*, DOMAIN.md section 35) still give the dot; the pop with the times and notices opens on the dot. */
.shell .table .cell-status { width: auto; text-align: left; }
.cell-status .order-status { display: inline-flex; align-items: center; gap: 6px; }
.cell-status .order-dot { width: 8px; }
.cell-status .order-dot .status-pill { height: 8px; }
.cell-status .order-dot .dot { width: 8px; height: 8px; }
.cell-status .order-dot-draft .dot { border-width: 1.5px; }
.cell-status .order-dot .status-word { display: none; } /* the word is already on the line */
.cell-status .status.order-dot-paid .dot { width: 4px; height: 9px; border-radius: 0; background: transparent; border: solid var(--status-dot); border-width: 0 1.5px 1.5px 0; transform: rotate(40deg) translate(-1px, -2px); } /* a ✓, short left stroke, long right (the Master Session, 14 Nov: it read as a "v"; .status in the selector, or the 8 x 8 dot below wins) */
.cell-status .order-dot-paid .dot::before { content: none; }
.cell-status .order-dot-sent .dot { box-shadow: 0 0 0 2px var(--accent-soft); }
.cell-status .order-dot-notice { right: -4px; top: -4px; width: 6px; height: 6px; border-width: 1px; }
.status-mark-word { color: var(--text); white-space: nowrap; }
.order-status:has(.order-dot-paid) .status-mark-word { color: var(--order-paid); }
.order-status:has(.order-dot-missing) .status-mark-word { color: var(--danger); }

/* The foot line under the grid: how many shown, and the pages. */
.list-foot { display: flex; align-items: center; gap: 16px; min-height: 26px; padding: 2px 10px; border: 1px solid var(--c-line); border-top: 0;
  border-radius: 0 0 6px 6px; background: var(--c-bar); color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.list-foot .pagination { margin: 0 0 0 auto; gap: 8px; }
.list-foot .pagination .btn { height: 22px; padding: 0 8px; font-size: 12px; }
.shell .table td.cell-menu { width: 28px; padding: 0 2px; }
.shell .table .cell-menu .menu-button { width: 24px; height: 22px; min-height: 0; padding: 0; }
.shell .table td.cell-number { padding-left: 16px; } /* the carrier's news dot sits in this room, so every number lines up (R6) */
.shell .table td.cell-number .news-dot { left: 4px; }
/* A switch of links in the toolbar (Follow-up's My stops · Everyone, Fleet's Trucks · Drivers) keeps its words and
   gliding blue line (L8, YY's test of 9 Nov), sized to the toolbar line. */
.toolbar .segmented-links a, .toolbar .segmented-links a[aria-current="page"] { height: 30px; }
/* Follow-up's lines on one line each (R12): the carrier or plate, then its phone, side by side; the tick button small. */
.shell .followup-table td { overflow: hidden; text-overflow: ellipsis; }
.shell .followup-table td > .cell-cut { display: inline-block; max-width: 55%; vertical-align: bottom; }
.shell .followup-table td > a.muted { margin-left: 6px; }
.shell .table .cell-tick .btn-small { height: 22px; padding: 0 10px; font-size: 12px; }
.shell .table td .tag { line-height: 18px; }
/* A partner's status in its list: the dot and its word (C1), the word no longer floating over the dense lines. */
.cell-status .status { display: inline-flex; align-items: center; gap: 6px; height: auto; }
.cell-status .status .status-pill { height: 8px; }
.cell-status .status .dot { width: 8px; height: 8px; }
.cell-status .status .dot-new { border-width: 1.5px; }
.cell-status .status .status-word { display: none; }
.cell-status .status::before { content: none; }
.cell-status .status + .status-mark-word { margin-left: 6px; } /* Partners: the word outside its dot, the same gap as Orders (R6) */
.cell-status .status .dot-new, .cell-status .order-dot-draft .dot { background: transparent; } /* a ring, empty in light and dark */

/* The Orders list's pane (YY, 14 Nov: "A", C10): fixed at the right under the toolbar line; the list makes room. */
.order-pane { position: fixed; z-index: 4; top: var(--pane-top, var(--topbar-h)); right: 0; bottom: 0; width: 320px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; background: var(--surface); border-left: 1px solid var(--c-line); }
.order-pane[aria-busy="true"]:empty::before { content: ""; display: block; height: 3px; width: 40%; border-radius: 2px; background: var(--c-line); }
body.has-pane #results { margin-right: 304px; }
body.has-pane .bulk-bar { margin-right: 304px; } /* the bulk bar beside the pane too, never cut by it (S7) */ /* room beside the list only: the toolbar line never moves */
.order-pane hr { width: 100%; margin: 0; border: 0; border-top: 1px solid var(--c-line); }
.pane-head { display: flex; align-items: center; gap: 8px; }
.pane-title { margin: 0; font: 600 17px/1.2 var(--font); }
.pane-title .row-key { color: var(--text); text-decoration: none; }
.pane-title .row-key:hover, .pane-title .row-key:focus-visible { color: var(--accent); text-decoration: underline; }
.pane-close { margin-left: auto; width: 28px; height: 28px; padding: 0; font-size: 18px; }
.pane-facts { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 6px 10px; margin: 0; }
.pane-facts dt { color: var(--muted); }
.pane-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.pane-facts dd .muted { display: block; font-size: 12.5px; }
.pane-money dd.num { text-align: right; font-variant-numeric: tabular-nums; max-width: 140px; }
.pane-money dd.is-loss { color: var(--danger); }
.pane-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.pane-buttons .btn { height: 28px; padding: 0 12px; border-radius: 6px; }
.shell .table tbody tr[data-pane-url] { cursor: default; }
.shell .table tbody tr.is-selected > td { background: var(--c-select); }
@media (max-width: 1099px) { .order-pane { display: none; } body.has-pane #results { margin-right: 0; } }

/* ===== The look C, step 4a: the order page (14 Nov; drawing "Order page", DESIGN.md "The look C", DESIGN_CHECKLIST C2 to C7) =====
   White group boxes on the grey of the side list, their title on the box's line; labels left of their boxes, right-aligned
   in one column (`.form-rows`, two columns with `.is-two`; `includes/field.html` the label and its box,
   `includes/value_row.html` a label and its value); a small table (`.small-table`). Step 4b reuses them on every form. */
.content:has(> .order-form), .content:has(> .order-form) > .toolbar + * { background: var(--c-side); }
.content:has(> .order-form) { min-height: calc(100vh - var(--topbar-h)); }
.shell .detail-grid.order-grid { grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; padding-top: 16px; }
.order-grid :is(.detail-main, .detail-side, .side-fields) { gap: 14px; }

/* A group box: its title sits on its top line, as a legend does (C2: a second label goes inside, never on the line). */
.group-box, .shell :is(.detail-grid > *, .form-page, .read-grid, .read-found, .home-cols, .home-stack, .content:has(> .home-cols)) > .panel, .shell .form-page .form-section { position: relative; margin-top: 8px; padding-top: 16px; }
.group-box > .group-title,
.shell :is(.detail-grid > *, .form-page, .read-grid, .read-found, .home-cols, .home-stack, .content:has(> .home-cols)) > .panel > h3:first-child,
.shell :is(.detail-grid > *, .form-page, .read-grid, .read-found, .home-cols, .home-stack, .content:has(> .home-cols)) > .panel > .panel-title-line > h3,
.shell :is(.detail-grid > *, .form-page, .read-grid, .read-found, .home-cols, .home-stack, .content:has(> .home-cols)) > .panel.fold > summary > h3,
.shell :is(.detail-grid > *, .form-page, .read-grid, .read-found, .home-cols, .home-stack, .content:has(> .home-cols)) > .panel > .panel-row:first-child > h3,
.shell :is(.detail-grid > *, .form-page, .read-grid, .read-found, .home-cols, .home-stack, .content:has(> .home-cols)) > .panel > .panel-row:first-child > div:first-child > h3,
.shell .form-page .form-section > legend,
.shell .home-partners > .home-partners-line > h3 { position: absolute; top: 0; left: 10px; transform: translateY(-50%); margin: 0; padding: 0 4px;
  font-size: 13px; line-height: 16px; font-weight: 600; color: var(--text);
  background: linear-gradient(transparent 50%, var(--surface) 50%); }
.group-box > .group-title + *, .shell :is(.detail-grid > *, .form-page, .read-grid, .read-found, .home-cols, .home-stack, .content:has(> .home-cols)) > .panel > h3:first-child + * { margin-top: 0; }
.order-grid .group-box .order-fields { margin: 0; padding: 0; border: 0; min-width: 0; }

/* Labels left of their boxes, right-aligned in one column; the boxes in one or two columns. */
.form-rows { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
:is(.form-rows.is-two, .form-page :is(.form-section, .panel) :is(.row-2, .row-postcode)) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; align-items: start; }
:is(.form-rows, .form-page .form-section, .form-page .panel, :is(.detail-grid, .form-page, .read-grid, .home-cols) .panel .fact-grid) :is(.field, .value-row, .fact) { display: grid; grid-template-columns: var(--label-w, 128px) minmax(0, 1fr);
  align-items: center; column-gap: 10px; margin: 0; min-width: 0; }
.form-rows.is-two :is(.field, .value-row) { --label-w: 112px; }
:is(.form-rows, .form-page .form-section, .form-page .panel, :is(.detail-grid, .form-page, .read-grid, .home-cols) .panel .fact-grid) :is(.field, .value-row, .fact) > :is(label, .label, dt), .shell :is(.detail-grid, .form-page, .read-grid, .home-cols) .panel .facts > dt { grid-column: 1; margin: 0; padding: 0; color: var(--muted); font-size: 13px;
  font-weight: 400; text-align: right; overflow-wrap: break-word; }  /* wraps, never cut (W2; French, session 37) */
:is(.form-rows, .form-page .form-section, .form-page .panel, :is(.detail-grid, .form-page, .read-grid, .home-cols) .panel .fact-grid) :is(.field, .value-row, .fact) > :not(label):not(.label):not(dt) { grid-column: 2; min-width: 0; }
:is(.form-rows, .form-page .form-section, .form-page .panel, :is(.detail-grid, .form-page, .read-grid, .home-cols) .panel .fact-grid) .field :is(input:not([type=checkbox]):not([type=radio]), select, textarea, .control) { width: 100%; }
:is(.form-rows, .form-page .form-section, .form-page .panel, :is(.detail-grid, .form-page, .read-grid, .home-cols) .panel .fact-grid) .field :is(.field-help, .field-error, [id$="_error"]) { margin: 2px 0 0; }
.form-rows .value { overflow-wrap: anywhere; }
.form-rows > :is(.live, details, p, .cost-calc, .rate-facts, .margin-rows, .driver-rows) { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-rows > .live:empty { display: none; }
.form-rows .live > :is(.alert, p) { margin: 0; }
/* The ticks under the boxes, from the label column on, in one aligned line. */
.form-ticks { display: grid; grid-template-columns: repeat(4, max-content); gap: 6px 28px; margin: 10px 0 0 calc(112px + 10px); }
.form-ticks + .live:not(:empty), .form-ticks ~ .form-rows:not([hidden]) { margin-top: 10px; }
.goods-line.form-rows { margin-bottom: 0; }
.goods-line.form-rows > .field { width: auto; }

/* A small table: a quiet head, fine lines between rows, no stripes (Readiness's Check and Effect, Payments). */
.small-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.small-table th { height: 22px; padding: 0 8px 0 0; border-bottom: 1px solid var(--c-line); color: var(--muted); font-size: 12px; font-weight: 500; text-align: left; }
.small-table td, .small-table tbody th { height: 26px; padding: 0 8px 0 0; border-bottom: 1px solid var(--c-col); text-align: left; }
.small-table tbody th { color: var(--muted); font-weight: 400; }
.small-table tbody tr:last-child > * { border-bottom: 0; }

/* The toolbar line: ‹ Orders, the number, Client and Client's order no. as label and value; status, Save order, ⋯. */
.toolbar > .back { flex: none; color: var(--muted); font-size: 13px; text-decoration: none; margin-right: 4px; }
.toolbar > .back:hover { color: var(--accent); }
.content:has(> .toolbar > .back) > .toolbar { top: 0; }
.toolbar .head-text:has(.head-label) { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.toolbar .head-text .muted:has(.head-label) { color: var(--text); font-size: 13px; }
.toolbar .head-label { color: var(--muted); font-size: 12px; margin-left: 8px; }
.toolbar .head-value { color: var(--text); text-decoration: none; }
a.head-value:hover { color: var(--accent); text-decoration: underline; }
.head-status { color: var(--text); }
.head-status.is-draft::before { --status-dot: var(--order-draft); }
.head-status:has(.wait-dot)::before { content: none; }

/* Stops: one line per stop, its kind, site, day and hour, reference; its address and contact in grey under it. */
.order-grid .stop .stop-sentence { display: grid; grid-template-columns: 96px minmax(0, 1fr) 150px 130px; column-gap: 10px; row-gap: 1px; align-items: baseline; width: 100%; padding: 4px 8px; }
.order-grid .stop:not(.is-closed) .stop-sentence { display: none; }
.order-grid .stop-sentence-head { display: contents; font-weight: 400; }
.order-grid .stop-sentence-kind { grid-column: 1; margin: 0; color: var(--muted); font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.order-grid .stop-sentence-site { grid-column: 2; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-grid .stop-sentence-when { grid-column: 3; font-variant-numeric: tabular-nums; }
.order-grid .stop-sentence-ref { grid-column: 4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-grid .stop-sentence-line { grid-column: 2 / -1; color: var(--muted); font-size: 12px; }
.order-grid .stop-sentence-line + .stop-sentence-line { color: var(--muted); }

/* Readiness: Check and Effect; the effect an aligned mark in its own column (C3). */
.check-head { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 10px; margin-top: 8px; padding-bottom: 2px;
  border-bottom: 1px solid var(--c-line); color: var(--muted); font-size: 12px; }
.check-head > :last-child { text-align: center; }
.check-table .readiness-line.is-open { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 112px; align-items: center; gap: 8px; padding: 4px 0; border-top: 0; border-bottom: 1px solid var(--c-col); }
.check-table .readiness-line:last-child { border-bottom: 0; }
.check-table .readiness-line > .dot { margin: 0; }
.check-table .readiness-line > .effect-mark { grid-column: 4; }
/* A check's sentence whole, onto a second line when long, in French as in English (YY, 15 Nov: "Pas de remarques pour le
   transpo…" cut); the dot by its first line, the mark at the right on that line. */
.check-table .readiness-line.is-open { align-items: start; }
.check-table .readiness-line > .dot { margin-top: 6px; }
.check-table .readiness-text { grid-column: 2 / 4; grid-row: 1; white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.check-table .readiness-line > .dot { grid-column: 1; grid-row: 1; }
.check-table .readiness-line > .effect-mark { grid-row: 1; }
.check-table .readiness-line > .readiness-ok { grid-column: 2; grid-row: 2; justify-self: start; }  /* under its sentence */
.effect-mark { white-space: nowrap; }
.readiness-top { margin-bottom: 0; }
.readiness-top .readiness-head { margin: 0; }

/* Rate: Margin (€) and Margin (%) two labelled values (C4), large figures, a loss red. */
.margin-value { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; padding-left: 9px; }
.margin-value.is-loss { color: var(--danger); }
.margin-rows { padding-bottom: 6px; margin-bottom: 2px; border-bottom: 1px solid var(--c-col); }
.order-grid .trip-rows { display: flex; flex-direction: column; gap: 6px; }
.order-grid .cost-calc { margin: 0; }

/* Remarks for the carrier: the standard remarks as ticks in two aligned columns (C5). */
.remarks-field { margin: 0; }
.remark-ticks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 24px; margin: 0 0 8px; }
.remark-ticks .remark-pick { display: flex; align-items: center; gap: 6px; padding: 2px 0; border: 0; border-radius: 0; background: none; color: var(--text); font: inherit; text-align: left; }
.remark-ticks .remark-pick::before { content: ""; flex: none; width: 14px; height: 14px; box-sizing: border-box; border: 1px solid var(--c-box); border-radius: 3px; background: var(--c-field); }
.remark-ticks .remark-pick[aria-pressed="true"] { background: none; color: var(--text); }
.remark-ticks .remark-pick[aria-pressed="true"]::before { content: "✓"; display: grid; place-items: center; border-color: var(--accent); background: var(--accent); color: #fff; font-size: 11px; line-height: 1.2; }
.remark-ticks .remark-pick:hover { background: none; color: var(--accent); }

/* Payments, History, Documents, Team messages. */
.pay-table { margin-bottom: 6px; }
.payments .pay-half:not(:has(> *:not(:empty))) { display: none; }
.history-summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; color: var(--text); }
.history-summary::-webkit-details-marker { display: none; }
.history-summary::before { content: ""; width: 6px; height: 6px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); transition: transform .15s; }
.history-fold[open] > .history-summary::before { transform: rotate(45deg); }
.history-fold > .history { margin-top: 8px; }
.documents-card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn.btn-icon-word { display: inline-flex; align-items: center; gap: 6px; background: var(--c-field); border: 1px solid var(--c-line); color: var(--text); font-weight: 400; }
.btn.btn-icon-word .icon { width: 14px; height: 14px; color: var(--accent); }
.order-grid .message-form { display: flex; gap: 8px; align-items: flex-start; }
.order-grid .message-form textarea { flex: 1; min-height: 28px; }
.kind-word { color: var(--text); }

/* A narrow window: the labels go back above their boxes, one column. */
@media (max-width: 1080px) {
  .shell .detail-grid.order-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  :is(.form-rows.is-two, .form-page :is(.form-section, .panel) :is(.row-2, .row-postcode)) { grid-template-columns: minmax(0, 1fr); }
  :is(.form-rows, .form-page .form-section, .form-page .panel, :is(.detail-grid, .form-page, .read-grid, .home-cols) .panel .fact-grid) :is(.field, .value-row, .fact) { display: block; }
  :is(.form-rows, .form-page .form-section, .form-page .panel, :is(.detail-grid, .form-page, .read-grid, .home-cols) .panel .fact-grid) :is(.field, .value-row, .fact) > :is(label, .label, dt), .shell :is(.detail-grid, .form-page, .read-grid, .home-cols) .panel .facts > dt { display: block; text-align: left; margin-bottom: 4px; }
  .remark-ticks { grid-template-columns: minmax(0, 1fr); }
  .order-grid .stop .stop-sentence { grid-template-columns: 96px minmax(0, 1fr); }
  .order-grid :is(.stop-sentence-when, .stop-sentence-ref) { grid-column: 2; }
  .toolbar .head-text:has(.head-label) { flex-wrap: wrap; row-gap: 0; }
}
/* The look C, step 4a, its first screenshots: the way back on the line, the status as a mark only, boxes 28 px high. */
.toolbar > .back { align-self: center; margin: 0 4px 0 0; font-weight: 400; }
.toolbar .head-status { background: none; padding: 0; border-radius: 0; font-size: 13px; font-weight: 400; }
:is(.form-rows, .form-page .form-section, .form-page .panel, :is(.detail-grid, .form-page, .read-grid, .home-cols) .panel .fact-grid) .field :is(input:not([type=checkbox]):not([type=radio]):not([type=file]), select, .control:not(textarea)) { height: 28px; min-height: 28px; padding-top: 0; padding-bottom: 0; font-size: 13px; }
@media (min-width: 761px) { .order-grid .stop .stop-sentence { grid-template-columns: 96px minmax(0, 1fr) 170px 130px; } }  /* wide only: under 760 px the two columns above hold (Codex, PR 215) */
.order-grid .stop.is-closed { padding: 2px 0; }
.order-grid .stop + .stop-swap { margin: 0; }
.history-fold > .history-summary::after { content: none; }
.history-fold > .history-summary { display: inline-flex; width: auto; padding: 2px 0; }
.order-grid .stop .stop-sentence { font-size: 13px; }
.order-grid .stop-sentence-site { font-size: 13px; }
/* The look C, step 4a, the screen checker's findings: "What the goods are" whole; a read-only stop without its drag,
   swap and Remove; in a narrow window the trip's boxes under the cost, a site and the head's words wrapping. */
.form-rows.is-two :is(.field, .value-row) { --label-w: 124px; }
.form-ticks { margin-left: calc(124px + 10px); }
.order-fields:disabled :is(.stop-grip, .stop-tools) { visibility: hidden; }  /* their columns kept: the boxes stay in theirs (screen checker, session 37) */
.order-fields:disabled .stop-swap { display: none; }
.form-rows .tag { white-space: normal; }  /* a long chip wraps in its value column (French, session 37) */
@media (max-width: 760px) {
  .order-grid :is(.cost-calc, .trip-rows, .trip-rows .field) { width: 100%; margin: 0; padding: 0; justify-items: stretch; }
  .order-grid .stop-sentence-site { white-space: normal; }
  .toolbar .head-text .muted:has(.head-label) { white-space: normal; }
  .form-ticks { margin-left: 0; }
}

/* ===== The look C, step 4b: every other page (14 Nov; DESIGN.md "The look C"; the order page of 4a is the model) =====
   Those pages are built from two shared pieces already: a panel (`includes/panel_head.html`, or a fold) and a form's
   `fieldset.form-section`. They take the order page's own rules by selector above (the group box, its title on the line,
   `.form-rows`; the Master Session: one set of rules, `core/tests_design.py`); what follows is only what those don't say. */
.shell .content:is(:has(> .detail-grid), :has(> .read-grid), :has(> .home-cols), :has(> .form-page), :has(> .settings-layout)) { background: var(--c-side); }
.shell .content:is(:has(> .detail-grid), :has(> .order-form), :has(> .read-grid), :has(> .home-cols), :has(> .form-page), :has(> .settings-layout)) { min-height: 100vh; }
.content > :is(.detail-grid, .form-page) { padding-top: 16px; }
.content > .form-page { max-width: 860px; gap: 14px; }
.form-page .form { gap: 14px; }
.detail-grid :is(.detail-main, .detail-side) { gap: 14px; }
.detail-grid .detail-side { --label-w: 108px; }
.page-head.toolbar > .back + .head-text { margin-right: auto; }  /* the title beside the way back, the buttons on the right */
/* A title on its box's line, beyond the group box's own: long ones cut, a legend out of its float. */
.shell :is(.detail-grid > *, .form-page, .read-grid, .read-found, .home-cols, .home-stack, .content:has(> .home-cols)) > .panel > h3:first-child,
.shell :is(.detail-grid > *, .form-page, .read-grid, .read-found, .home-cols, .home-stack, .content:has(> .home-cols)) > .panel > .panel-title-line > h3,
.shell :is(.detail-grid > *, .form-page, .read-grid, .read-found, .home-cols, .home-stack, .content:has(> .home-cols)) > .panel.fold > summary > h3,
.shell :is(.detail-grid > *, .form-page, .read-grid, .read-found, .home-cols, .home-stack, .content:has(> .home-cols)) > .panel > .panel-row:first-child > h3,
.shell :is(.detail-grid > *, .form-page, .read-grid, .read-found, .home-cols, .home-stack, .content:has(> .home-cols)) > .panel > .panel-row:first-child > div:first-child > h3,
.shell .form-page .form-section > legend,
.shell .home-partners > .home-partners-line > h3 { max-width: calc(100% - 20px); letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell .form-page .form-section > legend { float: none; width: auto; }
.shell .form-page .form-section { gap: 6px; }
.shell .home-partners > .home-partners-line > h3 a { color: var(--text); }
/* A panel's add button: inside its box, on the right of the first line, the content beside it (never on the line, C2). */
.shell :is(.detail-grid > *, .form-page, .read-grid, .read-found, .home-cols, .home-stack, .content:has(> .home-cols)) > .panel > .panel-title-line { justify-content: flex-end; min-height: 0; margin: 0; }
.shell :is(.detail-grid > *, .form-page, .read-grid, .read-found, .home-cols, .home-stack, .content:has(> .home-cols)) > .panel > .panel-title-line:has(> :not(h3)) { float: right; margin: -4px 0 4px 12px; }
.shell :is(.detail-grid > *, .form-page, .read-grid, .read-found, .home-cols, .home-stack, .content:has(> .home-cols)) > .panel::after { content: ""; display: block; clear: both; }
/* A fold inside a box (Documents, History; the order's "Spot truck, not in Fleet"): its arrow first and its words or
   count quiet, as the order's History (C7); never larger than its box's title. */
:is(.shell :is(.detail-grid > *, .form-page, .read-grid, .read-found, .home-cols, .home-stack, .content:has(> .home-cols)) > .panel.fold, .order-grid .spot-fold) > summary { display: flex; justify-content: flex-start; gap: 6px; font-size: 13px; color: var(--text); }
.order-grid .spot-fold > summary { display: inline-flex; width: auto; padding: 2px 0; }
.order-grid .spot-fold > summary > h4 { margin: 0; font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; color: inherit; }
:is(.shell :is(.detail-grid > *, .form-page, .read-grid, .read-found, .home-cols, .home-stack, .content:has(> .home-cols)) > .panel.fold, .order-grid .spot-fold) > summary::after { order: -1; width: 6px; height: 6px; margin: 0 2px 0 0; border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); }
:is(.shell :is(.detail-grid > *, .form-page, .read-grid, .read-found, .home-cols, .home-stack, .content:has(> .home-cols)) > .panel.fold, .order-grid .spot-fold)[open] > summary::after { margin: 0 2px 0 0; transform: rotate(45deg); }
:is(.shell :is(.detail-grid > *, .form-page, .read-grid, .read-found, .home-cols, .home-stack, .content:has(> .home-cols)) > .panel.fold, .order-grid .spot-fold) > summary:hover { color: var(--accent); }
:is(.shell :is(.detail-grid > *, .form-page, .read-grid, .read-found, .home-cols, .home-stack, .content:has(> .home-cols)) > .panel.fold, .order-grid .spot-fold) > summary:hover :is(h3, h4) { text-decoration: none; }
/* Facts: a `.fact` is drawn as a value row by the rules above; `dl.facts` (label and value pairs, no wrapper) here. */
.shell :is(.detail-grid, .form-page, .read-grid, .home-cols) .panel .fact-grid { gap: 6px 16px; }
.shell :is(.detail-grid, .form-page, .read-grid, .home-cols) .panel .fact > dt, .shell :is(.detail-grid, .form-page, .read-grid, .home-cols) .panel .facts > dt { font-size: 13px; }
.shell :is(.detail-grid, .form-page, .read-grid, .home-cols) .panel :is(.fact-grid, .facts) dd { margin: 0; font-size: 13px; }
.shell :is(.detail-grid, .form-page, .read-grid, .home-cols) .panel .facts { grid-template-columns: var(--label-w, 128px) minmax(0, 1fr); gap: 6px 10px; align-items: baseline; margin-top: 0; }
.shell :is(.detail-grid, .form-page, .read-grid, .home-cols) .panel .facts dd + dt { margin-top: 0; }
@media (max-width: 760px) {
  .shell :is(.detail-grid, .form-page, .read-grid, .home-cols) .panel .fact-grid { grid-template-columns: minmax(0, 1fr); }
  .shell :is(.detail-grid, .form-page, .read-grid, .home-cols) .panel .facts { display: block; }
  .shell :is(.detail-grid, .form-page, .read-grid, .home-cols) .panel .facts dd { margin-bottom: 6px; }
}
/* A form page's own pieces: a field that is a fieldset (a partner's Type, a truck's Formula: its legend in the label
   column), the two- and three-box rows, the lines under the boxes in the boxes' column. */
.form-page :is(.form-section, .panel) :is(.row-2, .row-postcode, .row-3) { gap: 6px 16px; align-items: start; }
.form-page :is(.form-section, .panel) fieldset.field { display: block; }
.form-page :is(.form-section, .panel) fieldset.field > legend { float: left; width: var(--label-w, 128px); margin: 0 10px 0 0; padding: 4px 0 0; }
.form-page :is(.form-section, .panel) fieldset.field > :not(legend) { margin-left: calc(var(--label-w, 128px) + 10px); }
.form-page :is(.form-section, .panel) fieldset.field > .field-help { margin: 2px 0 0 calc(var(--label-w, 128px) + 10px); }
.form-page :is(.form-section, .panel) fieldset.field > :is(.segmented, .choices-inline) { margin-top: 0; }
@media (min-width: 761px) {  /* wide only: under 760 px one column, as every row (Codex, PR 215) */
  .form-page :is(.form-section, .panel) fieldset.field .segmented > label { white-space: nowrap; }
  .form-page :is(.form-section, .panel) .row-2:has(> fieldset.field .segmented) { grid-template-columns: minmax(0, 1fr) max-content; }  /* a site's Used for whole */
  .form-page :is(.form-section, .panel) .row-2 > fieldset.field:has(.segmented) { --label-w: 64px; }
}
.form-page :is(.form-section, .panel).is-one .field { display: block; }  /* a box whose section title is its only label (W3): the whole width */
.form-page :is(.form-section, .panel) .field textarea { font-size: 13px; }
.form-page :is(.form-section, .panel) table input:not([type=checkbox]) { height: 28px; min-height: 28px; padding-top: 0; padding-bottom: 0; font-size: 13px; }
.form-page :is(.form-section, .panel) > :is(.form-actions, .choice-inline) { margin-left: calc(var(--label-w, 128px) + 10px); }
.form-page .form-section > :is(p, .map-tools, .site-map, .choices-grid):not(.alert):not(.read-drop-help) { margin-left: calc(var(--label-w, 128px) + 10px); }
@media (max-width: 760px) {
  .form-page :is(.form-section, .panel) fieldset.field > legend { float: none; width: auto; text-align: left; }
  .form-page :is(.form-section, .panel) :is(fieldset.field > :not(legend), fieldset.field > .field-help, > .form-actions, > .choice-inline) { margin-left: 0; }
  .form-page .form-section > :is(p, .map-tools, .site-map, .choices-grid):not(.alert) { margin-left: 0; }
}
/* Home: the counts in one box with the boxes' line; each stop's kind as the order's stop line. */
.home-counts { border: 1px solid var(--c-line); border-radius: 8px; }
.home-kind { font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; }
/* The pages before login: the grey of the side list behind one white box with the boxes' line (the field boxes are
   the app's own, `:is(.shell, .auth) .field` above); the carrier's page's cards keep their own frame. */
.auth { background: var(--c-side); }
.auth .auth-card { border: 1px solid var(--c-line); border-radius: 8px; box-shadow: none; background: var(--surface); }
.auth .field :is(input:not([type=checkbox]):not([type=radio]):not([type=file]), select) { height: 30px; min-height: 30px; padding-top: 0; padding-bottom: 0; font-size: 13px; box-shadow: none; }
.login-card .field > label { padding-left: 0; font-size: 13px; font-weight: 400; }
.shell :is(.detail-grid, .form-page, .read-grid, .home-cols) .panel .fact { align-items: baseline; }  /* a label at its value's first line (an address on three) */
/* The screen checker (step 4b): a field that is a lone tick (Team's Can log in) in the boxes' column; Team's exceptions
   fold there too; Company settings' search strip on the page's grey, a gap under the toolbar. */
.form-page :is(.form-section, .panel) .field > label.choice-inline:first-child { grid-column: 2; }
.form-page :is(.form-section, .panel) > .rights-fold { margin-left: calc(var(--label-w, 128px) + 10px); }
.shell .settings-search { background: var(--c-side); }
.shell .content > .settings-layout { padding-top: 16px; }
@media (max-width: 760px) { .form-page :is(.form-section, .panel) > .rights-fold { margin-left: 0; } }
/* The screen checker's walk (step 4b): a box someone may not change ("admin or back office") keeps its note under its label, small. */
.form-page :is(.form-section, .panel) .field > label:first-child .optional:not(.optional-word) { display: block; font-size: 11px; line-height: 14px; }
@media (max-width: 760px) {  /* Codex, PR 215 (S7): a form's switch in a narrow window, its long choice on two lines, never cut */
  .form-page :is(.form-section, .panel) fieldset.field .segmented { display: flex; }
  .form-page :is(.form-section, .panel) fieldset.field .segmented > label { flex: 1 1 0; justify-content: center; height: auto; min-height: 30px; padding: 4px 8px; line-height: 1.2; text-align: center; }
}

/* ===== The look C, step 5: the planning board (14 Nov; drawing "Planning board", DESIGN.md "The look C") =====
   A white grid with fine lines between the columns, no rounded frame; the day's name with its date small and grey
   under it; a grey band per carrier across the width, its country in a small box; truck rows white and grey in turn;
   the plate bold over one grey line; in a cell its notices first as words in their colour, then one line per stop, its
   arrow, its place and its hour at the right; a day's state a quiet word. Everything the board does is unchanged. */
:root { --c-band: #ededef; --c-weekend: #f0f0f2; --board-place: 18px; --board-line: 16px; --board-small: 16px; }
/* The board's every size comes from these three: the drawing's; YY's 1 Nov rule (DOMAIN.md s.13) is 18px, 16px, 16px. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --c-band: #2c2c2f; --c-weekend: #262628; } }
:root[data-theme="dark"] { --c-band: #2c2c2f; --c-weekend: #262628; }
.shell .board-wrap { border-radius: 0; border: 1px solid var(--c-line); background: var(--surface); }
.shell .board { font-size: var(--board-place); min-width: 1000px; }  /* inside its frame at 1280 px, Windows' scrollbar too (1038 px less 17; the tester's trial, 16 Nov: 1060 cut the last day by 22 px) */
.shell .board-col-truck { width: 270px; }
.shell .board-col-weekend { width: 78px; }
.shell .board th, .shell .board td { border-right: 1px solid var(--c-col); border-bottom: 1px solid var(--c-line); }
.shell .board thead th { height: 36px; padding: 3px 4px; font-weight: 600; color: var(--text); }
.shell .board thead .board-truck { font-size: var(--board-place); }
.shell .board-weekday { font-size: var(--board-place); font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text); line-height: 1.25; }
.shell .board-date { font-size: var(--board-small); font-weight: 400; color: var(--muted); line-height: 1.3; }
.shell .board-day.is-weekend, .shell .board-cell.is-weekend { background-color: var(--c-weekend); }
/* The carrier's band: grey across the whole width, its country in a small bordered box. */
.shell .board-group th { height: 26px; padding: 0 8px; background: var(--c-band); font-size: var(--board-place); font-weight: 600; }
.shell .board-country { min-width: 0; padding: 0 4px; margin-right: 4px; border: 1px solid var(--c-line); border-radius: 3px; background: transparent; font-size: var(--board-small); font-weight: 600; line-height: 1.45; color: var(--muted); }
.shell .board-group .muted { font-weight: 400; }
/* Truck rows white and grey in turn (C8), the truck's own cell too as it sticks at the left. */
.shell .board tr[data-row] { --row-bg: var(--surface); }
.shell .board tr[data-row]:nth-child(even of [data-row]) { --row-bg: var(--c-stripe); }
.shell .board .board-truck { background: var(--row-bg, var(--surface)); padding: 5px 8px; vertical-align: top; font-weight: 600; }
.shell .board thead .board-truck { background: var(--surface); vertical-align: middle; }
.shell .board-cell { background-color: var(--row-bg); }
.shell .board-cell.is-weekend { background-color: var(--c-weekend); }
.shell .board-cell.is-holiday { background-color: rgba(93, 63, 211, .14); }
.shell .board-cell.is-breach { background-color: var(--tint-red); }
.shell .board-cell:has(.has-delay) { background-color: rgba(201, 162, 39, .12); }
/* The truck: the plate bold, then one grey line (trailer · Mega · rate · km · its cabotage counter, whole at the end). */
.shell .board .board-truck-name { font-size: var(--board-place); line-height: 1.35; }
.shell .board-truck-info { display: flex; flex-wrap: wrap; max-height: 2.7em; min-width: 0; overflow: hidden; white-space: nowrap; font-size: var(--board-line); line-height: 1.33; font-weight: 400; color: var(--muted); }
.shell .board-truck-info > * { flex: none; }
/* The trailer's plate is never cut (the Master Session, 14 Nov): a long line wraps onto a second line, two at most. */
.shell .board-truck-info > * + *::before { content: "\00a0·\00a0"; }
.shell .board-truck-info .board-cabotage { flex: none; }
.shell .board-trailer, .shell .board-truck-line { display: inline; font-size: var(--board-line); line-height: 1.33; font-weight: 400; }
.shell .board-mega { letter-spacing: 0; }
.shell .board-rate, .shell .board-km { color: var(--muted); font-weight: 400; }
.shell .board-cabotage.is-breach { color: var(--danger); font-weight: 600; }
.shell .board-cabotage.is-full { color: var(--warning); font-weight: 600; }
/* A cell: one height for every row; its contents start top left. */
.shell .board-cell { height: calc(var(--board-place) * 3.9 + 12px); padding: 4px 6px; text-align: left; vertical-align: top; }
.shell .board-stops { display: flex; width: 100%; }
.shell .board-stop { grid-template-columns: 12px minmax(0, 1fr); column-gap: 5px; font-size: var(--board-place); font-weight: 400; line-height: 1.3; padding: 0; }
.shell .board-stop .board-arrow { height: 1.3em; }
.shell .board-arrow-mark { width: 12px; height: 12px; }
.shell .board-place { gap: 4px; }
.shell .board-place .board-time { margin-left: auto; font-weight: 500; color: var(--muted); }
.shell .board-delay { font-size: var(--board-small); font-weight: 600; }
/* The notices: words in their colour, a breach red, the Inter reminder and what is missing amber. */
/* One line each, ending in "…", the whole notice in its hover label: every row one height (YY, 1 and 15 Nov). */
.shell .board-mark { display: block; max-width: 100%; margin: 0 0 1px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: var(--board-line); font-weight: 500; line-height: 1.3; }
.shell .board-mark > * { display: inline; white-space: nowrap; }
.shell .board-mark > * + * { margin-left: 4px; }
.shell .board-mark-breach strong { display: inline; width: auto; padding: 0; border-radius: 0; background: none; color: var(--danger); font-size: inherit; font-weight: 600; letter-spacing: 0; }
.shell .board-mark-breach span { color: var(--danger); font-weight: 500; }
/* A cabotage breach is the exception (DOMAIN.md section 20): its red words read whole, its cell grows (Codex, PR 220). */
.shell .board-mark.board-mark-breach, .shell .board-mark-breach > * { overflow: visible; white-space: normal; text-overflow: clip; }
.shell .board-mark.board-mark-inter { padding: 0; border: 0; border-radius: 0; color: var(--warning); }
.shell .board-missing { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: var(--board-line); font-weight: 500; line-height: 1.3; }
.shell .board-mark-short { top: 3px; right: 4px; min-width: 14px; font-size: var(--board-small); line-height: 1.3; text-align: center; }
.shell .board-mark-short.board-mark-inter { color: var(--warning); }
.shell .board-weekend-line { min-height: 1.3em; font-size: var(--board-place); }
.shell .board-rest { font-size: var(--board-small); color: var(--muted); }
/* A day's state: a quiet word, no filled box (Service, En route, Stopped, Waiting). */
.shell .board-state { display: block; min-height: 0; border-radius: 0; background: none; box-shadow: none; outline: 0; font-size: var(--board-line); font-weight: 400; line-height: 1.4; color: var(--muted); }
.shell .board-state.is-en_route { background: none; color: var(--muted); }
.shell .board-state.is-stopped { background: none; }
.shell .board-state-beside { font-size: var(--board-line); line-height: 1.4; }
.shell :is(.board-state, .board-state-beside)::first-letter { text-transform: uppercase; }
.shell .board-state-dot { width: 8px; height: 8px; }
/* The toolbar line: the switch beside the title, the week's buttons at the right end. */
.shell .toolbar .week-nav .btn { height: 28px; }
.shell .toolbar .week-nav .btn { border: 1px solid var(--c-line); background: var(--c-field); color: var(--text); font-weight: 400; } /* plain, as drawn */
.shell .toolbar .week-nav .btn:hover { background-image: linear-gradient(var(--hover), var(--hover)); filter: none; border: 1px solid var(--c-line); }
.shell .toolbar .week-nav .btn.is-on { background: var(--c-side-on); border-color: var(--c-line); }

/* The French hunt (screen checker, 15 Nov; YY: "texts out of their designated boxes … for french"). */
/* The goods' four ticks stay an aligned grid (C5; Codex, pull request 219): each column gives way and its label wraps
   inside it, never out of the box; two columns on a narrow window, as before. */
.form-ticks { grid-template-columns: repeat(4, minmax(0, max-content)); }
.form-ticks > .choice-inline { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 760px) { .form-ticks { grid-template-columns: repeat(2, minmax(0, max-content)); } }
.home-place { flex: 0 1 160px; min-width: 64px; }  /* Home's Today: the town gives way before the truck is cut */
.home-truck { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.side-view:not(.side-saved) .side-label { white-space: normal; overflow-wrap: anywhere; }  /* "Tous les camions" whole; a saved view's own name still ends in … */
.trip-grid label { overflow: visible; text-overflow: clip; white-space: normal; }  /* the trip's labels wrap, never "Heures de servi…" */
