/* Control room, the look the owner chose on 2026-11-28 (design/prod-variants/v1-control-room.html): a navy sidebar,
   a light working surface, Public Sans with even-width numbers, and colour kept for status. The admin site keeps its
   own look in admin.css. */
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/public-sans.woff2") format("woff2");
}

:root {
  --ink-900: #0e1a2b;
  --ink-700: #34445a;
  --ink-500: #5a687c;
  --ink-400: #8592a3;
  --line: #dce2ea;
  --line-strong: #c9d1dc;
  --line-soft: #e9edf2;
  --canvas: #f3f5f8;
  --surface: #ffffff;
  --surface-soft: #f7f9fb;
  --navy-900: #10213a;
  --navy-800: #182d4b;
  --navy-700: #243b5e;
  --navy-text: #c9d3e1;
  --navy-muted: #8a9ab2;
  --blue-700: #1b45ac;
  --blue-600: #2458d3;
  --blue-100: #d8e3fa;
  --blue-50: #eef3fd;
  --bad-700: #b4251d;
  --bad-600: #d2352c;
  --bad-100: #fbe4e2;
  --bad-50: #fdf4f3;
  --warn-700: #8f5300;
  --warn-500: #e2980f;
  --warn-100: #fdebc8;
  --warn-50: #fff8ea;
  --good-700: #17724a;
  --good-500: #2e9d67;
  --good-100: #cfeadb;
  --good-50: #eaf6f0;
  --off-600: #5a687c;
  --off-50: #eff2f5;
  --e1: 0 1px 2px rgba(14, 26, 43, .06);
  --e2: 0 2px 6px rgba(14, 26, 43, .08), 0 12px 28px rgba(14, 26, 43, .12);
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --font: "Public Sans", "Segoe UI", system-ui, sans-serif;

  /* The old names, kept so every page takes the new colours while each is reworked in its own stage. */
  --sign-green: var(--blue-600);
  --sign-green-dark: var(--blue-700);
  --reflective-white: var(--surface);
  --asphalt: var(--ink-900);
  --asphalt-soft: var(--ink-500);
  --concrete: var(--canvas);
  --joint: var(--line);
  --lane-yellow: var(--warn-500);
  --stop-red: var(--bad-700);
  --road-font: var(--font);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink-900);
  font-family: var(--font);
  font-size: 14px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--blue-700); text-underline-offset: 2px; }
a:hover { color: var(--blue-600); }

:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 2px; }

h1 { margin: 0; font-size: 24px; line-height: 32px; font-weight: 700; letter-spacing: -.01em; }
h2 { margin: 0 0 8px; font-size: 16px; line-height: 24px; font-weight: 600; }
h3 { font-size: 14px; line-height: 20px; font-weight: 600; }

table, .board, .money-totals, .count, .num { font-variant-numeric: tabular-nums; }

