/* HauLink theme: "Safety yellow", redesign round 2 (docs/design/redesign).
   Tokens first; pages use the shared classes below and never set their own spacing. */
:root {
  --hl-ink: #16181A;
  --hl-yellow: #F2B705;
  --hl-yellow-dark: #C99600;
  --hl-yellow-soft: #FCEFC2;
  --hl-warn-text: #6B4F00;
  --hl-ground: #F4F3EF;
  --hl-ground-soft: #F8F7F4;
  --hl-card: #FFFFFF;
  --hl-line: #D9D6CE;
  --hl-line-soft: #E7E4DD;
  --hl-input-border: #B9B5AC;
  --hl-muted: #55595E;
  --hl-good: #1C7C45;
  --hl-good-text: #14633A;
  --hl-good-soft: #DDF0E3;
  --hl-problem: #B3261E;
  --hl-problem-soft: #F8E1DF;
  --hl-info: #1F5FA8;
  --hl-info-soft: #E1ECF8;
  --hl-topbar: #16181A;
  --hl-topbar-text: #E4E2DC;
  --hl-topbar-hover: #2A2D31;
  --hl-shadow: 0 8px 24px rgba(22, 24, 26, 0.18);

  --hl-font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hl-font-condensed: "Barlow Condensed", "Barlow", system-ui, sans-serif;

  /* Density and spacing */
  --hl-text-size: 0.9375rem;      /* 15px */
  --hl-title-size: 1.625rem;      /* 26px */
  --hl-control-h: 40px;
  --hl-radius-control: 8px;
  --hl-radius-card: 12px;
  --hl-card-pad: 16px;
  --hl-gap: 16px;
  --hl-gap-sm: 12px;
  --hl-page-max: 1440px;
  --hl-page-pad: 24px;
  --hl-topbar-h: 60px;
  --hl-savebar-h: 72px;

  /* Bootstrap stays, coloured and sized with our variables. */
  --bs-body-font-family: var(--hl-font);
  --bs-body-font-size: var(--hl-text-size);
  --bs-body-color: var(--hl-ink);
  --bs-body-bg: var(--hl-ground);
  --bs-emphasis-color: var(--hl-ink);
  --bs-secondary-color: var(--hl-muted);
  --bs-border-color: var(--hl-line);
  --bs-border-radius: var(--hl-radius-control);
  --bs-link-color: var(--hl-info);
  --bs-link-color-rgb: 31, 95, 168;
  --bs-link-hover-color: var(--hl-ink);
  --bs-link-hover-color-rgb: 22, 24, 26;
  --bs-heading-color: var(--hl-ink);
}

/* Touch screens get 44px controls. */
@media (pointer: coarse) {
  :root {
    --hl-control-h: 44px;
  }
}

@media (max-width: 899.98px) {
  :root {
    --hl-page-pad: 16px;
  }
}

html {
  font-size: 16px;
}

body {
  font-family: var(--hl-font);
  font-size: var(--hl-text-size);
  color: var(--hl-ink);
  background: var(--hl-ground);
}

:focus-visible {
  outline: 3px solid var(--hl-info);
  outline-offset: 2px;
}

.hl-skip {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 2000;
  padding: 8px 12px;
  border-radius: var(--hl-radius-control);
  background: var(--hl-yellow);
  color: var(--hl-ink);
  font-weight: 600;
}

.hl-skip:focus {
  left: 16px;
}

.hl-number {
  font-family: var(--hl-font-condensed);
  font-weight: 700;
}

.hl-icon {
  flex: none;
  width: 20px;
  height: 20px;
}

.hl-nowrap {
  white-space: nowrap;
}

.hl-muted {
  color: var(--hl-muted);
}

/* Logo */
.hl-logo {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 10px;
  color: var(--hl-card);
  text-decoration: none;
}

.hl-logo:hover {
  color: var(--hl-card);
}

.hl-logo-mark {
  position: relative;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--hl-yellow);
}

.hl-logo-mark::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 7px;
  height: 5px;
  border-radius: 2px;
  background: var(--hl-ink);
}

.hl-logo-text {
  font-family: var(--hl-font-condensed);
  font-weight: 700;
  font-size: 1.625rem;
  line-height: 1;
  letter-spacing: 0.01em;
}

/* Page frame: container, main area, full-screen pages */
.hl-container {
  width: 100%;
  max-width: var(--hl-page-max);
  margin: 0 auto;
  padding: 0 var(--hl-page-pad);
}

.hl-main {
  padding: var(--hl-gap) 0 48px;
}

body:has(.hl-savebar) .hl-main {
  padding-bottom: calc(var(--hl-savebar-h) + 32px);
}

.hl-fill-screen .hl-container {
  max-width: none;
}

/* Dispatch fills the window: the board scrolls inside its own area. */
@media (min-width: 900px) {
  .hl-fill-screen {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
  }

  .hl-fill-screen .hl-topbar,
  .hl-fill-screen .hl-pagehead,
  .hl-fill-screen .hl-acting-wrap {
    flex: none;
  }

  .hl-fill-screen .hl-main {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    padding: var(--hl-gap) 0;
  }

  .hl-fill-screen .hl-main > .hl-container {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }
}

/* Top menu bar: charcoal, 60px, fixed at the top on every screen. */
.hl-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--hl-topbar-h);
  background: var(--hl-topbar);
  color: var(--hl-topbar-text);
}

.hl-topbar :focus-visible {
  outline-color: var(--hl-yellow);
  outline-offset: -3px;
}

.hl-topbar-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
  padding: 0 var(--hl-page-pad);
}

.hl-menu {
  display: flex;
  flex: 1 1 auto;
  align-items: stretch;
  min-width: 0;
  height: 100%;
}

.hl-menu-top,
.hl-menu-button {
  display: none;
}

.hl-menu-list {
  display: flex;
  align-items: stretch;
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hl-menu-item {
  position: relative;
  display: flex;
}

.hl-menu-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 100%;
  padding: 0 14px;
  border: 0;
  background: none;
  color: var(--hl-topbar-text);
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.hl-menu-link:hover,
.hl-menu-link[aria-expanded="true"] {
  background: var(--hl-topbar-hover);
  color: var(--hl-card);
}

.hl-menu-link .hl-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.15s ease;
}

.hl-menu-link[aria-expanded="true"] .hl-icon {
  transform: rotate(180deg);
}

/* The current section: white, bold, 3px yellow underline. */
.hl-current > .hl-menu-link {
  color: var(--hl-card);
  font-weight: 700;
  box-shadow: inset 0 -3px 0 var(--hl-yellow);
}

.hl-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1040;
  min-width: 240px;
  margin: 0;
  padding: 8px;
  list-style: none;
  border: 1px solid var(--hl-line);
  border-radius: var(--hl-radius-card);
  background: var(--hl-card);
  box-shadow: var(--hl-shadow);
}

.hl-dropdown-end {
  left: auto;
  right: 0;
}

.hl-dropdown form {
  margin: 0;
}

.hl-dropdown a,
.hl-dropdown button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: var(--hl-control-h);
  padding: 0 12px;
  border: 0;
  border-radius: var(--hl-radius-control);
  background: none;
  color: var(--hl-ink);
  font: inherit;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
}

.hl-dropdown a:hover,
.hl-dropdown button:hover,
.hl-dropdown a[aria-current="page"] {
  background: var(--hl-ground);
}

.hl-dropdown a[aria-current="page"] {
  font-weight: 700;
}

.hl-dropdown :focus-visible {
  outline-color: var(--hl-info);
}

.hl-menu-user {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: auto;
}

.hl-user-button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 4px 0 12px;
  border: 0;
  border-radius: 24px;
  background: none;
  color: inherit;
  text-align: right;
}

.hl-user-button:hover,
.hl-user-button[aria-expanded="true"] {
  background: var(--hl-topbar-hover);
}

.hl-user-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.hl-user-company {
  color: var(--hl-card);
  font-weight: 700;
}

.hl-user-role {
  font-size: 0.8125rem;
}

.hl-user-avatar {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--hl-yellow);
  color: var(--hl-ink);
  font-weight: 700;
}

.hl-menu-signin {
  margin-left: auto;
}

