/* HAUL product UI. Dispatch-office tool: dense but calm. Cool asphalt neutrals
   with a slight blue bias, one signal-yellow accent (#ffcc00, owner 2026-11-08:
   a fill or on dark only, never text on white), semantic green/amber/red
   kept apart from the accent. Display face for headings and numbers, a plain
   sans for text, mono for codes and plates (the identity of the design-round
   mockups). Light and dark follow the system unless the person picks one. */
:root {
  --bg: #e9ecf0;
  --panel: #ffffff;
  --panel-2: #f4f6f8;
  --ink: #15191f;
  --ink-2: #434a55;
  --ink-3: #687080;
  --line: #d0d6de;
  --nav: #15191f;
  --nav-ink: #c9cfd8;
  --nav-active: #ffffff;
  --accent: #ffcc00;
  --accent-ink: #15191f;
  --accent-soft: #fff6cc;
  --good: #137a46;
  --warn: #9e6000;
  --bad: #c0392b;
  --focus: #2f6fdb;
  --mark-f: #15191f;
  --mark-j: #15191f;
  --f-display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1216; --panel: #161a20; --panel-2: #1d222a; --ink: #e9ecf0; --ink-2: #b8bfc9; --ink-3: #8791a0;
    --line: #2b323c; --nav: #0a0c10; --nav-ink: #b8bfc9; --nav-active: #ffffff; --accent: #ffcc00; --accent-ink: #15191f;
    --accent-soft: #3a3210; --good: #4cc27f; --warn: #e8b04a; --bad: #f0756a; --focus: #6f9cf0; --mark-f: #ffffff; --mark-j: #ffcc00; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1216; --panel: #161a20; --panel-2: #1d222a; --ink: #e9ecf0; --ink-2: #b8bfc9; --ink-3: #8791a0;
  --line: #2b323c; --nav: #0a0c10; --nav-ink: #b8bfc9; --nav-active: #ffffff; --accent: #ffcc00; --accent-ink: #15191f;
  --accent-soft: #3a3210; --good: #4cc27f; --warn: #e8b04a; --bad: #f0756a; --focus: #6f9cf0; --mark-f: #ffffff; --mark-j: #ffcc00; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
#app { min-height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f-body); }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; letter-spacing: .01em; margin: 0 0 .4em; text-wrap: balance; }
h1 { font-size: 2rem; } h2 { font-size: 1.5rem; } h3 { font-size: 1.15rem; }
p { margin: 0 0 .8em; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mono { font-family: var(--f-mono); font-size: .9em; }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }

/* Buttons and fields */
.btn { display: inline-flex; align-items: center; gap: .4em; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: .5em .95em; border-radius: var(--radius); cursor: pointer; font-weight: 500; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--accent); border-color: var(--accent-ink); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.link { border: 0; background: none; padding: .3em 0; text-decoration: underline; color: var(--ink-2); }
.btn[disabled] { opacity: .55; cursor: default; }
.field { display: grid; gap: .3em; margin-bottom: .9em; }
.field label { font-size: .85rem; color: var(--ink-2); font-weight: 500; }
.req { color: var(--bad); font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; padding: .55em .7em; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); }
.field textarea { min-height: 7em; resize: vertical; }
.row { display: flex; gap: .7em; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1em; }
.check { display: flex; gap: .5em; align-items: center; margin: .3em 0; }
.msg { padding: .6em .8em; border-radius: var(--radius); margin: .6em 0; font-size: .9rem; }
.msg.err { background: color-mix(in srgb, var(--bad) 12%, var(--panel)); color: var(--bad); }
.msg.ok { background: color-mix(in srgb, var(--good) 12%, var(--panel)); color: var(--good); }

/* Sign-in and picker: one centred card */
.gate { min-height: 100%; display: grid; place-items: center;
  padding-block: 32px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 28px; width: 100%; max-width: 440px; }
.brand { display: flex; align-items: center; gap: .55em; margin-bottom: 1.2em; }
/* The FJ mark and the FleetJudge name (owner 2026-11-09): on light grounds all asphalt,
   on dark grounds the F and "Fleet" white, the J and "Judge" yellow. Never yellow on white. */
