/* Clean Dispatch V3.63 - stable mileage form + single live map layout */

/* Stop mobile admin/order pages from bouncing horizontally */
html.cd-order-mileage-stable,
html.cd-order-mileage-stable body {
  overflow-x: hidden !important;
  max-width: 100% !important;
}

html.cd-order-mileage-stable .main-panel,
html.cd-order-mileage-stable .content,
html.cd-order-mileage-stable .card,
html.cd-order-mileage-stable form,
html.cd-order-mileage-stable .form-grid,
html.cd-order-mileage-stable .mileage-panel,
html.cd-order-mileage-stable .pricing-preview {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

html.cd-order-mileage-stable .mileage-panel {
  align-items: end;
}

html.cd-order-mileage-stable #mileage_status {
  display: block;
  min-height: 1.2em;
  line-height: 1.35;
  word-break: normal;
  overflow-wrap: anywhere;
}

html.cd-order-mileage-stable #pricing_preview {
  min-height: 48px;
  overflow-wrap: anywhere;
}

html.cd-order-mileage-stable #calculate_route_mileage {
  width: 100%;
  white-space: normal;
  line-height: 1.2;
}

/* Live map: force exactly one stable, visible map container */
.v363-live-page,
.v361-live-page {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.v360-live-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, .9fr);
  gap: 18px;
  align-items: start;
}

.v360-map-card {
  min-width: 0;
  overflow: hidden;
}

.v360-map,
#v360-live-map {
  width: 100% !important;
  height: min(72vh, 680px) !important;
  min-height: 520px !important;
  border-radius: 24px;
  overflow: hidden;
  background: #e5edf7;
  position: relative;
  z-index: 1;
}

#v360-live-map .leaflet-container,
.leaflet-container {
  font: inherit;
}

#v360-live-map .leaflet-tile-container img {
  max-width: none !important;
  max-height: none !important;
}

.v363-map-toolbar,
.v361-map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.v360-list-item {
  display: block;
  width: 100%;
  margin: 0 0 10px 0;
  padding: 14px;
  border: 1px solid #dbe5f4 !important;
  border-radius: 18px;
  background: #fff !important;
  box-shadow: 0 8px 22px rgba(15,23,42,.06);
}

.v360-list-item strong,
.v360-list-item small,
.v360-list-item span {
  display: block;
  overflow-wrap: anywhere;
}

.v360-pill {
  display: inline-block !important;
  width: auto !important;
  margin: 6px 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  background: #e5e7eb;
  color: #334155;
}

.v360-pill.on { background: #dcfce7; color: #166534; }
.v360-pill.off { background: #f1f5f9; color: #475569; }
.v360-pill.job { background: #dbeafe; color: #1d4ed8; }

.v360-empty-card {
  padding: 18px;
  border: 1px dashed #b6c7de;
  border-radius: 18px;
  background: #f8fafc;
  color: #64748b;
}

@media (max-width: 900px) {
  .v360-live-grid {
    grid-template-columns: 1fr;
  }
  .v360-map,
  #v360-live-map {
    height: 62vh !important;
    min-height: 420px !important;
    border-radius: 20px;
  }
}

@media (max-width: 520px) {
  html.cd-order-mileage-stable .form-grid,
  html.cd-order-mileage-stable .form-grid.two,
  html.cd-order-mileage-stable .form-grid.three,
  html.cd-order-mileage-stable .form-grid.four {
    grid-template-columns: 1fr !important;
  }
  .v360-map,
  #v360-live-map {
    min-height: 380px !important;
  }
}