/* Narrow desktops: tighter links, and a long company name is cut short. */
@media (min-width: 900px) and (max-width: 1199.98px) {
  .hl-topbar-inner {
    gap: 12px;
  }

  .hl-menu-link {
    padding: 0 9px;
    font-size: 1rem;
  }

  .hl-user-company {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Under 900px: a menu button opens the menu full screen; dropdowns open inline. */
@media (max-width: 899.98px) {
  .hl-menu-button,
  .hl-menu-close {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--hl-radius-control);
    background: none;
    color: var(--hl-card);
  }

  .hl-menu-button {
    margin-left: auto;
  }

  .hl-menu-button:hover,
  .hl-menu-close:hover {
    background: var(--hl-topbar-hover);
  }

  .hl-menu-button .hl-icon,
  .hl-menu-close .hl-icon {
    width: 24px;
    height: 24px;
  }

  .hl-menu {
    display: none;
  }

  html[data-menu-open] body {
    overflow: hidden;
  }

  html[data-menu-open] .hl-menu {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    height: auto;
    padding: 0 var(--hl-page-pad) 24px;
    overflow-y: auto;
    background: var(--hl-topbar);
  }

  .hl-menu-top {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: space-between;
    height: var(--hl-topbar-h);
  }

  .hl-menu-title {
    color: var(--hl-card);
    font-size: 1.125rem;
    font-weight: 700;
  }

  .hl-menu-list {
    flex-direction: column;
    height: auto;
  }

  .hl-menu-item {
    flex-direction: column;
  }

  .hl-menu-link {
    justify-content: space-between;
    width: 100%;
    min-height: 48px;
    padding: 0 12px;
    border-radius: var(--hl-radius-control);
  }

  .hl-current > .hl-menu-link {
    box-shadow: inset 3px 0 0 var(--hl-yellow);
  }

  .hl-dropdown {
    position: static;
    min-width: 0;
    padding: 0 0 8px 12px;
    border: 0;
    background: none;
    box-shadow: none;
  }

  .hl-dropdown a,
  .hl-dropdown button {
    min-height: 44px;
    color: var(--hl-topbar-text);
  }

  .hl-dropdown a:hover,
  .hl-dropdown button:hover,
  .hl-dropdown a[aria-current="page"] {
    background: var(--hl-topbar-hover);
    color: var(--hl-card);
  }

  .hl-dropdown :focus-visible {
    outline-color: var(--hl-yellow);
  }

  .hl-menu-user {
    flex-direction: column;
    align-items: stretch;
    margin: 16px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--hl-topbar-hover);
  }

  .hl-user-button {
    flex-direction: row-reverse;
    justify-content: flex-end;
    padding: 8px 12px;
    border-radius: var(--hl-radius-control);
    text-align: left;
  }

  .hl-menu-signin {
    margin: 16px 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hl-menu-link .hl-icon {
    transition: none;
  }
}

/* Acting as a company (SoftLinks staff) */
.hl-acting-wrap {
  border-bottom: 1px solid var(--hl-yellow-dark);
  background: var(--hl-yellow-soft);
}

.hl-acting {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.hl-acting form {
  margin: 0;
}

/* Standard page header: white band under the menu; fixed while scrolling from 900px up. */
.hl-pagehead {
  padding: 16px 0;
  border-bottom: 1px solid var(--hl-line);
  background: var(--hl-card);
}

@media (min-width: 900px) {
  .hl-pagehead {
    position: sticky;
    top: var(--hl-topbar-h);
    z-index: 1020;
  }
}

.hl-pagehead-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.hl-pagehead-text {
  min-width: 0;
}

.hl-back {
  display: inline-block;
  margin-bottom: 2px;
  color: var(--hl-muted);
  font-weight: 500;
}

.hl-back:hover {
  color: var(--hl-ink);
}

.hl-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
}

.hl-page-title {
  margin: 0;
  font-size: var(--hl-title-size);
  font-weight: 700;
  line-height: 1.2;
}

.hl-page-summary {
  margin: 4px 0 0;
  color: var(--hl-muted);
}

.hl-page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--hl-gap-sm);
}

.hl-page-actions form {
  margin: 0;
}

/* Toolbar: one light grey rounded container; groups divided by thin vertical lines. */
.hl-toolbar {
  margin-top: var(--hl-gap-sm);
  padding: 8px;
  border: 1px solid var(--hl-line-soft);
  border-radius: var(--hl-radius-card);
  background: var(--hl-ground-soft);
}

.hl-toolbar form {
  margin: 0;
}

.hl-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.hl-toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.hl-toolbar-group + .hl-toolbar-group {
  padding-left: 12px;
  border-left: 1px solid var(--hl-line);
}

.hl-toolbar-search {
  flex: 1 1 260px;
}

.hl-toolbar-search .form-control {
  width: 100%;
}

.hl-toolbar-label {
  margin: 0;
  color: var(--hl-muted);
  font-weight: 500;
  white-space: nowrap;
}

.hl-toolbar .form-select {
  width: auto;
  min-width: 120px;
  max-width: 260px;
}

.hl-toolbar .form-check {
  min-height: var(--hl-control-h);
}

.hl-toolbar-end {
  margin-left: auto;
}

.hl-toolbar-text {
  margin: 0;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 899.98px) {
  .hl-toolbar-group {
    flex: 1 1 100%;
  }

  .hl-toolbar-group + .hl-toolbar-group {
    padding-left: 0;
    border-left: 0;
  }

  .hl-toolbar .form-select {
    flex: 1 1 0;
    max-width: none;
  }

  .hl-toolbar-end {
    margin-left: 0;
  }
}

/* Buttons: main action yellow, secondary outlined in ink, danger outlined in red */
.btn {
  --bs-btn-font-size: var(--hl-text-size);
  --bs-btn-font-weight: 600;
  --bs-btn-border-radius: var(--hl-radius-control);
  --bs-btn-padding-x: 16px;
  --bs-btn-padding-y: 0;
  --bs-btn-focus-box-shadow: 0 0 0 3px var(--hl-card), 0 0 0 5px var(--hl-info);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--hl-control-h);
  white-space: nowrap;
}

.btn-primary {
  --bs-btn-color: var(--hl-ink);
  --bs-btn-bg: var(--hl-yellow);
  --bs-btn-border-color: var(--hl-yellow);
  --bs-btn-hover-color: var(--hl-ink);
  --bs-btn-hover-bg: var(--hl-yellow-dark);
  --bs-btn-hover-border-color: var(--hl-yellow-dark);
  --bs-btn-active-color: var(--hl-ink);
  --bs-btn-active-bg: var(--hl-yellow-dark);
  --bs-btn-active-border-color: var(--hl-yellow-dark);
  --bs-btn-disabled-color: var(--hl-ink);
  --bs-btn-disabled-bg: var(--hl-yellow-soft);
  --bs-btn-disabled-border-color: var(--hl-yellow-soft);
}

.btn-secondary {
  --bs-btn-color: var(--hl-ink);
  --bs-btn-bg: var(--hl-card);
  --bs-btn-border-color: var(--hl-ink);
  --bs-btn-hover-color: var(--hl-card);
  --bs-btn-hover-bg: var(--hl-ink);
  --bs-btn-hover-border-color: var(--hl-ink);
  --bs-btn-active-color: var(--hl-card);
  --bs-btn-active-bg: var(--hl-ink);
  --bs-btn-active-border-color: var(--hl-ink);
  --bs-btn-disabled-color: var(--hl-muted);
  --bs-btn-disabled-bg: var(--hl-card);
  --bs-btn-disabled-border-color: var(--hl-line);
}

.btn-danger {
  --bs-btn-color: var(--hl-problem);
  --bs-btn-bg: var(--hl-card);
  --bs-btn-border-color: var(--hl-problem);
  --bs-btn-hover-color: var(--hl-problem);
  --bs-btn-hover-bg: var(--hl-problem-soft);
  --bs-btn-hover-border-color: var(--hl-problem);
  --bs-btn-active-color: var(--hl-problem);
  --bs-btn-active-bg: var(--hl-problem-soft);
  --bs-btn-active-border-color: var(--hl-problem);
}

.hl-btn-ink {
  --bs-btn-color: var(--hl-card);
  --bs-btn-bg: var(--hl-ink);
  --bs-btn-border-color: var(--hl-ink);
  --bs-btn-hover-color: var(--hl-card);
  --bs-btn-hover-bg: var(--hl-topbar-hover);
  --bs-btn-hover-border-color: var(--hl-topbar-hover);
}

.btn-sm {
  --bs-btn-padding-x: 12px;
  min-height: 32px;
}

.hl-icon-button {
  width: var(--hl-control-h);
  padding: 0;
}

.btn-link {
  --bs-btn-padding-x: 4px;
  --bs-btn-color: var(--hl-info);
  font-weight: 600;
}

/* Forms */
.hl-field {
  margin-bottom: var(--hl-gap-sm);
}

.form-label {
  font-weight: 600;
  margin-bottom: 4px;
}

.form-control,
.form-select {
  min-height: var(--hl-control-h);
  padding-top: 6px;
  padding-bottom: 6px;
  border: 1px solid var(--hl-input-border);
  border-radius: var(--hl-radius-control);
  color: var(--hl-ink);
  background-color: var(--hl-card);
  font-size: var(--hl-text-size);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--hl-ink);
  box-shadow: 0 0 0 3px var(--hl-yellow);
}

.form-control[readonly],
.form-control:disabled,
.form-select:disabled {
  background-color: var(--hl-ground);
  color: var(--hl-muted);
}

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--hl-control-h);
  padding-left: 0;
  margin-bottom: 0;
}

.form-check .form-check-input {
  float: none;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
}

/* Radios and checkboxes need a 3:1 border against white, so they use the muted colour. */
.form-check-input {
  border: 1px solid var(--hl-muted);
}

.form-check-input:checked {
  background-color: var(--hl-ink);
  border-color: var(--hl-ink);
}

.form-check-input:focus {
  border-color: var(--hl-ink);
  box-shadow: 0 0 0 3px var(--hl-yellow);
}

legend.form-label {
  font-size: var(--hl-text-size);
}

.hl-hint {
  margin: 4px 0 0;
  color: var(--hl-muted);
  font-size: 0.875rem;
}

.field-validation-error {
  display: block;
  margin-top: 4px;
  color: var(--hl-problem);
  font-weight: 500;
}

.input-validation-error {
  border-color: var(--hl-problem);
}

.validation-summary-valid {
  display: none;
}

.validation-summary-errors ul {
  margin: 0;
  padding-left: 1.25rem;
}

.hl-password,
.hl-copy {
  display: flex;
  gap: 8px;
}

.hl-password .form-control,
.hl-copy .form-control {
  flex: 1;
  min-width: 0;
}

.hl-password .btn {
  flex: none;
  min-width: 76px;
}

fieldset.hl-group {
  min-width: 0;
  margin: 0 0 var(--hl-gap-sm);
  padding: 0;
  border: 0;
}

fieldset.hl-stack {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.hl-subhead {
  display: block;
  margin-bottom: 4px;
  font-size: var(--hl-text-size);
  font-weight: 600;
}

.hl-indent {
  padding-left: 30px;
}

.hl-input-affix {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--hl-muted);
}

.hl-input-short {
  width: 120px;
  max-width: 100%;
}

/* Field grids of 2 to 4 columns */
.hl-grid {
  display: grid;
  gap: var(--hl-gap-sm) var(--hl-gap);
}