.brand .mark { width: 46px; flex: none; display: block; }
.brand .mark svg { display: block; width: 100%; height: auto; }
.brand .mark .mf { fill: var(--mark-f); } .brand .mark .mj { fill: var(--mark-j); }
.brand .name { font: italic 800 1.6rem/1 "Fira Sans Condensed", var(--f-display); letter-spacing: -.01em; }
.brand .name .j { color: var(--mark-j); }
.nav .brand .mark .mf { fill: #ffffff; } .nav .brand .mark .mj { fill: var(--accent); }
.nav .brand .name .j { color: var(--accent); }
.brand .tag { font-size: .8rem; color: var(--ink-3); }
.list { display: grid; gap: .5em; margin: 1em 0; }
.list .item { display: flex; justify-content: space-between; align-items: center; gap: .8em; padding: .7em .9em;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); }
.chips { display: flex; flex-wrap: wrap; gap: .3em; align-items: center; }
.chip { font-size: .75rem; padding: .1em .55em; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-2); }
.chip.accent { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.lang { display: flex; gap: .3em; }
.lang button { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; padding: .1em .5em; cursor: pointer; font-size: .8rem; }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.nav .lang button { background: transparent; color: var(--nav-ink); border-color: rgba(255,255,255,.25); }
.nav .lang button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* App shell */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.nav { background: var(--nav); color: var(--nav-ink); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px;
  /* The menu stays in view while a long page scrolls (owner 2026-11-07): Contact
     us, Sign out, language and the version line are always on screen. */
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; }
.nav .nav-links { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 4px; }
.nav .nav-foot { flex: 0 0 auto; display: flex; flex-direction: column; gap: 4px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.08); }
.nav .version { padding: .2em .7em .1em; color: var(--nav-ink); opacity: .55; font-size: .78rem; font-variant-numeric: tabular-nums; cursor: default; }
.nav .version-off { color: #ff8a80; opacity: 1; }
.nav .brand .name, .nav .brand .tag { color: var(--nav-active); }
.nav .co { margin: 4px 4px 14px; padding: .6em .7em; border-radius: var(--radius); background: rgba(255,255,255,.06); }
.nav .co b { display: block; color: var(--nav-active); font-weight: 600; }
.nav a, .nav button.navbtn { display: flex; justify-content: space-between; align-items: center; gap: .4em; color: var(--nav-ink); text-decoration: none;
  padding: .5em .7em; border-radius: 6px; border: 0; background: none; cursor: pointer; text-align: left; width: 100%; }
.nav a:hover, .nav button.navbtn:hover { background: rgba(255,255,255,.06); color: var(--nav-active); }
.nav a[aria-current="page"] { background: rgba(255,255,255,.1); color: var(--nav-active); box-shadow: inset 3px 0 0 var(--accent); }
.nav .soon { font-size: .7rem; opacity: .7; }
.nav .spacer { flex: 1; }
.nav-toggle, .nav-page { display: none; }
.nav-top { display: contents; }
.main { padding-block: 24px 48px; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); min-width: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 18px; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1em; flex-wrap: wrap; margin-bottom: 14px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: .5em; }
.steps li { display: flex; gap: .7em; align-items: center; padding: .6em .8em; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); }
.steps .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line);
  font: 700 .95rem var(--f-display); flex: none; }