.hint.wide-hint { max-width: none; }
/* Skip to the page's own content, shown only when the keyboard reaches it. */
.skip-link { position: absolute; top: -100px; left: 8px; z-index: 100; padding: 8px 12px; background: var(--surface); border-radius: var(--r-sm); }
.skip-link:focus { top: 8px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

svg.i { flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* The frame: a navy sidebar with the pages, and the working surface beside it. */
.app { display: grid; grid-template-columns: 212px minmax(0, 1fr); min-height: 100vh; }

.side {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--navy-900);
  color: var(--navy-text);
}

.side-top { display: flex; align-items: center; gap: 4px; }

.org {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 12px;
  padding: 10px;
  border: 1px solid var(--navy-700);
  border-radius: var(--r-md);
  color: inherit;
  text-decoration: none;
}
.org:hover { background: var(--navy-800); color: inherit; }
.org-badge {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  background: #2e4b78;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.org-text { display: flex; flex-direction: column; min-width: 0; }
.org-name { overflow: hidden; color: #fff; font-size: 13px; font-weight: 600; line-height: 18px; text-overflow: ellipsis; white-space: nowrap; }
.org-sub { color: var(--navy-muted); font-size: 12px; line-height: 16px; }

.menu-button { display: none; }

.side-body { display: flex; flex: 1; flex-direction: column; min-height: 0; }

.side-nav { display: flex; flex: 1; flex-direction: column; gap: 2px; padding: 4px 12px 12px; overflow: auto; }
.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  color: var(--navy-text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
.side-nav a:hover { background: var(--navy-800); color: #fff; }
.side-nav a[aria-current="page"] { background: #fff; color: var(--navy-900); }
.side-nav a[aria-current="page"] .i { color: var(--blue-600); }
.side-nav a:focus-visible, .org:focus-visible, .side .sign-out:focus-visible, .menu-button:focus-visible { outline-color: #8db0f5; }
.side-sep { height: 1px; margin: 8px 10px; background: var(--navy-700); }

.who { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-top: 1px solid var(--navy-700); }
.who-role { padding: 0 2px; color: var(--navy-muted); font-size: 12px; line-height: 16px; }
.who form { margin: 0; }
.side .sign-out {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--navy-700);
  background: none;
  box-shadow: none;
  color: var(--navy-text);
  font-size: 12px;
}
.side .sign-out:hover { background: var(--navy-800); color: #fff; }

.main { min-width: 0; padding: 20px 24px 48px; }
.main > * { max-width: 1600px; }
.main.bare { max-width: 1100px; margin: 0 auto; }

.bare-head { display: flex; align-items: center; height: 56px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; font-size: 16px; font-weight: 600; text-decoration: none; }
.mark { flex: none; width: 28px; height: 28px; }

@media (max-width: 860px) {
  .app { display: block; }
  .side { z-index: 40; height: auto; }
  .side-top { padding-right: 12px; }
  .org { margin: 8px 0 8px 12px; padding: 6px 8px; border-color: transparent; }
  .menu-button {
    display: inline-flex;
    width: 40px;
    min-height: 40px;
    padding: 0;
    border-color: var(--navy-700);
    background: none;
    box-shadow: none;
    color: #fff;
  }
  .menu-button:hover { background: var(--navy-800); }
  .side-nav { flex-flow: row wrap; padding: 0 12px 8px; }
  .side-sep { display: none; }
  .js .side-body { display: none; }
  .js .side-body.open { display: flex; max-height: calc(100vh - 56px); overflow: auto; }
  .js .side-body.open .side-nav { flex-flow: column nowrap; }
  .side-nav a { height: 44px; }
  .main { padding: 16px 12px 40px; }
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.page-head h1 small, h2 small.count, .count { display: inline; color: var(--ink-500); font-size: 13px; font-weight: 500; letter-spacing: 0; }

.head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.head-actions form { margin: 0; }

/* Buttons and fields */
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: var(--e1);
  color: var(--ink-900);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .12s, border-color .12s;
}
button:hover, .button:hover { border-color: var(--line-strong); background: var(--surface-soft); color: var(--ink-900); }
button:active, .button:active { background: var(--canvas); }

.primary { border-color: var(--blue-600); background: var(--blue-600); color: #fff; }
.primary:hover { border-color: var(--blue-700); background: var(--blue-700); color: #fff; }
.ghost { border-color: transparent; background: none; box-shadow: none; color: var(--ink-700); }
.ghost:hover { border-color: transparent; background: var(--canvas); }
.lg { min-height: 40px; padding: 0 16px; font-size: 14px; }
.danger { color: var(--bad-700); }
.danger:hover { border-color: #e8a9a4; color: var(--bad-700); }

input, select, textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: var(--e1);
  color: var(--ink-900);
  font: inherit;
  font-size: 14px;
  line-height: 20px;
}
input::placeholder, textarea::placeholder { color: var(--ink-400); }
input:hover, select:hover, textarea:hover { border-color: #c1cad6; }
input:focus, select:focus, textarea:focus { border-color: var(--blue-600); outline: none; box-shadow: 0 0 0 3px var(--blue-100); }
select {
  padding-right: 30px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235A687C' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none;
  cursor: pointer;
}
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; padding: 0; box-shadow: none; accent-color: var(--blue-600); }
input[type="file"] { padding: 6px; box-shadow: none; }

/* Messages */
.messages { margin: 0 0 16px; padding: 0; list-style: none; }

.message {
  margin-bottom: 8px;
  padding: 10px 14px;
  border: 1px solid var(--good-100);
  border-left: 3px solid var(--good-500);
  border-radius: var(--r-sm);
  background: var(--good-50);
  color: var(--ink-900);
  font-size: 13px;
}

.message-error { border-color: #f2c6c2; border-left-color: var(--bad-600); background: var(--bad-50); color: var(--bad-700); font-weight: 600; }

.warnings {
  margin-bottom: 16px;
  padding: 10px 14px 10px 16px;
  border: 1px solid #f0d9a8;
  border-left: 3px solid var(--warn-500);
  border-radius: var(--r-sm);
  background: var(--warn-50);
  font-size: 13px;
}

.warnings ul { margin: 0; padding-left: 18px; }

.empty { max-width: 65ch; color: var(--ink-500); font-size: 15px; }
.hint { max-width: 70ch; margin: 4px 0 16px; color: var(--ink-500); font-size: 13px; }

/* Tables */
.board {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  font-size: 13px;
  line-height: 18px;
}

.board th {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink-500);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  text-align: left;
}
.board th:first-child { border-top-left-radius: var(--r-md); }
.board th:last-child { border-top-right-radius: var(--r-md); }

.board td { padding: 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.board tbody tr:last-child > td { border-bottom: 0; }

.board strong { display: block; font-weight: 600; }
small { display: block; color: var(--ink-500); font-size: 12px; line-height: 16px; }

/* A truck number reads like a unit tag. */
.plate {
  display: inline-block;
  min-width: 3.5rem;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--surface-soft);
  color: var(--ink-900);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
  text-align: center;
  white-space: nowrap;
}

/* A route: the two stops joined by a dashed line. */
.route { display: grid; grid-template-columns: minmax(8rem, 1fr) minmax(3rem, 6rem) minmax(8rem, 1fr); gap: 12px; align-items: center; }

.lane { height: 2px; background: repeating-linear-gradient(90deg, var(--ink-400) 0 4px, transparent 4px 8px); }

.status-form { display: flex; gap: 6px; margin: 0; }
.status-form select { min-width: 9.5rem; }

.actions { white-space: nowrap; }
.actions > a { margin-right: 12px; }

.confirm { display: inline-block; vertical-align: top; }
.confirm summary { color: var(--bad-700); cursor: pointer; text-decoration: underline; }
.confirm form { margin: 6px 0 0; }
.confirm button { border-color: #e8a9a4; color: var(--bad-700); }

.link-state { font-weight: 600; }
.link-bad { color: var(--bad-700); }

/* Forms */
.form { max-width: 820px; padding: 24px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--e1); }
.form.narrow { max-width: 400px; }
.form h1 { margin-bottom: 16px; }
.form label { display: block; margin-bottom: 14px; color: var(--ink-700); font-size: 13px; font-weight: 500; }
.form input, .form select, .form textarea { margin-top: 6px; color: var(--ink-900); font-weight: 400; }

.field-row { display: flex; flex-wrap: wrap; gap: 0 12px; }
.field-row label { flex: 1 1 9rem; }
.field-row .grow { flex: 3 1 14rem; }

fieldset { margin: 0 0 16px; padding: 12px 16px 4px; border: 1px solid var(--line); border-radius: var(--r-md); }
legend { padding: 0 6px; font-size: 14px; font-weight: 600; }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }

/* Sign in: the product on the left, the form on the right. */
.signin { display: grid; grid-template-columns: minmax(380px, 44%) 1fr; min-height: 100vh; }
.signin-side {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 40px 48px;
  background: var(--navy-900);
  color: var(--navy-text);
}
.signin-side .brand { color: #fff; }
.signin-side .net { position: absolute; top: 140px; left: -40px; width: calc(100% + 80px); height: auto; }
.signin-side .say { position: relative; max-width: 360px; font-weight: 400; }
.signin-side .say h2 { margin: 0 0 12px; color: #fff; font-size: 24px; line-height: 32px; }
.signin-side .say p { margin: 0; color: var(--navy-muted); }
.signin-main { display: flex; align-items: center; justify-content: center; padding: 32px; }
.signin-form { display: flex; flex-direction: column; gap: 20px; width: 100%; max-width: 380px; }
.signin-form h1 { font-size: 32px; line-height: 40px; }
.signin-form .lead { margin: 8px 0 0; color: var(--ink-500); }
.signin-form .messages { margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { color: var(--ink-700); font-size: 13px; font-weight: 500; }
.field input { min-height: 40px; }
.pw { position: relative; }
.js .pw input { padding-right: 68px; }
.pw .show-password { position: absolute; top: 4px; right: 4px; }
.signin-form .phone-brand { display: none; margin-bottom: -4px; }
.signin-foot { margin: 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink-500); font-size: 13px; }

@media (max-width: 760px) {
  .signin { grid-template-columns: 1fr; }
  .signin-side { display: none; }
  .signin-form .phone-brand { display: flex; }
  .signin-main { align-items: flex-start; padding: 40px 20px; }
}

/* On a phone, each row becomes a block with its own labels. */
@media (max-width: 860px) {
  .board thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .board, .board tbody, .board tr, .board td { display: block; width: 100%; }
  .board { border: 0; background: none; }
  .board tr { margin-bottom: 8px; padding: 6px 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
  .board td { padding: 6px 12px; border-bottom: 0; }
  .board td[data-label]::before { content: attr(data-label); display: block; color: var(--ink-500); font-size: 12px; }

  .route { grid-template-columns: 1fr; gap: 6px; }
  .lane { width: 3rem; }
  .actions { white-space: normal; }
  /* Links and small buttons a thumb must hit are at least 44px tall. */
  .board:not(.loads-board) td a, .board td .link-button, .actions a, .actions summary, .form-actions a, .new-broker > summary, .week-switch a {
    display: inline-flex; align-items: center; min-height: 44px;
  }
  .actions { display: flex; flex-wrap: wrap; gap: 0 1rem; }
  /* Numbers read as label then value, like every other line of the card. */
  .board td.number, .board td.num, .money-table td.number { text-align: left; }
  .board td.empty-cell { display: none; }
  .history-filter > * { min-width: 0; max-width: 100%; }
  .history-filter .grow { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; transition: none !important; }
}

/* The map on the load form */
.place-picker { margin-bottom: .75rem; }
.place-picker[hidden], .place-results[hidden] { display: none; }
.place-picker input[type="search"] { width: 100%; }
.place-results {
  margin: .25rem 0;
  padding: 0;
  list-style: none;
  background: var(--reflective-white);
  border: 1px solid var(--joint);
}
.place-results button {
  display: block;
  width: 100%;
  padding: .5rem .6rem;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--asphalt);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.place-results li + li button { border-top: 1px solid var(--joint); }
.place-results button:hover, .place-results button:focus-visible { background: var(--concrete); }
/* Its own layer, so the map's panes never draw over the phone header or the open menu. */
.place-map { position: relative; z-index: 0; isolation: isolate; height: 16rem; margin-top: .5rem; border: 1px solid var(--joint); }
.place-picker .hint { margin: .35rem 0 0; }

/* Files on a load: the three sections side by side on a wide screen, each with a drop area. */
.page-head .hint { margin: .2rem 0 0; }
.file-sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 1rem; align-items: start; }
.file-section { position: relative; padding: 1.1rem 1.25rem 1.25rem; background: var(--reflective-white); border: 2px solid transparent; }
.file-section h2 { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin: 0 0 .75rem; }
.file-section h2 .count { color: var(--asphalt-soft); font-size: .875rem; font-weight: 400; }
.file-list { margin: 0 0 .9rem; padding: 0; list-style: none; }
.file-list li { display: flex; align-items: center; gap: .7rem; padding: .55rem 0; border-top: 1px solid var(--joint); }
.file-thumb {
  display: grid;
  flex: none;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  overflow: hidden;
  border: 1px solid var(--joint);
  border-radius: 3px;
  text-decoration: none;
}
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-thumb-doc { background: var(--concrete); color: var(--asphalt-soft); font-size: .8rem; font-weight: 700; }
.file-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.file-name small { display: block; color: var(--asphalt-soft); }
.file-list .actions { display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; font-size: .9rem; }
.file-list .actions > a { margin: 0; }
.file-upload { display: flex; flex-direction: column; gap: .6rem; }
.file-upload .message { margin: 0; }
.file-upload .message[hidden] { display: none; }

.drop-area {
  display: grid;
  gap: .2rem;
  padding: 1.1rem 1rem;
  border: 2px dashed var(--joint);
  border-radius: 6px;
  background: var(--surface-soft);
  text-align: center;
  cursor: pointer;
}
.drop-area:hover, .drop-area:focus-within { border-color: var(--sign-green); background: var(--blue-50); }
.drop-title { color: var(--sign-green); font-size: 1.05rem; font-weight: 700; }
.drop-sub { color: var(--asphalt-soft); font-size: .875rem; }
.drop-area input { margin-top: .4rem; }
/* With the script the whole area is the button, so the browser's own file box is hidden but still reachable. */
.js .drop-area input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.dragging-files .file-section[data-drop-to] { border-color: #9fbbf5; border-style: dashed; }
.dragging-files .file-section.drop-here { border-style: solid; border-color: var(--sign-green); background: var(--blue-50); }
.dragging-files .file-section.drop-here .drop-area { border-color: var(--sign-green); }
.file-section.uploading .drop-area { border-style: solid; border-color: var(--sign-green); background: linear-gradient(90deg, var(--blue-100) var(--done, 0%), var(--surface-soft) var(--done, 0%)); }
.drop-title.for-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .drop-title.for-mouse { display: none; }
  .drop-title.for-touch { display: block; }
}
.drop-progress { display: none; color: var(--sign-green); font-size: 1.05rem; font-weight: 700; }
.file-section.uploading .drop-progress { display: block; }
.file-section.uploading .drop-title, .file-section.uploading .drop-sub { display: none; }

@media (max-width: 860px) {
  .file-section { padding: 1rem; }
}

/* The Loads page */
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.tools .add { margin-left: auto; }
.filter { padding: .35rem .8rem; }
.filter[aria-pressed="true"] { border-color: var(--blue-100); background: var(--blue-50); color: var(--blue-700); font-weight: 600; }
.filter.trouble { border-color: #e8a9a4; color: var(--bad-700); }
.filter.trouble[aria-pressed="true"] { border-color: var(--bad-600); background: var(--bad-50); color: var(--bad-700); }
.search { flex: 1 1 11rem; width: auto; max-width: 22rem; }
.last-check { margin-left: auto; }
.tools .last-check + .add { margin-left: .25rem; }
.warnings[hidden] { display: none; }

.finished-search { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.finished-search input { flex: 1 1 14rem; width: auto; max-width: 26rem; }
.pager { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1rem; margin: .75rem 0; }

/* What needs the script only appears with it, so the page still works without. */
.js-only { display: none; }
.js .tools .js-only { display: inline-block; }
.js .board .js-only { display: table-cell; }
.js .status-form button { display: none; }
.js .board tr.detail:not(.open) { display: none; }
.board tr[hidden], .board tr.detail[hidden] { display: none; }
.empty[hidden] { display: none; }

.loads-board th { padding: .45rem .6rem; white-space: nowrap; }
.loads-board td { padding: .55rem .6rem; }
.loads-board tr.row > td:first-child { border-left: 3px solid transparent; }
.loads-board tr.t-bad > td { background: var(--bad-50); }
.loads-board tr.t-bad > td:first-child { border-left-color: var(--bad-600); }
.loads-board tr.t-warn > td:first-child { border-left-color: var(--lane-yellow); }
.loads-board .route { grid-template-columns: minmax(6.5rem, 1fr) 2.2rem minmax(6.5rem, 1fr); gap: .5rem; }
.loads-board .lane { height: 2px; }
.loads-board .status-form select { min-width: 8rem; }
/* What the bot says and the next stop keep a readable width; the table scrolls inside its own box if it must. */
.loads-board .c-says { min-width: 9rem; }
.loads-board .c-next { min-width: 8rem; }
.board-scroll { max-width: 100%; overflow-x: auto; }

.say { font-weight: 600; }
.say-bad { color: var(--stop-red); }
.say-warn { color: var(--warn-700); }
.say-good { color: var(--good-700); }
.say-quiet { color: var(--asphalt-soft); font-weight: 400; }

.chips { display: flex; gap: .25rem; white-space: nowrap; }
.chip {
  padding: .1rem .45rem;
  border: 1px solid var(--joint);
  border-radius: 3px;
  color: var(--asphalt-soft);
  font-size: .9rem;
  text-decoration: none;
}
.chip:hover { border-color: var(--asphalt); color: var(--asphalt); }
.chip-has { border-color: var(--sign-green); color: var(--sign-green); font-weight: 600; }
.chip-need { border-color: var(--stop-red); color: var(--stop-red); font-weight: 600; }

/* Dragging files: every place that takes them stands out, and the one under the pointer lights up. */
.dragging-files .chip[data-drop-to] { border: 2px dashed var(--sign-green); background: var(--blue-50); color: var(--sign-green); }
.dragging-files .chip.drop-here, .chip.uploading { border-style: solid; background: var(--sign-green); color: var(--reflective-white); }
.chip.uploading { background: linear-gradient(90deg, var(--sign-green) var(--done, 0%), #9fbbf5 var(--done, 0%)); }
.chip.uploading::after { content: " " attr(data-progress-text); }
.drop-note { display: none; }
.dragging-files .drop-note {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  z-index: 10;
  display: block;
  margin: 0;
  padding: .6rem 1.1rem;
  transform: translateX(-50%);
  border-radius: 6px;
  background: var(--asphalt);
  color: var(--reflective-white);
  font-weight: 600;
  pointer-events: none;
}
.js .js-only-block { display: block; }
.js-only-block, .js-only-inline { display: none; }
.js .js-only-inline { display: inline; }
.js .no-js { display: none; }

.more { padding: .2rem .5rem; border-width: 1px; font-weight: 400; }
.detail td { padding: .6rem .9rem .9rem; background: var(--surface-soft); }
.detail p { max-width: 70ch; margin: 0 0 .4rem; }
/* A note keeps its own lines in full, and shows as one cut-off line in a busy row. */
.note-full { white-space: pre-line; }
.note-line { max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1.1rem; font-weight: 600; }

/* On a laptop each stop sits above the other, so the table still fits. */
@media (max-width: 1500px) {
  .loads-board .route { grid-template-columns: 1fr; gap: .2rem; }
  .loads-board .lane { display: none; }
  .chips { flex-wrap: wrap; }
  .loads-board .status-form select { min-width: 7rem; }
}

/* On a phone each load is a short card: who, what the bot says, the road, the next stop, then the controls. */
@media (max-width: 860px) {
  .js .board .js-only { display: block; }
  .loads-board { background: none; }
  .loads-board tr.row {
    display: grid;
    grid-template-columns: 4.6rem 1fr auto auto;
    grid-template-areas:
      "truck driver driver more"
      "says says says says"
      "route route route route"
      "next next next next"
      "status status files files";
    gap: .35rem .6rem;
    align-items: center;
    margin-top: .6rem;
    padding: .65rem .75rem;
    border: 0;
    border: 1px solid var(--line);
    border-left: 3px solid var(--line);
    border-radius: var(--r-md);
    background: var(--reflective-white);
  }
  .loads-board tr.row > td { width: auto; padding: 0; }
  .loads-board tr.row > td:first-child { border-left: 0; }
  .loads-board td[data-label]::before { display: none; }
  .loads-board tr.t-bad { border-left-color: var(--stop-red); }
  .loads-board tr.t-warn { border-left-color: var(--lane-yellow); }
  .loads-board tr.t-good { border-left-color: var(--sign-green); }
  .loads-board .c-truck { grid-area: truck; }
  .loads-board .c-driver { grid-area: driver; }
  .loads-board .c-driver small { display: block; }
  .loads-board .c-says { grid-area: says; }
  .loads-board .c-route { grid-area: route; }
  .loads-board .c-next { grid-area: next; }
  .loads-board .c-next strong, .loads-board .c-next small { display: inline; }
  .loads-board .c-next strong + small { margin-left: .35rem; }
  .loads-board .c-says, .loads-board .c-next { min-width: 0; }
  /* Columns a person added have no place of their own on the card, so each takes a whole line with its label. */
  .loads-board tr.row > td:is(.c-load, .c-broker, .c-eta, .c-miles, .c-phone, .c-notes) { grid-column: 1 / -1; }
  .loads-board tr.row > td:is(.c-load, .c-broker, .c-eta, .c-miles, .c-phone, .c-notes)::before {
    content: attr(data-label) ": "; display: inline; color: var(--ink-500); font-size: 12px;
  }
  .loads-board .c-eta strong, .loads-board .c-eta small { display: inline; }
  .loads-board .c-eta small { margin-left: .35rem; }
  .columns-panel { left: 0; right: auto; width: min(20rem, calc(100vw - 24px)); }
  .loads-board .c-status { grid-area: status; }
  .loads-board .c-files { grid-area: files; }
  .loads-board .c-more { grid-area: more; }
  .loads-board .route { grid-template-columns: 1fr 1.4rem 1fr; gap: .4rem; }
  .loads-board .lane { display: block; width: 100%; }
  .loads-board .status-form select { min-width: 0; width: 100%; }
  .loads-board .c-files .chips { justify-content: flex-end; }
  .loads-board .c-more { align-self: start; }
  .loads-board .chips { flex-wrap: nowrap; gap: .2rem; }
  .loads-board .chip { padding: .35rem .4rem; font-size: .85rem; }
  .loads-board .more { padding: .45rem .6rem; }
  .loads-board tr.detail { margin-top: -.1rem; border-bottom: 0; }
  .loads-board tr.detail td { padding: .6rem .75rem .8rem; }
  .detail-links { gap: .6rem 1.1rem; }
  .detail-links a { padding: .2rem 0; }
}

.problem-line { margin-top: .2rem; }
.health-total { margin: 0 0 1rem; font-size: 1.25rem; }
.restart-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.add-company h2, .password-box h2 { margin-bottom: .75rem; }
.password-box { margin-top: 1rem; }
.password-box form { margin: 0; }
.password { padding: .1rem .4rem; background: var(--concrete); font-family: Consolas, "Courier New", monospace; font-size: 1.1rem; user-select: all; }
.form label.check { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; font-weight: 400; }
.form label.check input { width: auto; min-height: 0; margin: 0; }
.log { margin-top: 1.5rem; }
.log-text {
  max-height: 24rem;
  margin: 0;
  padding: .75rem 1rem;
  overflow: auto;
  background: var(--asphalt);
  color: var(--concrete);
  font-family: Consolas, "Courier New", monospace;
  font-size: .85rem;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Settings pages: stacked boxes, and the messages the bot sends, each shown like a Telegram message */
section.form + section.form { margin-top: 1rem; }

.messages-box { --chat: #d5e0e8; --chat-link: #1f6fb2; --chat-font: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
.message-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); gap: 1rem; }
.message-card { display: flex; flex-direction: column; border: 1px solid var(--joint); border-radius: 6px; overflow: hidden; }
.message-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .5rem .5rem .5rem .8rem; }
.message-card-head h3 { flex: 1; margin: 0; font-size: 1.05rem; }
.edit-message { margin-left: auto; padding: .25rem .8rem; }
.tag { padding: .05rem .5rem; border-radius: 999px; background: var(--concrete); font-size: .8rem; font-weight: 600; white-space: nowrap; }
.tag-own { background: var(--sign-green); color: var(--reflective-white); }
.tag-off { background: var(--asphalt-soft); color: var(--reflective-white); }
.message-card.is-off .bubble { opacity: .6; }

.chat { flex: 1; padding: .9rem .9rem 1rem; background: var(--chat); }
.bubble {
  width: fit-content;
  max-width: 100%;
  padding: .45rem .7rem .5rem;
  border-radius: 12px 12px 12px 4px;
  background: var(--reflective-white);
  box-shadow: 0 1px 1px rgb(36 40 42 / 18%);
  color: #111;
  font: .9rem/1.42 var(--chat-font);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bubble b { font-weight: 700; }
.bubble a, .bubble u { color: var(--chat-link); text-decoration: none; }

/* The editor window */
.message-editor {
  width: min(66rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--asphalt);
  box-shadow: 0 12px 40px rgb(0 0 0 / 35%);
}
.message-editor::backdrop { background: rgb(36 40 42 / 60%); }
.message-editor form { display: flex; flex-direction: column; max-height: calc(100dvh - 2rem); }
.editor-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem .8rem .7rem 1.2rem; border-bottom: 1px solid var(--joint); }
.editor-head h3 { margin: 0; font-size: 1.2rem; }
.editor-close { padding: 0 .55rem; border-color: transparent; font-size: 1.5rem; line-height: 1.3; }
.editor-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.2rem; padding: 1rem 1.2rem; overflow: auto; }
.editor-tools { display: flex; align-items: end; justify-content: space-between; margin-bottom: .3rem; }
.form .editor-tools label { margin: 0; }
.editor-tools button { min-width: 2.2rem; padding: .1rem .5rem; font-weight: 800; }
.message-editor textarea { min-height: 15rem; resize: vertical; font: .92rem/1.45 Consolas, "Courier New", monospace; }
.message-editor .hint { margin: .5rem 0; }
.field-list { max-height: 13.5rem; margin: 0; padding: 0; overflow: auto; border: 1px solid var(--joint); border-radius: 4px; list-style: none; }
.field-list button {
  display: grid;
  grid-template-columns: 8.2rem 1fr;
  gap: .6rem;
  width: 100%;
  padding: .3rem .6rem;
  border: 0;
  border-bottom: 1px solid var(--concrete);
  border-radius: 0;
  box-shadow: none;
  justify-content: stretch;
  font-size: .88rem;
  font-weight: 400;
  text-align: left;
}
.field-list li:last-child button { border-bottom: 0; }
.field-list code { color: var(--sign-green-dark); font-family: Consolas, "Courier New", monospace; font-weight: 700; }
.editor-preview { display: flex; flex-direction: column; min-width: 0; }
.preview-label { margin: 0 0 .3rem; font-weight: 600; }
.editor-problems { margin: 0 0 .5rem; }
.editor-preview .chat { flex: 1; border-radius: 6px; }
.editor-actions { display: flex; align-items: center; gap: .6rem; padding: .7rem 1.2rem; border-top: 1px solid var(--joint); }
.editor-gap { flex: 1; }
button:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 760px) {
  .message-editor { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .message-editor form { height: 100dvh; max-height: 100dvh; }
  .editor-columns { grid-template-columns: minmax(0, 1fr); }
  .message-editor textarea { min-height: 11rem; }
  .editor-preview { order: -1; }
  .editor-preview .chat { max-height: 16rem; overflow: auto; }
}

/* Status set by GPS, with its Undo (2026-11-20) */
.gps-note { display: flex; align-items: baseline; gap: .4rem; margin-top: .25rem; }
.gps-note small { color: var(--ink-soft, #555); }
.link-button { display: inline; min-height: 0; background: none; border: 0; box-shadow: none; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; font-size: .85em; }
.feature-row { padding: .6rem 0; border-bottom: 1px solid rgba(0, 0, 0, .08); }
.feature-row select { max-width: 22rem; margin-left: 0; }
.feature-row .hint { margin: .2rem 0 0; }

/* A ratecon dropped on the Loads page (2026-11-20) */
.ratecon-drop { display: inline-flex; flex-direction: row; justify-content: center; align-items: center; min-height: 32px; border-style: dashed; cursor: pointer; position: relative; }
/* The file box stays in the page, out of sight, so Tab reaches it and the label shows its focus. */
.ratecon-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ratecon-drop:focus-within { outline: 2px solid var(--blue-600); outline-offset: 2px; }
.ratecon-drop.drop-here, .dragging-files .ratecon-drop { outline: 2px solid currentColor; outline-offset: 2px; }
.ratecon-drop.uploading { background: linear-gradient(90deg, rgba(0, 0, 0, .08) var(--done, 0%), transparent var(--done, 0%)); }

/* History, brokers and drivers (2026-11-20) */
.history-filter { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; margin-bottom: 1rem; }
.history-filter label { display: flex; flex-direction: column; font-size: .85rem; }
.history-filter .grow { flex: 1 1 12rem; }
.label-filter { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.record-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.tidy-up { margin-top: 2rem; }
.incidents { list-style: none; padding: 0; margin: 1rem 0 0; }
.incidents li { border-top: 1px solid rgba(0, 0, 0, .08); padding: .5rem 0; }
.facts dt { font-weight: 600; margin-top: .5rem; }
.facts dd { margin: 0; }

/* Money (2026-11-20) */
.money-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .75rem; margin: 1rem 0 1.5rem; }
.money-totals div { display: flex; flex-direction: column; padding: .6rem .8rem; border: 1px solid rgba(0, 0, 0, .1); border-radius: 6px; }
.money-totals strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.inline-form { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.fee-form { display: flex; gap: .6rem; align-items: end; margin-top: 1.5rem; }

/* Dispatcher and updater sign-ins (2026-11-21) */
.role-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.role-card { border: 1px solid rgba(0, 0, 0, .1); border-radius: 6px; padding: .8rem 1rem; }
.role-card h3 { margin-top: 0; }
.role-card details { margin-top: .6rem; }

/* Money page, reworked 2026-11-21 */
.week-switch { display: flex; align-items: center; gap: .6rem; }
.pay-rule select, .pay-rule input { max-width: 16rem; }
.attention { border-left: 4px solid var(--warn-500); background: var(--warn-50); padding: .6rem 1rem; margin: 1rem 0; border-radius: 4px; }
.attention h2 { font-size: 1.05rem; margin: 0 0 .3rem; }
.attention ul { margin: 0; padding-left: 1.2rem; }
.attention li { margin: .2rem 0; }
.all-set { color: var(--good-700); margin: 1rem 0; }
.money-totals .profit { border-color: var(--good-700); }
.money-totals .profit small + strong + small, .money-totals small:last-child { font-size: .75rem; }
.money-how { margin: -.5rem 0 1.5rem; }
.money-how summary { cursor: pointer; color: var(--ink-700); }
.money-table td.number, .money-table th.number { text-align: right; font-variant-numeric: tabular-nums; }
.money-table td small { display: block; }
.pay-rule summary { cursor: pointer; list-style: none; }
.pay-rule summary::-webkit-details-marker { display: none; }
.pay-rule .inline-form { margin-top: .4rem; }
.link-like { text-decoration: underline; color: var(--blue-700); margin-left: .3rem; font-size: .9em; }
.say-warn { background: var(--warn-50); color: var(--warn-700); }
section + section { margin-top: 2rem; }
.money-table .say { display: inline-block; padding: .05rem .4rem; border-radius: 3px; font-size: .85rem; }
.money-result dl { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; margin: 0; }
.money-result dt { color: var(--ink-500); }
.money-result dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.money-result small, form.form label small { display: block; font-weight: normal; color: var(--ink-500); font-size: .8rem; }
form.form h2 { font-size: 1rem; margin: .8rem 0 .4rem; }

/* Columns: the Loads page holds every column and hides the ones not chosen. */
[data-col][hidden] { display: none !important; }
.columns-picker { position: relative; }
.columns-picker > summary { list-style: none; cursor: pointer; }
.columns-picker > summary::-webkit-details-marker { display: none; }
.columns-panel {
  position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; width: 20rem;
  padding: .75rem; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
}
/* Column lists: shown in order, dragged by a handle; and hidden (2026-11-28) */
.column-lists { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.columns-panel .column-lists { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.column-zone-title { margin: 0 0 6px; color: var(--ink-500); font-size: 12px; font-weight: 600; }
.column-list { position: relative; min-height: 40px; margin: 0; padding: 0; list-style: none; counter-reset: place; }
.column-list li {
  display: flex; align-items: center; gap: 6px; margin-bottom: 4px; padding: 4px 10px 4px 4px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); user-select: none;
}
.column-list[data-shown] li { counter-increment: place; }
.column-list[data-shown] .column-place::before { content: counter(place); }
.column-place { min-width: 1.4em; color: var(--ink-400); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.column-list[data-hidden] li { border-style: dashed; background: var(--surface-soft); color: var(--ink-500); }
.column-list[data-hidden] .column-place { display: none; }
.column-list .grip {
  display: none; flex: none; align-items: center; justify-content: center; width: 28px; height: 28px; min-height: 0;
  padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--ink-400); cursor: grab; touch-action: none;
}
.js .column-list .grip { display: inline-flex; }
.column-list .grip svg { fill: currentColor; }
.column-list .grip:hover { background: var(--surface-soft); color: var(--ink-700); }
.column-list .grip:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 0; }
.column-list[data-hidden] .grip { visibility: hidden; }
.column-list .column-name, .form .column-list label.column-name {
  display: flex; flex: 1; align-items: center; gap: 8px; min-width: 0; margin: 0; color: inherit;
  font-size: 13px; font-weight: 500; cursor: pointer;
}
.column-list .column-name input { flex: none; width: 16px; height: 16px; margin: 0; }
.column-list li.dragging { position: relative; z-index: 2; border-color: var(--blue-600); box-shadow: var(--e2); cursor: grabbing; }
.column-list li.dragging .grip { cursor: grabbing; }
.column-list li.settling { transition: transform .15s ease; }
.column-none { display: none; margin: 0; padding: 9px 10px; border: 1px dashed var(--line); border-radius: var(--r-sm); color: var(--ink-400); font-size: 13px; }
.column-list[data-hidden]:empty + .column-none { display: block; }
body.moving-column, body.moving-column * { cursor: grabbing; user-select: none; }
.columns-panel .column-list { max-height: none; }
.columns-panel .column-list li { margin-bottom: 3px; padding: 1px 8px 1px 2px; }
.columns-panel .column-lists { max-height: 60vh; overflow-y: auto; }
@media (max-width: 760px) { .column-lists { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .column-list li.settling { transition: none; } }
.loads-board .c-eta strong, .loads-board .c-phone a { white-space: nowrap; }

/* A new broker on the load form (2026-11-28) */
.new-broker { margin: 0 0 16px; }
.new-broker > summary { width: fit-content; color: var(--blue-700); font-size: 13px; font-weight: 500; cursor: pointer; }
.new-broker[open] > summary { margin-bottom: 12px; }

/* On a phone the Money cards read label then value on the left, like every other card (2026-12-01). */
@media (max-width: 860px) {
  .money-table td.number { text-align: left; }
}