.hl-grid > .hl-field,
.hl-grid > fieldset.hl-group {
  margin-bottom: 0;
}

.hl-grid + .hl-grid,
.hl-grid + .hl-field,
.hl-field + .hl-grid {
  margin-top: var(--hl-gap-sm);
}

.hl-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hl-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hl-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hl-span-all {
  grid-column: 1 / -1;
}

.hl-span-2 {
  grid-column: span 2;
}

@media (max-width: 991.98px) {
  .hl-grid-3,
  .hl-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .hl-grid-2,
  .hl-grid-3,
  .hl-grid-4 {
    grid-template-columns: minmax(0, 1fr);
  }

  .hl-span-2 {
    grid-column: auto;
  }
}

/* Form pages: form on the left, summary on the right; one column under 1100px. */
.hl-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
  gap: var(--hl-gap);
  align-items: start;
}

.hl-form-layout > * {
  min-width: 0;
}

@media (max-width: 1099.98px) {
  .hl-form-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Two columns of equal weight, such as a form and a documents card. */
.hl-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: var(--hl-gap);
  align-items: start;
}

@media (max-width: 991.98px) {
  .hl-two-col {
    grid-template-columns: minmax(0, 1fr);
  }
}

.hl-stack {
  display: flex;
  flex-direction: column;
  gap: var(--hl-gap);
  min-width: 0;
}

/* Fixed save bar at the bottom of long forms */
.hl-savebar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1025;
  border-top: 1px solid var(--hl-line);
  background: var(--hl-card);
  box-shadow: 0 -4px 16px rgba(22, 24, 26, 0.06);
}

.hl-savebar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  min-height: var(--hl-savebar-h);
  padding-top: 12px;
  padding-bottom: 12px;
}

.hl-unsaved {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--hl-warn-text);
  font-weight: 600;
}

.hl-unsaved::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--hl-yellow);
}

.hl-savebar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--hl-gap-sm);
  margin-left: auto;
}

@media (max-width: 575.98px) {
  .hl-savebar-actions {
    width: 100%;
  }

  .hl-savebar-actions .btn {
    flex: 1 1 auto;
  }
}

/* Large option cards: a radio with a title and a hint; the chosen one is yellow with an ink border. */
.hl-option-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--hl-gap-sm);
}

.hl-option-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid var(--hl-line);
  border-radius: var(--hl-radius-control);
  background: var(--hl-card);
  cursor: pointer;
}

.hl-option-card .form-check-input {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
}

.hl-option-card:has(input:checked) {
  padding: 11px 15px;
  border: 2px solid var(--hl-ink);
  background: var(--hl-yellow-soft);
}

.hl-option-card:has(input:focus-visible) {
  outline: 3px solid var(--hl-info);
  outline-offset: 2px;
}

.hl-option-title {
  display: block;
  font-weight: 600;
}

.hl-option-hint {
  display: block;
  color: var(--hl-muted);
  font-size: 0.875rem;
}

/* Segmented control: radios or links shown as joined buttons; the chosen one is ink. */
.hl-segmented {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1px solid var(--hl-input-border);
  border-radius: var(--hl-radius-control);
  overflow: hidden;
  background: var(--hl-card);
}

.hl-segment-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.hl-segment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: calc(var(--hl-control-h) - 2px);
  padding: 0 14px;
  border: 0;
  border-right: 1px solid var(--hl-line);
  background: none;
  color: var(--hl-ink);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.hl-segment:last-child {
  border-right: 0;
}

.hl-segment-input:checked + .hl-segment,
.hl-segment[aria-current="page"] {
  background: var(--hl-ink);
  color: var(--hl-card);
  font-weight: 700;
}

.hl-segment-input:focus-visible + .hl-segment {
  outline: 3px solid var(--hl-info);
  outline-offset: -3px;
}

.hl-segment-input:disabled + .hl-segment,
.hl-segment[aria-disabled="true"] {
  cursor: default;
  color: var(--hl-muted);
}

.hl-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hl-good);
}

/* Cards */
.hl-card {
  padding: var(--hl-card-pad);
  border: 1px solid var(--hl-line);
  border-radius: var(--hl-radius-card);
  background: var(--hl-card);
}

.hl-card-flush {
  padding: 0;
  overflow: hidden;
}

.hl-card-flush > .hl-card-header {
  margin: 0;
  padding: var(--hl-card-pad);
}

.hl-section-title {
  margin: 0 0 var(--hl-gap-sm);
  font-size: 1.1875rem;
  font-weight: 700;
}

.hl-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px var(--hl-gap-sm);
  margin-bottom: var(--hl-gap-sm);
}

.hl-card-header .hl-section-title {
  margin: 0;
}

.hl-card-attention {
  border-color: var(--hl-yellow);
}

.hl-details {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 20px;
  margin: 0;
}

.hl-details dt {
  color: var(--hl-muted);
  font-weight: 500;
}

.hl-details dd {
  margin: 0;
  font-weight: 600;
}

.hl-details-card > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  min-height: var(--hl-control-h);
  cursor: pointer;
}

.hl-details-card > summary .hl-section-title {
  margin: 0;
}

.hl-coming-soon-label {
  margin-bottom: 4px;
  font-family: var(--hl-font-condensed);
  font-size: 1.5rem;
  font-weight: 700;
}

/* Notes and alerts */
.hl-note,
.hl-alert-good,
.hl-alert-problem,
.hl-alert-warn {
  margin-bottom: var(--hl-gap);
  padding: 12px 16px;
  border-left: 4px solid;
  border-radius: var(--hl-radius-control);
  font-size: var(--hl-text-size);
}

.hl-note {
  background: var(--hl-info-soft);
  border-left-color: var(--hl-info);
  color: var(--hl-ink);
}

.hl-alert-good {
  background: var(--hl-good-soft);
  border-left-color: var(--hl-good);
  color: var(--hl-good-text);
}

.hl-alert-problem {
  background: var(--hl-problem-soft);
  border-left-color: var(--hl-problem);
  color: var(--hl-ink);
}

.hl-alert-warn {
  background: var(--hl-yellow-soft);
  border-left-color: var(--hl-yellow-dark);
  color: var(--hl-ink);
}

/* Status chips */
.hl-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.hl-chip-good {
  background: var(--hl-good-soft);
  color: var(--hl-good-text);
}

.hl-chip-warn {
  background: var(--hl-yellow-soft);
  color: var(--hl-warn-text);
}

.hl-chip-problem {
  background: var(--hl-problem-soft);
  color: var(--hl-problem);
}

.hl-chip-info {
  background: var(--hl-info-soft);
  color: var(--hl-info);
}

.hl-chip-neutral {
  background: var(--hl-ground);
  color: var(--hl-muted);
}

.hl-chip-row {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.hl-text-good {
  color: var(--hl-good-text);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.hl-text-warn {
  color: var(--hl-warn-text);
  font-weight: 600;
}

.hl-text-problem {
  color: var(--hl-problem);
  font-weight: 600;
}

/* Tables and lists */
.table-responsive {
  /* Keeps visually hidden labels inside the scroll box, so wide tables never widen the page. */
  position: relative;
}

.hl-table {
  --bs-table-bg: var(--hl-card);
  --bs-table-color: var(--hl-ink);
  margin-bottom: 0;
}

.hl-table > :not(caption) > * > * {
  padding: 10px 16px;
  vertical-align: middle;
}

.hl-table thead th {
  background: var(--hl-ground-soft);
  color: var(--hl-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hl-table tbody tr:last-child > * {
  border-bottom: 0;
}

.hl-table th[scope="row"] {
  font-weight: 600;
}

.hl-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  text-decoration: none;
}

.hl-sort:hover,
th[aria-sort] .hl-sort {
  color: var(--hl-ink);
}

.hl-sort-arrow {
  width: 14px;
  height: 14px;
}

.hl-unit {
  color: var(--hl-ink);
  font-weight: 700;
}

.hl-row-sub > * {
  --bs-table-bg: color-mix(in srgb, var(--hl-yellow-soft) 40%, var(--hl-card));
}

.hl-row-inactive > * {
  color: var(--hl-muted);
}

.hl-sub-tag {
  margin-left: 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hl-empty {
  margin: 0;
  padding: var(--hl-card-pad);
  color: var(--hl-muted);
}

/* Pager: "Showing 1–25 of 132", page numbers, rows per page */
.hl-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--hl-gap-sm) var(--hl-gap);
  padding: var(--hl-gap-sm) var(--hl-card-pad);
  border-top: 1px solid var(--hl-line);
}

.hl-pager-count {
  margin: 0;
  color: var(--hl-muted);
}

.hl-pager-count strong {
  color: var(--hl-ink);
}

.hl-pager-pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hl-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--hl-control-h);
  height: var(--hl-control-h);
  padding: 0 8px;
  border: 1px solid var(--hl-line);
  border-radius: var(--hl-radius-control);
  background: var(--hl-card);
  color: var(--hl-ink);
  font-weight: 600;
  text-decoration: none;
}

.hl-page-link:hover {
  border-color: var(--hl-ink);
}

.hl-page-link[aria-current="page"] {
  border-color: var(--hl-ink);
  background: var(--hl-ink);
  color: var(--hl-card);
}

.hl-page-link[aria-disabled="true"] {
  color: var(--hl-line);
  pointer-events: none;
}

.hl-page-link .hl-icon {
  width: 18px;
  height: 18px;
}

.hl-page-gap {
  padding: 0 4px;
  color: var(--hl-muted);
}

