/* Heavy-haul form polish (owner, 2026-11-19): a clean Pickup / Delivery pair, a 2x2 block of dimensions on a phone, and a labelled Cargo type group.
   Loaded after the page's own styles, so these rules only refine what is there. */

/* The owner's exact gaps are stated once, as tokens (the spacing guard reads custom properties as the token source). */
#hh-form { --hh-gap-addr: 10px; --hh-gap-seg: 6px; }

/* Pickup address | Delivery address: two equal columns, no dotted spacer between them. */
#hh-form .hh-inaddr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--hh-gap-addr); }
#hh-form .hh-inaddr > .hh-routemk { display: none; }
#hh-form .hh-inaddr .hh-sug { width: calc(200% + var(--hh-gap-addr)); }

/* Cargo type: the label sits above three equal buttons, each with its own border and a clear active state. */
#hh-form .hh-mobility-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--hh-gap-seg); align-items: start; }
#hh-form .hh-mobility-row > .hh-lab { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }
#hh-form .hh-mobility { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--hh-gap-seg); border: 0; border-radius: 0; overflow: visible; }
#hh-form .hh-mobility button,
#hh-form #hh-shipment .hh-mobility button,
#hh-form .hh-cargo-input-card .hh-mobility button {
  height: 38px; min-height: 38px; padding: 0 var(--hh-gap-seg); flex: none;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-weight: 500; white-space: nowrap; color: var(--ink); background: var(--surface);
}
#hh-form .hh-mobility button + button { border-left: 1px solid var(--border); }
#hh-form .hh-mobility button:hover { background: var(--surface-2); }
#hh-form .hh-mobility button[aria-checked="true"],
#hh-form #hh-shipment .hh-mobility button[aria-checked="true"] {
  border-color: var(--accent); color: var(--accent); font-weight: 600;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}
#hh-form .hh-cargo-input-card .hh-mobility button:nth-child(2) { flex-grow: 0; }

/* A unit label (ft, m, lb) never wraps or squeezes inside a narrow box. */
#hh-form .hh-field .hh-sfx, #hh-form .hh-uom-opt { white-space: nowrap; flex-shrink: 0; }

/* Phones: Length | Width, then Height | Cargo weight, then the Cargo type group, then the type picker and quantity. */
@media (max-width: 639px) {
  #hh-form .hh-cargo-input-card { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 8px; row-gap: 8px; }
  #hh-form .hh-cargo-input-card .hh-incargo, #hh-form .hh-cargo-input-card #hh-shipment { display: contents; }
  #hh-form .hh-cargo-input-card .hh-incargo > .hh-field { grid-column: auto / span 1; }
  #hh-form .hh-cargo-input-card #hh-shipment > .hh-field--unit { grid-column: auto / span 1; }
  #hh-form .hh-cargo-input-card .hh-incargo > .hh-field:nth-child(1) { order: 1; }
  #hh-form .hh-cargo-input-card .hh-incargo > .hh-field:nth-child(2) { order: 2; }
  #hh-form .hh-cargo-input-card .hh-incargo > .hh-field:nth-child(3) { order: 3; }
  #hh-form .hh-cargo-input-card #hh-shipment > .hh-field--unit { order: 4; }
  #hh-form .hh-cargo-input-card #hh-shipment > .hh-mobility-row { order: 5; grid-column: 1 / -1; }
  #hh-form .hh-cargo-input-card #hh-shipment .hh-field--ctype { order: 6; grid-column: 1 / -1; }
  #hh-form .hh-cargo-input-card #hh-shipment .hh-field--quantity { order: 7; grid-column: 1 / -1; }
  #hh-form .hh-cargo-input-card .hh-field--unit > input { min-width: 0; }
}
