:root {
  --ink: #071633;
  --muted: #506179;
  --line: #dbe2ec;
  --soft-line: #edf1f6;
  --panel: #ffffff;
  --surface: #f7f9fc;
  --purple: #6b3df4;
  --purple-dark: #4b22ca;
  --green: #14813a;
  --green-soft: #eaf8ef;
  --optimized: #e83e8c;
  --optimized-soft: #fff0f7;
  --amber: #f4a300;
  --red: #ef3c2f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f5f7fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  max-width: 1440px;
  min-height: 100vh;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 18px 60px rgba(28, 45, 74, 0.12);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 38px 24px;
  border-bottom: 1px solid var(--line);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.1;
  letter-spacing: 0;
}

.topbar p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
}

.controls {
  display: flex;
  align-items: end;
  gap: 20px;
  flex-wrap: wrap;
}

.traffic-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.traffic-legend em {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-style: normal;
  white-space: nowrap;
}

.traffic-legend em::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}

.traffic-legend .legend-red {
  color: #d52420;
}

.traffic-legend .legend-orange {
  color: #ed7a17;
}

.traffic-legend .legend-yellow {
  color: #c79600;
}

.traffic-legend .legend-green {
  color: #168546;
}

.planning-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 28px 4px;
}

.planning-intro h2 {
  font-size: clamp(22px, 2.5vw, 28px);
}

.planning-intro p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
}

.status-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.status-legend em {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  font-style: normal;
  white-space: nowrap;
}

.status-legend em::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}

.status-legend small {
  color: currentColor;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.82;
}

.status-legend .pre-commit {
  background: #eaf8ef;
  color: #13783a;
}

.status-legend .after-commit {
  background: #ede6ff;
  color: #5d32bf;
}

.status-legend .near-cal {
  background: #fff3ce;
  color: #8a5d00;
}

.status-legend .tight-cal {
  background: #ffe3c7;
  color: #a64b00;
}

.status-legend .post-cal {
  background: #ffe3df;
  color: #a22b22;
}

.field {
  position: relative;
  display: grid;
  gap: 8px;
  min-width: 160px;
}

.field span {
  font-size: 14px;
  color: var(--ink);
}

.field input,
.customer-select,
.mini-input {
  height: 44px;
  border: 1px solid #ccd6e3;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.field input {
  width: 100%;
  padding: 0 44px 0 14px;
}

.field small {
  position: absolute;
  right: 12px;
  bottom: 12px;
  color: var(--muted);
}

.button {
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.button-secondary {
  color: var(--ink);
  background: #fff;
  border-color: #cbd5e3;
}

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  box-shadow: 0 10px 24px rgba(86, 48, 215, 0.28);
}

.button-success {
  height: 36px;
  color: var(--optimized);
  background: #fff;
  border-color: var(--optimized);
}