.hl-pager-size {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.hl-pager-size .form-select {
  width: auto;
}

@media (max-width: 575.98px) {
  .hl-pager {
    justify-content: center;
  }
}

/* Tabs inside a toolbar */
.hl-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.hl-tab {
  display: inline-flex;
  align-items: center;
  min-height: var(--hl-control-h);
  padding: 0 14px;
  border-radius: var(--hl-radius-control);
  color: var(--hl-ink);
  font-weight: 500;
  text-decoration: none;
}

.hl-tab:hover {
  background: var(--hl-line-soft);
}

.hl-tab[aria-current="page"] {
  background: var(--hl-ink);
  color: var(--hl-card);
  font-weight: 700;
}

/* Sign-in pages: charcoal brand panel and a centred form; the columns stack on a phone. */
.hl-auth {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  min-height: 100vh;
  background: var(--hl-card);
}

.hl-auth-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: 48px;
  background: var(--hl-ink);
  color: var(--hl-topbar-text);
}

.hl-auth-heading {
  max-width: 16ch;
  margin: 0;
  color: var(--hl-card);
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1.15;
}

.hl-auth-credit {
  margin: 0;
  font-size: 0.875rem;
}

.hl-auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.hl-auth-form {
  width: 100%;
  max-width: 420px;
}

.hl-auth-title {
  margin-bottom: 12px;
  font-size: 2rem;
  font-weight: 700;
}

.hl-auth-lead {
  margin-bottom: 24px;
  color: var(--hl-muted);
}

.hl-auth-form form {
  margin-top: 24px;
}

.hl-auth-form .hl-field {
  margin-bottom: 20px;
}

.hl-form-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  margin-bottom: 20px;
}

.hl-auth-back {
  margin: 20px 0 0;
  text-align: center;
}

@media (max-width: 767.98px) {
  .hl-auth {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .hl-auth-brand {
    gap: 16px;
    padding: 24px 16px;
  }

  .hl-auth-heading {
    font-size: 1.5rem;
  }

  .hl-auth-main {
    align-items: flex-start;
    padding: 32px 16px;
  }
}

/* Users and invites */
.hl-invite-form {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto;
  gap: var(--hl-gap-sm) var(--hl-gap);
  align-items: end;
}

.hl-invite-form .hl-field {
  margin-bottom: 0;
}

@media (max-width: 767.98px) {
  .hl-invite-form {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Profile heading with initials */
.hl-profile-heading {
  display: flex;
  align-items: center;
  gap: var(--hl-gap);
}

.hl-avatar {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--hl-yellow-soft);
  color: var(--hl-ink);
  font-family: var(--hl-font-condensed);
  font-size: 1.25rem;
  font-weight: 700;
}

.hl-pin {
  font-family: var(--hl-font-condensed);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--hl-ink);
}

/* Documents card */
.hl-doc-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hl-doc-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--hl-gap-sm);
  padding: 12px 0;
  border-top: 1px solid var(--hl-line);
}

.hl-doc-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.hl-doc-name {
  margin: 0;
  font-weight: 600;
}

.hl-doc-meta {
  margin: 2px 0 0;
  color: var(--hl-muted);
  font-size: 0.875rem;
}

.hl-doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 4px 0 0;
  font-size: 0.875rem;
}

/* Today (today.png): four tiles, today's work, needs attention, the week strip */
.hl-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--hl-gap);
  margin-bottom: var(--hl-gap);
}

@media (max-width: 1099.98px) {
  .hl-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 479.98px) {
  .hl-tiles {
    grid-template-columns: minmax(0, 1fr);
  }
}

.hl-tile {
  padding: var(--hl-card-pad) 20px;
  border: 1px solid var(--hl-line);
  border-radius: var(--hl-radius-card);
  background: var(--hl-card);
}

.hl-tile-label {
  margin: 0;
  color: var(--hl-muted);
}

.hl-tile-value {
  margin: 6px 0 4px;
  font-family: var(--hl-font-condensed);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
}

.hl-tile-value small {
  font-size: 1.5rem;
}

.hl-tile-detail {
  margin: 0;
  color: var(--hl-muted);
}

.hl-tile-warn {
  border-color: var(--hl-yellow);
  background: color-mix(in srgb, var(--hl-yellow-soft) 30%, var(--hl-card));
}

.hl-tile-warn .hl-tile-label,
.hl-tile-warn .hl-tile-value {
  color: var(--hl-warn-text);
  font-weight: 600;
}

.hl-tile-problem {
  border-color: var(--hl-problem);
}

.hl-tile-problem .hl-tile-label,
.hl-tile-problem .hl-tile-value {
  color: var(--hl-problem);
  font-weight: 600;
}

.hl-today-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--hl-gap);
  align-items: start;
}

@media (max-width: 991.98px) {
  .hl-today-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.hl-attention {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hl-attention li {
  padding: 12px 0;
  border-top: 1px solid var(--hl-line);
}

.hl-attention li:first-child {
  border-top: 0;
  padding-top: 0;
}

.hl-attention-title {
  font-weight: 700;
  text-decoration: none;
}

.hl-attention-title:hover {
  text-decoration: underline;
}

.hl-attention-warn {
  color: var(--hl-warn-text);
}

.hl-attention-problem {
  color: var(--hl-problem);
}

.hl-attention-info {
  color: var(--hl-ink);
}

.hl-attention-detail {
  margin: 2px 0 0;
  color: var(--hl-muted);
}

.hl-week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
}

.hl-week-name {
  display: block;
  color: var(--hl-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
}

.hl-week-today .hl-week-name {
  color: var(--hl-ink);
}

.hl-need {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--hl-radius-control);
  font-weight: 700;
  white-space: nowrap;
}

.hl-week-strip .hl-need {
  display: flex;
  margin-top: 4px;
  padding: 6px 0;
  font-family: var(--hl-font-condensed);
  font-size: 1.125rem;
}

.hl-need-met {
  background: var(--hl-good-soft);
  color: var(--hl-good-text);
}

.hl-need-short {
  background: var(--hl-yellow-soft);
  color: var(--hl-warn-text);
}

.hl-need-over {
  background: var(--hl-problem-soft);
  color: var(--hl-problem);
}

.hl-need-none {
  background: var(--hl-ground);
  color: var(--hl-muted);
}

/* Parties, locations and jobs */
.hl-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0 var(--hl-gap);
}

.hl-check-aligned {
  align-self: end;
}

.hl-contact-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr) auto;
  gap: 0 var(--hl-gap-sm);
  align-items: end;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--hl-line);
  margin-bottom: var(--hl-gap-sm);
}

@media (max-width: 991.98px) {
  .hl-contact-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .hl-contact-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.hl-map {
  height: 360px;
  margin-bottom: var(--hl-gap-sm);
  border: 1px solid var(--hl-line);
  border-radius: var(--hl-radius-control);
}

.hl-rate-table {
  max-width: 640px;
}

.hl-rate-table th[scope="row"] {
  font-weight: 600;
}

.hl-history-header {
  margin-bottom: var(--hl-gap-sm);
}

/* Small badges on the board */
.hl-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hl-badge-problem {
  background: var(--hl-problem-soft);
  color: var(--hl-problem);
}

.hl-badge-warn {
  background: var(--hl-yellow-soft);
  color: var(--hl-warn-text);
}

.hl-badge-info {
  background: var(--hl-info-soft);
  color: var(--hl-info);
}

.hl-badge-neutral {
  background: var(--hl-ground);
  color: var(--hl-muted);
}

.hl-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 12px;
  background: var(--hl-ink);
  color: var(--hl-card);
  font-size: 0.8125rem;
  vertical-align: middle;
}

/* Dispatch board (dispatch.png): trucks-needed panel, week or day board, legend, right-click menu */
.hl-board-message {
  flex: none;
}

.hl-board-area {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: var(--hl-gap);
  align-items: start;
}

.hl-board-area[data-panel-collapsed] {
  grid-template-columns: 56px minmax(0, 1fr);
}

@media (min-width: 900px) {
  .hl-fill-screen .hl-board-area {
    flex: 1 1 auto;
    min-height: 0;
    align-items: stretch;
  }

  .hl-fill-screen .hl-board-wrap,
  .hl-fill-screen .hl-panel {
    max-height: 100%;
  }
}

@media (max-width: 899.98px) {
  .hl-board-area,
  .hl-board-area[data-panel-collapsed] {
    grid-template-columns: minmax(0, 1fr);
  }

  .hl-board-wrap {
    max-height: 75vh;
  }
}

.hl-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: var(--hl-card-pad);
  overflow: auto;
  border: 1px solid var(--hl-line);
  border-radius: var(--hl-radius-card);
  background: var(--hl-card);
}

.hl-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: var(--hl-gap-sm);
}

.hl-panel-head .hl-section-title {
  margin: 0;
}

.hl-board-area[data-panel-collapsed] .hl-panel {
  padding: 8px;
}

.hl-board-area[data-panel-collapsed] .hl-panel-head {
  justify-content: center;
}

.hl-board-area[data-panel-collapsed] .hl-panel-head .hl-section-title,
.hl-board-area[data-panel-collapsed] .hl-panel-body {
  display: none;
}

.hl-board-area[data-panel-collapsed] .hl-panel-toggle .hl-icon {
  transform: rotate(180deg);
}

.hl-job-card {
  margin-bottom: var(--hl-gap-sm);
  padding: 12px 14px;
  border: 1px solid var(--hl-line);
  border-left: 4px solid var(--hl-wo-edge, var(--hl-ink));
  border-radius: var(--hl-radius-control);
  background: color-mix(in srgb, var(--hl-wo-soft, var(--hl-card)) 45%, var(--hl-card));
}

.hl-job-card[draggable="true"] {
  cursor: grab;
}

.hl-job-selected {
  outline: 2px solid var(--hl-ink);
  outline-offset: 1px;
}

.hl-job-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.hl-job-card-title {
  color: var(--hl-ink);
  font-weight: 700;
  text-decoration: none;
}

.hl-job-card-title:hover {
  text-decoration: underline;
}

.hl-grip {
  color: var(--hl-muted);
}

.hl-grip .hl-icon {
  width: 16px;
  height: 16px;
}

