/* Stopjot. Charcoal ink on warm paper. See docs/BRAND.md. */

@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/barlow-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/barlow-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/barlow-700.woff2") format("woff2"); }

:root {
  --ink: #15191E;
  --graphite: #3B424C;
  --slate: #626A76;
  --line: #E2DFD8;
  --line-strong: #CFCBC2;
  --paper: #F7F6F2;
  --surface: #FFFFFF;
  --sunk: #EFEDE7;
  --kerb: #F4B400;
  --signal: #D8261C;
  --focus: #1F5FBF;
  --done: #2E7D4F;
  --done-bg: #E7F2EB;
  --active: #8A5E0E;
  --active-bg: #FBF1DC;
  --requested: #5A6472;
  --requested-bg: #EDEEF0;
  --problem: #B3261E;
  --problem-bg: #FBEAE8;
  --van-navy: #2D5A87;
  --van-brick: #A2462E;
  --van-forest: #3F6B45;
  --van-plum: #6B4A6E;
  --van-teal: #2C6E6A;
  --van-ochre: #8A6A1F;
  --radius: 5px;
  --sidebar: 228px;
  --topbar: 0px;
  --bottombar: 62px;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.45 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, dl, dd, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1 { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 18px; line-height: 1.3; font-weight: 700; }
h3 { font-size: 16px; line-height: 1.3; font-weight: 700; }
a { color: var(--focus); text-decoration: none; }
a.card { display: block; color: var(--ink); }
a.card-head { color: var(--ink); }
a.card-head:hover { background: #FBFAF7; text-decoration: none; }
a.card-head > .i:last-child { color: var(--slate); }
a.card:hover { text-decoration: none; border-color: var(--line-strong); }
a:hover { text-decoration: underline; }
/* A link inside a sentence is underlined, so colour isn't the only thing marking it. */
p.muted a, p.small a, .help-body a { text-decoration: underline; text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.i { width: 1.2em; height: 1.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--surface); padding: 10px 14px; z-index: 100; border-radius: var(--radius); }
.skip:focus { top: 8px; }
.small { font-size: 14px; }
.muted { color: var(--slate); }
.strong { font-weight: 700; }
.medium { font-weight: 500; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden, [hidden] { display: none !important; }
.stack > * + * { margin-top: 16px; }
.stack > input[type="hidden"] + :not([type="hidden"]) { margin-top: 0; }
.stack-lg > * + * { margin-top: 28px; }
.stack-sm > * + * { margin-top: 8px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-aside { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.wrap-anywhere { overflow-wrap: anywhere; }

/* Shell: on a computer everything lives in the sidebar; the top bar is only for phones. */
.app { min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
  background: var(--ink); color: #D9DCE1;
  display: flex; flex-direction: column; gap: 14px; padding: 18px 12px 12px; z-index: 30;
}
.sidebar .brand { display: block; padding: 2px 10px 4px; }
.sidebar .brand img { height: 26px; width: auto; }
.sidebar-company { color: #A9B0BA; font-size: 14px; margin: -10px 10px 0; overflow-wrap: anywhere; }
.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav-list a, .menu.account > summary {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--radius);
  color: #C7CCD3; font-weight: 500; position: relative;
}
.nav-list a:hover, .menu.account > summary:hover { background: #22282F; color: #fff; text-decoration: none; }
.nav-list a[aria-current="page"] { background: #262D35; color: #fff; }
.nav-list a[aria-current="page"]::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; background: var(--kerb); border-radius: 0 2px 2px 0;
}
.nav-list a:focus-visible, .menu.account > summary:focus-visible { outline-color: #fff; }
.nav-list .count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--kerb); color: var(--ink); font: 700 12px/20px var(--font); text-align: center; }
.sidebar-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid #262D35; }
.sidebar .search-form { max-width: none; flex: none; }
.sidebar .search-form .i { top: 10px; color: #8D95A1; }
.sidebar .search-form input { height: 38px; background: #1E242B; border-color: #2F3640; color: #fff; }
.sidebar .search-form input::placeholder { color: #8D95A1; }
.sidebar .search-form input:focus { border-color: #5B6573; box-shadow: none; }
.sidebar .search-form kbd { top: 8px; background: transparent; border-color: #3A424C; color: #8D95A1; }
.sidebar .search-results { width: 440px; max-width: calc(100vw - 32px); color: var(--ink); }
.menu.account { position: relative; }
.menu.account > summary { height: auto; }
.menu.account > summary .avatar { width: 24px; height: 24px; font-size: 11px; line-height: 24px; background: #3A424C; }
.menu.account > summary .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu.account > summary .i { color: #8D95A1; }
.menu.account .menu-panel { top: auto; bottom: calc(100% + 6px); left: 0; right: auto; width: 260px; color: var(--ink); }
@media (max-height: 600px) { .sidebar { overflow-y: auto; } }

.main { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { display: none; }
.search-form { position: relative; flex: 1 1 auto; max-width: 440px; }
.search-form .i { position: absolute; left: 11px; top: 11px; color: var(--slate); pointer-events: none; }
.search-form input { width: 100%; height: 40px; padding: 0 40px 0 36px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.search-form input:focus { border-color: var(--graphite); outline: none; box-shadow: 0 0 0 3px rgba(31, 95, 191, .18); }
.search-form kbd { position: absolute; right: 9px; top: 9px; font: 500 13px/20px var(--font); color: var(--slate); border: 1px solid var(--line); border-radius: 3px; padding: 0 6px; background: var(--paper); }
.search-results { position: absolute; left: 0; right: 0; top: 46px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); max-height: 60vh; overflow: auto; z-index: 40; box-shadow: 0 8px 24px rgba(21, 25, 30, .12); }
.search-results h3 { padding: 10px 14px 4px; font-size: 13px; color: var(--slate); font-weight: 500; }
.search-results a { display: block; padding: 8px 14px; color: var(--ink); }
.search-results a:hover, .search-results a.is-active { background: var(--sunk); text-decoration: none; }
.search-results .none { padding: 14px; color: var(--slate); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--radius); background: transparent; border: 0; color: var(--graphite); cursor: pointer;
}
.icon-btn:hover { background: var(--sunk); color: var(--ink); text-decoration: none; }
.count-dot { position: absolute; top: 5px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--kerb); color: var(--ink); font: 700 12px/18px var(--font); text-align: center; }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 8px; border-radius: var(--radius); font-weight: 500; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover { background: var(--sunk); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; font: 700 13px/30px var(--font); text-align: center; flex: none; }
.menu-panel { position: absolute; right: 0; top: 50px; min-width: 220px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(21, 25, 30, .12); padding: 6px; z-index: 40; }
.menu-panel a, .menu-panel button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; color: var(--ink); text-align: left; cursor: pointer; border-radius: 3px; font-weight: 400; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--sunk); text-decoration: none; }
.menu-panel .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }

.content { flex: 1 1 auto; width: 100%; max-width: 1240px; padding: 32px 36px 48px; }
.content.wide { max-width: none; }
.content.narrow { max-width: 800px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .sub { color: var(--slate); margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-foot { margin-top: 20px; }
.crumb { display: inline-flex; align-items: center; gap: 4px; color: var(--slate); font-size: 14px; margin-bottom: 6px; }
.crumb .i { width: 1em; height: 1em; }

.bottom-nav { display: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: var(--radius); border: 1px solid transparent;
  font-weight: 500; font-size: 16px; line-height: 1.1; cursor: pointer; text-align: center; background: none; color: var(--ink);
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #2A313A; }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--graphite); }
.btn-danger { color: var(--problem); padding: 0 10px; }
.btn-danger:hover { background: var(--problem-bg); }
.btn-ghost { color: var(--graphite); padding: 0 10px; }
.btn-ghost:hover { background: var(--sunk); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 15px; }
.btn-lg { min-height: 52px; font-size: 18px; padding: 0 20px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--focus); cursor: pointer; font: inherit; }
.link-btn:hover { text-decoration: underline; }

/* Forms */
.field { display: block; }
.field + .field { margin-top: 18px; }
.field > label, .field-label { display: block; font-weight: 500; margin-bottom: 6px; }
.field .help { color: var(--slate); font-size: 14px; margin-top: 5px; }
.field-error { color: var(--problem); font-size: 14px; margin-top: 5px; font-weight: 500; }
.input, select.input, textarea.input {
  display: block; width: 100%; min-height: 44px; padding: 9px 12px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius); font-size: 16px;
}
textarea.input { min-height: 88px; resize: vertical; }
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(31, 95, 191, .18); }
.input[aria-invalid="true"] { border-color: var(--problem); }
select.input { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--graphite) 50%), linear-gradient(135deg, var(--graphite) 50%, transparent 50%); background-position: right 16px top 19px, right 11px top 19px; background-size: 5px 5px; background-repeat: no-repeat; }
.check { display: flex; align-items: flex-start; gap: 10px; min-height: 28px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }
.check + .check { margin-top: 8px; }
.field > .check { display: flex; margin-bottom: 0; font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid .field + .field, .grid-2 .field + .field, .grid-3 .field + .field { margin-top: 0; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid + .field, .field + .form-grid { margin-top: 18px; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 24px; flex-wrap: wrap; }
/* A choice of a few: separate buttons, so they wrap cleanly on a phone. */
.segmented { display: flex; flex-wrap: wrap; gap: 6px; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span { display: flex; align-items: center; min-height: 42px; padding: 0 14px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); font-weight: 500; }
.segmented label:hover span { border-color: var(--graphite); }
.segmented input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.segmented input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.stepper button { width: 46px; min-height: 44px; border: 0; background: none; font-size: 22px; cursor: pointer; }
.stepper button:hover { background: var(--sunk); }
.stepper input { width: 58px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; background: none; }
.pc-confirm { font-size: 14px; color: var(--done); margin-top: 5px; display: flex; gap: 6px; align-items: center; }
.pc-confirm.bad { color: var(--problem); }

/* Stops and what's moved between them */
.kind-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 2.5px solid var(--ink); margin-right: 8px; vertical-align: -1px; }
.kind-deliver { background: var(--ink); }
.stop-block + .stop-block { padding-top: 16px; border-top: 1px dashed var(--line-strong); }
.item-list { margin: 10px 0; }
.item-row { padding: 10px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.item-main { display: flex; gap: 8px; align-items: center; }
.item-main .input { min-width: 0; }
.item-route { display: flex; gap: 10px 16px; margin-top: 8px; flex-wrap: wrap; }
.item-pick { display: flex; align-items: center; gap: 8px; flex: 1 1 220px; font-size: 14px; color: var(--graphite); }
.item-pick .input { min-height: 40px; padding-top: 6px; padding-bottom: 6px; background-position: right 16px top 17px, right 11px top 17px; }
.items-table td { padding: 6px 0; vertical-align: top; }
.items-table td + td { padding-left: 14px; }

/* Autocomplete */
.ac { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(21, 25, 30, .12); z-index: 25; max-height: 300px; overflow: auto; }
.ac-list button { display: block; width: 100%; text-align: left; padding: 10px 12px; background: none; border: 0; cursor: pointer; }
.ac-list button:hover, .ac-list button.is-active { background: var(--sunk); }
.ac-list .ac-new { border-top: 1px solid var(--line); font-weight: 500; }
.ac-list .ac-group { padding: 10px 12px 4px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--slate); }
.picked { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); }

/* Cards and data */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.card-body { padding: 20px; }
.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 8px 16px; }
.kv dt { color: var(--slate); }
.kv dd { overflow-wrap: anywhere; }
aside .kv { grid-template-columns: 104px minmax(0, 1fr); }
.kv a.row { display: inline-flex; gap: 8px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); background: var(--active-bg); color: #5F4209; }
.notice.info { background: var(--sunk); color: var(--graphite); }
.notice.error { background: var(--problem-bg); color: #8B1D16; }
.notice.ok { background: var(--done-bg); color: #1F5937; }
.notice .i { margin-top: 2px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th { text-align: left; font-weight: 500; font-size: 14px; color: var(--slate); padding: 10px 14px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; background: var(--surface); }
.table th a { color: inherit; }
.table th.sorted { color: var(--ink); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table tbody tr[data-href] { cursor: pointer; }
@media (hover: hover) { .table tbody tr:hover td { background: #FBFAF7; } }
.table .primary-cell a { color: var(--ink); font-weight: 500; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters .input { width: auto; min-height: 40px; padding-top: 6px; padding-bottom: 6px; }
.filters select.input { background-position: right 16px top 17px, right 11px top 17px; }
.filters .search { flex: 1 1 220px; min-width: 180px; }
.filter-more { flex: 1 1 100%; }
.filter-more > summary { cursor: pointer; color: var(--focus); font-size: 15px; list-style: none; width: max-content; display: inline-flex; align-items: center; gap: 6px; }
.filter-more > summary::-webkit-details-marker { display: none; }
.filter-more[open] > summary { margin-bottom: 8px; }
.filter-more .filters { margin-bottom: 0; }
.filter-date { display: inline-flex; align-items: center; gap: 6px; color: var(--graphite); font-size: 15px; }
.menu > summary.btn { height: auto; padding: 0 16px; font-weight: 500; }
.btn .count { min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--ink); color: #fff; font: 700 12px/20px var(--font); text-align: center; }
.menu-panel select.input { min-width: 220px; }
.menu > summary.btn-secondary:hover { background: var(--surface); border-color: var(--graphite); }
.menu-panel.left { right: auto; left: 0; }
.menu-panel form { margin: 0; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-strong); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--graphite); font-weight: 500; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--kerb); }
.tabs .count { color: var(--slate); font-weight: 400; margin-left: 4px; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; color: var(--slate); font-size: 14px; }

/* Status tags: a word and a dot, coloured by meaning. */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px; border-radius: 10px; font-size: 14px; font-weight: 500; line-height: 1.5; white-space: nowrap; background: var(--requested-bg); color: var(--graphite); }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.tag .i { width: 15px; height: 15px; stroke-width: 2.2; }
.tag.wrap { white-space: normal; align-items: flex-start; margin-top: 3px; border-radius: 4px; }
.tag.wrap::before, .tag:has(> .i)::before { display: none; }
.tag-done, .tag-finished, .tag-paid { background: var(--done-bg); color: #226040; }
.tag-in_progress, .tag-started, .tag-queried, .tag-part_paid { background: var(--active-bg); color: var(--active); }
.tag-failed, .tag-overdue { background: var(--problem-bg); color: var(--problem); }
.tag-cancelled, .tag-void { background: transparent; color: var(--slate); padding-left: 0; }
.tag-requested { background: transparent; color: var(--requested); outline: 1px dashed var(--requested); outline-offset: -1px; }

/* Van colour */
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; flex: none; }
.van-navy { --van: var(--van-navy); } .van-brick { --van: var(--van-brick); } .van-forest { --van: var(--van-forest); }
.van-plum { --van: var(--van-plum); } .van-teal { --van: var(--van-teal); } .van-ochre { --van: var(--van-ochre); }
.swatch { background: var(--van, var(--slate)); }

/* Calendar */
.cal-head { margin-bottom: 14px; }
.cal-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-nav { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.cal-nav a { display: flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 8px; color: var(--ink); font-weight: 500; }
.cal-nav a + a { border-left: 1px solid var(--line); }
.cal-nav a:hover { background: var(--sunk); text-decoration: none; }
.view-switch { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.view-switch a { padding: 0 12px; height: 40px; display: flex; align-items: center; color: var(--graphite); font-weight: 500; }
.view-switch a + a { border-left: 1px solid var(--line); }
.view-switch a[aria-current="page"] { background: var(--ink); color: #fff; }
.view-switch a:hover { text-decoration: none; }

.board { display: grid; grid-template-columns: 112px repeat(5, minmax(0, 1fr)) repeat(2, minmax(0, .62fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.board-corner, .board-day { padding: 8px 10px; border-bottom: 1px solid var(--line-strong); background: var(--surface); font-size: 14px; }
.board-day { border-left: 1px solid var(--line); color: var(--graphite); }
.board-day a { color: inherit; display: block; }
.board-day .n { font-size: 20px; font-weight: 700; color: var(--ink); line-height: 1.1; display: block; }
.board-day.is-today { box-shadow: inset 0 3px 0 var(--kerb); }
.board-day.is-today .n { color: var(--ink); }
.board-van { padding: 10px; border-bottom: 1px solid var(--line); border-left: 4px solid var(--van, var(--line)); font-weight: 700; }
.board-van small { display: block; font-weight: 400; color: var(--slate); font-size: 13px; }
.board-cell { min-height: 118px; padding: 6px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 5px; position: relative; }
.board-cell.is-weekend { background: #FBFAF7; }
.board-cell.is-today { background: #FFFDF6; }
.board-cell.drop-ok { background: #EEF3FB; box-shadow: inset 0 0 0 2px var(--focus); }
.board-cell.drop-bad { background: var(--problem-bg); box-shadow: inset 0 0 0 2px var(--problem); }
.board-add { opacity: 0; display: flex; align-items: center; justify-content: center; min-height: 28px; color: var(--slate); border-radius: 3px; margin-top: auto; }
.board-cell:hover .board-add, .board-add:focus-visible { opacity: 1; }
.board-add:hover { background: var(--sunk); text-decoration: none; color: var(--ink); }
.drop-why { font-size: 13px; color: var(--problem); font-weight: 500; }

.jc { display: block; background: var(--surface); border: 1px solid var(--line-strong); border-left: 4px solid var(--van, var(--slate)); border-radius: 3px; padding: 5px 7px; font-size: 14px; line-height: 1.25; color: var(--ink); }
.jc:hover { text-decoration: none; border-color: var(--graphite); border-left-color: var(--van, var(--slate)); }
.jc .jc-top { display: flex; justify-content: space-between; gap: 6px; color: var(--slate); font-size: 13px; }
.jc .jc-main { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; }
.jc .jc-sub { display: block; color: var(--graphite); overflow: hidden; text-overflow: ellipsis; }
.jc.is-requested { border-style: dashed; border-left-style: solid; background: #FBFAF7; }
.jc.is-done { color: var(--slate); background: #FBFAF7; }
.jc.is-done .jc-main, .jc.is-done .jc-sub { color: var(--slate); }
.jc.is-failed { border-color: var(--problem); border-left-color: var(--problem); }
.jc.is-cancelled { display: none; }
.jc[draggable="true"] { cursor: grab; }
.jc.dragging { opacity: .45; }
.trip-chip { display: flex; align-items: center; gap: 5px; padding: 2px 4px 2px 6px; border-radius: 3px; font-size: 13px; color: var(--graphite); background: var(--sunk); white-space: nowrap; overflow: hidden; }
.trip-chip:hover { text-decoration: none; color: var(--ink); background: #E9E6DF; }
.trip-chip .i { width: 14px; height: 14px; color: var(--van, var(--slate)); }
.trip-chip .grow { overflow: hidden; text-overflow: ellipsis; }
.trip-chip .i:last-child { color: var(--slate); }
.jc .tag-mini { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; }
.jc .tag-mini .i { width: 13px; height: 13px; }
.bb { display: flex; align-items: center; gap: 5px; padding: 5px 7px; font-size: 13px; line-height: 1.2; border-radius: 3px; background: repeating-linear-gradient(135deg, var(--sunk), var(--sunk) 6px, #E7E4DC 6px, #E7E4DC 12px); color: var(--graphite); font-weight: 500; }
a.bb:hover { text-decoration: none; color: var(--ink); }
.booked { background: var(--sunk); color: var(--slate); padding: 5px 7px; border-radius: 3px; font-size: 13px; font-weight: 500; }

.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.month-h { padding: 8px 10px; font-size: 14px; color: var(--slate); border-bottom: 1px solid var(--line-strong); }
.month-d { min-height: 104px; padding: 7px 9px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--ink); display: block; }
.month-d:nth-child(7n+1) { border-left: 0; }
.month-d:hover { background: #FBFAF7; text-decoration: none; }
.month-d.other { background: #FBFAF7; color: var(--slate); }
.month-d .n { font-weight: 700; }
.month-d.is-today .n { display: inline-block; background: var(--kerb); color: var(--ink); padding: 0 6px; border-radius: 3px; }
.month-bars { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.month-bar { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--graphite); }

.agenda-strip { display: flex; gap: 4px; margin: 0 -16px 8px; padding: 0 16px 8px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
.agenda-strip::-webkit-scrollbar { display: none; }
.agenda-strip a { flex: 1 0 44px; min-height: 58px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; padding: 6px 0; border-radius: var(--radius); color: var(--graphite); font-size: 13px; background: var(--surface); border: 1px solid var(--line); }
.agenda-strip a:hover { text-decoration: none; }
.agenda-strip a b { font-size: 17px; color: var(--ink); }
.agenda-strip a.is-today { border-color: var(--ink); box-shadow: inset 0 -3px 0 var(--kerb); }
.agenda-strip a[aria-current="date"] { background: var(--ink); color: #D9DCE1; border-color: var(--ink); }
.agenda-strip a[aria-current="date"] b { color: #fff; }
.agenda-strip .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--signal); margin-top: 2px; }
.agenda-strip .dot.off { background: transparent; }
.agenda-date { position: sticky; top: var(--topbar); background: var(--paper); padding: 10px 0 6px; font-weight: 700; z-index: 4; }
.agenda-date small { font-weight: 400; color: var(--slate); margin-left: 6px; font-size: 14px; }
.agenda-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.agenda-list .jc { padding: 10px 12px; font-size: 15px; line-height: 1.3; }
.cal-desktop { display: block; }
.cal-phone { display: none; }

/* Stop lists */
.stops { counter-reset: stop; }
.stop-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.stop-row:last-child { border-bottom: 0; }
.stop-row a { color: var(--ink); }
.stop-n { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font: 700 14px/26px var(--font); text-align: center; flex: none; }
.stop-row.is-done .stop-n { background: var(--done); }
.stop-row.is-failed .stop-n { background: var(--problem); }
.reorder { display: flex; gap: 2px; margin-left: auto; }
.how { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; font-size: 15px; }
.how li { padding: 4px 0; display: flex; justify-content: space-between; gap: 16px; }
.how li + li { border-top: 1px solid var(--line); }
details.disclose > summary { cursor: pointer; color: var(--focus); list-style: none; display: inline-flex; gap: 4px; align-items: center; }
details.disclose > summary::-webkit-details-marker { display: none; }
details.disclose[open] > summary { margin-bottom: 10px; }
details.disclose > summary .i { width: 1em; height: 1em; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.photo-grid a { display: block; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; background: var(--sunk); }
.photo-grid img { width: 100%; height: 120px; object-fit: cover; }
.history li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.history li:last-child { border-bottom: 0; }

/* Trips on Today, and lists of links */
.block { display: block; }
.trip { border-left: 4px solid var(--van, var(--line-strong)); }
.trip-stops { list-style: none; margin: 0; padding: 4px 20px 8px; }
.trip-stops li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.trip-stops li:last-child { border-bottom: 0; }
.trip-stops a { color: var(--ink); }
.trip-stops .stop-n { width: 24px; height: 24px; font-size: 13px; line-height: 24px; display: inline-flex; align-items: center; justify-content: center; }
.trip-stops .is-done .stop-n { background: var(--done); }
.trip-stops .is-failed .stop-n { background: var(--problem); }
.trip-stops .is-done a { color: var(--slate); }
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li + li { border-top: 1px solid var(--line); }
.link-list a { display: flex; gap: 12px; align-items: center; padding: 12px 20px; color: var(--ink); }
.link-list a:hover { background: var(--sunk); text-decoration: none; }
.link-list a > .i { color: var(--graphite); }
.link-list a > .i:last-child { color: var(--slate); }

/* Booking */
.book-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.book-section { padding: 20px 24px; border-bottom: 1px solid var(--line); }
.book-section:last-child { border-bottom: 0; }
.book-h, .field > label.book-h { display: block; margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--slate); }
.book-side { position: sticky; top: calc(var(--topbar) + 24px); }
.day-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 10px; }
.day-strip button { display: flex; flex-direction: column; gap: 2px; align-items: center; padding: 7px 2px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; cursor: pointer; font-size: 13px; color: var(--graphite); }
.day-strip button b { font-size: 17px; color: var(--ink); }
.day-strip button[aria-pressed="true"] { background: var(--ink); color: #D9DCE1; border-color: var(--ink); }
.day-strip button[aria-pressed="true"] b { color: #fff; }
.day-strip button.full { background: var(--sunk); color: var(--slate); }
.day-strip button.full b { color: var(--slate); }
.day-strip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--done); }
.day-strip .some .dot { background: var(--kerb); }
.day-strip .full .dot { background: transparent; }
.price-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 15px; }
.price-lines:empty { display: none; }
.price-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 18px; }
.price-lines:not(:empty) + p + .price-total, .price-lines:not(:empty) + .price-total { border-top: 1px solid var(--line-strong); padding-top: 8px; margin-top: 6px; }

/* Rows: a label and its value on one line, the whole row a link. Price lists, zones, settings. */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li + li { border-top: 1px solid var(--line); }
.rows a, .rows summary, .rows-static { display: grid; grid-template-columns: minmax(130px, 200px) minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding: 13px 20px; color: var(--ink); }
.rows summary { list-style: none; cursor: pointer; }
.rows summary::-webkit-details-marker { display: none; }
.rows a:hover, .rows summary:hover { background: #FBFAF7; text-decoration: none; }
.rows a > .i, .rows summary > .i { color: var(--slate); align-self: center; }
.rows-k { font-weight: 500; }
.rows-v { overflow-wrap: anywhere; }
.rows .is-off .rows-k, .rows .is-off .rows-v { color: var(--slate); }
.rows details[open] > summary > .i { transform: rotate(180deg); }
.rows-body { padding: 4px 20px 18px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.rows-body .form-grid { width: 100%; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--line); }
.card-foot.row .input { width: auto; min-width: 0; }
.link-btn.danger { color: var(--problem); }

/* Price fields: what the price is for on the left, the amount on the right. */
.price-rows { display: flex; flex-direction: column; }
.price-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); font-weight: 500; }
.price-rows > :last-child, .price-rows > :last-child .price-row { border-bottom: 0; }
.price-row .input { width: 140px; flex: none; text-align: right; }
.bands td { padding: 6px 8px 6px 0; border: 0; }
.bands th { padding: 0 8px 4px 0; border: 0; text-align: left; font-weight: 500; font-size: 14px; color: var(--slate); }

/* Invoice on screen */
.inv { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 36px 40px; }
.inv-head { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 26px; flex-wrap: wrap; }
.inv-title { font-size: 30px; font-weight: 700; letter-spacing: -.01em; }
.inv-meta { display: grid; grid-template-columns: auto auto; gap: 2px 14px; justify-content: end; font-size: 15px; text-align: right; }
.inv-meta dt { color: var(--slate); }
.inv-bill { margin-bottom: 20px; }
.inv-lines { width: 100%; border-collapse: collapse; }
.inv-lines th { font-size: 14px; font-weight: 500; color: var(--slate); text-align: left; padding: 8px 8px; border-bottom: 2px solid var(--ink); }
.inv-lines td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.inv-lines .num { text-align: right; white-space: nowrap; }
.inv-lines tr.group td { background: none; font-weight: 700; font-size: 14px; padding-top: 14px; border-bottom: 1px solid var(--line-strong); }
.inv-lines .ctl { width: 64px; text-align: right; white-space: nowrap; }
.inv-totals { margin: 18px 0 0 auto; width: 300px; max-width: 100%; }
.inv-totals div { display: flex; justify-content: space-between; padding: 4px 8px; }
.inv-totals .big { font-weight: 700; font-size: 20px; border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 8px; }
.inv-pay { margin-top: 26px; padding: 14px 16px; background: var(--paper); border-radius: var(--radius); font-size: 15px; }

/* Toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: #fff; padding: 11px 14px; border-radius: var(--radius); display: flex; gap: 14px; align-items: center; justify-content: space-between; box-shadow: 0 6px 20px rgba(21, 25, 30, .25); }
.toast.error { background: var(--problem); }
.toast button, .toast a { background: none; border: 0; color: var(--kerb); font-weight: 700; cursor: pointer; padding: 0; }
.toast.error button, .toast.error a { color: #fff; text-decoration: underline; }

/* Dialog */
dialog.sheet { border: 0; padding: 0; border-radius: 8px; width: min(460px, calc(100vw - 32px)); box-shadow: 0 16px 48px rgba(21, 25, 30, .3); color: var(--ink); }
dialog.sheet::backdrop { background: rgba(21, 25, 30, .45); }
.sheet-body { padding: 22px; }
.sheet-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 0 22px 20px; flex-wrap: wrap; }

/* Empty, checklist, misc */
.empty { padding: 40px 20px; text-align: center; color: var(--slate); }
.empty p { margin-bottom: 14px; }
.narrow-col { max-width: 728px; }
.pay-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.pay-row .field + .field { margin-top: 0; }
.pay-row .field:not(.grow) { width: 170px; }
.role-row { gap: 6px 18px; margin-top: 10px; }
.role-row .check + .check { margin-top: 0; }
.checklist li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist a { color: var(--ink); font-weight: 500; }
.checklist .tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); display: flex; align-items: center; justify-content: center; flex: none; color: #fff; }
.checklist .is-done .tick { background: var(--done); border-color: var(--done); }
.checklist .is-done a { color: var(--slate); }
.bar-chart { width: 100%; max-width: 640px; height: auto; font-family: var(--font); }
/* Help articles: written for people who don't use computers much, so roomy and plain. */
.help-body { max-width: 720px; font-size: 17px; line-height: 1.6; }
.help-body h2 { margin: 30px 0 10px; font-size: 22px; }
.help-body h3 { margin: 20px 0 6px; font-size: 18px; }
.help-body p + p { margin-top: 10px; }
.help-body ul { list-style: disc; padding-left: 22px; }
.help-body ul li, .help-body ol li { margin: 6px 0; }
.help-body ol { list-style: decimal; padding-left: 22px; }
.help-body img { border: 1px solid var(--line); border-radius: 6px; margin: 12px 0; max-height: 560px; width: auto; max-width: 100%; }
.help-lede { font-size: 19px; color: var(--graphite); margin-bottom: 6px; }
.help-body ol.help-steps { list-style: none; padding: 0; counter-reset: step; }
.help-steps > li { counter-increment: step; position: relative; padding: 2px 0 2px 46px; margin: 14px 0; min-height: 32px; }
.help-steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; font: 700 16px/32px var(--font); text-align: center; }
.help-shot { margin: 18px 0; }
.help-shot img { display: block; margin: 0; box-shadow: 0 4px 16px rgba(21, 25, 30, .08); }
.help-shot-phone img { max-width: 320px; }
.help-shot figcaption { font-size: 15px; color: var(--slate); margin-top: 6px; }
.help-tip, .help-warn { border-radius: 6px; padding: 12px 16px; margin: 16px 0; font-size: 16px; }
.help-tip { background: #EEF3FB; border-left: 4px solid var(--focus); }
.help-warn { background: #FDF5E6; border-left: 4px solid var(--kerb); }
.help-tip > strong:first-child, .help-warn > strong:first-child { display: block; margin-bottom: 2px; }
.help-terms dt { font-weight: 700; margin-top: 10px; }
.help-terms dd { margin: 2px 0 0; color: var(--graphite); }
.help-related { margin-top: 34px; padding-top: 6px; border-top: 1px solid var(--line); }
.help-related ul { list-style: none; padding: 0; }

/* Help centre */
.help-hero { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 22px; margin-bottom: 22px; }
.help-hero h1 { margin-bottom: 6px; }
.help-hero .row { flex-wrap: wrap; margin-top: 14px; }
.help-search { width: 100%; font-size: 18px; min-height: 52px; }
.help-group { margin-bottom: 22px; }
.help-group h2 { margin-bottom: 10px; }
.help-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.help-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; color: var(--ink); }
.help-card:hover { text-decoration: none; border-color: var(--graphite); }
.help-card strong { display: block; font-size: 17px; }
.help-card span { display: block; color: var(--slate); font-size: 15px; margin-top: 3px; }
.help-none { color: var(--slate); }

/* Explainer videos */
.video-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.video-card { display: flex; flex-direction: column; gap: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px 8px 12px; color: var(--ink); }
.video-card:hover { text-decoration: none; border-color: var(--graphite); }
.video-card strong { font-size: 16px; padding: 6px 6px 0; }
.video-card > span:last-child { color: var(--slate); font-size: 14px; padding: 0 6px; }
.video-card.is-big { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-content: center; column-gap: 18px; }
.video-card.is-big .video-thumb { grid-row: 1 / span 2; }
.video-card.is-big strong { font-size: 22px; align-self: end; }
.video-card.is-big > span:last-child { font-size: 16px; align-self: start; }
.video-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 4px; overflow: hidden; background: var(--ink); }
.video-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.video-play { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: rgba(21, 25, 30, .78); }
.video-play::after { content: ""; position: absolute; left: 17px; top: 13px; border-style: solid; border-width: 9px 0 9px 14px; border-color: transparent transparent transparent #fff; }
.video-len { position: absolute; right: 6px; bottom: 6px; background: rgba(21, 25, 30, .82); color: #fff; font-size: 12px; font-weight: 500; padding: 2px 6px; border-radius: 3px; }
.video-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; margin-bottom: 28px; }
.video-player { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 6px; }
.video-summary { color: var(--graphite); margin-top: 10px; }
.video-chapter-list { list-style: none; margin: 0; padding: 4px 0; }
.video-chapter-list button { display: flex; gap: 12px; width: 100%; text-align: left; background: none; border: 0; padding: 9px 20px; font: inherit; color: var(--ink); cursor: pointer; }
.video-chapter-list button:hover, .video-chapter-list button.is-on { background: var(--sunk); }
.video-chapter-list button.is-on { box-shadow: inset 3px 0 0 var(--kerb); }
.video-at { color: var(--slate); min-width: 38px; }
.help-video { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 6px; padding: 8px; margin-bottom: 14px; color: var(--ink); }
.help-video:hover { text-decoration: none; border-color: var(--graphite); }
.help-video .video-thumb { width: 132px; flex: none; }
.help-video .video-play { width: 32px; height: 32px; margin: -16px 0 0 -16px; }
.help-video .video-play::after { left: 12px; top: 9px; border-width: 7px 0 7px 11px; }

/* The Help button and panel, on every screen */
.help-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--surface); border-left: 1px solid var(--line-strong); box-shadow: -8px 0 28px rgba(21, 25, 30, .14); z-index: 70; display: flex; flex-direction: column; }
.help-panel[hidden] { display: none; }
.help-panel:focus { outline: none; }
.help-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--line); }
.help-panel-head h2 { font-size: 19px; display: flex; align-items: center; gap: 8px; }
.help-panel-body { padding: 18px 20px 28px; overflow-y: auto; font-size: 16px; }
.help-panel-body h3 { margin: 22px 0 8px; font-size: 16px; color: var(--graphite); text-transform: uppercase; letter-spacing: .04em; font-size: 13px; }
.help-panel-intro { font-size: 17px; margin-bottom: 14px; }
.help-qs details { border: 1px solid var(--line); border-radius: 6px; margin-bottom: 8px; background: #FDFCFA; }
.help-qs summary { cursor: pointer; padding: 11px 14px; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.help-qs summary::-webkit-details-marker { display: none; }
.help-qs summary::after { content: "+"; color: var(--slate); font-weight: 400; }
.help-qs details[open] summary::after { content: "–"; }
.help-qs details > p, .help-qs details > ol { padding: 0 14px 12px; margin: 0; }
.help-qs ol { list-style: decimal; padding-left: 34px !important; }
.help-qs ol li { margin: 4px 0; }
.help-links { list-style: none; padding: 0; }
.help-links a { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.help-person { margin-top: 20px; background: var(--sunk); border-radius: 6px; padding: 12px 14px; }

/* Guided tour */
.tour-shade { position: fixed; inset: 0; z-index: 80; background: transparent; }
.tour-shade.dim { background: rgba(21, 25, 30, .55); }
.tour-shade[hidden], .tour-ring[hidden], .tour-card[hidden] { display: none; }
.tour-ring { position: fixed; z-index: 81; border-radius: 8px; box-shadow: 0 0 0 4px var(--kerb), 0 0 0 9999px rgba(21, 25, 30, .55); pointer-events: none; transition: left .2s, top .2s, width .2s, height .2s; }
.tour-card { position: fixed; z-index: 82; width: min(380px, calc(100vw - 24px)); background: var(--surface); border-radius: 10px; padding: 18px 20px 16px; box-shadow: 0 14px 40px rgba(21, 25, 30, .3); }
.tour-card.center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); }
.tour-card.dock-bottom { left: 12px !important; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); top: auto !important; width: auto; }
.tour-card.dock-top { left: 12px !important; right: 12px; top: 12px !important; width: auto; }
.tour-card h2 { font-size: 20px; margin: 2px 0 6px; }
.tour-text { font-size: 16px; line-height: 1.5; }
.tour-count { font-size: 13px; color: var(--slate); }
.tour-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.tour-actions .tour-skip { margin-right: auto; color: var(--slate); }
@media (prefers-reduced-motion: reduce) { .tour-ring { transition: none; } }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches div { width: 120px; font-size: 13px; }
.swatches i { display: block; height: 52px; border-radius: 4px; border: 1px solid var(--line); margin-bottom: 4px; }
.t-ink { background: var(--ink); } .t-graphite { background: var(--graphite); } .t-slate { background: var(--slate); } .t-line { background: var(--line); }
.t-paper { background: var(--paper); } .t-surface { background: var(--surface); } .t-kerb { background: var(--kerb); } .t-signal { background: var(--signal); }
.t-focus { background: var(--focus); } .t-done { background: var(--done); } .t-active { background: var(--active); } .t-requested { background: var(--requested); } .t-problem { background: var(--problem); }

/* Auth pages */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 16px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-brand { display: block; margin-bottom: 26px; }
.auth-brand img { height: 36px; width: auto; }
.auth h1 { font-size: 24px; margin-bottom: 18px; }
.auth-foot { margin-top: 14px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--slate); margin: 22px 0; font-size: 14px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line-strong); }
.btn-google { background: #fff; border: 1px solid #747775; color: #1F1F1F; font-weight: 500; }
.btn-google:hover { background: #F7F8F8; }
.btn-ms { background: #fff; border: 1px solid #8C8C8C; color: #5E5E5E; font-weight: 500; margin-top: 10px; }
.btn-ms:hover { background: #F3F3F3; }
.btn-google img, .btn-ms img { width: 20px; height: 20px; }

/* Phone */
@media (max-width: 1099px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .book-grid, .grid-aside { grid-template-columns: minmax(0, 1fr); }
  .book-side { position: static; }
  /* On a narrow screen what needs doing comes before the day's trips. */
  .today-grid > aside { order: -1; }
}
@media (max-width: 599px) {
  .item-main { flex-wrap: wrap; }
  .item-main .input.grow { order: -1; flex: 1 1 100%; }
  .item-main [data-remove-item] { margin-left: auto; }
}
@media (max-width: 899px) {
  :root { --topbar: 56px; }
  .sidebar { display: none; }
  .main { margin-left: 0; padding-bottom: calc(var(--bottombar) + env(safe-area-inset-bottom)); }
  .topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar); display: flex; align-items: center; gap: 10px; background: var(--ink); padding: 0 6px 0 16px; }
  .topbar .phone-brand img { height: 22px; width: auto; }
  .topbar .icon-btn { color: #D9DCE1; }
  .topbar .icon-btn:hover { background: #262D35; color: #fff; }
  .help-cards { grid-template-columns: minmax(0, 1fr); }
  .video-cards { grid-template-columns: minmax(0, 1fr); }
  .video-card.is-big { display: flex; }
  .video-layout { grid-template-columns: minmax(0, 1fr); }
  .help-panel { width: 100vw; border-left: 0; }
  .content { padding: 18px 16px 32px; }
  h1 { font-size: 22px; }
  .page-head { margin-bottom: 16px; }
  .bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    background: var(--surface); border-top: 1px solid var(--line-strong); padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--bottombar); color: var(--graphite); font-size: 13px; font-weight: 500; position: relative; }
  .bottom-nav a .i { width: 23px; height: 23px; }
  .bottom-nav a:hover { text-decoration: none; }
  .bottom-nav a[aria-current="page"] { color: var(--ink); font-weight: 700; }
  .bottom-nav a[aria-current="page"]::before { content: ""; position: absolute; top: -1px; left: 22%; right: 22%; height: 3px; background: var(--kerb); }
  .fab { position: fixed; right: 16px; bottom: calc(var(--bottombar) + 16px + env(safe-area-inset-bottom)); z-index: 25; width: 56px; height: 56px; border-radius: 8px; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(21, 25, 30, .3); }
  .fab .i { width: 26px; height: 26px; }
  .toasts { left: 16px; right: 16px; bottom: calc(var(--bottombar) + 12px + env(safe-area-inset-bottom)); max-width: none; }
  .grid-2, .grid-3, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .kv dt { font-size: 14px; margin-top: 8px; }
  .cal-desktop { display: none; }
  .cal-phone { display: block; }
  .card-pad, .card-body { padding: 16px; }
  .card-head { padding: 12px 16px; }
  .book-section { padding: 16px; }
  .rows a, .rows summary, .rows-static { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 16px; }
  .rows-v { grid-column: 1; grid-row: 2; }
  .rows a > .i, .rows summary > .i { grid-column: 2; grid-row: 1 / span 2; }
  .rows-body { padding: 4px 16px 16px; }
  .card-foot { padding: 12px 16px; }
  .card-foot.row { flex-wrap: wrap; }
  .card-foot.row .input { flex: 1 1 100%; }
  .inv { padding: 18px 14px; }
  .inv-lines .hide-phone { display: none; }
  .day-strip button { min-height: 62px; }
  /* Tables become two-line cards */
  .table.cards thead { display: none; }
  .table.cards, .table.cards tbody, .table.cards tr, .table.cards td { display: block; width: 100%; }
  .table.cards { background: none; }
  .table.cards tr { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; }
  .table.cards td { padding: 0; border: 0; background: none !important; }
  .table.cards td.c-hide { display: none; }
  .table.cards td.c-full { grid-column: 1 / -1; }
  .table.cards td.num { text-align: right; }
  .table.cards td.c-status { grid-column: 2; grid-row: 1; text-align: right; }
  .card.flush-phone { border: 0; background: none; }
  .filters .input { flex: 1 1 140px; min-height: 44px; }
  .btn-sm { min-height: 44px; }
  .cal-nav a, .view-switch a { height: 44px; min-width: 44px; }
  .check { min-height: 44px; align-items: center; }
  .check input { margin-top: 0; }
  .link-btn { min-height: 44px; }
  .hide-phone { display: none !important; }
}
@media (min-width: 1100px) {
  /* A sticky header needs the page as its scroller, not the table's own wrapper. */
  .table-wrap:has(> table > thead.sticky) { overflow: visible; }
  .table thead.sticky th { position: sticky; top: var(--topbar); z-index: 5; }
}
@media (min-width: 900px) {
  .show-phone { display: none !important; }
  .fab { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .icon-btn, .nav-list a { transition: background-color .12s ease, border-color .12s ease; }
}
@media print {
  .sidebar, .topbar, .bottom-nav, .toasts, .no-print { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; }
  body { background: #fff; }
  .inv { border: 0; padding: 0; }
}

/* Administrator view-as */
.view-as-banner { position: sticky; top: 0; z-index: 60; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 8px 16px; background: var(--kerb); color: var(--ink); font-size: 14px; }
.view-as-banner form { margin: 0; }
.view-as-banner button { font: inherit; font-weight: 600; background: var(--ink); color: #fff; border: 0; border-radius: 6px; padding: 4px 12px; cursor: pointer; }
.menu-panel .view-as { display: grid; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line, #e3e3e3); }
.menu-panel .view-as .btn { width: 100%; }

/* What was recorded at a stop: the signed note, photos and signature, big enough to read */
.evidence { display: grid; gap: 10px; margin: 10px 0 4px; }
.ev-page { display: block; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; background: #fff; max-width: 560px; }
.ev-page img { display: block; width: 100%; height: auto; }
.ev-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-width: 640px; }
.ev-photos a { display: block; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; background: var(--sunk); }
.ev-photos img { display: block; width: 100%; height: 180px; object-fit: contain; }
.ev-sig { margin: 0; max-width: 320px; background: #fff; border: 1px solid var(--line); border-radius: 3px; padding: 6px 10px; color: #15191E; }
.ev-sig img { display: block; width: 100%; height: auto; max-height: 120px; object-fit: contain; }
.ev-sig figcaption { font-size: 14px; border-top: 1px solid #E2DFD8; padding-top: 4px; }

/* A customer's delivery note with its boxes, on the job page and in the booking form */
.nf-page { position: relative; border: 1px solid var(--line); background: #fff; margin-top: 6px; max-width: 560px; touch-action: none; user-select: none; -webkit-user-select: none; }
.nf-page img { display: block; width: 100%; height: auto; pointer-events: none; }
.nf-box { position: absolute; display: flex; align-items: center; justify-content: center; font: 600 12px/1 var(--font); color: #14215A; background: rgba(255, 214, 0, .28); border: 1.5px dashed #14215A; border-radius: 2px; overflow: hidden; white-space: nowrap; }
.nf-box.is-signature { background: rgba(80, 140, 255, .18); }
.nf-edit .nf-box { cursor: move; }
.nf-edit .nf-box.is-on { border-style: solid; box-shadow: 0 0 0 2px var(--focus); }
.nf-box .nf-size { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 50%, #14215A 50%); }
.nf-box .nf-del { position: absolute; top: 0; right: 0; width: 22px; height: 22px; padding: 0; border: 0; background: #14215A; color: #fff; font: 700 14px/22px var(--font); cursor: pointer; }
.nf-box.is-fill { background: transparent; border-color: transparent; color: #14215A; font-weight: 500; }
.nf-box.is-fill img { width: 100%; height: 100%; object-fit: contain; }
.nf-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nf-doc { border-top: 1px solid var(--line); padding-top: 10px; }
.nf-box .nf-del, .nf-box .nf-size { display: none; }
.nf-box.is-on .nf-del, .nf-box.is-on .nf-size { display: block; }
.nf-file { position: relative; overflow: hidden; }
.nf-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.stop-row form .link-btn { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; }
