.driver-work {
  --driver-blue: #1b4aab;
  --driver-blue-hover: #153b8a;
  --driver-ink: #172d4a;
  --driver-muted: #475d76;
  --driver-border: #d8e3f0;
  max-width: 940px;
  color: var(--driver-ink);
}

.driver-work .btn,
.driver-work .driver-ticket .btn,
.driver-work .driver-filters .tabs button,
.driver-work .driver-select select,
.driver-work summary,
.driver-work .map-link {
  min-height: 52px;
}

.driver-work .driver-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 12px 0;
}

.driver-work .driver-filters .tabs { margin: 0; }
.driver-work .driver-filters .tabs button { font-weight: 750; }

.driver-work .driver-ticket {
  display: flex;
  flex-direction: column;
  align-self: start;
  gap: 12px;
  padding: 15px;
  border-color: var(--driver-border);
  border-radius: 14px;
}

.driver-ticket-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.driver-ticket-head > div { min-width: 0; }
.driver-ticket-head h2 {
  margin: 0;
  color: var(--driver-ink);
  font-size: .94rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.driver-ticket-head p {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: var(--driver-muted);
  font-size: .85rem;
  font-weight: 650;
}
.driver-ticket-head p svg { width: 15px; height: 15px; }
.driver-ticket-head .chip { flex: 0 0 auto; }

.driver-work .driver-ticket .driver-primary {
  width: 100%;
  min-height: 56px;
  border-color: var(--driver-blue);
  border-radius: 9px;
  background: var(--driver-blue);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
}
.driver-work .driver-primary:hover { background: var(--driver-blue-hover); }
.driver-work .driver-primary svg { width: 20px; height: 20px; }
.driver-work :is(button, a, summary, select):focus-visible {
  outline: 3px solid #5274b7;
  outline-offset: 2px;
}

.driver-stages {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.driver-stages li {
  display: grid;
  justify-items: center;
  gap: 4px;
  align-content: start;
  color: #536a84;
  position: relative;
  font-weight: 650;
  font-size: .75rem;
  text-align: center;
}
.driver-stages small { font-size: inherit; line-height: 1.35; }
.driver-stages li > span:first-child {
  z-index: 1;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  background: white;
  border: 2px solid #b4c6dd;
  border-radius: 50%;
}
.driver-stages li > span:first-child svg { width: 13px; height: 13px; stroke-width: 2.4; }
.driver-stages li:not(:first-child)::before {
  content: "";
  position: absolute;
  top: 10px;
  right: 50%;
  width: calc(100% + 3px);
  height: 1px;
  background: #d1dceb;
}
.driver-stages li.done { color: #145c41; }
.driver-stages li.done > span:first-child { color: #fff; border-color: #19714d; background: #19714d; }
.driver-stages li.queued { color: #704300; }
.driver-stages li.queued > span:first-child { border: 2px dashed #946015; background: #fff7e3; }
.driver-stages li.next { color: #143f96; font-weight: 800; }
.driver-stages li.next > span:first-child { border: 5px solid #2359b3; }

.driver-next-stop {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  background: #f2f7ff;
  border: 1px solid #dbe7fc;
  border-radius: 9px;
}
.driver-next-stop > div { display: grid; gap: 3px; }
.driver-next-stop small { color: #445c7a; font-size: .77rem; }
.driver-next-stop strong { overflow-wrap: anywhere; font-size: .89rem; }
.driver-work .driver-next-stop .map-link {
  display: grid;
  align-items: center;
  padding: 3px 9px;
  text-decoration: none;
  background: #fff;
  border: 1px solid #adc5f0;
  border-radius: 7px;
  color: #163f8b;
  font-size: .82rem;
  font-weight: 750;
  text-align: center;
}

.driver-work .driver-facts {
  margin: 0;
  padding: 0;
  background: transparent;
  gap: 9px 12px;
}
.driver-work .driver-facts > div {
  padding-top: 7px;
  border-top: 1px solid #e4ecf5;
}
.driver-work .driver-facts dt { color: var(--driver-muted); }

.driver-card-links {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 3px 6px;
}
.driver-card-links > .btn,
.driver-card-links summary {
  color: #244568;
  font-size: .8rem;
  font-weight: 750;
}
.driver-card-links details { max-width: 100%; min-width: 0; }
.driver-card-links details[open] { flex: 1 0 100%; }
.driver-card-links summary,
.driver-progress-proof summary {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  list-style: none;
}
.driver-card-links summary::-webkit-details-marker,
.driver-progress-proof summary::-webkit-details-marker { display: none; }
.driver-card-links summary:hover,
.driver-progress-proof summary:hover,
.driver-card-links details[open] summary { background: #eef4fd; }
.driver-card-links summary svg { width: 15px; height: 15px; }
.driver-card-links summary span {
  display: grid;
  place-items: center;
  min-width: 19px;
  padding: 2px 4px;
  border-radius: 4px;
  background: #e9f0fc;
  color: #224980;
}
.driver-other > div,
.driver-photo-section .photo-actions,
.driver-proof .photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-block: 5px;
}
.driver-other .btn,
.driver-proof .btn { flex: 1 0 130px; }

.driver-sync, .driver-change, .driver-ticket-pending {
  background: #edf4ff;
  border: 1px solid #c6d8f2;
  border-radius: 9px;
  color: #1c4a88;
}
.driver-sync, .driver-change {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 7px;
  padding: 8px 10px;
}
.driver-change > div,
.driver-sync-copy,
.driver-ticket-pending {
  display: flex;
  align-items: start;
  gap: 8px;
  min-width: 0;
}
.driver-change svg, .driver-sync svg, .driver-ticket-pending svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}
.driver-change small,
.driver-sync-copy span {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
  font-size: .78rem;
}
.driver-change strong, .driver-sync-copy strong { font-size: .91rem; }
.driver-change.caution, .driver-sync.failed { background: #fff0ee; border-color: #efc6bf; color: #85382c; }
.driver-trip-alert {
  display: flex;
  gap: 6px;
  align-items: center;
  border: 1px solid #efc6bf;
  border-radius: 7px;
  padding: 7px;
  background: #fff0ee;
  color: #85382c;
  font-size: .8rem;
  font-weight: 750;
}
.driver-trip-alert svg { width: 16px; height: 16px; flex: 0 0 16px; }
.driver-sync.waiting, .driver-sync.offline, .driver-ticket-pending { background: #fff6e0; border-color: #eed8a4; color: #69450b; }
.driver-sync.success { background: #e9f8ef; border-color: #b9dec9; color: #19593c; }
.driver-ticket-pending { padding: 7px; font-size: .77rem; }
.driver-sync-actions { display: flex; flex-wrap: wrap; gap: 6px; }

html[data-role="driver"] dialog .driver-progress-proof {
  margin: 6px 0;
  border: 1px solid #d7e3f2;
  border-radius: 8px;
}
html[data-role="driver"] dialog .driver-progress-proof summary {
  min-height: 52px;
  padding-inline: 10px;
  color: #244568;
  font-size: .89rem;
  font-weight: 750;
}
html[data-role="driver"] dialog .driver-progress-proof .inline-attachment { margin: 8px; }
html[data-role="driver"] dialog .driver-progress-form button.btn,
html[data-role="driver"] dialog .driver-progress-form .field :is(input, select),
html[data-role="driver"] dialog .driver-pending-item .btn { min-height: 52px; }
html[data-role="driver"] dialog .driver-progress-form .modal-actions > button[type="submit"] {
  background: #1b4aab;
  border-color: #1b4aab;
}
.driver-pending-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 8px 0;
}
.driver-pending-item + .driver-pending-item { border-top: 1px solid #d7e3f2; }
.driver-pending-item > div { display: grid; gap: 3px; min-width: 0; }
.driver-pending-item :is(span, small) { overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .driver-work .driver-ticket { padding: 12px; }
  .driver-card-links > .btn { padding-inline: 6px; }
  html[data-role="driver"] dialog .driver-progress-form .modal-actions > button[type="submit"] { flex: 1; }
  html[data-role="driver"] dialog .driver-detail-actions .btn,
  html[data-role="driver"] dialog .detail-section .photo-actions .btn { min-height: 52px; }
}