.hl-job-card-meta {
  margin: 4px 0 8px;
  color: var(--hl-muted);
  font-size: 0.875rem;
}

.hl-need-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hl-need-chips .hl-need {
  padding: 3px 8px;
  font-size: 0.8125rem;
}

.hl-board-wrap {
  /* Positioned, so visually hidden labels stay inside the scroll box. */
  position: relative;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--hl-line);
  border-radius: var(--hl-radius-card);
  background: var(--hl-card);
}

.hl-board {
  width: 100%;
  min-width: 920px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.hl-board-day {
  min-width: 0;
}

.hl-col-truck {
  width: 200px;
}

.hl-board th,
.hl-board td {
  padding: 8px;
  border-bottom: 1px solid var(--hl-line);
  border-left: 1px solid var(--hl-line-soft);
  vertical-align: top;
}

/* The day headings and the truck column stay put while the board scrolls. */
.hl-board thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 10px 8px;
  background: var(--hl-card);
  color: var(--hl-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: left;
  white-space: nowrap;
}

.hl-board tbody th {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--hl-card);
  font-weight: 400;
  text-align: left;
}

.hl-board thead .hl-board-corner {
  left: 0;
  z-index: 4;
}

.hl-board thead .hl-today-col {
  background: var(--hl-yellow-soft);
  color: var(--hl-ink);
}

.hl-day-link {
  color: inherit;
  text-decoration: none;
}

.hl-day-link:hover {
  text-decoration: underline;
}

.hl-board .hl-group-row th {
  position: static;
  padding: 0;
  background: var(--hl-ground-soft);
}

.hl-group-toggle {
  position: sticky;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--hl-ink);
  font: inherit;
  font-weight: 700;
}

.hl-group-toggle .hl-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.15s ease;
}

.hl-group-toggle[aria-expanded="false"] .hl-icon {
  transform: rotate(-90deg);
}

.hl-group[data-collapsed] tr:not(.hl-group-row) {
  display: none;
}

.hl-board-sub > th,
.hl-board-sub > td {
  background: color-mix(in srgb, var(--hl-yellow-soft) 40%, var(--hl-card));
}

.hl-board-truck {
  display: block;
  font-weight: 700;
}

.hl-board-meta {
  display: block;
  color: var(--hl-muted);
  font-size: 0.875rem;
}

.hl-cell {
  position: relative;
  height: 96px;
}

.hl-board .hl-today-cell {
  background: color-mix(in srgb, var(--hl-yellow-soft) 30%, var(--hl-card));
}

.hl-cell-down,
.hl-board .hl-cell-down {
  background: repeating-linear-gradient(135deg, var(--hl-ground) 0 8px, var(--hl-line-soft) 8px 16px);
  vertical-align: middle;
}

.hl-down {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--hl-ink);
  font-weight: 600;
}

/* Work orders: coloured by customer with a strong left edge. */
.hl-wo {
  display: block;
  margin-bottom: 6px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-left: 4px solid var(--hl-wo-edge, var(--hl-ink));
  border-radius: 6px;
  background: var(--hl-wo-soft, var(--hl-ground));
  color: var(--hl-ink);
  text-decoration: none;
  overflow: hidden;
}

.hl-wo[draggable="true"] {
  cursor: grab;
}

.hl-wo:hover,
.hl-wo:focus-visible {
  border-color: var(--hl-ink);
}

.hl-wo-job {
  display: block;
  font-weight: 700;
  line-height: 1.2;
}

.hl-wo-meta {
  display: block;
  margin-top: 2px;
  font-size: 0.8125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hl-wo-card {
  display: inline-block;
  width: 260px;
  max-width: 100%;
  margin-right: 8px;
  padding: 10px 12px;
  vertical-align: top;
}

.hl-wo-card .hl-chip {
  margin-top: 6px;
}

.hl-wo-c0 {
  --hl-wo-edge: var(--hl-yellow);
  --hl-wo-soft: var(--hl-yellow-soft);
}

.hl-wo-c1 {
  --hl-wo-edge: var(--hl-info);
  --hl-wo-soft: var(--hl-info-soft);
}

.hl-wo-c2 {
  --hl-wo-edge: var(--hl-good);
  --hl-wo-soft: var(--hl-good-soft);
}

.hl-wo-c3 {
  --hl-wo-edge: var(--hl-muted);
  --hl-wo-soft: var(--hl-ground);
}

.hl-wo-waiting {
  border: 1px dashed var(--hl-ink);
  border-left: 4px solid var(--hl-wo-edge, var(--hl-ink));
  background: var(--hl-card);
}

.hl-wo-declined {
  opacity: 0.7;
  text-decoration: line-through;
}

/* "+" shows on hover or keyboard focus (always on touch screens). */
.hl-cell-add {
  position: absolute;
  right: 4px;
  bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-height: 24px;
  background: var(--hl-card);
  border: 1px dashed var(--hl-input-border);
  border-radius: 6px;
  color: var(--hl-muted);
  font-weight: 700;
  text-decoration: none;
  opacity: 0;
}

.hl-cell:hover .hl-cell-add,
.hl-cell-add:focus-visible {
  opacity: 1;
}

.hl-cell-add:hover,
.hl-cell-add:focus-visible {
  border-color: var(--hl-ink);
  color: var(--hl-ink);
}

@media (hover: none) {
  .hl-cell-add {
    opacity: 1;
  }
}

.hl-board .hl-drop-target {
  outline: 2px dashed var(--hl-ink);
  outline-offset: -3px;
  background: var(--hl-yellow-soft);
}

.hl-dragging {
  opacity: 0.5;
}

/* Compact rows: half the height. */
.hl-board-compact .hl-cell {
  height: 48px;
}

.hl-board-compact .hl-board th,
.hl-board-compact .hl-board td {
  padding: 4px 6px;
}

.hl-board-compact .hl-wo {
  margin-bottom: 3px;
  padding: 2px 6px;
}

.hl-board-compact .hl-wo-meta,
.hl-board-compact .hl-board-meta,
.hl-board-compact .hl-badge {
  display: none;
}

.hl-board-search {
  width: 200px;
}

@media (max-width: 899.98px) {
  .hl-board-search {
    flex: 1 1 0;
    width: auto;
  }
}

.hl-legend {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: var(--hl-gap-sm) 0 0;
  padding: 0;
  list-style: none;
  color: var(--hl-muted);
  font-size: 0.875rem;
}

.hl-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hl-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border-left: 4px solid var(--hl-wo-edge, var(--hl-line));
  background: var(--hl-wo-soft, var(--hl-ground));
}

.hl-legend-swatch.hl-wo-waiting {
  border: 1px dashed var(--hl-ink);
}

.hl-legend-swatch.hl-cell-down {
  border-left: 0;
}

/* Right-click menu */
.hl-context-menu {
  position: fixed;
  z-index: 1060;
  min-width: 260px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  padding: 8px;
  overflow-y: auto;
  border: 1px solid var(--hl-line);
  border-radius: var(--hl-radius-card);
  background: var(--hl-card);
  box-shadow: var(--hl-shadow);
}

.hl-context-title {
  margin: 4px 8px 6px;
  color: var(--hl-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hl-context-menu [role="menuitem"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: var(--hl-control-h);
  padding: 0 10px;
  border: 0;
  border-radius: var(--hl-radius-control);
  background: none;
  color: var(--hl-ink);
  font: inherit;
  text-align: left;
}

.hl-context-menu [role="menuitem"]:hover,
.hl-context-menu [role="menuitem"]:focus {
  background: var(--hl-ground);
  outline: none;
}

.hl-context-menu [role="menuitem"]:focus-visible {
  box-shadow: inset 0 0 0 2px var(--hl-info);
}

.hl-context-menu [role="menuitem"][aria-disabled="true"] {
  color: var(--hl-muted);
}

.hl-context-menu [role="separator"] {
  height: 1px;
  margin: 6px 4px;
  background: var(--hl-line);
}

.hl-context-key {
  color: var(--hl-muted);
  font-size: 0.8125rem;
}

.hl-context-menu .hl-context-danger {
  color: var(--hl-problem);
}

/* Dialogs */
.hl-dialog {
  width: min(480px, calc(100vw - 32px));
  padding: 20px;
  border: 1px solid var(--hl-line);
  border-radius: var(--hl-radius-card);
  box-shadow: var(--hl-shadow);
}

.hl-dialog::backdrop {
  background: rgba(22, 24, 26, 0.45);
}

.hl-dialog-list {
  margin: 0 0 var(--hl-gap);
  padding-left: 1.25rem;
}

.hl-dialog-list:empty {
  display: none;
}

.hl-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--hl-gap-sm);
}

@media (prefers-reduced-motion: reduce) {
  .hl-group-toggle .hl-icon {
    transition: none;
  }
}

/* Toolbar fields: a label and its select stay together */
.hl-toolbar-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

@media (max-width: 899.98px) {
  .hl-toolbar-field {
    flex: 1 1 100%;
  }
}

.hl-card + .hl-hint,
.hl-card + .hl-card,
.hl-stack + .hl-hint {
  margin-top: var(--hl-gap-sm);
}

/* Money inputs with a $ inside the field */
.hl-money {
  position: relative;
}

.hl-money::before {
  content: "$";
  position: absolute;
  top: 50%;
  left: 12px;
  color: var(--hl-muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.hl-money .form-control {
  padding-left: 26px;
}

.hl-input-medium {
  max-width: 240px;
}

.hl-details-card[open] > summary {
  margin-bottom: var(--hl-gap-sm);
}

.hl-section-gap {
  margin-top: var(--hl-gap);
}

.hl-form-narrow {
  max-width: 760px;
}

/* Job schedule: trucks needed by day */
.hl-day-needs-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin-top: var(--hl-gap);
}

.hl-day-needs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--hl-gap-sm);
  margin-top: 6px;
}