.steps .done .n { background: var(--good); color: #fff; border-color: var(--good); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .6em .5em; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; }
td.num { font-variant-numeric: tabular-nums; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .9em; margin: .4em 0 .8em; }
.plan { position: relative; border: 1px solid var(--line); border-radius: 14px; padding: 18px 16px 16px; background: var(--panel-2);
  display: flex; flex-direction: column; gap: .7em; transition: border-color .15s, box-shadow .15s; }
.plan:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.plan.featured { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.plan.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: .5em; min-height: 1.9em; }
.plan .pname { font: 700 1.3rem var(--f-display); }
.plan-head .chip { white-space: nowrap; }
/* "Most popular" sits on the top edge, so it never pushes the price down. */
.plan .plan-flag { position: absolute; top: 0; left: 16px; transform: translateY(-50%); background: var(--panel); border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.plan .price { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1em .35em; padding-bottom: .7em; border-bottom: 1px solid var(--line); }
.plan .price .amount { font: 700 2rem/1 var(--f-display); font-variant-numeric: tabular-nums; }
.plan .price .small-amount { font-size: 1.25rem; }
.plan .price .per { color: var(--ink-3); font-size: .9rem; }
.plan .price .usd { flex-basis: 100%; font-variant-numeric: tabular-nums; }
.plan-feats { list-style: none; margin: 0; padding: 0; display: grid; gap: .45em; font-size: .92rem; }
.plan-feats li { position: relative; padding-left: 1.35em; }
.plan-feats li::before { content: "✓"; position: absolute; left: 0; color: var(--good); font-weight: 700; }
.plan-feats li.muted { color: var(--ink-3); font-size: .85rem; }
.plan-feats li.muted::before { content: "·"; color: var(--ink-3); }
.offer-banner { border: 1px solid var(--accent); border-radius: 10px; padding: .6em .9em; margin-bottom: .8em; background: var(--panel-2); }
.dialog { position: fixed; inset: 0; background: rgba(10,14,20,.5); display: grid; place-items: center; z-index: 20;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.dialog .card { max-width: 520px; max-height: 92vh; overflow: auto; }
.dlg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .6em; }
.dlg-head h2 { margin-top: 0; }
.dlg-x { flex: none; border: 0; background: none; color: var(--ink-2); font-size: 1.6rem; line-height: 1; width: 36px; height: 36px; border-radius: 8px; cursor: pointer; margin: -6px -8px 0 0; }
.dlg-x:hover, .dlg-x:focus-visible { background: var(--panel-2); color: var(--ink); }
.dlg-foot { margin-top: 1em; justify-content: flex-end; }
.pos-cols { display: grid; gap: 0 1.2em; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.pos-cols .map.small-map { height: 300px; margin-top: 0; }
@media (max-width: 760px) { .pos-cols { grid-template-columns: minmax(0, 1fr); } .pos-cols .map.small-map { height: 200px; } }
.cf-trap { position: absolute; left: -9999px; }


/* Fleet board: rigs list beside a synced map (synthesis P16 position states). */
.board { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.board-list { min-width: 0; }
.map { height: 560px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); position: sticky; top: 16px; overflow: hidden; }
.map.small-map { height: 240px; position: relative; top: auto; margin: .5em 0; }
.map.nomap { display: none; }
.rigs { display: grid; gap: .6em; }
.rig { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel-2); display: grid; gap: .45em; }
.rig.retired > .rig-head > .rig-units, .rig.retired > .rig-meta { opacity: .6; }
.rig:has(.more-menu) { z-index: 5; }
/* The ⋯ menu always sits in the card's top-right corner (owner 2026-11-09), however the head wraps. */
.rig { position: relative; }
.rig .more { position: absolute; top: 8px; right: 8px; }
.rig > .rig-head { padding-right: 46px; }
.rig-head { display: flex; justify-content: space-between; gap: .6em; align-items: flex-start; flex-wrap: wrap; }
.rig-units { display: flex; flex-wrap: wrap; align-items: center; gap: .35em .5em; min-width: 0; }
.unit { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .1em .45em; padding: .25em .5em; border-radius: 7px; background: var(--panel); border: 1px solid var(--line); }
.unit.vehicle { border-color: var(--accent); }
.arrow { color: var(--ink-3); font-weight: 600; }
.unit-icon { width: 52px; height: 22px; flex: none; color: var(--ink); vertical-align: middle; }
.unit.vehicle .unit-icon { color: var(--ink); }
.body-preview { display: flex; justify-content: center; padding: .3em 0 .6em; }
.body-preview .unit-icon { width: 168px; height: 70px; color: var(--ink); }
.check.fam .unit-icon { width: 38px; height: 16px; }
/* Searchable dropdowns (combo.js): the native select stays for forms, hidden. */
.combo-native { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; overflow: hidden; }
.combo-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .5em; padding: .5em .7em; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--panel); cursor: pointer; text-align: left; min-height: 2.4em; }
.combo-btn:hover { border-color: var(--ink-3); }
.combo-btn[disabled] { opacity: .6; cursor: default; }
.combo-face { display: inline-flex; align-items: center; gap: .55em; min-width: 0; }
.combo-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-caret { color: var(--ink-3); font-size: .8em; }
.combo-pop { position: fixed; z-index: 60; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(10,14,20,.22); display: flex; flex-direction: column; overflow: hidden; }
.combo-search { margin: 8px; padding: .5em .7em; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); }
.combo-list { list-style: none; margin: 0; padding: 0 6px 6px; overflow: auto; }
.combo-opt { display: flex; align-items: center; gap: .6em; padding: .45em .6em; border-radius: 6px; cursor: pointer; }
.combo-opt:hover, .combo-opt.active { background: var(--accent-soft); }
.combo-opt[aria-selected="true"] { font-weight: 600; }
.combo-opt .unit-icon, .combo-face .unit-icon { width: 46px; height: 18px; color: var(--ink); }
/* Tabs inside forms and dialogs: one short panel at a time. */
.tabs-box { margin-bottom: .6em; }
.tabbar { display: flex; gap: .2em; border-bottom: 1px solid var(--line); margin-bottom: .9em; overflow-x: auto; }
.tabbar [role="tab"] { border: 0; background: none; padding: .55em .9em; cursor: pointer; color: var(--ink-2); font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabbar [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabpanel { min-height: 300px; }
.dialog .card.wide { max-width: 760px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 1em; }
.basics { display: grid; grid-template-columns: 220px 1fr; gap: 1em; align-items: start; }
.basics .photo-box img.photo-big { max-height: 150px; }
@media (max-width: 640px) { .basics { grid-template-columns: 1fr; } .tabpanel { min-height: 0; } }
/* Photos. */
img.thumb { width: 52px; height: 36px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); flex: none; vertical-align: middle; }
.photo-box { display: grid; gap: .5em; justify-items: center; margin-bottom: .8em; }
.photo-box .row { justify-content: center; }
img.photo-big { max-width: 100%; max-height: 200px; border-radius: 10px; border: 1px solid var(--line); display: block; }
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center;
  background: var(--accent-soft); color: var(--ink); font: 700 .85rem var(--f-display); border: 1px solid var(--line); }
