/* Plan's editing, results and comparison views share the atlas typography. */
.housing-preferences { margin: 12px 0 0; padding: 8px 0 0; min-width: 0; border: 0; background: transparent; color: var(--action-ink); font: 400 var(--panel-label)/1.45 var(--font-ui); }
.housing-preferences legend { padding: 0; font: 650 var(--type-body)/1.4 var(--font-ui); }
.housing-preferences-row { display: grid; grid-template-columns: minmax(70px, .75fr) minmax(100px, 1.25fr); gap: 10px; }
.housing-preferences label { display: grid; gap: 4px; min-width: 0; }
body.is-route-mode .housing-preferences label > span { color: var(--action-muted); font: 600 var(--panel-label)/1.4 var(--font-ui); letter-spacing: 0; text-transform: none; }
body.is-route-mode .housing-preferences :is(input, select) { width: 100%; min-width: 0; min-height: 44px; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--action-edge); border-radius: var(--action-radius); background: var(--action-paper); color: var(--action-ink); box-shadow: var(--action-inset); font: 400 var(--panel-body)/1.4 var(--font-ui); }
.housing-preferences :is(input, select):focus-visible { outline: 2px solid var(--button-focus-ring, var(--accent)); outline-offset: 3px; }
body.is-route-mode .housing-preferences > small { display: block; margin-top: 5px; color: var(--action-muted); font: 400 var(--panel-label)/1.45 var(--font-ui); }
body.is-route-mode :is(.housing-preferences p, .housing-map-key p) { color: var(--action-muted); font: 400 var(--panel-label)/1.5 var(--font-ui); margin: 8px 0; }
.housing-map-key { margin-top: 12px; border-top: 1px solid var(--commute-rule); }
.housing-sort { margin-top: 10px; }
.housing-coverage { padding-left: 16px; max-height: 180px; overflow-y: auto; }
.housing-coverage li { margin: 5px 0; }
.housing-rent { display: grid; gap: 3px; padding: 10px 0 2px; text-align: left; font: 400 .8125rem/1.4 var(--font-ui); }
.commute-fit-candidate-select .housing-rent > strong, .housing-rent > strong { color: var(--action-ink); font: 650 var(--panel-lead)/1.3 var(--font-metric); font-variant-numeric: tabular-nums; }
.housing-rent > strong > span { font-size: var(--panel-label); font-weight: 400; color: var(--action-muted); }
body.is-route-mode .housing-rent small { display: block; font: 400 var(--panel-label)/1.45 var(--font-ui); color: var(--action-muted); overflow-wrap: anywhere; }
.housing-rent.is-unavailable > strong { color: var(--action-muted); font-size: var(--type-body); }
.housing-budget-status { border-left: 2px solid var(--action-edge); padding-left: 8px; margin-top: 4px; }
.housing-evidence { font: 400 var(--panel-label)/1.5 var(--font-ui); margin-top: 4px; overflow-wrap: anywhere; }
.housing-evidence summary { cursor: pointer; min-height: 44px; }
.housing-evidence a { color: var(--action-ink); text-underline-offset: 3px; }
.housing-evidence a:focus-visible { outline: 2px solid var(--button-focus-ring, var(--accent)); outline-offset: 3px; }
.housing-evidence dl > div { display: flex; justify-content: space-between; gap: 8px; }
.housing-evidence dd { margin: 0; }
.plan-focused-candidate > .housing-preferences { margin: 0 12px 12px; }
.commute-task-description { color: var(--ink-muted, #625c54); font: 400 .875rem/1.5 var(--font-ui); margin: 12px 0; }
.home-finder-place-editor { min-width: 0; }
.home-finder-place-editor > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 44px; padding: 6px 0; cursor: pointer; list-style: none;
  color: var(--ink-muted, #625c54); font: 500 .8125rem/1.5 var(--font-ui);
}
.home-finder-place-editor > summary::-webkit-details-marker { display: none; }
.home-finder-place-editor > summary > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.home-finder-edit-label { flex-shrink: 0; text-decoration: underline; text-underline-offset: 3px; }
.home-finder-place-editor > summary:focus-visible,
.plan-comparison button:focus-visible,
.plan-comparison-scroll:focus-visible { outline: 2px solid var(--accent, #b4422b); outline-offset: 2px; }
.home-finder-place-editor[open] > .home-finder-place-controls { padding-bottom: 10px; }
.home-finder-baseline > summary { cursor: pointer; font: 600 .875rem/1.5 var(--font-ui); padding: 4px 0; }
.home-finder-baseline > summary small { color: var(--ink-muted, #625c54); font-weight: 400; }
.home-finder-baseline[open] > summary { margin-bottom: 10px; }
.home-finder-baseline > summary > [data-home-finder-baseline-label] { display: block; font-weight: 400; overflow-wrap: anywhere; }
.plan-destination-preview { display: grid; gap: 2px; padding-top: 8px; font: 400 .8125rem/1.4 var(--font-ui); }
.commute-fit-candidate-select .plan-destination-preview > strong { font: 600 .8125rem/1.4 var(--font-ui); }
.commute-fit-candidate-select .plan-destination-preview > em { color: #923b23; font: 500 .8125rem/1.4 var(--font-ui); padding: 0; }
.plan-average-context { display: grid; gap: 4px; font: 400 .75rem/1.4 var(--font-ui); }
.plan-save-candidate, .plan-back-results, .plan-comparison > button {
  min-height: 44px; padding: 8px 12px; border: 1px solid var(--commute-rule-strong, #b9b1a4);
  background: transparent; color: inherit; cursor: pointer; font: 600 .8125rem/1.4 var(--font-ui);
}
.plan-save-candidate { margin: 0 12px 12px; }
.plan-save-candidate[aria-pressed="true"] { background: var(--commute-selection-wash, #e7e0d4); }
.plan-focused-candidate .plan-back-results { margin: 12px; }
.plan-focused-candidate .commute-fit-dossier-actions { margin: 12px 0; }
.plan-stop-choices > summary { min-height: 44px; align-content: center; cursor: pointer; font: 600 .875rem/1.5 var(--font-ui); }
.commute-fit-results-toolbar { flex-wrap: wrap; gap: 6px; }
.commute-fit-results-toolbar > button:disabled { opacity: .55; cursor: default; }
.plan-comparison { min-width: 0; padding: 12px 0; }
.plan-comparison > h3 { margin: 20px 0 8px; font: 600 1.5rem/1.2 var(--font-editorial, var(--font-ui)); }
.plan-comparison > p { font: 400 .875rem/1.5 var(--font-ui); }
.plan-comparison-choices { display: grid; gap: 4px; margin: 16px 0; padding: 10px; border: 1px solid var(--commute-rule-strong, #b9b1a4); }
.plan-comparison-choices legend { font: 600 .875rem/1.5 var(--font-ui); }
.plan-comparison-choices label { display: flex; align-items: center; gap: 8px; min-height: 44px; font: 500 .875rem/1.4 var(--font-ui); }
.plan-comparison-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.plan-comparison table { border-collapse: collapse; font: 400 .8125rem/1.5 var(--font-ui); width: 100%; }
.plan-comparison caption { text-align: left; padding: 8px 0; font-weight: 600; }
.plan-comparison th, .plan-comparison td { min-width: 130px; padding: 12px 10px; vertical-align: top; text-align: left; border-bottom: 1px solid var(--commute-rule-strong, #b9b1a4); }
.plan-comparison th { font-weight: 600; }
.plan-comparison td small { display: block; margin-top: 6px; color: var(--ink-muted, #625c54); }
.plan-comparison tbody th { min-width: 100px; }
body.is-route-mode .commute-fit-candidate-rank { align-self: start; }
body.is-route-mode .plan-priority-badge { display: block; color: var(--accent, #923b23); font: 600 .75rem/1.4 var(--font-ui); }
body.is-route-mode .commute-fit-candidate-average { align-self: start; }
body.is-route-mode .commute-fit-candidate-average > small { font: 500 .75rem/1.4 var(--font-ui); white-space: normal; }
/* The atlas is the visual reference: ink for values, rust for actions,
 * green reserved for saved/within-limit state, and rules instead of nested cards. */
body.is-route-mode .commute-fit-results-context { padding: 6px 0; border: 0; background: transparent; box-shadow: none; }
body.is-route-mode .commute-fit-results-context > :is(span, small) { color: var(--action-muted); font: 500 var(--panel-label)/1.4 var(--font-ui); letter-spacing: 0; text-transform: none; }
body.is-route-mode .commute-fit-results-context > strong { font: 650 var(--type-body)/1.4 var(--font-ui); }
body.is-route-mode .commute-fit-candidate-copy > strong { font: 650 var(--type-lead)/1.25 var(--font-ui); }
body.is-route-mode .commute-fit-candidate-copy > small { color: var(--action-muted); font: 400 var(--panel-label)/1.45 var(--font-ui); }
body.is-route-mode .commute-fit-candidate-rank > span { border: 1px solid var(--action-edge); background: var(--action-paper); font-weight: 600; }
body.is-route-mode .commute-fit-candidate-average { min-width: 76px; max-width: 84px; }
body.is-route-mode .commute-fit-candidate-average > small { color: var(--action-muted); font-size: var(--panel-label); }
body.is-route-mode .commute-fit-candidates > header > :is(span, strong) { font: 600 var(--panel-label)/1.4 var(--font-ui); letter-spacing: 0; text-transform: none; }
body.is-route-mode .commute-fit-candidates > header > span { color: var(--action-ink); }
body.is-route-mode .commute-fit-dossier-ledger :is(dt, dd span),
body.is-route-mode .commute-fit-dossier-trip-times :is(small, em) { color: var(--action-muted); font: 500 var(--panel-label)/1.4 var(--font-ui); }
body.is-route-mode .commute-fit-dossier-section > h4 { font: 650 var(--panel-label)/1.4 var(--font-ui); letter-spacing: .02em; }
body.is-route-mode :is(.commute-fit-dossier-identity h3, .plan-comparison > h3) { margin: 4px 0 8px; color: var(--action-ink); font: 600 var(--panel-title)/1.2 var(--font-editorial); letter-spacing: -.015em; text-transform: none; }
body.is-route-mode :is(.commute-fit-dossier-identity h3, .plan-comparison > h3)::after { content: none; }
body.is-map-active.is-route-mode :is(.housing-evidence, .housing-map-key, .plan-stop-choices) > summary { font: 650 var(--panel-label)/1.4 var(--font-ui); letter-spacing: 0; text-transform: none; }
body.is-route-mode .plan-comparison-choices input[type="checkbox"] { width: 16px; height: 16px; flex: 0 0 16px; accent-color: var(--commute-rail-green); }
@media (max-width: 980px) {
  body.is-route-mode .housing-preferences :is(input, select) { font-size: 16px; }
  body.is-route-mode #mobileSheet[data-snap] .mobile-route-card .home-finder-place-list { display: grid; overflow: visible; order: 0; }
  body.is-route-mode #mobileSheet[data-snap] .mobile-route-card .home-finder-place { width: auto; min-width: 0; }
  body.is-route-mode #mobileSheet[data-snap] .mobile-route-card .home-finder-place-editor[open] .home-finder-place-controls { display: grid; }
  body.is-route-mode #mobileSheet[data-snap] .mobile-route-card .home-finder-place-controls select { font-size: 16px; min-height: 44px; }
  body.is-route-mode #mobileSheet[data-snap] .mobile-route-card .home-finder-place > header button { width: 44px; min-height: 44px; }
  body.is-route-mode #mobileSheet[data-snap] .commute-fit-candidate-select { grid-template-columns: 24px minmax(0, 1fr) 76px; gap: 8px; }
}
/* A citywide figure repeats across a city's results; keep it quieter than area evidence. */
.housing-rent.is-city-reference > strong { color: var(--action-muted); font-weight: 600; }
.plan-unit-note { display: grid; gap: 4px; padding: 10px 0 10px 12px; border-left: 2px solid #a98132; color: var(--action-muted); font: 400 12px/1.5 var(--font-ui); }
.plan-unit-note > strong { color: var(--action-ink); font-size: 13px; font-weight: 600; }
.plan-comparison-hint { color: var(--action-muted); font-size: 12px; margin-bottom: 4px; }
.plan-comparison table { border-collapse: separate; border-spacing: 0; }
.plan-comparison thead th { background: #e9e3d7; }
.plan-comparison thead th small { display: block; margin-top: 6px; font: 400 12px/1.4 var(--font-ui); color: var(--action-muted); }
.plan-comparison tr > th:first-child { position: sticky; left: 0; z-index: 1; min-width: 90px; max-width: 110px; background: #f4f0e6; border-right: 1px solid var(--action-edge); }
.plan-comparison tr > :not(:first-child) { min-width: 170px; max-width: 210px; }

/* Results own the first screen; secondary controls remain editable in place. */
.plan-results-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: start; }
.plan-results-settings { flex: 1 1 165px; min-width: 0; }
.plan-results-settings[open] { flex-basis: 100%; }
.plan-results-settings > summary { cursor: pointer; min-height: 44px; align-content: center; font: 600 13px/1.4 var(--font-ui); }
.plan-results-settings > .housing-preferences { margin-block: 8px; }
.plan-compare-saved { margin-left: auto; }
/* The steps double as navigation: Destinations, or back to unchanged results. */
.home-finder-progress [data-home-finder-stage-link] {
  display: grid; gap: 5px; justify-items: center; align-content: start; min-width: 44px; min-height: 44px;
  margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer;
}
.home-finder-progress [data-home-finder-stage-link]:is([aria-disabled="true"], [aria-current="step"]) { cursor: default; }
.home-finder-progress [data-home-finder-stage-link]:focus-visible { outline: 2px solid var(--accent, #b4422b); outline-offset: 2px; }
.plan-start-over, .home-finder-clear-all { min-height: 44px; font: 600 13px/1.4 var(--font-ui); cursor: pointer; }
.home-finder-clear-all { padding: 0 4px; border: 0; background: none; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.plan-unit-caption { font: 400 12px/1.45 var(--font-ui); color: var(--action-muted); margin: 8px 0 14px; }
.plan-weekly-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 8px 0; color: var(--action-muted); font: 400 11px/1.4 var(--font-ui); }
.plan-weekly-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.plan-weekly-legend i { width: 7px; height: 7px; border-radius: 1px; }
.plan-weekly-bar { display: flex; width: 100%; height: 8px; margin: 10px 0 6px; background: #e6e0d3; border-radius: 2px; overflow: hidden; }
.plan-weekly-bar > i { display: block; flex: 0 0 auto; height: 100%; background: var(--destination-color); }
.plan-weekly-comparison { margin: 20px 0; }
.plan-weekly-comparison > div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 3px 12px; padding: 12px 0; border-bottom: 1px solid var(--action-edge); font: 600 14px/1.4 var(--font-ui); }
.plan-weekly-comparison small { display: block; font: 400 12px/1.4 var(--font-ui); color: var(--action-muted); }
.plan-weekly-comparison .plan-weekly-bar { grid-column: 1/-1; margin: 4px 0; height: 12px; }
body.is-route-mode .commute-fit-candidate-select { padding-block: 14px 8px; }
body.is-route-mode .commute-fit-candidate-select .plan-destination-preview { padding-top: 5px; gap: 0; }
body.is-route-mode .commute-fit-candidate-select .plan-destination-preview > strong { font-size: 12px; }
body.is-route-mode .commute-fit-candidate-select .housing-rent { margin-top: 6px; }
body.is-route-mode .commute-fit-candidate-select .housing-rent > strong { font-size: 14px; }
body.is-route-mode .commute-fit-candidate-average > strong { font: 600 30px/1 var(--font-metric); }
body.is-route-mode [data-home-finder-stage="results"] .home-finder-progress { display: none; }
body.is-route-mode .commute-fit-candidate:not(.plan-focused-candidate) { position: relative; }
body.is-route-mode .commute-fit-candidate:not(.plan-focused-candidate) > .plan-save-candidate { position: absolute; bottom: 12px; right: 0; margin: 0; }
body.is-route-mode [data-home-destinations="1"] .plan-destination-preview > strong { display: none; }
body.is-route-mode .commute-fit-candidates > header { padding-block: 10px; }
body.is-route-mode .commute-fit-candidates > header > span { font: 600 21px/1.2 var(--font-editorial); }

/* A dated answer and a chronological strip, with a full-size touch target. */
.route-answer-endpoints { display: none; }
body.is-route-mode .route-answer { display: flex; align-items: baseline; gap: 10px; margin: 10px 0 4px; }
body.is-route-mode .route-answer > strong { font: 600 46px/1.1 var(--font-metric); letter-spacing: -.04em; color: var(--action-ink); }
body.is-route-mode .route-answer > span { color: var(--action-muted); font: 400 13px/1.4 var(--font-ui); }
body.is-route-mode .route-evidence-header .sf-route-schedule { margin: 4px 0 12px; font: 400 12px/1.4 var(--font-ui); }
body.is-route-mode .route-journey-strip .route-cost-bar { display: flex; gap: 0; height: 44px; min-height: 44px; border-radius: 3px; overflow: visible; }
body.is-route-mode .route-journey-strip .route-cost-segment { flex-grow: 0; flex-shrink: 0; min-width: 0; min-height: 44px; padding: 0; margin: 0; border: 0; border-radius: 0; background: var(--segment-color); box-shadow: inset -1px 0 #fff8; transform: none; }
body.is-route-mode .route-journey-strip button.route-cost-segment { cursor: pointer; }
body.is-route-mode .route-journey-strip .route-cost-segment:focus-visible { outline: 3px solid var(--action-ink); outline-offset: 3px; z-index: 1; }
body.is-route-mode .route-journey-strip .route-cost-segment:hover { filter: brightness(1.12); transform: none; }
body.is-route-mode .route-journey-strip .route-cost-segment::before,
body.is-route-mode .route-journey-strip .route-cost-segment::after,
body.is-route-mode .route-journey-strip .route-cost-segment > i { display: none; }
body.is-route-mode .route-journey-strip .route-cost-axis { font: 600 12px/1.4 var(--font-ui); letter-spacing: 0; padding: 8px 0; }
body.is-route-mode .route-journey-strip .route-cost-labels { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 10px 0; }
body.is-route-mode .route-journey-strip .route-cost-labels > span { display: inline-flex; gap: 5px; align-items: center; }
body.is-route-mode .route-journey-strip .route-cost-labels :is(b,strong) { font: 500 12px/1.4 var(--font-ui); }
body.is-route-mode.has-route-endpoints .route-check-workflow > .commute-task-description { display: none; }
body.is-route-mode .route-method-note { font: 400 12px/1.5 var(--font-ui); }
body.is-route-mode .commute-day-duration-track { display: flex; height: 12px; background: #e6e0d3; width: 100%; grid-column: 1/-1; overflow: hidden; border-radius: 2px; }
body.is-route-mode .commute-day-duration-track i { flex: 0 0 auto; height: 100%; }
body.is-route-mode .briefing-masthead[data-content-type="commute"][data-trip-answer="true"] { padding-block: 16px; }
body.is-route-mode .briefing-masthead[data-content-type="commute"][data-trip-answer="true"] .briefing-masthead-title > strong { font: 600 24px/1.2 var(--font-editorial); }
@media (max-width: 980px) {
  body.is-route-mode .route-evidence-header .route-answer-endpoints { display: grid; gap: 5px; margin: 0 0 14px; }
  body.is-route-mode .route-answer-endpoints > span { display: grid; grid-template-columns: 32px minmax(0,1fr); gap: 8px; }
  body.is-route-mode .route-answer-endpoints :is(small,strong) { font: 500 12px/1.4 var(--font-ui); }
  body.is-route-mode .route-answer-endpoints small { color: var(--action-muted); }
}

/* Commute mode: one four-way choice for the search, repeated per destination
 * only when there is more than one. Glyphs share the map travel-mode family. */
.home-finder-mode-icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.home-finder-commute-mode-label { color: var(--action-ink, #191815); font: 650 var(--panel-label)/1.4 var(--font-ui); }
.home-finder-mode-choices,
.home-finder-place-mode-choices { display: grid; grid-template-columns: repeat(4, minmax(min-content, 1fr)); gap: 2px; min-width: 0; }
.home-finder-mode-choices { padding: 3px; border: 1px solid var(--commute-rule, rgba(17, 16, 14, 0.15)); border-radius: 10px; background: rgba(255, 253, 247, 0.64); }
.home-finder-place-mode-choices { grid-column: 1 / -1; }
html:is([data-material-prototype], :not([data-material-prototype])) body :is(.home-finder-mode-choices, .home-finder-place-mode-choices) > .home-finder-mode-choice[data-atlas-control][data-atlas-control] {
  display: grid; justify-items: center; align-content: center; gap: 2px;
  min-width: 0; min-height: 52px; padding: 6px 2px; border-radius: 7px;
  /* Whole words only; long translations ("Transporte") shrink on narrow phones. */
  font: 650 clamp(0.6875rem, 3.3vw, var(--panel-label))/1.15 var(--font-ui); overflow-wrap: normal; word-break: normal; text-align: center;
}
html:is([data-material-prototype], :not([data-material-prototype])) body .home-finder-place-mode-choices > .home-finder-mode-choice[data-atlas-control][data-atlas-control] { min-height: 48px; padding-block: 4px; }
html body .home-finder-place-mode-choices > .home-finder-mode-choice .home-finder-mode-icon { width: 18px; height: 18px; }
html[data-material-prototype] body.is-map-active :is(.home-finder-mode-choices, .home-finder-place-mode-choices) > .home-finder-mode-choice[data-atlas-control="tab"][aria-pressed="true"] { color: var(--action-ink, #191815); }
html[data-material-prototype] body.is-map-active :is(.home-finder-mode-choices, .home-finder-place-mode-choices) > .home-finder-mode-choice[data-atlas-control="tab"][aria-pressed="true"]::after { left: 22%; right: 22%; }
.home-finder-mode-note { margin: 0; color: var(--action-muted, #625d53); font: 400 var(--panel-label)/1.45 var(--font-ui); }
.home-finder-place-mode { display: inline-flex; align-items: center; gap: 4px; color: var(--action-ink, #191815); font-weight: 650; vertical-align: -4px; }
.home-finder-place-mode .home-finder-mode-icon { width: 18px; height: 18px; }
body.is-route-mode .commute-fit-results-context > .commute-fit-results-mode { display: inline-flex; align-items: center; gap: 4px; color: var(--action-ink, #191815); font: 650 var(--panel-label)/1.4 var(--font-ui); align-self: center; }
.commute-fit-results-mode .home-finder-mode-icon { width: 18px; height: 18px; }
.commute-fit-dossier-trip-copy .commute-fit-dossier-trip-mode { display: inline-flex; align-items: center; gap: 4px; margin-right: 4px; padding: 1px 6px 1px 4px; border: 1px solid var(--commute-rule, rgba(17, 16, 14, 0.15)); border-radius: 999px; background: rgba(255, 253, 247, 0.8); font: 650 .75rem/1.3 var(--font-ui); vertical-align: 1px; }
.commute-fit-dossier-trip-mode .home-finder-mode-icon { width: 16px; height: 16px; }
.commute-fit-dossier-trip-copy .commute-fit-dossier-path { color: var(--action-ink, #191815); font-variant-numeric: tabular-nums; }
/* On the narrowest phones a destination's own mode row keeps its icons; the
 * words stay in each button's accessible name and in the row above. */
@media (max-width: 359px) {
  .home-finder-place-mode-choices > .home-finder-mode-choice > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 980px) {
  html:is([data-material-prototype], :not([data-material-prototype])) body .mobile-route-card .home-finder-mode-choices > .home-finder-mode-choice[data-atlas-control][data-atlas-control] { min-height: 56px; }
}
/* "Fewest transfers" is hidden when no destination uses transit; the third
 * remaining choice then fills the row instead of leaving an empty cell. */
.commute-fit-priority > button[hidden],
html[data-material-prototype] body.is-route-mode .commute-fit-priority > button[hidden] { display: none; }
.commute-fit-priority:has(> button[data-commute-fit-priority="low-transfer"][hidden]) > button[data-commute-fit-priority="fairest"] { grid-column: span 2; }

/* Check a trip: the same four-way travel choice, and a drive/bike/walk
 * summary in place of the timetable breakdown. */
.route-travel-mode { display: grid; gap: 6px; min-width: 0; margin: 4px 0 12px; grid-column: 1 / -1; }
.route-direct-summary { display: grid; gap: 8px; min-width: 0; }
.route-direct-summary > p { margin: 0; color: var(--action-muted, #625d53); font: 400 var(--panel-label)/1.45 var(--font-ui); overflow-wrap: anywhere; }
.route-direct-summary > .route-direct-mode { color: var(--action-ink, #191815); }
.route-direct-times { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.route-direct-times > span { display: inline-flex; align-items: baseline; gap: 5px; }
.route-direct-times small { color: var(--action-muted, #625d53); font: 600 var(--panel-label)/1 var(--font-ui); }
.route-direct-times b { color: var(--action-ink, #191815); font: 650 var(--panel-metric, 2.125rem)/1 var(--font-metric, var(--font-ui)); font-variant-numeric: tabular-nums; }
.route-direct-times em { color: var(--action-muted, #625d53); font: 500 var(--panel-label)/1 var(--font-ui); font-style: normal; }
.route-direct-times > i { color: var(--action-muted, #625d53); font-style: normal; }
.route-direct-summary > .route-direct-path, .route-direct-summary > .route-direct-traffic { color: var(--action-ink, #191815); font-variant-numeric: tabular-nums; }

/* On a phone the map's bottom edge sits under the sheet, which hid Find a
   Home's messages and their Undo. Show them at the top, below the picker. */
@media (max-width: 760px) {
  /* Centered by margins: the entrance motion replaces the transform. */
  body.is-map-active.is-route-mode .toast {
    position: fixed;
    top: max(16px, calc(env(safe-area-inset-top) + 12px));
    right: 16px;
    bottom: auto;
    left: 16px;
    z-index: 40;
    width: fit-content;
    max-width: calc(100vw - 32px);
    margin-inline: auto;
    animation: none;
    transform: none;
  }
  body.is-map-active.is-route-mode.has-commute-map-picker .toast { top: max(152px, calc(env(safe-area-inset-top) + 142px)); }
}

/* Destination cards hold their own mode, days and longest acceptable trip;
 * notes and the "every destination" shortcut span the card. */
.home-finder-place-controls > :is(.home-finder-place-mode-choices, .home-finder-mode-note, .home-finder-limit-note, .home-finder-apply-mode) { grid-column: 1 / -1; }
.home-finder-limit-note { margin: 0; color: var(--action-muted, #625d53); font: 400 var(--panel-label)/1.45 var(--font-ui); }
.home-finder-apply-mode { justify-self: start; }
.home-finder-starter-detail { grid-column: 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--action-muted, #625d53); font: 400 var(--type-micro)/1.3 var(--font-ui); }

/* Your home: bedrooms and budget, asked before ranking. */
.home-finder-home-needs { display: grid; gap: 8px; margin: 12px 0 0; padding: 10px 10px 9px; border: 1px solid var(--commute-rule, rgba(17, 16, 14, 0.15)); background: rgba(255, 253, 247, 0.64); }
.home-finder-home-needs[hidden] { display: none; }
.home-finder-home-needs > header { display: grid; gap: 2px; }
.home-finder-home-needs > header > strong { color: var(--action-ink, #191815); font: 650 var(--panel-label)/1.4 var(--font-ui); }
.home-finder-home-needs > header > p,
.home-finder-home-needs > small { margin: 0; color: var(--action-muted, #625d53); font: 400 var(--panel-label)/1.45 var(--font-ui); }
.home-finder-home-needs-row { display: grid; grid-template-columns: minmax(70px, .75fr) minmax(100px, 1.25fr); gap: 10px; }
.home-finder-home-needs-row > label { display: grid; gap: 4px; min-width: 0; }
.home-finder-home-needs-row > label > span { color: var(--action-muted, #625d53); font: 600 var(--panel-label)/1.4 var(--font-ui); }
.home-finder-home-needs-row :is(select, input) { min-width: 0; min-height: 34px; }

/* Ranked areas fall into the groups their order follows. */
.plan-result-group { display: grid; gap: 6px; }
.plan-result-group + .plan-result-group { margin-top: 10px; }
.plan-result-group > h4 { margin: 4px 0 0; color: var(--action-muted, #625d53); font: 650 var(--panel-label)/1.4 var(--font-ui); }
.plan-result-group[data-home-finder-result-group="over-limit"] > h4 { color: #8a4a1c; }
.commute-fit-candidate.is-over-limit .commute-fit-candidate-average > strong { color: #8a4a1c; }
.commute-fit-candidate-average > .plan-weekly-total { color: var(--action-muted, #625d53); font: 400 var(--type-micro)/1.3 var(--font-ui); }
.plan-limit-notice { display: grid; gap: 4px; margin: 8px 0; padding: 9px 10px; border: 1px solid rgba(161, 93, 41, 0.45); border-left-width: 3px; background: rgba(255, 246, 236, 0.8); }
.plan-limit-notice > strong { color: #6e3a14; font: 650 var(--panel-label)/1.4 var(--font-ui); }
.plan-limit-notice > p { margin: 0; color: var(--action-ink, #191815); font: 400 var(--panel-label)/1.45 var(--font-ui); }
.plan-limit-notice > button { justify-self: start; }

/* The schedule popover shows the fields the current mode reads. */
.sf-schedule-controls[data-schedule-context="home"] .sf-explore-schedule,
.sf-schedule-controls[data-schedule-context="explore"] .sf-home-schedule { display: none; }

/* A destination's disclosure reads Edit while closed and Close while open. */
.home-finder-edit-label > span:last-child,
.home-finder-place-editor[open] .home-finder-edit-label > span:first-child { display: none; }
.home-finder-place-editor[open] .home-finder-edit-label > span:last-child { display: inline; }
body.is-route-mode .home-finder-home-needs-row > label > span { letter-spacing: 0; text-transform: none; }