.hl-day-need {
  padding: 10px 12px;
  border: 1px solid var(--hl-line);
  border-radius: var(--hl-radius-control);
}

.hl-day-need-changed {
  border: 2px solid var(--hl-yellow);
  padding: 9px 11px;
  background: color-mix(in srgb, var(--hl-yellow-soft) 30%, var(--hl-card));
}

.hl-day-need-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.hl-day-need-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hl-day-need-row .form-control {
  width: 64px;
}

.hl-day-need-row span {
  font-size: 0.875rem;
  white-space: nowrap;
}

/* Addresses: the "Find address" search and the location page's gate pin */
.hl-address {
  margin: var(--hl-gap-sm) 0;
}

.hl-address-search {
  position: relative;
}

.hl-address-search > .hl-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 18px;
  height: 18px;
  color: var(--hl-muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.hl-address-search .form-control {
  padding-left: 38px;
}

.hl-place-widget {
  display: block;
  width: 100%;
}

.hl-pin-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
}

.hl-pin-reset {
  margin-left: auto;
}

@media (max-width: 575.98px) {
  .hl-pin-reset {
    margin-left: 0;
  }
}

/* Warnings ticked one by one (work order form and board dialog) */
.hl-warning-checks {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}

.hl-warning-checks > li,
.hl-warning-check {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 4px 0;
}

.hl-dialog-list .hl-warning-check {
  list-style: none;
  margin-left: -1.25rem;
}

.hl-warning-check label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex: 1 1 260px;
}

.hl-warning-check .form-check-input {
  flex: 0 0 auto;
  margin-top: 0.2em;
}

/* Toasts: top right under the menu bar, newest on top */
.hl-toasts {
  position: fixed;
  top: 72px;
  right: 16px;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(400px, calc(100vw - 32px));
  pointer-events: none;
}

.hl-toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 8px 12px 14px;
  background: #fff;
  border: 1px solid var(--hl-line);
  border-left: 4px solid var(--hl-good);
  border-radius: var(--hl-radius-control);
  box-shadow: var(--hl-shadow);
  color: var(--hl-ink);
  pointer-events: auto;
}

.hl-toast-info { border-left-color: var(--hl-info); }
.hl-toast-warning { border-left-color: var(--hl-yellow-dark); background: #FFFBEF; }
.hl-toast-error { border-left-color: var(--hl-problem); background: #FFF8F7; }

.hl-toast-body {
  flex: 1 1 auto;
  min-width: 0;
}

.hl-toast-text {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.hl-toast-details {
  margin: 4px 0 0;
  padding-left: 1.1rem;
  font-size: 0.875rem;
  max-height: 180px;
  overflow-y: auto;
}

.hl-toast-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--hl-ink);
  font-size: 1.4rem;
  line-height: 1;
}

.hl-toast-close:hover,
.hl-toast-close:focus-visible {
  background: var(--hl-line-soft);
}

@media (max-width: 899.98px) {
  .hl-toasts {
    top: 64px;
    right: 8px;
    width: calc(100vw - 16px);
  }
}

/* A checkbox in a field grid lines up with the inputs beside it */
.hl-field-check {
  align-self: end;
  padding-bottom: 8px;
}

/* Conflict dialog: booked work orders over downtime or time off */
.hl-dialog-wide {
  width: min(640px, calc(100vw - 32px));
}

.hl-conflict-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  border: 1px solid var(--hl-line-soft);
  border-radius: var(--hl-radius-control);
  max-height: 220px;
  overflow-y: auto;
}

.hl-conflict-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--hl-line-soft);
}

.hl-conflict-list li:last-child {
  border-bottom: 0;
}

.hl-choice-list {
  display: grid;
  gap: 8px;
}

.hl-option-text {
  display: block;
  font-size: 0.875rem;
  color: var(--hl-muted, #5A5D61);
}

/* A work order kept over truck downtime or driver time off */
.hl-wo.hl-wo-conflict,
.hl-legend-swatch.hl-wo-conflict {
  background: var(--hl-problem-soft);
  border-left-color: var(--hl-problem);
  color: var(--hl-problem);
}

.hl-wo-conflict .hl-wo-meta {
  color: var(--hl-problem);
  font-weight: 600;
}

.hl-cell-down-booked .hl-down {
  display: block;
  margin-bottom: 4px;
  font-size: 0.75rem;
}

/* "2 short" (amber, links to the board) and "1 over" (red) under booked of needed */
.hl-need-note {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.hl-need a {
  color: inherit;
}

.hl-choice-list .hl-option-card {
  flex-wrap: wrap;
}

.hl-choice-list .hl-option-text {
  flex-basis: 100%;
  padding-left: 28px;
}

/* ---------- Phase 2E layout: one-line header, content aligned with the menu, up to 1600px ---------- */
:root {
  --hl-page-max: 1600px;
  --hl-title-size: 1.375rem;      /* 22px */
  --hl-pagehead-h: 56px;
}

.hl-container {
  max-width: calc(var(--hl-page-max) + 2 * var(--hl-page-pad));
  margin: 0;
}

.hl-pagehead {
  padding: 8px 0;
}

.hl-pagehead-row {
  flex-wrap: nowrap;
  min-height: 40px;
}

.hl-pagehead-text {
  display: flex;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.hl-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  font-size: var(--hl-title-size);
  font-family: var(--hl-font-condensed);
  font-weight: 600;
  line-height: 1.2;
}

.hl-crumb .hl-back {
  margin: 0;
  color: var(--hl-muted);
  text-decoration: none;
}

.hl-crumb .hl-back:hover,
.hl-crumb .hl-back:focus-visible {
  color: var(--hl-ink);
  text-decoration: underline;
}

.hl-crumb-sep {
  color: var(--hl-muted);
}

.hl-page-title {
  flex: none;
  font-family: var(--hl-font-condensed);
  font-size: var(--hl-title-size);
  white-space: nowrap;
}

.hl-pagehead-text .hl-chip {
  flex: none;
}

.hl-page-summary {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
}

.hl-page-actions {
  flex: none;
  flex-wrap: nowrap;
  gap: 8px;
}

.hl-pagehead .hl-toolbar {
  margin-top: 8px;
  padding: 4px 8px;
}

@media (max-width: 899.98px) {
  .hl-pagehead-row {
    flex-wrap: wrap;
  }

  .hl-pagehead-text {
    flex-wrap: wrap;
  }

  .hl-page-title {
    white-space: normal;
  }

  .hl-page-summary {
    flex-basis: 100%;
    white-space: normal;
  }

  .hl-page-actions {
    flex-wrap: wrap;
  }
}

/* ---------- Dispatch: header and toolbar under 100px ---------- */
.hl-fill-screen .hl-pagehead .hl-toolbar-row {
  flex-wrap: nowrap;
  gap: 8px;
}

.hl-fill-screen .hl-pagehead .hl-toolbar-group {
  flex-wrap: nowrap;
  gap: 6px;
}

.hl-fill-screen .hl-pagehead .hl-toolbar-group + .hl-toolbar-group {
  padding-left: 8px;
}

.hl-fill-screen .hl-pagehead .btn,
.hl-fill-screen .hl-pagehead .form-select,
.hl-fill-screen .hl-pagehead .hl-segment {
  min-height: 36px;
  height: 36px;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 34px;
}

.hl-fill-screen .hl-pagehead .form-select {
  min-width: 96px;
  max-width: 200px;
}

.hl-board-range {
  display: none;
}

.hl-view-menu {
  position: relative;
}

.hl-view-menu > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.hl-view-menu > summary::-webkit-details-marker {
  display: none;
}

.hl-view-menu > summary svg {
  width: 16px;
  height: 16px;
}

.hl-view-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 1040;
  display: grid;
  gap: 8px;
  width: 260px;
  padding: 12px;
  border: 1px solid var(--hl-line);
  border-radius: var(--hl-radius-control);
  background: var(--hl-card);
  box-shadow: var(--hl-shadow);
}

.hl-view-panel .form-label {
  margin: 0;
}

.hl-fullscreen-button svg,
.hl-fullscreen-exit svg {
  width: 18px;
  height: 18px;
}

.hl-fullscreen-exit {
  display: none;
}

body.hl-board-fullscreen .hl-pagehead-row {
  display: none;
}

body.hl-board-fullscreen .hl-pagehead .hl-toolbar {
  margin-top: 0;
}

body.hl-board-fullscreen .hl-fullscreen-exit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 899.98px) {
  .hl-fill-screen .hl-pagehead .hl-toolbar-row,
  .hl-fill-screen .hl-pagehead .hl-toolbar-group {
    flex-wrap: wrap;
  }

  .hl-fullscreen-button {
    display: none;
  }

  .hl-view-panel {
    left: 0;
    right: auto;
  }
}

/* Board warnings: one icon with a count per truck; the list shows on hover or focus. Red only when dispatch is blocked. */
.hl-issues {
  position: relative;
  display: inline-block;
  margin-top: 2px;
}

.hl-issues-button {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 22px;
  padding: 0 6px 0 2px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.hl-issues-button svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

.hl-issues-warn .hl-issues-button {
  background: var(--hl-yellow-soft);
  border-color: var(--hl-yellow-dark);
  color: var(--hl-warn-text);
}

.hl-issues-problem .hl-issues-button {
  background: var(--hl-problem-soft);
  border-color: var(--hl-problem);
  color: var(--hl-problem);
}

/* Drawn on a fixed layer above the board (site.js places it and flips it near the window's edges). */
.hl-issues-tip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1080;
  display: none;
  width: max-content;
  max-width: 280px;
  padding: 8px 10px;
  border: 1px solid var(--hl-line);
  border-radius: var(--hl-radius-control);
  background: var(--hl-card);
  box-shadow: var(--hl-shadow);
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: none;
  white-space: normal;
}

.hl-issues-tip.is-open {
  display: grid;
  gap: 4px;
}