.photo-box .avatar { width: 96px; height: 96px; font-size: 2rem; }
.me-photo { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; }
.nav .co .row { flex-wrap: nowrap; }
.nav .co { position: relative; }
.co-switch { flex: 1; min-width: 0; display: flex; justify-content: space-between; align-items: center; gap: .4em; border: 0; background: none;
  color: inherit; text-align: left; cursor: pointer; padding: 0; font: inherit; }
.co-switch b { display: block; color: var(--nav-active); font-weight: 600; }
.co-switch .caret { color: var(--nav-ink); }
.co-menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40; background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(10,14,20,.3); padding: 6px; display: grid; gap: 2px; min-width: 220px; }
.co-menu-title { padding: .3em .6em; }
.co-menu [role=menuitem] { display: flex; justify-content: space-between; align-items: center; gap: .6em; border: 0; background: none; text-align: left;
  padding: .55em .6em; border-radius: 6px; cursor: pointer; color: var(--ink); }
.co-menu [role=menuitem]:hover, .co-menu [role=menuitem]:focus-visible { background: var(--accent-soft); }
.nav .co .co-menu [role=menuitem] b { display: block; color: var(--ink); }
.co-menu .current { font-weight: 600; }
.co-menu .co-new { border-top: 1px solid var(--line); border-radius: 0 0 6px 6px; color: var(--ink-2); }
.more { position: relative; display: inline-flex; }
.more-btn { padding-inline: .7em; font-weight: 700; letter-spacing: .08em; }
.more-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 40; background: var(--panel); color: var(--ink); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(10,14,20,.25); padding: 6px; display: grid; gap: 2px; min-width: 190px; }
.more-menu.up { top: auto; bottom: calc(100% + 4px); }
.more-menu.right { right: auto; left: 0; }
.more-menu [role=menuitem] { border: 0; background: none; text-align: left; padding: .55em .7em; border-radius: 6px; cursor: pointer; color: var(--ink); font: inherit; white-space: nowrap; }
.more-menu [role=menuitem]:hover, .more-menu [role=menuitem]:focus-visible { background: var(--accent-soft); outline: none; }
.plate { display: inline-flex; align-items: stretch; border: 1.5px solid var(--ink); border-radius: 4px; overflow: hidden; font: 500 .78rem var(--f-mono); background: #ffffff; color: #111111; }
.plate .cc { background: #1f4fa3; color: #ffffff; padding: 0 .3em; display: grid; place-items: center; font-size: .65rem; }
.plate span:last-child { padding: .05em .4em; }
.pos { display: inline-flex; align-items: center; gap: .4em; }
.pos .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--good); flex: none; }
.pos.stale .dot { background: transparent; border: 2px solid var(--ink-3); }
.pos.stale { color: var(--ink-3); }
.pos.none .dot, .pos.none { color: var(--ink-3); }
.chip.status-ok { border-color: var(--good); color: var(--good); }
.chip.status-shop, .chip.status-home { border-color: var(--warn); color: var(--warn); }
.chip.status-retired { color: var(--ink-3); }
.chip.over { background: color-mix(in srgb, var(--warn) 15%, var(--panel)); border-color: var(--warn); color: var(--ink); }
.chip.exp-bad { border-color: var(--bad); color: var(--bad); }
.chip.exp-warn { border-color: var(--warn); color: var(--warn); }
.chip.exp-good { border-color: var(--good); color: var(--good); }
.list button.item { width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.list button.item:hover { border-color: var(--ink-3); }
.btn.small, .btn.link.small { font-size: .8rem; padding: 0 .2em; }
.btn.active { border-color: var(--accent); background: var(--accent-soft); }
details > summary { cursor: pointer; color: var(--ink-2); margin: .4em 0; }
.pin { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--ink); position: relative; cursor: default; }
.pin.t { border-radius: 3px; background: var(--ink-2); }
.pin.stale { background: var(--panel); box-shadow: 0 0 0 2px var(--ink-3); }
.pin span { position: absolute; left: 20px; top: -4px; white-space: nowrap; font: 600 .72rem var(--f-body); background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 5px; padding: 0 .35em; }
@media (max-width: 1000px) { .board { grid-template-columns: 1fr; } .map { position: relative; top: auto; height: 320px; order: -1; } }

