/* Trip estimator v0.1; scoped to avoid changing the Jobs form or themes. */
.trip-launch { position: relative; font-family: inherit; }
.trip-new { position: absolute; right: -5px; bottom: -9px; background: #186331; color: #fff; border-radius: 4px; padding: 1px 5px; font-size: .75rem; line-height: 1.4; text-shadow: none; }
nav li.trip-nav { margin-left: auto; }
nav li.trip-nav + li.cta { margin-left: 0; }
#rates .trip-launch { margin-top: 1rem; }
:is(#trip-estimator, #trip-details) { color: var(--fg); background: var(--bg); width: min(780px, calc(100% - 24px)); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); padding: 1.25rem; border: 1px solid #ddd; border-radius: 12px; overflow: auto; }
:is(#trip-estimator, #trip-details)::backdrop { background: rgba(0, 0, 0, .65); }
body.trip-estimator-open { overflow: hidden; }
:is(#trip-estimator, #trip-details) .trip-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
:is(#trip-estimator, #trip-details) h2 { margin: 0; }
:is(#trip-estimator, #trip-details) button, :is(#trip-estimator, #trip-details) input { font: inherit; }
:is(#trip-estimator, #trip-details) .trip-close { background: #f4f6f8; color: #111; cursor: pointer; }
:is(#trip-estimator, #trip-details) .trip-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0; }
:is(#trip-estimator, #trip-details) label { display: block; font-weight: 600; }
:is(#trip-estimator, #trip-details) input { display: block; width: 100%; min-width: 0; padding: .6rem; border: 1px solid #999; border-radius: 4px; color: #111; background: #fff; }
:is(#trip-estimator, #trip-details) button:focus-visible, :is(#trip-estimator, #trip-details) a:focus-visible, .trip-launch:focus-visible { outline: 3px solid #0a66c2; outline-offset: 3px; }
:is(#trip-estimator, #trip-details) button:disabled { opacity: .6; cursor: wait; }
#trip-map { height: 300px; width: 100%; background: #f4f6f8; border: 1px solid #ddd; border-radius: 6px; }
:is(#trip-estimator, #trip-details) .trip-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
:is(#trip-estimator, #trip-details) .trip-summary strong { display: block; font-size: 2rem; line-height: 1.3; }
:is(#trip-estimator, #trip-details) .trip-summary span { display: block; }
:is(#trip-estimator, #trip-details) .trip-error { color: #a21b1b; font-weight: 600; }
:is(#trip-estimator, #trip-details) [hidden] { display: none !important; }
@media (max-width: 540px) {
  :is(#trip-estimator, #trip-details) { padding: 1rem; }
  :is(#trip-estimator, #trip-details) .trip-fields { grid-template-columns: 1fr; gap: .75rem; }
  #trip-map { height: 240px; }
  :is(#trip-estimator, #trip-details) .trip-summary strong { font-size: 1.6rem; }
  :is(#trip-estimator, #trip-details) .trip-call { width: 100%; text-align: center; }
}
@media print { :is(#trip-estimator, #trip-details), .trip-launch { display: none !important; } }

/* Keep the primary estimate quiet; detailed explanations live in a second dialog. */
#trip-details { width: min(620px, calc(100% - 24px)); }
#trip-estimator .trip-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
#trip-restart { background: #f4f6f8; color: #111; cursor: pointer; }
#trip-estimator .trip-details-link { display: inline; background: none; border: 0; padding: 0; color: #0a66c2; text-decoration: underline; cursor: pointer; font: inherit; }
#trip-estimator .trip-details-link:hover { color: #084c91; }
#trip-estimator .trip-area-notice { background: #fff4d6; color: #674400; border-left: 3px solid #e09b13; padding: .6rem .75rem; }
#trip-details .trip-breakdown { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: .5rem 1rem; margin: 1.25rem 0; }
#trip-details dt { font-weight: 600; }
#trip-details dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 540px) {
  #trip-details .trip-breakdown { grid-template-columns: 1fr; gap: .15rem; }
  #trip-details dd { margin-bottom: .6rem; }
}

/* Inset input focus stays clear of labels; empty estimates remain in place. */
#trip-estimator input:focus { outline: none; border-color: #666; box-shadow: inset 0 0 0 1px #888; }
#trip-result.trip-summary-empty strong { color: #777; }

/* Matching label heights align the values; button progress keeps its width. */
#trip-result .trip-summary-label { line-height: 1.4; }
#trip-result .trip-progress { display: inline; visibility: hidden; white-space: nowrap; font-size: .8em; }
#trip-result.trip-calculating .trip-progress { visibility: visible; }
#trip-estimator .trip-call { flex-direction: column; gap: .1rem; }
#trip-estimator .trip-call-number { font-weight: 700; white-space: nowrap; }
#trip-estimator .trip-heading .trip-close { flex-shrink: 0; }
@media (max-width: 540px) {
  #trip-result .trip-summary-label { min-height: 2.8em; }
}
#trip-calculate { min-width: 12rem; }

/* Brand icon and plain phone number share the primary popup header. */
#trip-estimator .trip-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .75rem; }
#trip-estimator-title { display: flex; align-items: center; gap: .5rem; min-width: 0; }
#trip-estimator-title img { flex: 0 0 24px; }
#trip-estimator .trip-heading-phone { white-space: nowrap; font-size: 1.4rem; font-weight: 800; line-height: 1.2; }
@media (max-width: 640px) {
  #trip-estimator .trip-heading { grid-template-columns: minmax(0, 1fr) auto; gap: .25rem .75rem; }
  #trip-estimator-title { grid-column: 1; grid-row: 1; }
  #trip-estimator .trip-heading-phone { grid-column: 1; grid-row: 2; padding-left: 2rem; }
  #trip-estimator .trip-heading .trip-close { grid-column: 2; grid-row: 1 / span 2; }
}
#trip-estimator a.trip-heading-phone { color: inherit; text-decoration: none; }

#rates .trip-estimate-link { color: var(--accent, #0a66c2); text-decoration: underline; }

/* One billed distance, with the minimum note beside it when space permits. */
#trip-result .trip-distance-value { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: .4rem; line-height: 1.3; }
#trip-result #trip-minimum { display: inline; font-size: .875rem; }
@media (max-width: 540px) {
  #trip-result .trip-distance-value { min-height: 3.5rem; align-content: flex-start; }
}