.hl-issue::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--hl-yellow-dark);
}

.hl-issue-problem::before {
  background: var(--hl-problem);
}

/* ---------- Forms fit the screen: tighter cards and headings, 3 to 4 fields per row ---------- */
:root {
  --hl-card-pad: 14px;
  --hl-gap: 12px;
  --hl-gap-sm: 10px;
}

.hl-main {
  padding-top: 12px;
}

.hl-section-title {
  margin-bottom: 8px;
  font-size: 1.0625rem;
}

.form-label {
  margin-bottom: 2px;
}

.hl-hint {
  margin-top: 2px;
  font-size: 0.8125rem;
}

.hl-option-card {
  min-height: 44px;
  padding: 8px 12px;
}

.hl-option-card:has(input:checked) {
  padding: 7px 11px;
}

.hl-doc-item {
  padding: 8px 0;
}

/* Two columns only on wide screens; below 1100px the side column goes under the main one. */
@media (min-width: 1100px) {
  .hl-form-layout {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  }

  /* The job form's summary column is narrow. */
  .hl-form-layout-narrow {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  }
}

/* A section folded until opened: <details class="hl-fold"> with a <summary> heading. */
.hl-fold > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  list-style: none;
  cursor: pointer;
}

.hl-fold > summary::-webkit-details-marker {
  display: none;
}

.hl-fold > summary .hl-section-title {
  margin: 0;
}

.hl-fold > summary::after {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  margin-right: 4px;
  border-right: 2px solid var(--hl-muted);
  border-bottom: 2px solid var(--hl-muted);
  transform: rotate(45deg);
  transition: transform 0.15s;
}

.hl-fold[open] > summary {
  margin-bottom: 10px;
}

.hl-fold[open] > summary::after {
  transform: rotate(-135deg);
}

.hl-fold-note {
  margin: 0;
  color: var(--hl-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  margin-left: auto;
}

/* An "add" row: fields and the button on one line */
.hl-field-button {
  align-self: start;
  padding-top: 22px;
}

.hl-inline-add .hl-hint {
  white-space: nowrap;
}

/* The job's per-day trucks needed: seven to a row */
.hl-day-needs {
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 6px;
}

.hl-day-need {
  padding: 6px 8px;
}

.hl-day-need-changed {
  padding: 5px 7px;
}

.hl-day-need-label {
  margin-bottom: 4px;
  font-size: 0.8125rem;
}

.hl-day-need-row {
  flex-wrap: wrap;
  gap: 2px 8px;
}

.hl-day-need-row .form-control {
  width: 56px;
  min-height: 34px;
  height: 34px;
}

.hl-day-need-row a {
  flex-basis: 100%;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Dispatch: header line and toolbar together under 100px */
.hl-fill-screen .hl-pagehead {
  padding: 6px 0;
}

.hl-fill-screen .hl-pagehead .hl-toolbar {
  margin-top: 4px;
  padding: 2px 6px;
}

.hl-fill-screen .hl-pagehead .btn,
.hl-fill-screen .hl-pagehead .form-select,
.hl-fill-screen .hl-pagehead .hl-segment {
  min-height: 34px;
  height: 34px;
  line-height: 32px;
}

/* Checkboxes on one wrapping row, and a fieldset whose legend sits beside its control */
.hl-check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.hl-inline-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin-bottom: var(--hl-gap-sm);
}

.hl-inline-group > legend {
  float: left;
  width: auto;
  margin: 0;
}

.hl-grid-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 1199.98px) {
  .hl-grid-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .hl-grid-5 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Geoapify address search: the match list under the box */
.hl-lookup {
  position: relative;
}

.hl-lookup-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 1050;
  max-height: 280px;
  margin: 0;
  padding: 4px 0;
  overflow-y: auto;
  list-style: none;
  border: 1px solid var(--hl-line);
  border-radius: var(--hl-radius-control);
  background: var(--hl-card);
  box-shadow: var(--hl-shadow);
}

.hl-lookup-list [role="option"] {
  padding: 8px 12px;
  cursor: pointer;
}

.hl-lookup-list [role="option"]:hover,
.hl-lookup-list [role="option"][aria-selected="true"] {
  background: var(--hl-yellow-soft);
}

.hl-attribution {
  white-space: nowrap;
}

/* The gate pin on the Leaflet map */
.hl-map-pin span {
  position: absolute;
  left: 2px;
  top: 0;
  width: 24px;
  height: 24px;
  border: 3px solid #FFFFFF;
  border-radius: 50% 50% 50% 0;
  background: var(--hl-problem);
  box-shadow: 0 2px 6px rgba(22, 24, 26, 0.4);
  transform: rotate(-45deg);
}

.leaflet-container {
  font-family: var(--hl-font);
}

/* Driver photos on problem and inspection pages */
.hl-photo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hl-photo {
  width: 160px;
  height: 120px;
  object-fit: cover;
  border: 1px solid var(--hl-line);
  border-radius: var(--hl-radius-control);
}

/* The foreman's signature pad */
.hl-signature-pad {
  display: block;
  width: 100%;
  max-width: 600px;
  height: 200px;
  border: 2px dashed var(--hl-input-border);
  border-radius: var(--hl-radius-control);
  background: #FFFFFF;
  touch-action: none;
}

/* Tickets */
.hl-timeline {
  margin: 0;
  padding-left: 1.25rem;
}

.hl-timeline li {
  padding: 2px 0;
}

.hl-pre {
  margin: 0;
  padding: 8px;
  border-radius: var(--hl-radius-control);
  background: var(--hl-ground-soft);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.8125rem;
}

.hl-signature {
  display: block;
  max-width: 100%;
  height: 90px;
  border-bottom: 1px solid var(--hl-ink);
  object-fit: contain;
}

.hl-history-item + .hl-history-item {
  padding-top: 6px;
  border-top: 1px solid var(--hl-line-soft);
}

.hl-table-inputs .form-control {
  min-width: 96px;
}

.hl-tile-problem {
  border-color: var(--hl-problem);
}

/* Live view on Dispatch (live.png): six columns of truck cards, refreshed every 30 seconds. */
.hl-live-area {
  flex: 0 1 auto;
  min-height: 0;
  overflow: auto;
}

.hl-live-columns {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.hl-live-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 240px;
  padding: 12px;
  border-radius: var(--hl-radius-card);
  background: var(--hl-line-soft);
}

.hl-live-col-idle {
  background: var(--hl-yellow-soft);
}

.hl-live-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
}

.hl-live-col-idle .hl-live-col-head {
  color: var(--hl-warn-text);
}

.hl-live-card {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--hl-line);
  border-left: 4px solid var(--hl-wo-edge, var(--hl-line));
  border-radius: 8px;
  background: var(--hl-card);
  color: var(--hl-ink);
  text-decoration: none;
}

.hl-live-card:hover,
.hl-live-card:focus-visible {
  border-color: var(--hl-ink);
  border-left-color: var(--hl-wo-edge, var(--hl-ink));
  color: var(--hl-ink);
}

.hl-live-truck {
  display: block;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.2;
}

.hl-live-meta,
.hl-live-detail {
  display: block;
  margin-top: 2px;
  font-size: 0.875rem;
  color: var(--hl-muted);
  overflow-wrap: anywhere;
}

.hl-live-detail.hl-live-warn {
  color: var(--hl-warn-text);
  font-weight: 600;
}

.hl-live-detail.hl-live-good {
  color: var(--hl-good-text);
  font-weight: 600;
}

.hl-live-detail.hl-live-problem {
  color: var(--hl-problem);
  font-weight: 600;
}

.hl-live-empty {
  margin: 0;
  color: var(--hl-muted);
  font-size: 0.875rem;
}

.hl-live-updated {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--hl-good-text);
  font-weight: 600;
}

.hl-live-updated.hl-live-stale {
  color: var(--hl-warn-text);
}

.hl-live-updated.hl-live-stale .hl-live-dot {
  background: var(--hl-yellow-dark);
}

.hl-live-note {
  margin: 12px 0 0;
}

@media (max-width: 1279.98px) {
  .hl-live-columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .hl-live-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .hl-live-col {
    min-height: 0;
  }

  .hl-live-updated {
    margin-left: 0;
  }
}

/* Money: totals under a table, facts in the aside, the receivables tabs and the aging tiles. */
.hl-totals {
  display: grid;
  gap: 4px;
  justify-content: end;
  margin: 0;
  padding: 12px 16px 16px;
}

.hl-totals > div {
  display: grid;
  grid-template-columns: 160px 140px;
  gap: 12px;
}

.hl-totals dt {
  font-weight: 400;
  color: var(--hl-muted);
}

.hl-totals dd {
  margin: 0;
  text-align: right;
}

.hl-totals .hl-totals-strong dt,
.hl-totals .hl-totals-strong dd {
  font-weight: 700;
  color: var(--hl-ink);
}

.hl-facts {
  display: grid;
  gap: 6px;
  margin: 0;
}

.hl-facts > div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px;
}

.hl-facts dt {
  font-weight: 400;
  color: var(--hl-muted);
}

.hl-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.hl-plain-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hl-plain-list li + li {
  margin-top: 4px;
}

.hl-money-tabs {
  flex: none;
  max-width: 100%;
  overflow-x: auto;
}

.hl-money-tabs .hl-segment {
  white-space: nowrap;
}

.hl-aging .hl-tile-value {
  font-size: 1.25rem;
}