/* Offer desk: verdict chips carry the band colour; the score sits beside the word. */
.verdict { display: inline-flex; align-items: center; gap: .45em; padding: .15em .25em .15em .6em; border-radius: 99px; border: 1.5px solid var(--line);
  font-size: .85rem; white-space: nowrap; }
.verdict .score { font: 700 .95rem var(--f-display); font-variant-numeric: tabular-nums; background: var(--panel); border-radius: 99px; padding: 0 .45em; }
.verdict.v-take { border-color: var(--good); color: var(--good); background: color-mix(in srgb, var(--good) 10%, var(--panel)); }
.verdict.v-negotiate { border-color: var(--warn); color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--panel)); }
.verdict.v-skip { border-color: var(--bad); color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, var(--panel)); }
.kpi.big .verdict { font-size: 1.15rem; padding: .3em .35em .3em .9em; }
.kpi.big .verdict .score { font-size: 1.4rem; }
.kpis { display: flex; flex-wrap: wrap; gap: .8em 1.6em; align-items: center; margin: .6em 0; }
.kpi { display: grid; gap: .05em; min-width: 0; }
.kpi .k { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.kpi b { font: 700 1.35rem var(--f-display); font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: .3em; flex-wrap: wrap; }
.tab { border: 1px solid var(--line); background: var(--panel); border-radius: 99px; padding: .3em .85em; cursor: pointer; font-size: .9rem; }
.tab[aria-pressed="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.panel.narrow { max-width: 820px; }
.list-tools { margin-bottom: .8em; }
.list-search { flex: 1; min-width: 220px; max-width: 460px; padding: .5em .8em; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.paste { border: 2px dashed var(--line); border-radius: 12px; padding: 12px; margin-bottom: .8em; background: var(--panel-2); display: grid; gap: .6em; }
.paste textarea { width: 100%; min-height: 9em; padding: .7em; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); resize: vertical; font: .95rem/1.45 var(--f-body); }
.paste img.shot { max-width: 100%; max-height: 260px; border: 1px solid var(--line); border-radius: 6px; display: block; margin-bottom: .3em; }
.warn-text { color: var(--warn); }
.explain { margin-top: .6em; }
.explain p { margin: .4em 0 0; padding: .7em .9em; background: var(--accent-soft); border-radius: var(--radius); }
form[hidden] { display: none; }
.stops { display: grid; gap: .6em; margin-bottom: .6em; }
.stop { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel-2); }
.stop input[type="search"], .stop select { width: 100%; padding: .5em .6em; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.stop select { width: auto; }
.fams { border: 1px solid var(--line); border-radius: 10px; padding: .5em .9em; margin: 0 0 .9em; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.fams legend { font-size: .85rem; color: var(--ink-2); font-weight: 500; padding: 0 .3em; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td, tr.clickable:focus-visible td { background: var(--panel-2); }
tr.dim td { color: var(--ink-3); }
table.cands td { font-size: .88rem; }
table.cands details summary { margin: 0; color: inherit; }
table.mini { font-size: .8rem; margin-top: .3em; }
table.mini td, table.mini th { padding: .15em .3em; }
pre.source { white-space: pre-wrap; font: .85rem/1.45 var(--f-mono); background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: .7em; max-height: 320px; overflow: auto; }
.stoplist { padding-left: 1.2em; display: grid; gap: .35em; }
.chip.status-accepted { border-color: var(--good); color: var(--good); }
.chip.status-pending_approval, .chip.status-countered { border-color: var(--warn); color: var(--warn); }
.chip.status-declined, .chip.status-expired, .chip.status-withdrawn { color: var(--ink-3); }

/* Trips (M3). */
.chip.trip-en_route { border-color: var(--good); color: var(--good); }
.chip.trip-planned, .chip.trip-dispatched { border-color: var(--accent); }
.chip.trip-cancelled { color: var(--ink-3); }
.trip-code { font: 700 1.9rem var(--f-mono); letter-spacing: .18em; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 8px; padding: .1em .45em; }
.trip-stops, .drv-stops { list-style: none; padding: 0; margin: 0; display: grid; gap: .6em; }
.trip-stop, .drv-stop { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel-2); display: grid; gap: .35em; }
.st-done, .st-skipped { opacity: .7; }
.chip.st { margin-left: auto; }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: .5em; }
.timeline li { border-left: 3px solid var(--line); padding-left: .7em; }
.timeline li.problem { border-left-color: var(--bad); }
a.item { text-decoration: none; color: inherit; }
/* The driver's page and the tracking page: one column, big targets, phone first. */
.driver { max-width: 560px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-left, 0px)) 48px; display: grid; gap: .9em; }
.driver .lang { justify-content: flex-end; }
.drv-head h1 { font-size: 2.2rem; margin: 0; }
.drv-place { font-size: 1.15rem; font-weight: 600; }
.drv-stop.current { border: 2px solid var(--ink); background: var(--panel); box-shadow: inset 4px 0 0 var(--accent); }
.btn.big { justify-content: center; padding: .95em 1em; font-size: 1.1rem; width: 100%; }
.drv-tools { display: grid; gap: .6em; }
.driver .map, .driver .map.small-map { order: 0; position: relative; top: auto; height: 220px; }
.drv-tools textarea, .code-input { width: 100%; padding: .7em; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.code-input { font: 700 2rem var(--f-mono); letter-spacing: .3em; text-align: center; text-transform: uppercase; margin-bottom: .6em; }

/* Money (M4): the invoice prints as a clean sheet. */
.invoice-sheet { max-width: 820px; }
.invoice-sheet table { margin-top: 1.2em; }
.invoice-sheet .k { text-transform: uppercase; letter-spacing: .06em; }
.invoice-sheet th { color: var(--ink); font-size: 1.05rem; text-transform: none; letter-spacing: 0; font-weight: 700; }
@media print {
  .nav, .no-print, .lang { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .invoice-sheet { border: 0; padding: 0; }
  body { background: #fff; color: #000; }
}

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: .6em 0; border-bottom: 1px solid var(--line); }
  table.stack td { border: 0; padding: .2em 0; }
  table.stack td[data-label] { display: flex; justify-content: space-between; gap: 1em; }
  table.stack td[data-label]::before { content: attr(data-label); color: var(--ink-3); font-size: .8rem; text-align: left; }
  /* Phones: a slim top bar; the menu opens below it (☰). */
  .nav { padding: 8px max(12px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px)); gap: 4px;
    position: sticky; top: 0; z-index: 15; height: auto; max-height: 100vh; overflow-y: auto; }
  .nav-top { display: flex; align-items: center; gap: .6em; }
  .nav .brand { margin: 0; }
  .nav .brand .name { font-size: 1.25rem; }
  .nav .brand br, .nav .brand .tag, .nav .spacer { display: none; }
  .nav-page { display: block; flex: 1 1 auto; min-width: 0; color: var(--nav-active); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: auto;
    border-radius: 10px; border: 1px solid rgba(255,255,255,.2); background: transparent; color: var(--nav-active); font-size: 1.3rem; cursor: pointer; }
  .nav:not(.open) .co, .nav:not(.open) .nav-links, .nav:not(.open) .nav-foot { display: none; }
  .nav.open .co { margin: 8px 0 6px; }
  .nav.open .nav-links, .nav.open .nav-foot { flex: 0 0 auto; overflow: visible; }
  .nav a, .nav button.navbtn { padding: .7em .8em; }
  .main { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
/* AI credits in the sidebar */
.nav .co .credits { display: block; margin-top: .55em; padding-top: .5em; border-top: 1px solid rgba(255,255,255,.1); color: inherit; text-decoration: none; }
.nav .co .credits[hidden] { display: none !important; }
.nav .co .credits .credits-k { font-size: .78em; opacity: .75; margin-right: .4em; }
.nav .co .credits .credits-n { display: inline; font-size: .9em; color: var(--nav-active); }
.nav .co .credits .credits-bar { display: block; height: 4px; margin-top: .35em; border-radius: 2px; background: rgba(255,255,255,.15); overflow: hidden; }
.nav .co .credits .credits-bar i { display: block; height: 100%; background: #3fae6a; }
.nav .co .credits.low .credits-bar i { background: #e0a020; }
.nav .co .credits.out .credits-bar i { background: #d9534f; }
.nav .co .credits.out .credits-n { color: #ff8a80; }

/* ---- assistant panel (M5) ---- */
.as-fab { position: fixed; right: max(20px, env(safe-area-inset-right, 0px)); bottom: max(20px, env(safe-area-inset-bottom, 0px)); z-index: 40;
  display: inline-flex; align-items: center; gap: .55em; padding: .85em 1.35em; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font: inherit; font-size: 1.02rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 8px 24px rgba(232,163,23,.45), 0 2px 6px rgba(0,0,0,.18); transition: transform .15s ease, box-shadow .15s ease; }
.as-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(232,163,23,.55), 0 3px 8px rgba(0,0,0,.2); }
.as-fab:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.as-fab-icon { font-size: 1.15em; line-height: 1; }
.as-title { display: inline-flex; align-items: baseline; gap: .1em; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.as-fab[hidden], .as-panel[hidden] { display: none !important; }
.as-panel { position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 100vw; z-index: 45; display: flex; flex-direction: column;
  background: var(--panel); color: var(--ink); border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgba(0,0,0,.12); }
.as-head { display: flex; align-items: center; gap: .4em; padding: .8em 1em; border-bottom: 1px solid var(--line); }
.as-head .spacer { flex: 1; }
.as-x { border: 0; background: none; color: var(--ink-2); font-size: 1.6em; line-height: 1; cursor: pointer; padding: 0 .2em; }
.as-list { flex: 1; overflow-y: auto; padding: 1em; display: flex; flex-direction: column; gap: .8em; }
.as-msg { max-width: 92%; padding: .6em .8em; border-radius: 12px; overflow-wrap: anywhere; }
.as-msg.user { align-self: flex-end; background: var(--accent-soft); color: var(--ink); }
.as-msg.assistant { align-self: flex-start; background: var(--panel-2); }
.as-text p { margin: 0 0 .45em; } .as-text p:last-child { margin-bottom: 0; }
.as-text ul { margin: .2em 0 .45em 1.1em; padding: 0; }
.as-card { margin-top: .6em; padding: .7em .8em; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--panel); }
.as-card ul { margin: .4em 0 .6em 1.1em; padding: 0; font-size: .92em; }
.as-card.done { border-color: #3fae6a; } .as-card.dismissed { opacity: .65; }
.as-result { margin-top: .4em; }
.as-rate { margin-top: .4em; display: flex; align-items: center; gap: .3em; }
.as-ans { margin-top: .45em; display: flex; flex-wrap: wrap; align-items: center; gap: .1em .4em; }
.as-info { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 .2em; font-size: 1em; line-height: 1; }
.as-info:focus-visible { outline: 2px solid var(--focus); border-radius: 4px; }
.as-detail { flex-basis: 100%; }
.as-rate input { flex: 1; min-width: 0; }
.as-thumb { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; cursor: pointer; padding: .1em .45em; }
.as-form { display: flex; gap: .5em; padding: .7em 1em; border-top: 1px solid var(--line); align-items: flex-end; }
.as-form textarea { flex: 1; resize: none; min-height: 2.6em; max-height: 9em; }
.as-foot { margin: 0; padding: 0 1em .8em; }
@media (min-width: 1280px) { body.as-on .shell { margin-right: 400px; } }
@media (max-width: 600px) { .as-panel { width: 100vw; } }
/* AI usage (Company page) */
.ai-days { display: flex; align-items: flex-end; gap: 3px; height: 90px; margin: .6em 0 1em; padding-bottom: 16px; position: relative; }
.ai-day { flex: 1; max-width: 22px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.ai-day i { display: block; width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; }
.ai-day span { position: absolute; bottom: -16px; font-size: .65rem; color: var(--ink-3); }
.as-mine { margin: 0; padding: .3em 1em 0; color: var(--ink-2); }
/* Written monthly analysis */
.ma-sheet { margin-top: 1em; padding: 1.2em 1.4em; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.ma-sheet .as-text h3 { margin: 1.1em 0 .35em; font-size: 1.05rem; }
.ma-sheet .as-text p, .ma-sheet .as-text li { line-height: 1.55; }
.ma-facts { max-height: 320px; overflow: auto; background: var(--panel-2); padding: .8em; border-radius: var(--radius); }
@media print {
  body.print-ma .nav, body.print-ma .as-panel, body.print-ma .as-fab, body.print-ma .no-print { display: none !important; }
  body.print-ma .shell { display: block; }
  body.print-ma .main > :not(.ma-panel) { display: none !important; }
  body.print-ma .ma-panel > h2, body.print-ma .ma-panel > p { display: none !important; }
  body.print-ma .ma-sheet { border: 0; padding: 0; }
}
/* How the fuel price was found (offer assessment) */
.fuel-note { margin: .6em 0; padding: .6em .8em; border-left: 3px solid var(--accent); background: var(--panel-2); border-radius: 0 var(--radius) var(--radius) 0; }
.fuel-note .small { margin-top: .2em; }
.fp-table { max-height: 300px; overflow-y: auto; }

/* Delivery photos and trip messages (office, driver and tracking pages). */
.pod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .7em; margin: .6em 0; }
.pod { margin: 0; display: flex; flex-direction: column; gap: .25em; }
.pod img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); display: block; }
.msgs { list-style: none; margin: .4em 0 .8em; padding: 0; display: grid; gap: .5em; }
.tmsg { border: 1px solid var(--line); border-radius: 10px; padding: .5em .7em; max-width: 46em; background: var(--panel-2); }
.tmsg.driver { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.tmsg.unread { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.tmsg-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: .15em 0; }
.drv-msgs, .drv-photos { margin: 1em 0; }
.drv-msgs textarea, .msg-form textarea { width: 100%; max-width: 46em; margin-bottom: .4em; }

/* Timeline (Gantt) of the Trips page: one row per truck, a week of days. */
.tl-tools { align-items: center; gap: .5em; margin-bottom: .6em; }
.tl-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.tl-grid { --tl-label: 170px; --tl-day: 150px; min-width: calc(var(--tl-label) + var(--tl-days) * var(--tl-day)); }
.tl-row { display: grid; grid-template-columns: var(--tl-label) 1fr; border-top: 1px solid var(--line); }
.tl-headrow { border-top: 0; position: sticky; top: 0; z-index: 2; background: var(--panel); }
.tl-label { padding: .45em .6em; border-right: 1px solid var(--line); background: var(--panel); position: sticky; left: 0; z-index: 3; font-size: .88rem; }
.tl-none .tl-label { color: var(--ink-3); font-style: italic; }
.tl-lane { position: relative; min-height: 44px;
  background-image: repeating-linear-gradient(to right, transparent 0, transparent calc(100% / var(--tl-days) - 1px), var(--line) calc(100% / var(--tl-days) - 1px), var(--line) calc(100% / var(--tl-days))); }
.tl-days { display: grid; grid-template-columns: repeat(var(--tl-days), 1fr); background: none; min-height: 0; }
.tl-day { padding: .45em .5em; font-size: .82rem; border-left: 1px solid var(--line); white-space: nowrap; }
.tl-day.today { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); z-index: 1; }
.tl-bar { position: absolute; height: 28px; display: flex; align-items: center; gap: .4em; padding: 0 .5em; border-radius: 6px; overflow: hidden;
  white-space: nowrap; font-size: .8rem; text-decoration: none; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); z-index: 2; }
.tl-bar.movable { cursor: grab; touch-action: none; } /* a finger on a planned trip drags it; elsewhere it scrolls */
.tl-bar.dragging { cursor: grabbing; opacity: .85; box-shadow: 0 6px 18px rgba(0,0,0,.25); z-index: 5; }
.tl-bar.st-planned { background: color-mix(in srgb, var(--accent) 18%, var(--panel)); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.tl-bar.st-dispatched { background: color-mix(in srgb, var(--accent) 34%, var(--panel)); border-color: var(--accent); }
.tl-bar.st-en_route { background: color-mix(in srgb, var(--good) 26%, var(--panel)); border-color: var(--good); }
.tl-bar.st-completed { background: var(--panel-2); color: var(--ink-3); }
.tl-bar.est { border-right-style: dashed; }
.tl-bar.conflict { border: 2px solid var(--bad); box-shadow: 0 0 0 1px var(--bad) inset; }
.tl-ref { font-weight: 700; font-variant-numeric: tabular-nums; }
.tl-route { overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.tl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); flex: 0 0 auto; }
@media (max-width: 760px) { .tl-grid { --tl-label: 110px; --tl-day: 110px; } .tl-route { display: none; } }
.tabs a.tab[aria-current="page"] { background: var(--ink); color: var(--panel); border-color: var(--ink); text-decoration: none; }
.tl-bar { user-select: none; -webkit-user-drag: none; }
.tabs a.tab { text-decoration: none; color: var(--ink); display: inline-block; }
.legal-note { text-align: center; max-width: 420px; margin: 1em auto 0; }
.legal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .4em; }
.legal-links a { white-space: nowrap; }