.map-section {
  display: grid;
  grid-template-columns: 470px minmax(0, 1fr);
  min-height: 680px;
  padding-right: 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.customer-panel {
  padding: 22px 14px 22px 22px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.customer-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.customer-panel h2,
.section-header h2 {
  font-size: 20px;
}

.refresh-button {
  height: 34px;
  padding: 0 14px;
}

.customer-search {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

.customer-search span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.customer-search input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #ccd6e3;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.customer-search input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(107, 61, 244, 0.12);
  outline: none;
}

.customer-list {
  height: 600px;
  margin-top: 12px;
  overflow-y: auto;
  padding-right: 10px;
}

.customer-message {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcff;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.4;
}

.customer-message.error {
  border-color: #efb1aa;
  background: #fff2f0;
  color: #98251c;
}

.customer-list::-webkit-scrollbar {
  width: 10px;
}

.customer-list::-webkit-scrollbar-thumb {
  background: #aeb7c4;
  border-radius: 99px;
}

.customer-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px 38px;
  align-items: center;
  gap: 14px;
  padding: 0 12px 0 0;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: #fff;
  text-align: left;
}

.customer-item:first-child {
  border-radius: 6px 6px 0 0;
}

.customer-item:last-child {
  border-bottom: 1px solid var(--line);
  border-radius: 0 0 6px 6px;
}

.customer-item.is-selected {
  background: #fbfcff;
}

.customer-preview {
  width: 100%;
  min-width: 0;
  padding: 16px 0 16px 18px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.customer-preview:focus-visible,
.customer-add:focus-visible {
  outline: 3px solid rgba(107, 61, 244, 0.22);
  outline-offset: 2px;
}

.customer-item strong,
td strong {
  display: block;
  font-size: 15px;
}

.customer-item small,
td small {
  display: block;
  margin-top: 4px;
  color: #41536c;
  font-size: 14px;
}

.customer-travel {
  position: relative;
  font-style: normal;
  font-size: 14px;
  text-align: right;
}

.customer-travel::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 12px;
  border-radius: 50%;
  vertical-align: middle;
  background: currentColor;
}

.customer-travel strong,
.customer-travel small {
  display: block;
}

.customer-travel small {
  margin-top: 3px;
  font-size: 12px;
  color: currentColor;
  opacity: 0.82;
}

.customer-add {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--purple);
  border-radius: 50%;
  background: #fff;
  color: var(--purple);
  cursor: pointer;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.customer-add:hover {
  background: #f4efff;
}

.customer-add.is-added {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
  cursor: default;
  font-size: 17px;
}

.customer-item .good {
  color: #118541;
}

.customer-item .watch {
  color: var(--amber);
}

.customer-item .orange {
  color: #ed7a17;
}

.customer-item .late {
  color: var(--red);
}

.customer-item .neutral {
  color: #68778d;
}

.map-panel {
  position: relative;
  min-height: 680px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.8)),
    radial-gradient(circle at 16% 20%, #d8f1d6 0 2.3%, transparent 2.5%),
    radial-gradient(circle at 74% 18%, #d8f1d6 0 3%, transparent 3.2%),
    radial-gradient(circle at 72% 60%, #d8f1d6 0 2.8%, transparent 3%),
    #eef3f8;
}

.google-map {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.google-map ~ .map-grid,
.google-map ~ .map-river,
.google-map ~ .map-road,
.google-map ~ .route-line,
.google-map ~ .route-label {
  display: none;
}

.map-markers {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.route-status {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  padding: 14px 16px;
  border: 1px solid #d5b76a;
  border-radius: 6px;
  background: #fff8e5;
  color: #6e4b00;
  box-shadow: 0 14px 36px rgba(20, 31, 52, 0.16);
  font-weight: 700;
}

.route-status[data-type="error"] {
  border-color: #efb1aa;
  background: #fff2f0;
  color: #98251c;
}

.map-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(146, 164, 189, 0.23) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(146, 164, 189, 0.23) 1px, transparent 1px);
  background-size: 34px 34px;
}

.map-river,
.map-road,
.route-line {
  position: absolute;
  transform-origin: left center;
  border-radius: 999px;
}

.map-river {
  height: 7px;
  background: #b8dcff;
  opacity: 0.75;
}

.river-one {
  width: 520px;
  left: 280px;
  top: 190px;
  transform: rotate(18deg);
}

.river-two {
  width: 620px;
  left: 430px;
  top: 470px;
  transform: rotate(-12deg);
}

.map-road {
  height: 4px;
  background: #f1c85f;
  opacity: 0.8;
}

.road-east {
  width: 560px;
  right: -20px;
  top: 330px;
  transform: rotate(18deg);
}

.road-south {
  width: 520px;
  left: 420px;
  top: 575px;
  transform: rotate(-30deg);
}

.road-west {
  width: 460px;
  left: -80px;
  top: 150px;
  transform: rotate(-8deg);
}

.route-line {
  height: 5px;
  background: #5575e7;
  box-shadow: 0 0 0 1px rgba(61, 82, 199, 0.16);
}

.route-a {
  width: 270px;
  left: 114px;
  top: 245px;
  transform: rotate(-7deg);
}

.route-b {
  width: 240px;
  left: 365px;
  top: 236px;
  transform: rotate(22deg);
}

.route-c {
  width: 220px;
  left: 594px;
  top: 302px;
  transform: rotate(0deg);
}

.route-d {
  width: 320px;
  left: 770px;
  top: 333px;
  transform: rotate(28deg);
}

.route-label {
  position: absolute;
  color: rgba(7, 22, 51, 0.84);
  font-size: 14px;
  text-transform: uppercase;
}

.route-label.city {
  left: 30%;
  top: 45%;
  font-size: 28px;
  text-transform: none;
  font-weight: 700;
}

.route-label.college {
  right: 27%;
  top: 25%;
  color: #65758d;
}

.route-label.base {
  right: 21%;
  bottom: 9%;
}

.map-marker {
  position: absolute;
  width: 30px;
  height: 30px;
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  border-radius: 50%;
  background: #8d97a8;
  color: #fff;
  box-shadow: 0 8px 18px rgba(20, 31, 52, 0.28);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  pointer-events: auto;
}

.map-marker.is-active {
  background: var(--purple);
}

.map-legend {
  position: absolute;
  left: 18px;
  top: 18px;
  z-index: 2;
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 28px rgba(20, 31, 52, 0.14);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.map-legend span {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.map-legend i {
  width: 28px;
  height: 4px;
  border-radius: 999px;
}

.map-legend .customer-route {
  background: #f59e0b;
}

.map-legend .planned-route {
  background: var(--purple);
}

.map-legend .optimized-route {
  background: var(--optimized);
}

.route-card {
  margin: 18px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.route-card.planned {
  border-color: #d8c9ff;
}

.route-card.optimized {
  border-color: #f4b8d5;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
}

.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.header-time-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.header-time-control input {
  width: 130px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #cdbfff;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.route-execution-state {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff3ce;
  color: #8a5d00;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.route-execution-state[data-state="current"] {
  background: #eaf8ef;
  color: #13783a;
}

.route-execution-state[data-state="executing"] {
  background: #eef3ff;
  color: #294da8;
}

.route-execution-state[data-state="empty"] {
  background: #eef2f7;
  color: #506179;
}

.planned .section-header {
  background: #fbf8ff;
  color: #3d14ca;
}

.optimized .section-header {
  background: var(--optimized-soft);
  color: #b71967;
}

.route-message {
  margin: 16px;
  display: grid;
  place-items: center;
  height: 90px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.route-board {
  display: grid;
  gap: 10px;
  padding: 12px 16px;
}

.order-badge {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--purple);
  border-radius: 50%;
  color: var(--purple);
  background: #fff;
}

.order-badge.success {
  border-color: var(--optimized);
  color: var(--optimized);
}

.customer-select {
  width: 100%;
  min-width: 0;
  padding: 0 12px;
}

.mini-input {
  width: 74px;
  padding: 0 12px;
  text-align: center;
}

.time-input {
  width: 116px;
  height: 44px;
  padding: 0 10px;
  border: 1px solid #ccd6e3;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-align: center;
}

.muted {
  margin-left: 8px;
  color: var(--muted);
}

.remove-button {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.remove-button:hover {
  border-color: #f0cbc6;
  background: #fff2f0;
  color: #a22b22;
}

.remove-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  pointer-events: none;
}

.stop-card {
  position: relative;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(26, 42, 70, 0.07);
}

.stop-card.planned {
  cursor: default;
}

.stop-card.pre-commit {
  border-left-color: #21a65b;
}

.stop-card.near-cal {
  border-left-color: #efad1f;
  background: #fffdf6;
}

.stop-card.tight-cal {
  border-left-color: #f07d18;
  background: #fff8f1;
}

.stop-card.after-commit {
  border-left-color: #8b5cf6;
  background: #fbf8ff;
}

.stop-card.post-cal {
  border-left-color: #e3483e;
  background: #fff7f6;
}

.stop-card.route-end {
  border-left-color: #506179;
  background: #fbfcff;
}

.stop-card.route-end.planned {
  cursor: default;
}

.stop-card.is-dragging {
  opacity: 0.56;
}

.stop-card.is-drop-target {
  outline: 2px dashed var(--purple);
  outline-offset: 3px;
}

.stop-card-main {
  display: grid;
  grid-template-columns: 70px 34px minmax(220px, 1fr) auto 34px 34px;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 10px 14px;
}

.optimized .stop-card-main {
  grid-template-columns: 42px 34px minmax(220px, 1fr) auto 34px;
}

.reorder-controls {
  display: grid;
  grid-template-columns: 22px repeat(2, 18px);
  gap: 3px;
}

.drag-handle {
  width: 22px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: #637089;
  cursor: grab;
  font-weight: 900;
  line-height: 1;
}

.drag-handle:active {
  cursor: grabbing;
}

.move-button {
  width: 18px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: #8a96a9;
  cursor: pointer;
  font-weight: 800;
  font-size: 12px;
  text-align: center;
  touch-action: none;
  user-select: none;
}

.move-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.stop-title strong,
.stop-title small {
  display: block;
}

.stop-title small {
  margin-top: 4px;
  color: var(--muted);
}

.eta-stack {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 8px;
  flex-wrap: wrap;
}

.eta-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.eta-badge {
  background: #eef3ff;
  color: #294da8;
}

.status-badge.pre-commit {
  background: #eaf8ef;
  color: #13783a;
}

.status-badge.near-cal {
  background: #fff3ce;
  color: #8a5d00;
}

.status-badge.tight-cal {
  background: #ffe3c7;
  color: #a64b00;
}

.status-badge.after-commit {
  background: #ede6ff;
  color: #5d32bf;
}

.status-badge.post-cal {
  background: #ffe3df;
  color: #a22b22;
}

.status-badge.route-end {
  background: #eef2f7;
  color: #40516a;
}

.collapse-button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.stop-card-details {
  padding: 0 14px 12px 96px;
}

.stop-card.is-collapsed .stop-card-details {
  display: none;
}

.route-metrics {
  display: grid;
  grid-template-columns: minmax(190px, 1.35fr) repeat(5, minmax(104px, 1fr));
  gap: 8px;
}

.route-metrics > div,
.route-metrics label {
  display: grid;
  gap: 5px;
  min-height: 64px;
  padding: 10px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #fbfcff;
}

.wide-control {
  min-width: 190px;
}

.route-metrics span,
.route-metrics label > span:first-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.inline-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-transform: none;
}

.warning-line {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
}

.warning-line.pre-commit {
  color: #13783a;
}

.warning-line.near-cal {
  color: #8a5d00;
}

.warning-line.tight-cal {
  color: #a64b00;
}

.warning-line.after-commit {
  color: #5d32bf;
}

.warning-line.post-cal {
  color: #a22b22;
}

.warning-line.route-end {
  color: #40516a;
}

.compare-card {
  margin: 18px 12px;
  border: 1px solid #c8d7ef;
  border-radius: 8px;
  background: #f8fbff;
  overflow: hidden;
}

.compare-card:empty {
  display: none;
}

.compare-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid #d9e5f5;
}

.compare-header h2 {
  font-size: 20px;
}

.compare-header span {
  color: var(--muted);
  font-weight: 700;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 16px;
}

.compare-grid article {
  min-height: 104px;
  padding: 16px;
  border: 1px solid #dce6f4;
  border-radius: 8px;
  background: #fff;
}

.compare-grid small,
.compare-grid span,
.compare-grid em {
  display: block;
  color: var(--muted);
  font-style: normal;
}

.compare-grid strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 22px;
}

.compare-delta.positive {
  border-color: #bfe5cd;
  background: #f3fbf6;
}

.compare-delta.negative {
  border-color: #f0cbc6;
  background: #fff7f6;
}

.add-stop {
  width: calc(100% - 32px);
  min-height: 56px;
  margin: 14px 16px 18px;
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 10px;
  border: 1px dashed var(--purple);
  border-radius: 6px;
  background: #fff;
  color: var(--purple);
  cursor: pointer;
}

.add-stop span {
  display: inline-grid;
  place-items: center;
  justify-self: start;
  width: 30px;
  height: 30px;
  margin-left: 14px;
  border: 1px solid var(--purple);
  border-radius: 50%;
  background: #fff;
}

.add-stop strong {
  justify-self: center;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 16px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(90deg, #fff, #fbf8ff);
}

.summary-strip.success {
  border-color: #f4b8d5;
  background: linear-gradient(90deg, #fff, var(--optimized-soft));
}

.summary-strip article {
  display: flex;
  gap: 18px;
  align-items: center;
  min-height: 86px;
  padding: 16px 26px;
  border-right: 1px solid var(--soft-line);
}

.summary-strip article:last-child {
  border-right: 0;
}

.summary-strip small,
.summary-strip em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: 14px;
}

.summary-strip strong {
  display: block;
  margin-top: 2px;
  font-size: 22px;
}

.summary-strip em {
  margin-top: 6px;
  color: var(--green);
  font-weight: 700;
}

.dose-risk.pre-commit strong,
.dose-risk.pre-commit em {
  color: #13783a;
}

.dose-risk.near-cal strong,
.dose-risk.near-cal em {
  color: #8a5d00;
}

.dose-risk.tight-cal strong,
.dose-risk.tight-cal em {
  color: #a64b00;
}

.dose-risk.post-cal strong,
.dose-risk.post-cal em {
  color: #a22b22;
}

.summary-icon {
  font-size: 28px;
}

.finish {
  background: rgba(107, 61, 244, 0.06);
}

.success .finish {
  background: rgba(232, 62, 140, 0.08);
}

@media (max-width: 980px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .controls {
    align-items: stretch;
  }

  .traffic-legend {
    justify-content: flex-start;
  }

  .planning-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-legend {
    justify-content: flex-start;
  }

  .field,
  .button {
    flex: 1 1 190px;
  }

  .map-section {
    grid-template-columns: 1fr;
    padding-right: 0;
  }

  .customer-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .customer-list {
    height: 280px;
  }

  .map-panel {
    min-height: 430px;
  }

  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stop-card-main {
    grid-template-columns: 70px 34px minmax(0, 1fr) 34px;
  }

  .optimized .stop-card-main {
    grid-template-columns: 42px 34px minmax(0, 1fr) 34px;
  }

  .eta-stack {
    grid-column: 3 / 5;
    justify-content: start;
  }

  .remove-button {
    grid-column: 4;
    grid-row: 1;
  }

  .stop-card-details {
    padding-left: 16px;
  }

  .route-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compare-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .topbar {
    padding: 22px 18px;
  }

  .map-section {
    min-height: auto;
  }

  .section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }

  .summary-strip article {
    border-right: 0;
  }

  .route-board {
    padding: 10px;
  }

  .stop-card-main {
    grid-template-columns: 70px 30px minmax(0, 1fr) 34px;
    gap: 10px;
    padding: 12px;
  }

  .optimized .stop-card-main {
    grid-template-columns: 42px 30px minmax(0, 1fr) 34px;
  }

  .order-badge {
    grid-column: 2;
  }

  .stop-title {
    grid-column: 3 / 5;
  }

  .eta-stack {
    grid-column: 1 / 4;
  }

  .collapse-button {
    grid-column: 4;
    grid-row: 1;
    justify-self: end;
  }

  .remove-button {
    grid-column: 4;
    grid-row: 2;
    justify-self: end;
  }

  .route-metrics {
    grid-template-columns: 1fr;
  }
}