@media (max-width: 575.98px) {
  .hl-totals {
    justify-content: stretch;
  }

  .hl-totals > div {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

.hl-deduction {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hl-field-end {
  align-self: end;
}

.hl-card-pad {
  padding: 12px 16px 0;
}

/* ---------- Part A ---------- */
.hl-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Daily trip inspection report, laid out like the paper form */
.hl-paper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px 16px;
  margin: 0 0 12px;
}

.hl-paper-grid dt {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--hl-muted);
}

.hl-paper-grid dd {
  margin: 0;
  font-weight: 600;
}

.hl-paper-items td:first-child {
  width: 3em;
}

.hl-row-problem td {
  background: var(--hl-problem-bg, #f8e1df);
}

.hl-row-warn td {
  background: var(--hl-warn-bg, #fff4d6);
}

.hl-paper-sign {
  border-top: 1px solid var(--hl-line);
  padding-top: 12px;
}

.hl-list-plain {
  list-style: none;
  padding: 0;
  margin: 0;
}

.hl-list-plain li {
  padding: 4px 0;
  border-bottom: 1px solid var(--hl-line);
}

/* Get started (new companies) */
.hl-getstarted {
  margin-bottom: var(--hl-gap);
}

.hl-getstarted-steps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin: 0;
  padding-left: 1.25rem;
}

.hl-getstarted-steps li.is-done a {
  color: var(--hl-muted);
}

/* Today: the five summary cards in one even row on wide screens. */
@media (min-width: 1100px) {
  .hl-tiles {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 768px) and (max-width: 1099.98px) {
  .hl-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.hl-subtitle {
  margin: 0 0 4px;
  font-size: 0.875rem;
  font-weight: 600;
}

/* Part B: money reports */
.hl-row-total td {
  font-weight: 700;
  border-top: 2px solid var(--hl-ink, #16181a);
}

.hl-row-void td {
  color: var(--hl-muted);
  text-decoration: line-through;
}

/* Part C: customer portal */
.hl-portal-header {
  background: var(--hl-ink, #16181a);
  color: #fff;
}

.hl-portal-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.hl-portal-who {
  margin-left: auto;
  font-size: 0.875rem;
  color: #d9d6ce;
}

.hl-portal-signout {
  color: #fff;
}

.hl-portal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  padding-bottom: 8px;
}

.hl-portal-nav a {
  color: #d9d6ce;
  font-weight: 600;
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 3px solid transparent;
}

.hl-portal-nav a[aria-current="page"] {
  color: #fff;
  border-bottom-color: var(--hl-yellow, #f2b705);
}

.hl-portal-title {
  font-size: 1.375rem;
  margin: 0 0 12px;
}

/* Part D: trial banners */
.hl-trial-banner {
  background: var(--hl-yellow-soft, #fcefc2);
  padding: 8px 0;
  font-weight: 600;
}

.hl-trial-banner-problem {
  background: var(--hl-problem-soft, #f8e1df);
  color: var(--hl-problem, #b3261e);
}

/* Part D/E: SoftLinks console */
.hl-console-forms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--hl-gap);
  align-items: start;
}

.hl-invoice-reason {
  min-width: 14rem;
}

.hl-invoice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.hl-invoice-actions form {
  margin: 0;
}

.hl-mark-failed > summary {
  list-style: none;
}

.hl-mark-failed[open] > form {
  min-width: 15rem;
}

/* Part F: dispatch locks */
.hl-wo.hl-wo-started {
  border-left-style: dashed;
  box-shadow: inset 0 0 0 1px var(--hl-wo-edge, var(--hl-ink));
}

.hl-wo.hl-wo-done {
  background: var(--hl-good-soft, #e6f2ea);
  border-left-color: var(--hl-good, #1c7c45);
}

.hl-wo.hl-wo-done .hl-wo-meta {
  color: var(--hl-good, #1c7c45);
  font-weight: 700;
}

.hl-wo.hl-wo-invoiced {
  background: #ecebe7;
  border-left-color: #8a8d91;
  color: #5f6368;
}

.hl-wo-lock {
  margin-right: 4px;
  vertical-align: -1px;
}

.hl-wo[draggable="false"] {
  cursor: pointer;
}

.hl-alert-info {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--hl-info-soft, #e7eff9);
  color: var(--hl-info, #1f4f8a);
}

.hl-live-card.hl-live-done {
  background: var(--hl-good-soft, #e6f2ea);
}

.hl-table tr.hl-row-done td,
.hl-table tr.hl-row-done th {
  background: var(--hl-good-soft, #e6f2ea);
}

/* Part F 3.1: problems */
.hl-inline-form {
  position: relative;
  display: inline-block;
}

.hl-inline-form > summary {
  list-style: none;
}

.hl-popover-form {
  position: absolute;
  right: 0;
  z-index: 20;
  width: 300px;
  margin-top: 6px;
  padding: 12px;
  border: 1px solid var(--hl-line, #d9d6ce);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.hl-problem-map {
  height: 180px;
  border-radius: 8px;
  background: var(--hl-ground, #f4f3ef);
}

.hl-table tr.hl-row-problem td {
  background: var(--hl-problem-soft, #fbe9e7);
}

.hl-problem-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--hl-problem, #b3261e);
  color: #fff !important;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

/* Part F 3.2: what happens to the driver's part when started work changes truck or driver. */
.hl-started-choice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--hl-yellow-dark);
  border-radius: var(--hl-radius-control);
  background: var(--hl-yellow-soft);
}

.hl-started-choice legend {
  float: none;
  width: auto;
  margin-bottom: 8px;
  font-size: 1rem;
}

.hl-started-choice .form-check + .form-check {
  margin-top: 10px;
}

.hl-started-detail {
  max-width: 320px;
  margin: 6px 0 0;
}

.hl-dialog-choice {
  display: grid;
  gap: 12px;
  margin: 8px 0 4px;
}

.hl-dialog-choice .hl-field {
  margin: 6px 0 0 24px;
}

/* Part F 3.3: the truck and job filters on New invoice, and the tick column. */
.hl-pick {
  position: relative;
}

.hl-pick > summary {
  list-style: none;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hl-pick > summary::-webkit-details-marker {
  display: none;
}

.hl-pick-list {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  min-width: 220px;
  max-height: 260px;
  margin-top: 4px;
  padding: 8px 12px;
  overflow-y: auto;
  background: var(--hl-card);
  border: 1px solid var(--hl-line);
  border-radius: var(--hl-radius-control);
  box-shadow: var(--hl-shadow);
}

.hl-pick-list .form-check {
  display: block;
  margin: 4px 0;
}

.hl-col-check {
  width: 44px;
}

/* Run G: one set of ticket status colours (TicketStatusLook, and the driver app). Used with .hl-chip. */
.hl-status-open {
  background: #FFF6D6;
  color: #6B4A00;
}

.hl-status-signed {
  background: #E7EFF9;
  color: #1F4F8A;
}

.hl-status-approved {
  background: #E6F2EA;
  color: #14633A;
}

.hl-status-invoiced {
  gap: 4px;
  background: #EFEDE7;
  color: #3D4146;
}

.hl-status-invoiced::before {
  content: "";
  width: 10px;
  height: 11px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 11'%3E%3Cpath d='M2 5V3.5a3 3 0 0 1 6 0V5h.5A1.5 1.5 0 0 1 10 6.5v3A1.5 1.5 0 0 1 8.5 11h-7A1.5 1.5 0 0 1 0 9.5v-3A1.5 1.5 0 0 1 1.5 5H2zm1.5 0h3V3.5a1.5 1.5 0 0 0-3 0V5z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 11'%3E%3Cpath d='M2 5V3.5a3 3 0 0 1 6 0V5h.5A1.5 1.5 0 0 1 10 6.5v3A1.5 1.5 0 0 1 8.5 11h-7A1.5 1.5 0 0 1 0 9.5v-3A1.5 1.5 0 0 1 1.5 5H2zm1.5 0h3V3.5a1.5 1.5 0 0 0-3 0V5z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.hl-status-void {
  background: #FFFFFF;
  color: #B3261E;
  box-shadow: inset 0 0 0 1px #B3261E;
}

.hl-status-disputed {
  background: #F8E1DF;
  color: #8C1D18;
}

/* Edited by office / changed after signing: an amber mark next to the status. */
.hl-mark-edited {
  gap: 5px;
  background: #FFFFFF;
  color: #6B4A00;
  box-shadow: inset 0 0 0 1px #6B4A00;
}

.hl-mark-edited::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #E0A100;
}

/* A void ticket's number and hours, crossed out. */
.hl-voided {
  color: #B3261E;
  text-decoration: line-through;
}

/* Run H: the sign-up bot trap, off screen for people (bots fill it in). */
.hl-trap {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Run H: the driver app's install page and "Send app link". */
.hl-qr svg {
    width: 200px;
    height: 200px;
    display: block;
}

.hl-steps {
    padding-left: 1.25rem;
}

.hl-steps li {
    margin-bottom: 0.5rem;
}


/* Run I: a truck that can't work today (out of service, in the shop, down): a red label wherever it appears. */
.hl-down-badge,
.hl-chip.hl-down-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--hl-problem);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: middle;
}

.hl-down-reason {
  display: block;
  color: var(--hl-problem);
  font-size: 0.82rem;
}

.hl-row-down > th:first-child {
  box-shadow: inset 3px 0 0 var(--hl-problem);
}

.hl-board .hl-truck-row-down > th,
.hl-board .hl-truck-row-down > td {
  border-top: 2px solid var(--hl-problem);
  border-bottom: 2px solid var(--hl-problem);
}

.hl-board .hl-truck-row-down > th {
  border-left: 2px solid var(--hl-problem);
}

.hl-board .hl-truck-row-down > td:last-child {
  border-right: 2px solid var(--hl-problem);
}

.hl-card-down {
  border-color: var(--hl-problem);
  box-shadow: inset 4px 0 0 var(--hl-problem);
}

.hl-option-down {
  color: var(--hl-muted);
}

.hl-live-card-down {
  outline: 2px solid var(--hl-problem);
  outline-offset: -2px;
}

/* Run I: the signing page names the company that sends the ticket. */
.hl-sign-from {
  margin: 0 0 4px;
  color: var(--hl-muted);
  font-size: 0.9rem;
}
