/* Transit-inspired presentation for RouteCHI. Structure and route data remain RouteCHI-owned. */
:root {
  color-scheme: dark;
  --ink: #f5f7f7;
  --muted: #9ba4a8;
  --green: #155c36;
  --green-dark: #0d482a;
  --line: #ffffff1b;
  --paper: #08090b;
  --shadow: 0 16px 42px #0008;
  font-family: Roboto, "Arial", sans-serif;
  background: #07090a;
  color: #f4f6f6;
}
html, body, .app-shell { min-height: 100%; background: #07090a; }
body { color: #f4f6f6; }
.app-shell { background: #05080b; }
#map { background: #07151c; }
.leaflet-container { background: #07151c; color: #f4f6f6; }
.leaflet-control-attribution { background: #061016d9 !important; color: #aab4b8 !important; }
.leaflet-control-attribution a { color: #d0d8dc !important; }
.topbar { z-index: 520; top: 18px; left: 22px; right: 22px; height: 52px; padding: 0; pointer-events: none; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 8px; pointer-events: auto; }
.topbar-left { gap: 7px; }
.brand { width: 152px; height: 42px; justify-content: center; gap: 0; overflow: hidden; border: 1px solid #ffffffd9; border-radius: 13px; background: #fff; box-shadow: 0 4px 15px #0007; }
.brand-mark { display: block; flex: none; width: 144px; height: 34px; border: 0; border-radius: 0; background: #fff url('/lgcns-logo.png') no-repeat -96.5px -71.4px / 336px 176.4px; box-shadow: none; font-size: 0; }
.brand > span:not(.brand-mark) { display: none; }
.home-settings { width: 39px; height: 39px; margin: 0; border: 3px solid #fff; background: #37383e; color: #fff; box-shadow: 0 3px 12px #0009; font-size: 18px; }
.topbar-right { gap: 11px; }
.service-status { border: 1px solid #ffffff20; background: #071820d9; color: #dae1e4; box-shadow: 0 3px 12px #0008; }
.icon-button { border: 0; background: #36373d; color: #fff; box-shadow: 0 3px 14px #0008; }
.icon-button:hover { color: #fff; background: #42434a; }
.home-options-card { display: none; }
.home-center-marker { display: none; }
.quick-search { display: none; }
.nearby-arrivals { display: none; }
.planner-panel { display: none; }
.route-detail-view[hidden] { display: none; }
.route-detail-view { position: absolute; inset: 0; z-index: 510; pointer-events: none; }
.detail-map-actions { position: absolute; top: 24px; right: 24px; display: flex; flex-direction: column; gap: 10px; pointer-events: auto; }
.detail-action { display: grid; width: 54px; height: 54px; place-items: center; border: 0; border-radius: 50%; background: #35363b; color: #fff; box-shadow: 0 4px 14px #0008; cursor: pointer; transition: background .15s, transform .15s; }
.detail-action:hover { background: #48494f; }
.detail-action:active { transform: scale(.96); }
.detail-action .control-icon { display: block; width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 3.2; }
.detail-action .share-icon { stroke-width: 3; }
.detail-action .share-icon circle { fill: currentColor; }
.detail-action .locate-icon { stroke-width: 2.8; }
.route-detail-content { position: absolute; right: 0; bottom: 0; left: 0; display: flex; height: min(30dvh, 420px); max-height: min(30dvh, 420px); align-items: stretch; justify-content: center; transition: height .22s ease; pointer-events: auto; }
.detail-panel { width: 100%; max-height: 50vh; overflow: auto; scrollbar-width: none; padding: 24px 28px max(18px, env(safe-area-inset-bottom)); border: 1px solid #ffffff12; border-bottom: 0; border-radius: 32px 32px 0 0; background: linear-gradient(180deg, #073c67 0%, #041b30 82%); box-shadow: 0 -15px 48px #0008; color: #f6f8fb; }
.detail-panel::-webkit-scrollbar { display: none; }
.detail-grabber { display: none; }
.detail-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.detail-panel-heading h2 { margin: 0; font-size: clamp(20px, 3vw, 31px); font-weight: 800; letter-spacing: -.6px; }
.detail-panel-heading p { margin: 7px 0 0; color: #c5d4e7; font-size: 15px; }
.detail-total { flex: 0 0 auto; color: #e5edf6; font-size: 22px; font-weight: 800; white-space: nowrap; }
.detail-route-track { position: relative; display: flex; align-items: center; gap: 10px; min-height: 56px; margin: 18px 0 15px; overflow-x: auto; }
.detail-route-track::before { position: absolute; top: 50%; right: 12px; left: 12px; border-top: 6px dotted #4692d4; content: ""; }
.detail-route-pill, .detail-walk-pill { position: relative; z-index: 1; flex: 0 0 auto; padding: 8px 14px; border: 3px solid #073c67; border-radius: 13px; background: #087ee0; color: #fff; font-size: 20px; font-weight: 900; }
.detail-route-pill { display: inline-flex; align-items: center; justify-content: center; line-height: 1; text-align: center; white-space: nowrap; }
.detail-walk-pill { display: grid; width: 46px; height: 46px; place-items: center; padding: 0; border-radius: 50%; background: #dce5ee; color: #24384d; font-size: 18px; }
.detail-walk-summary { display: inline-flex; align-items: center; gap: 9px; margin: 1px 0 16px; padding: 10px 17px; border-radius: 22px; background: #092f50; color: #e7edf6; font-size: 15px; font-weight: 700; }
.detail-alternatives { display: flex; gap: 10px; overflow-x: auto; margin: 17px -28px -24px; padding: 0 28px 20px; }
.detail-alternative { flex: 0 0 145px; min-height: 118px; padding: 12px; border: 1px solid #ffffff18; border-radius: 20px 20px 0 0; background: #07529a; color: #fff; text-align: center; cursor: pointer; }
.detail-alternative.active { background: #0c88eb; }
.detail-alternative strong { display: block; margin: 7px 0 3px; font-size: 34px; }
.detail-alternative small { color: #e0effc; }
.search-back { width: 42px; height: 42px; flex: 0 0 42px; font-size: 22px; }
.search-heading { flex: 1; min-width: 0; }
.search-heading .eyebrow { color: #9be3bf; }
.search-heading h1 { color: #fff; }
.route-group-title { display: flex; align-items: center; gap: 14px; margin: 18px 0 0; color: #abb1b4; font-size: 14px; font-weight: 500; letter-spacing: .04em; }
.route-group-title::after { height: 1px; flex: 1; background: #ffffff20; content: ""; }
.itinerary { margin: 0; padding: 20px 4px 23px; border: 0; border-bottom: 1px solid #ffffff22; border-radius: 0; background: transparent; color: #f5f6f7; box-shadow: none; }
.itinerary:hover, .itinerary.active { border-color: #ffffff22; background: #ffffff05; box-shadow: none; }
.itinerary-top { align-items: center; }
.itinerary-time { color: #fff; font-family: Roboto, Arial, sans-serif; font-size: clamp(22px, 3vw, 31px); font-weight: 800; letter-spacing: -.3px; }
.itinerary-duration { color: #aeb5b9; font-size: 14px; }
.itinerary-badge { border-radius: 20px; background: #153d2b; color: #b1edc9; font-size: 12px; }
.route-summary { position: relative; min-height: 75px; gap: 10px; margin-top: 15px; overflow-x: auto; padding: 6px 3px 0; }
.route-summary::before { position: absolute; top: 24px; right: 28px; left: 28px; border-top: 7px dotted #393b41; content: ""; }
.route-pill { position: relative; z-index: 1; min-width: 54px; padding: 9px 12px; border: 3px solid #090a0c; border-radius: 14px; color: #fff !important; font-size: 20px; text-align: center; }
.walk-pill { display: grid; width: 43px; height: 43px; min-width: 43px; place-items: center; padding: 0; background: #d8dde1; color: #26333a; font-size: 18px; }
.walk-pill svg, .detail-walk-pill svg { display: block; width: 24px; height: 24px; fill: currentColor; stroke: none; }
.summary-sep { display: none; }
.agency-tag { align-self: center; margin-left: auto; color: #92999e; font-size: 11px; }
.itinerary-details { display: none !important; }
.results-heading h2 { color: #f5f7f7; font-size: 16px; }
.results-heading small, .schedule-note { color: #a2aaae; }
.schedule-note { background: #111315; font-size: 12px; }
.results-empty { border: 0; background: transparent; color: #fff; }
.results-empty h2 { color: #fff; font-size: 20px; }
.results-empty p { color: #aab2b7; font-size: 14px; }
.empty-icon { background: #162b2c; color: #67d1ac; }
.choice-button { border-color: #ffffff10; background: #37383d; color: #f5f5f6; }
.choice-button:hover { border-color: #ffffff2b; background: #48494f; }
.choice-button span:first-child { color: #fff; }
.filter-count { background: #139e5a; }
.walking-speed-heading label { color: #f5f6f7; }
.walking-speed-heading output { color: #aeb5b9; }
.walking-speed-control input { accent-color: #168be0; }
.map-tools { right: 20px; bottom: 22px; }
.map-tool { border: 1px solid #ffffff18; border-radius: 50px; background: #06171edb; color: #f0f5f7; box-shadow: 0 4px 14px #0008; }
.map-tool.active { border-color: #058bd8; background: #087bd0; color: white; }
.map-tool:hover { background: #123542; color: white; }
.rail-legend { border-color: #ffffff12; background: #07141ae8; color: #e9eef0; }
.rail-legend>small, .rail-legend-item { color: #aeb9bd; }
.rail-swatch { box-shadow: 0 0 0 2px #fff; }
.cta-map-links { border-color: #ffffff20; }
.cta-map-links a { color: #7bd7f6; }
.bus-network-legend { border-color: #ffffff12; background: #07141ae8; color: #edf2f3; }
.bus-network-legend span, .bus-network-legend small { color: #aeb9bd; }
.leaflet-endpoint { width: 42px !important; height: 42px !important; transform: rotate(-45deg); border: 0 !important; border-radius: 50% 50% 50% 0 !important; background: #24a75b !important; box-shadow: 0 3px 12px #000a !important; }
.leaflet-endpoint::after { width: 13px; height: 13px; border-radius: 50%; background: #fff; content: ""; }
.leaflet-endpoint.destination { background: #ff514a !important; }
.current-location-marker { display: grid; width: 24px !important; height: 24px !important; place-items: center; border: 3px solid #fff; border-radius: 50%; background: #2787ee; box-shadow: 0 0 0 4px #2787ee66, 0 3px 12px #000b; }
.current-location-marker span { width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.map-route-badge { display: grid; width: 100%; height: 100%; box-sizing: border-box; place-items: center; padding: 0 8px; border: 3px solid #fff; border-radius: 18px; box-shadow: 0 3px 10px #0009; font-size: 16px; font-weight: 800; line-height: 1; text-align: center; white-space: nowrap; }
.nearby-arrivals { border: 0; border-radius: 0; background: #001b25f2; box-shadow: 0 -10px 30px #0008; color: #f6fbfd; }
.arrivals-heading .eyebrow { color: #00a8e8; }
.arrivals-heading h2 { font-size: 20px; }
.arrivals-location { color: #a5bec7; font-size: 12px; }
.arrivals-refresh { border-color: #ffffff22; background: #ffffff10; color: #fff; }
.arrivals-grabber { display: none; }
.arrivals-list { display: flex; flex-wrap: nowrap; gap: 10px; max-height: 105px; overflow-x: auto; }
.arrival-carousel { display: contents; }
.arrival-slides, .arrival-slide { display: contents; }
.arrivals-pagination { display: none; align-items: center; justify-content: center; gap: 8px; min-height: 8px; }
.arrival-page-dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: #ffffff35; cursor: pointer; }
.arrival-page-dot[aria-current="true"] { background: #00a8e8; }
.arrival-item { flex: 0 0 min(42vw, 260px); grid-template-columns: 42px minmax(0,1fr) auto; min-height: 54px; border-color: #ffffff14; border-radius: 13px; background: #ffffff0b; }
.arrival-route { min-width: 34px; height: 32px; border-radius: 9px; background: #087eda; color: #fff; font-size: 15px; }
.arrival-copy strong { color: #fff; font-size: 12px; }
.arrival-copy small { color: #a9c4cc; font-size: 10px; }
.arrival-countdown { color: #28c3f4; font-size: 20px; }
.arrivals-empty, .arrivals-loading { color: #aac4cc; font-size: 13px; }
.arrivals-updated { color: #7fa6b2; font-size: 10px; }
.sheet-backdrop { background: #000b; }
.control-sheet { border-color: #ffffff13; background: #141619; color: #f2f5f6; }
.sheet-grabber { background: #5b6065; }
.sheet-heading h2, .sheet-toggle strong, .time-input-label { color: #f2f5f6; }
.sheet-heading .eyebrow { color: #7dd7f5; }
.sheet-close { background: #303438; color: #f5f7f8; }
.time-tabs { background: #26292d; }
.time-tabs button { color: #bdc3c7; }
.time-tabs button.selected { background: #42464b; color: #83daf6; }
.trip-time-input { border-color: #43484d; background: #202327; color: #f5f7f8; }
.secondary-button { border-color: #42474b; background: #25282b; color: #e2e6e8; }
.primary-button { background: #087ed5; }
.filter-section { border-color: #ffffff16; }
.filter-section+h3, .filter-section h3 { color: #aab2b7; }
.sheet-toggle small, .filter-note { color: #a0a8ad; }
.sheet-toggle .toggle-track { background: #4a5055; }
.sheet-toggle input:checked+.toggle-track { background: #138bd4; }

body[data-view="home"] #map { display: block; }
body[data-view="home"] .home-options-card { position: absolute; z-index: 480; right: 24px; bottom: 186px; left: 24px; display: grid; grid-template-columns: minmax(0, 1fr) 54px auto; min-height: 84px; align-items: center; gap: 8px; padding: 10px 12px 10px 19px; border: 1px solid #ffffff45; border-radius: 28px; background: linear-gradient(110deg, #155c36f5, #0d482af5); color: #fff; box-shadow: 0 6px 22px #0009; }
.home-options-select { display: flex; min-width: 0; min-height: 58px; align-items: center; gap: 11px; padding: 4px 5px; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.home-options-copy { display: grid; gap: 2px; min-width: 0; flex: 1; }
.home-options-copy small { color: #bfe8cd; font-size: 14px; }
.home-options-copy strong { overflow: hidden; font-size: clamp(18px, 2.2vw, 25px); font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.home-address-credit { position: absolute; bottom: 5px; left: 21px; color: #cce4d3; font-size: 9px; line-height: 1; text-decoration: none; }
.home-options-arrow { color: #d9eee0; font-size: 31px; line-height: 1; }
.home-location-button, .home-plan-button { min-width: 0; height: 52px; border: 0; border-radius: 28px; cursor: pointer; }
.home-location-button { width: 52px; background: #30343a; color: #fff; font-size: 29px; }
.home-plan-button { padding: 0 21px; background: #fff; color: #155c36; font-size: 15px; font-weight: 750; }
.home-options-select:hover { color: #fff; }
.home-location-button:hover { background: #454a50; }
.home-plan-button:hover { background: #e5f5ea; }
.home-center-marker { position: absolute; z-index: 470; top: 50%; left: 50%; display: none; width: 34px; height: 42px; transform: translate(-50%, -100%); pointer-events: none; }
body[data-view="home"] .home-center-marker { display: block; }
body[data-view="pick"] .home-center-marker { display: block; }
.home-center-marker span { position: absolute; inset: 0 3px 3px; transform: rotate(-45deg); border: 3px solid #fff; border-radius: 50% 50% 50% 0; background: #dc3948; box-shadow: 0 3px 12px #0009; }
body[data-view="pick"] .home-center-marker { width: 42px; height: 51px; }
body[data-view="pick"] .home-center-marker span {
  inset: 0 auto auto 0;
  width: 42px;
  height: 42px;
  transform: rotate(-45deg);
  border: 0;
  border-radius: 50% 50% 50% 0;
  background: #24a75b;
}
body[data-view="pick"] .home-center-marker.origin-pick span { background: #24a75b; }
body[data-view="pick"] .home-center-marker.destination-pick span { background: #ff514a; }
.home-center-marker span::after { position: absolute; top: 8px; left: 8px; width: 8px; height: 8px; border-radius: 50%; background: #fff; content: ""; }
body[data-view="pick"] .home-center-marker span::after {
  top: 14px;
  left: 14px;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  transform: rotate(45deg);
}
body[data-view="home"] #nearby-arrivals { position: absolute; z-index: 500; right: 0; bottom: 0; left: 0; display: block; min-height: 165px; padding: 19px 28px max(15px, env(safe-area-inset-bottom)); background: #001b25; }
body[data-view="home"] .topbar { justify-content: flex-start; }
body[data-view="home"] .topbar-right { margin-left: auto; }
body[data-view="home"] .service-status { display: none; }
body[data-view="home"] .rail-legend { display: none; }
body[data-view="home"] .bus-network-legend { display: none; }
body[data-view="search"] #map { display: block; }
body[data-view="search"] .topbar-right .service-status { display: none; }
body[data-view="search"] .home-options-card, body[data-view="search"] #nearby-arrivals { display: none; }
body[data-view="search"] .planner-panel { position: absolute; right: 0; bottom: 0; left: 0; display: flex; width: 100%; max-height: min(78vh, 690px); border: 1px solid #ffffff16; border-bottom: 0; border-radius: 30px 30px 0 0; background: #101316f7; box-shadow: 0 -15px 48px #000b; overflow: visible; }
body[data-view="search"] .panel-grabber { background: #555b60; }
body[data-view="search"] .panel-header { padding: 14px 22px 15px; }
body[data-view="search"] .panel-header h1 { color: #f6f7f8; font-size: 23px; }
body[data-view="search"] .panel-header .eyebrow { color: #7dd7f5; }
body[data-view="search"] #route-form { overflow: visible; padding: 0 20px 19px; }
body[data-view="search"] .place-field { border-color: #ffffff1b; background: #202428; }
body[data-view="search"] .place-field input { color: #f6f7f8; }
body[data-view="search"] .place-field input::placeholder { color: #a9b0b4; }
body[data-view="search"] .field-connector { border-color: #7c858a; }
body[data-view="search"] .map-tip { color: #a7b0b5; }
body[data-view="search"] .planning-options { border-color: #ffffff19; }
body[data-view="search"] .mode-chip, body[data-view="search"] .choice-button { border-color: #ffffff1a; background: #272b2f; color: #eef1f2; }
body[data-view="search"] .plan-button { border-radius: 26px; background: #008bda; font-size: 15px; }
body[data-view="search"] .route-results { display: none; }
body[data-view="search"] .panel-footer { display: none; }
body[data-view="results"] #map, body[data-view="results"] .topbar, body[data-view="results"] .home-options-card, body[data-view="results"] #nearby-arrivals, body[data-view="results"] .map-tools, body[data-view="results"] .rail-legend, body[data-view="results"] .bus-network-legend { display: none; }
body[data-view="results"] .planner-panel { position: fixed; inset: 0; display: flex; width: 100%; border: 0; border-radius: 0; background: #08090b; box-shadow: none; overflow: hidden; }
body[data-view="results"] .panel-grabber, body[data-view="results"] .search-back { display: none; }
body[data-view="results"] .panel-header { flex: 0 0 auto; min-height: 66px; padding: 18px 28px 8px; background: #155c36; }
body[data-view="results"] .panel-header .eyebrow, body[data-view="results"] .panel-header h1 { display: none; }
body[data-view="results"] .swap-button { width: 48px; height: 48px; border: 0; background: transparent; color: #e1f4e8; box-shadow: none; font-size: 34px; }
body[data-view="results"] #route-form { flex: 0 0 auto; padding: 0 28px 15px; background: #155c36; }
body[data-view="results"] .field-stack { display: grid; grid-template-columns: minmax(0,1fr); gap: 10px; }
body[data-view="results"] .place-field { height: 58px; gap: 15px; padding: 0 20px; border: 0; border-radius: 22px; background: #0d482b; }
body[data-view="results"] .place-field input { color: #f3fff6; font-size: clamp(16px, 2vw, 24px); font-weight: 700; }
body[data-view="results"] .place-field input::placeholder { color: #c3e1cc; }
body[data-view="results"] .field-connector { top: 43px; left: 19px; height: 29px; border-color: #a7d7b5; }
body[data-view="results"] .place-dot { width: 18px; height: 18px; border: 4px solid #b5e5c4; background: #237547; box-shadow: none; }
body[data-view="results"] .destination-dot { border-radius: 5px; background: #237547; }
body[data-view="results"] .map-tip, body[data-view="results"] .planning-options, body[data-view="results"] .plan-button { display: none; }
body[data-view="results"] .search-actions { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(180px,1fr) 62px 62px 62px; gap: 12px; margin: -1px 0 0; }
body[data-view="results"] .choice-button { min-width: 0; height: 62px; justify-content: center; border: 0; border-radius: 34px; background: #35363b; color: #fff; font-size: 18px; }
body[data-view="results"] .choice-button span:first-child { font-size: 24px; }
body[data-view="results"] .choice-button span:nth-child(2) { flex: 0 1 auto; }
body[data-view="results"] .choice-button span:last-child { display: none; }
body[data-view="results"] .choice-button:not(#time-choice) { width: 62px; padding: 0; }
body[data-view="results"] .action-icon span:nth-child(2), body[data-view="results"] #filters-open span:nth-child(2) { display: none; }
body[data-view="results"] .route-results { flex: 1; width: 100%; margin: 0; padding: 17px 30px max(18px, env(safe-area-inset-bottom)); background: #08090b; }
body[data-view="results"] .results-heading { margin: 6px 0 12px; }
body[data-view="results"] .results-heading h2 { font-size: 18px; }
body[data-view="results"] .panel-footer { display: none; }
body[data-view="detail"] #map { display: block; }
body[data-view="detail"] .topbar, body[data-view="detail"] .home-options-card, body[data-view="detail"] #nearby-arrivals, body[data-view="detail"] .planner-panel, body[data-view="detail"] .map-tools, body[data-view="detail"] .rail-legend, body[data-view="detail"] .bus-network-legend { display: none; }
body[data-view="detail"] #route-detail-view { display: block; }
body[data-view="detail"] .detail-map-actions { top: 24px; right: 22px; }

@media (max-width: 700px) {
  .topbar { top: max(20px, env(safe-area-inset-top)); left: 16px; right: 16px; }
  .topbar-left { gap: 6px; }
  .brand { width: 126px; height: 36px; border-radius: 11px; }
  .brand-mark { width: 118px; height: 28px; background-position: -79.3px -58.7px; background-size: 275.1px 144.6px; }
  .home-settings { width: 45px; height: 45px; margin: 0; font-size: 21px; }
  .topbar-right .icon-button { width: 56px; height: 56px; background: #3a3b40e8; font-size: 30px; }
  body[data-view="home"] .home-options-card { right: 5%; bottom: calc(145px + env(safe-area-inset-bottom)); left: 5%; min-height: 80px; grid-template-columns: minmax(0, 1fr) 48px auto; gap: 5px; padding: 8px 9px 8px 12px; border-radius: 27px; }
  .home-options-select { min-height: 56px; gap: 5px; }
  .home-options-copy small { font-size: 14px; }
  .home-options-copy strong { font-size: clamp(17px, 5vw, 23px); }
  .home-location-button, .home-plan-button { height: 46px; }
  .home-location-button { width: 46px; font-size: 25px; }
  .home-plan-button { padding: 0 15px; font-size: 14px; }
  body[data-view="home"] #nearby-arrivals { min-height: 148px; padding: 17px 20px calc(13px + env(safe-area-inset-bottom)); }
  .arrivals-heading h2 { font-size: 19px; }
  .arrivals-location, .arrivals-updated { display: none; }
  .arrivals-list { max-height: 72px; margin-top: 6px; }
  .arrival-item { flex-basis: min(78vw, 340px); }
  .arrivals-empty, .arrivals-loading { padding: 14px 3px; }
  .map-tools { right: 13px; bottom: 270px; gap: 8px; }
  .map-tool { width: 42px; min-width: 42px; height: 42px; padding: 0; background: #071820e8; }
  .map-tool span { display: none; }
  body[data-view="home"] .rail-legend { display: none; }
  body[data-view="search"] .planner-panel { max-height: 82vh; border-radius: 28px 28px 0 0; }
  body[data-view="search"] .panel-header { padding: 12px 15px 12px; }
  body[data-view="search"] #route-form { padding: 0 15px 18px; }
  body[data-view="search"] .place-field { height: 54px; border-radius: 16px; }
  body[data-view="search"] .map-tip { margin: 10px 3px 12px; font-size: 12px; }
  body[data-view="search"] .planning-options { padding: 10px 2px 12px; }
  body[data-view="search"] .search-actions { grid-template-columns: 1fr 1fr; }
  body[data-view="search"] .plan-button { min-height: 52px; }
  body[data-view="results"] .panel-header { min-height: 58px; padding: 10px 15px 5px; }
  body[data-view="results"] #route-form { padding: 0 15px 13px; }
  body[data-view="results"] .field-stack { grid-template-columns: minmax(0,1fr); gap: 8px; }
  body[data-view="results"] .place-field { height: 54px; gap: 10px; padding: 0 14px; border-radius: 20px; }
  body[data-view="results"] .place-field input { font-size: 18px; }
  body[data-view="results"] .place-dot { width: 15px; height: 15px; }
  body[data-view="results"] .field-connector { top: 39px; left: 16px; height: 25px; }
  body[data-view="results"] .swap-button { width: 44px; height: 44px; font-size: 30px; }
  body[data-view="results"] .search-actions { grid-template-columns: minmax(125px,1fr) 52px 52px 52px; gap: 8px; }
  body[data-view="results"] .choice-button { height: 54px; font-size: 15px; }
  body[data-view="results"] .choice-button:not(#time-choice) { width: 52px; }
  body[data-view="results"] .route-results { padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); }
  body[data-view="results"] .itinerary { padding: 18px 1px 20px; }
  body[data-view="results"] .route-summary { min-height: 70px; }
  body[data-view="results"] .agency-tag { display: none; }
  body[data-view="detail"] .detail-map-actions { top: calc(18px + env(safe-area-inset-top)); right: 15px; gap: 11px; }
  body[data-view="detail"] .detail-action { width: 58px; height: 58px; }
  .detail-panel { width: 100%; max-height: 50vh; padding: 25px 22px calc(16px + env(safe-area-inset-bottom)); border-radius: 36px 36px 0 0; }
  .detail-panel-heading h2 { font-size: 25px; }
  .detail-panel-heading p { font-size: 16px; }
  .detail-total { font-size: 22px; }
  .detail-route-track { margin: 15px 0 12px; }
  .detail-alternatives { margin-right: -22px; margin-left: -22px; padding-right: 22px; padding-left: 22px; }
  .leaflet-bottom.leaflet-right { bottom: 0; left: 8px; right: auto; }
}

@media (max-width: 380px) {
  .brand { width: 112px; height: 33px; }
  .brand-mark { width: 104px; height: 25px; background-position: -69.9px -51.8px; background-size: 243.6px 128px; }
  .home-settings { width: 41px; height: 41px; }
}

/* Route cards use a departure timeline instead of itinerary summary boxes. */
.suggestion-section-title { padding: 14px 19px 9px; border-bottom: 1px solid #ffffff20; color: #aeb3b8; font-size: 12px; font-weight: 500; letter-spacing: .04em; }
.suggestion-overflow { flex: 0 0 24px; color: #b8bdc1; font-size: 25px; line-height: 1; text-align: center; }
.itinerary { padding: 21px 6px 19px; }
.itinerary-top { align-items: flex-start; }
.itinerary-time { font-size: clamp(25px, 3.4vw, 36px); line-height: 1.1; }
.itinerary-duration { margin-top: 7px; color: #25bb75; font-size: 17px; font-weight: 700; }
.itinerary-badge { align-self: center; padding: 7px 12px; border-radius: 18px; background: #26282c; color: #d5d8dc; font-size: 12px; }
.route-summary { min-height: 63px; align-items: center; gap: 11px; margin-top: 10px; padding: 5px 8px 0; }
.route-summary::before { top: 50%; right: 32px; left: 32px; border-color: #414348; }
.route-pill { min-width: 58px; padding: 11px 14px; border-width: 3px; border-color: #090a0c; border-radius: 15px; font-size: 22px; }
.walk-pill { min-width: 44px; width: 44px; height: 44px; padding: 0; }
.agency-tag { font-size: 10px; }
.itinerary-bottom { display: flex; align-items: center; gap: 11px; padding: 4px 8px 0; color: #aeb5b9; font-size: 14px; }
.itinerary-bottom strong { color: #f0f1f2; font-size: 17px; }
.itinerary-bottom > span:last-child { margin-left: auto; }
.accessible-tag { color: #83d5ac; font-size: 12px; }
.route-group-title { margin-top: 23px; padding-bottom: 9px; border-bottom: 1px solid #ffffff20; }
.results-heading { min-height: 30px; }
.results-heading small { font-size: 11px; }
.detail-panel { height: 100%; max-height: 100%; overflow: hidden; padding-top: 22px; }
.detail-step { display: flex; min-height: 66px; align-items: center; gap: 15px; padding: 9px 4px; border-bottom: 1px solid #ffffff18; }
.detail-step-icon { display: grid; width: 46px; height: 46px; flex: 0 0 46px; place-items: center; border-radius: 13px; background: #087ee0; color: #fff; font-size: 18px; font-weight: 900; }
.bus-step .detail-step-icon { width: auto; min-width: 46px; flex: 0 0 auto; padding: 0 8px; font-size: clamp(13px, 1.4vw, 15px); line-height: 1; text-align: center; white-space: nowrap; }
.detail-step-icon svg { width: 24px; height: 24px; }
.walk-step .detail-step-icon { border-radius: 50%; background: #d8dde1; color: #26333a; }
.detail-step > span:last-child { display: grid; gap: 4px; min-width: 0; }
.detail-step strong { color: #fff; font-size: 15px; }
.detail-step small { overflow: hidden; color: #b7c6d9; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.alternatives-heading { margin: 14px 0 9px; color: #b7c6d9; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.detail-alternatives { margin-top: 4px; }
.detail-alternative { flex-basis: 175px; min-height: 108px; border-radius: 18px; }
.detail-alternative strong { font-size: 29px; }
.detail-alternative small { font-size: 11px; }
.detail-route-track { min-height: 52px; }
.detail-panel-heading p { color: #c2d4ea; }
.detail-total { color: #fff; }

/* Full-height sheets match the phone reference while retaining browser controls. */
#filter-sheet, #time-sheet { padding: 0; }
#filter-sheet .control-sheet, #time-sheet .control-sheet {
  width: min(100%, 760px); height: min(100dvh, 100vh); max-height: none; overflow-y: auto;
  padding: max(23px, env(safe-area-inset-top)) clamp(24px, 6vw, 64px) max(26px, env(safe-area-inset-bottom));
  border: 0; border-radius: 0; background: #151619; box-shadow: none;
}
#filter-sheet .sheet-grabber, #time-sheet .sheet-grabber { display: none; }
#filter-sheet .sheet-heading, #time-sheet .sheet-heading { margin: 28px 0 30px; }
#filter-sheet .sheet-heading h2, #time-sheet .sheet-heading h2 { font-size: clamp(29px, 5vw, 42px); font-weight: 750; letter-spacing: -.7px; }
#filter-sheet .sheet-heading .eyebrow, #time-sheet .sheet-heading .eyebrow { color: #32b66f; font-size: 12px; }
#filter-sheet .filter-section { padding: 8px 0 20px; border: 0; }
#filter-sheet .filter-section h3 { margin: 7px 0 12px; color: #f1f2f3; font-size: 17px; letter-spacing: .03em; }
#filter-sheet .sheet-toggle { min-height: 76px; gap: 20px; padding: 12px 0; border-bottom: 1px solid #ffffff16; }
#filter-sheet .sheet-toggle strong, .filter-static-row strong { color: #f4f5f6; font-size: 17px; }
#filter-sheet .sheet-toggle small, .filter-static-row small { color: #aeb3b9; font-size: 13px; line-height: 1.4; }
#filter-sheet .sheet-toggle .toggle-track { flex-basis: 52px; width: 52px; height: 29px; border: 2px solid #878d92; border-radius: 18px; background: #2d3034; }
#filter-sheet .sheet-toggle .toggle-track::after { top: 3px; left: 3px; width: 19px; height: 19px; background: #a9adb1; }
#filter-sheet .sheet-toggle input:checked + .toggle-track { border-color: #21965c; background: #157c49; }
#filter-sheet .sheet-toggle input:checked + .toggle-track::after { transform: translateX(23px); background: #fff; }
.filter-static-row { display: flex; min-height: 72px; align-items: center; gap: 14px; padding: 9px 0; border-bottom: 1px solid #ffffff16; }
.filter-static-row > span:nth-child(2) { display: grid; flex: 1; gap: 3px; }
.filter-check { display: grid; width: 35px; height: 35px; flex: 0 0 35px; place-items: center; border-radius: 10px; background: #168450; color: #fff; font-size: 21px; font-weight: 800; }
.filter-lock { color: #a8afb4; font-size: 12px; }
#filter-sheet .filter-note { margin: 8px 0 18px; color: #a9b0b5; font-size: 12px; }
#filter-sheet .sheet-actions { position: sticky; bottom: -26px; margin: 14px calc(clamp(24px, 6vw, 64px) * -1) -26px; padding: 14px clamp(24px, 6vw, 64px) max(14px, env(safe-area-inset-bottom)); background: linear-gradient(180deg, #151619dc, #151619); }
#filter-sheet .sheet-actions button, #time-sheet .sheet-actions button { min-height: 62px; border-radius: 18px; font-size: 17px; }
#filter-sheet .primary-button, #time-sheet .primary-button { background: #15864e; }

#time-sheet .time-tabs { gap: 10px; margin: 46px auto 34px; padding: 0; background: transparent; }
#time-sheet .time-tabs button { min-height: 64px; border-radius: 36px; color: #e5e7e8; font-size: 16px; font-weight: 800; }
#time-sheet .time-tabs button.selected { background: #16894f; color: #fff; box-shadow: none; }
.time-wheel { display: flex; min-height: 235px; align-items: center; justify-content: center; gap: 13px; margin: 0 auto; }
.time-wheel-column { display: grid; width: min(22vw, 130px); justify-items: center; }
.time-wheel-column button { width: 48px; height: 48px; border: 0; background: transparent; color: #8d9297; font-size: 26px; cursor: pointer; }
.time-wheel-column strong { display: grid; width: 100%; min-height: 72px; place-items: center; border: 2px solid #17663c; border-radius: 20px; background: #17251e; color: #fff; font-size: clamp(28px, 5vw, 40px); }
.time-wheel-column.period-wheel { width: min(20vw, 125px); }
.time-colon { color: #fff; font-size: 33px; font-weight: 800; }
.time-date-row { display: flex; align-items: center; justify-content: center; gap: 19px; margin: 33px auto 6px; }
.time-date-row button { width: 44px; height: 52px; border: 0; background: transparent; color: #c1c5c9; font-size: 37px; cursor: pointer; }
.time-date-row label { color: #f5f6f6; font-size: 23px; font-weight: 700; }
#trip-date-input { width: 35px; height: 35px; overflow: hidden; border: 0; border-radius: 50%; background: #25282c; color: transparent; color-scheme: dark; }
#trip-date-input::-webkit-calendar-picker-indicator { margin: 0; opacity: .8; }
.time-zone-note { display: block; color: #8d969b; text-align: center; font-size: 12px; }
#time-sheet .sheet-actions { margin-top: auto; padding-top: 48px; }
#time-sheet .secondary-button { min-height: 52px !important; }

@media (max-width: 700px) {
  .brand-mark { font-size: 38px; }
  .home-settings { font-size: 21px; }
  body[data-view="results"] .itinerary { padding: 20px 1px 21px; }
  body[data-view="results"] .itinerary-time { font-size: 31px; }
  body[data-view="results"] .itinerary-duration { font-size: 17px; }
  body[data-view="results"] .itinerary-bottom { font-size: 14px; }
  body[data-view="results"] .route-summary { min-height: 65px; }
  body[data-view="results"] .agency-tag { display: none; }
  .detail-panel { max-height: 58vh; padding: 22px 20px max(17px, env(safe-area-inset-bottom)); }
  .detail-step { gap: 12px; }
  .detail-step-icon { width: 42px; height: 42px; flex-basis: 42px; }
  #filter-sheet .control-sheet, #time-sheet .control-sheet { width: 100%; }
  #filter-sheet .sheet-heading, #time-sheet .sheet-heading { margin-top: max(42px, env(safe-area-inset-top)); }
  #time-sheet .time-tabs { margin-top: 52px; }
  .time-wheel { min-height: 265px; }
  .time-wheel-column { width: 27vw; }
  .time-wheel-column.period-wheel { width: 24vw; }
  .time-wheel-column strong { min-height: 78px; }
}

@media (min-width: 701px) {
  body[data-view="search"] .planner-panel { right: 24px; left: auto; bottom: 24px; width: min(480px, calc(100vw - 48px)); max-height: 76vh; }
  body[data-view="search"] .nearby-arrivals { display: none; }
  body[data-view="home"] .home-options-card { right: auto; bottom: 195px; left: 27px; width: min(520px, calc(100vw - 54px)); }
  body[data-view="home"] #nearby-arrivals { right: auto; left: 0; width: min(580px, 100vw); min-height: 165px; }
}

/* Search is a focused place-picker screen, following the supplied Transit capture. */
body[data-view="search"] #map,
body[data-view="search"] .topbar,
body[data-view="search"] .home-options-card,
body[data-view="search"] #nearby-arrivals,
body[data-view="search"] .map-tools,
body[data-view="search"] .rail-legend,
body[data-view="search"] .bus-network-legend { display: none; }
body[data-view="search"] .planner-panel {
  position: fixed; inset: 0; display: flex; width: 100%; max-height: none; height: 100vh; height: 100dvh;
  border: 0; border-radius: 0; background: #151619; box-shadow: none; overflow: auto;
}
body[data-view="search"] .panel-grabber,
body[data-view="search"] .panel-footer,
body[data-view="search"] .map-tip,
body[data-view="search"] .search-actions,
body[data-view="search"] .route-results { display: none; }
body[data-view="search"] .panel-header {
  flex: 0 0 auto; min-height: 148px; justify-content: flex-start; gap: 22px;
  padding: max(56px, calc(env(safe-area-inset-top) + 30px)) clamp(22px, 6vw, 68px) 25px;
  background: #17613a;
}
body[data-view="search"] .search-back {
  width: 58px; height: 58px; flex-basis: 58px; border: 0; border-radius: 0; background: transparent;
  box-shadow: none; color: #d4f1de; font-size: 36px;
}
body[data-view="search"] .search-heading .eyebrow { display: none; }
body[data-view="search"] .search-heading h1 {
  color: #e1f5e8; font-size: clamp(30px, 5vw, 46px); font-weight: 500; letter-spacing: -.8px;
}
body[data-view="search"] .swap-button {
  width: 60px; height: 60px; margin-left: auto; border: 0; background: transparent; color: #dff5e7;
  box-shadow: none; font-size: 36px;
}
body[data-view="search"] #route-form {
  display: flex; flex: 1 0 auto; flex-direction: column; gap: 20px; overflow: visible;
  padding: 24px clamp(22px, 6vw, 68px) max(26px, env(safe-area-inset-bottom)); background: #151619;
}
body[data-view="search"] .field-stack { gap: 10px; }
body[data-view="search"] .place-field {
  min-height: 66px; height: 66px; padding: 0 20px; border: 1px solid #ffffff13; border-radius: 18px;
  background: #303135;
}
body[data-view="search"] .place-field:focus-within { border-color: #67be8b; box-shadow: 0 0 0 3px #48a86f2b; }
body[data-view="search"] .place-dot { width: 17px; height: 17px; }
body[data-view="search"] .place-field input { color: #f6f6f7; font-size: 19px; }
body[data-view="search"] .place-field input::placeholder { color: #c2c4c8; }
body[data-view="search"] .field-connector { top: 52px; left: 29px; height: 25px; border-color: #9da0a4; }
body[data-view="search"] .clear-field { color: #c8cbd0; }
body[data-view="search"] .suggestions {
  top: calc(100% + 9px); max-height: min(46vh, 440px); border-color: #383a3f; border-radius: 4px;
  background: #17181b; box-shadow: 0 14px 28px #0009;
}
body[data-view="search"] .suggestion { align-items: center; min-height: 78px; padding: 15px 20px; border-color: #ffffff1c; background: transparent; color: #f3f3f4; }
body[data-view="search"] .suggestion:hover { background: #ffffff0b; }
body[data-view="search"] .suggestion-icon { width: 43px; height: 43px; flex-basis: 43px; border-radius: 50%; background: #292a2e; color: #f5f5f6; font-size: 20px; }
body[data-view="search"] .suggestion-text strong { color: #f4f4f5; font-size: 19px; }
body[data-view="search"] .suggestion-text small { color: #b4b6bc; font-size: 14px; }
body[data-view="search"] .quick-search { display: grid; gap: 12px; }
body[data-view="search"] .quick-choice {
  display: flex; min-height: 92px; align-items: center; gap: 22px; padding: 15px 24px; border: 0; border-radius: 30px;
  background: #303135; color: #f2f2f4; text-align: left; cursor: pointer;
}
body[data-view="search"] .quick-choice:hover { background: #3b3c41; }
body[data-view="search"] .quick-choice-icon { display: grid; width: 55px; height: 55px; flex: 0 0 55px; place-items: center; border: 5px solid #d7d8dc; border-radius: 50%; color: #f2f2f4; font-size: 25px; }
body[data-view="search"] .quick-choice-icon.location { border-color: #a300bd; color: #a300bd; }
body[data-view="search"] .quick-choice-icon.downtown { border: 0; font-size: 42px; }
body[data-view="search"] .quick-choice-copy { display: grid; gap: 3px; min-width: 0; flex: 1; }
body[data-view="search"] .quick-choice-copy strong { overflow: hidden; font-size: clamp(19px, 3vw, 27px); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
body[data-view="search"] .quick-choice-copy small { color: #c0c1c5; font-size: 15px; }
body[data-view="search"] .quick-choice-arrow { color: #c8c9ce; font-size: 38px; font-weight: 300; }
body[data-view="search"].searching .quick-search { display: none; }
body[data-view="search"] .planning-options { margin-top: 2px; padding: 17px 2px 12px; border-top-color: #ffffff1c; }
body[data-view="search"] .mode-chip { border: 0; background: #25272b; color: #e2e3e5; font-size: 13px; }
body[data-view="search"] .toggle-row { color: #d5d6d9; font-size: 13px; }
body[data-view="search"] .plan-button {
  position: sticky; bottom: 0; min-height: 62px; margin-top: 7px; padding: 0 24px; border-radius: 32px;
  background: #078bd7; box-shadow: 0 6px 20px #0007; font-size: 17px;
}
body[data-view="search"] .planner-panel { scrollbar-color: #4a4c51 #151619; }
body[data-view="pick"] #map { display: block; }
body[data-view="pick"] .planner-panel,
body[data-view="pick"] #nearby-arrivals,
body[data-view="pick"] .home-options-card,
body[data-view="pick"] .rail-legend,
body[data-view="pick"] .bus-network-legend { display: none; }
body[data-view="pick"] .topbar { z-index: 550; }
body[data-view="pick"] .topbar-right .service-status { display: none; }
.map-pick-hint:not([hidden]) {
  position: absolute; z-index: 570; bottom: calc(30px + env(safe-area-inset-bottom)); left: 50%;
  display: flex; width: min(600px, calc(100vw - 40px)); min-height: 110px; align-items: center; gap: 12px; padding: 18px 22px;
  transform: translateX(-50%); border: 0; border-radius: 24px; background: linear-gradient(110deg, #155c36f5, #0d482af5); color: #fff; box-shadow: 0 8px 26px #0009;
}
.map-pick-address { display: grid; min-width: 0; flex: 1; gap: 4px; }
.map-pick-address span { color: #d9f0df; font-size: 15px; font-weight: 600; }
.map-pick-address strong { overflow: hidden; color: #f4fff6; font-size: clamp(18px, 3.2vw, 26px); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.map-pick-hint button { flex: 0 0 auto; border: 0; cursor: pointer; }
.map-pick-cancel { width: 36px; height: 36px; border-radius: 50%; background: #ffffff18; color: #e4f2e8; font-size: 27px; line-height: 1; }
.map-pick-confirm { display: grid; width: 52px; height: 52px; place-items: center; padding: 0; border-radius: 50%; background: transparent; color: #f4fff6; }
.map-pick-confirm svg { display: block; width: 38px; height: 38px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 3.4; }
.map-pick-confirm:disabled { cursor: wait; opacity: .55; }
.map-pick-hint button:not(:disabled):hover { filter: brightness(1.15); }
@media (max-width: 700px) {
  body[data-view="search"] .panel-header { min-height: 158px; gap: 11px; padding: max(62px, calc(env(safe-area-inset-top) + 30px)) 16px 20px; }
  body[data-view="search"] .search-back { width: 40px; height: 52px; flex-basis: 40px; font-size: 30px; }
  body[data-view="search"] .search-heading h1 { font-size: clamp(27px, 7vw, 35px); }
  body[data-view="search"] .swap-button { width: 48px; height: 52px; font-size: 32px; }
  body[data-view="search"] #route-form { gap: 15px; padding: 16px 16px max(24px, env(safe-area-inset-bottom)); }
  body[data-view="search"] .place-field { min-height: 58px; height: 58px; padding: 0 14px; border-radius: 15px; }
  body[data-view="search"] .place-field input { font-size: 16px; }
  body[data-view="search"] .field-connector { top: 46px; left: 23px; height: 22px; }
  body[data-view="search"] .quick-search { gap: 10px; }
  body[data-view="search"] .quick-choice { min-height: 78px; gap: 16px; padding: 12px 16px; border-radius: 24px; }
  body[data-view="search"] .quick-choice-icon { width: 44px; height: 44px; flex-basis: 44px; border-width: 4px; font-size: 21px; }
  body[data-view="search"] .quick-choice-icon.downtown { font-size: 34px; }
  body[data-view="search"] .quick-choice-copy strong { font-size: 19px; }
  body[data-view="search"] .quick-choice-copy small { font-size: 13px; }
  body[data-view="search"] .quick-choice-arrow { font-size: 30px; }
  body[data-view="search"] .plan-button { min-height: 56px; font-size: 15px; }
  .map-pick-hint:not([hidden]) { right: 18px; bottom: calc(30px + env(safe-area-inset-bottom)); left: 18px; width: auto; min-height: 112px; gap: 8px; padding: 18px 16px; transform: none; border-radius: 21px; }
  .map-pick-address span { font-size: 13px; }
  .map-pick-address strong { font-size: clamp(18px, 5vw, 25px); }
  .map-pick-cancel { width: 32px; height: 32px; font-size: 24px; }
  .map-pick-confirm { width: 44px; height: 44px; }
  .map-pick-confirm svg { width: 34px; height: 34px; }
}

body[data-view="search"].searching .plan-button { display: none; }
.agency-tag { display: none; }
@media (max-width: 700px) {
  body[data-view="home"] .home-options-card { bottom: calc(210px + env(safe-area-inset-bottom)); }
  body[data-view="home"] #nearby-arrivals { height: calc(190px + env(safe-area-inset-bottom)); min-height: calc(190px + env(safe-area-inset-bottom)); padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); overflow: hidden; transition: height .2s ease, min-height .2s ease; touch-action: pan-x; }
  body[data-view="home"] .arrivals-heading,
  body[data-view="home"] .arrivals-location,
  body[data-view="home"] .arrivals-updated { display: none; }
  body[data-view="home"] .arrival-carousel { display: grid; flex: 0 0 auto; grid-template-rows: 8px 62px; gap: 4px; min-width: 0; }
  body[data-view="home"] .arrivals-pagination:not([hidden]) { display: flex; height: 8px; min-height: 8px; margin: 0; }
  body[data-view="home"] .arrivals-pagination[hidden] { display: none; }
  body[data-view="home"] .arrivals-list { display: flex; flex: 0 0 auto; flex-direction: column; gap: 7px; height: 155px; max-height: 155px; margin-top: 0; overflow: hidden; scrollbar-width: none; }
  body[data-view="home"] .arrival-slides { display: flex; width: 100%; min-width: 0; height: 62px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; }
  body[data-view="home"] .arrival-slides::-webkit-scrollbar { display: none; }
  body[data-view="home"] .arrival-slide { display: flex; flex: 0 0 100%; min-width: 0; scroll-snap-align: start; }
  body[data-view="home"] .arrival-item { flex: 0 0 100%; min-width: 0; min-height: 62px; grid-template-columns: 38px minmax(0,1fr) auto; gap: 7px; padding: 5px 6px; border: 1px solid #ffffff14; border-radius: 12px; background: #ffffff0b; }
  body[data-view="home"] .arrival-route { width: 38px; min-width: 38px; height: 38px; border: 2px solid #1aa8dc; border-radius: 10px; background: transparent; color: #27bce9; font-size: 14px; }
  body[data-view="home"] .arrival-copy strong { font-size: clamp(10px, 3vw, 14px); }
  body[data-view="home"] .arrival-copy small { margin-top: 2px; font-size: 9px; }
  body[data-view="home"] .arrival-countdown { font-size: clamp(14px, 4vw, 18px); }
  body[data-view="home"].nearby-arrivals-expanded:not(.nearby-arrivals-tall) .home-options-card { bottom: calc(var(--nearby-arrivals-panel-height, 190px) + 20px); }
  body[data-view="home"].nearby-arrivals-tall .topbar,
  body[data-view="home"].nearby-arrivals-tall .home-options-card { display: none; }
  body[data-view="home"].nearby-arrivals-expanded #nearby-arrivals { display: flex; height: auto; min-height: 0; max-height: calc(100dvh - max(10px, env(safe-area-inset-top))); flex-direction: column; padding-top: calc(12px + env(safe-area-inset-top)); border-radius: 22px 22px 0 0; touch-action: auto; }
  body[data-view="home"].nearby-arrivals-expanded .arrivals-grabber:not([hidden]) { display: block; width: 38px; height: 4px; flex: 0 0 auto; margin: 0 auto 12px; padding: 0; border: 0; border-radius: 4px; background: #5b6065; cursor: pointer; touch-action: none; }
  body[data-view="home"].nearby-arrivals-expanded .arrivals-heading { display: flex; }
  body[data-view="home"].nearby-arrivals-expanded .arrivals-location,
  body[data-view="home"].nearby-arrivals-expanded .arrivals-updated { display: block; }
  body[data-view="home"].nearby-arrivals-expanded .arrivals-list { flex: 1 1 auto; height: auto; min-height: 0; max-height: none; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 8px; }
  body[data-view="home"] .arrivals-empty,
  body[data-view="home"] .arrivals-loading { padding: 32px 3px; font-size: 13px; }
}

/* The first route-entry state starts with the destination, as in the reference flow. */
body[data-view="search"].destination-only .origin-field,
body[data-view="search"].destination-only .field-connector { display: none; }
body[data-view="search"].destination-only .field-stack { gap: 0; }
body[data-view="search"].has-destination .quick-search { display: none; }
body[data-view="search"].has-destination .plan-button { display: none; }
body[data-view="search"].has-destination.place-field-active:not(.searching) .quick-search { display: grid; }
body[data-view="search"].has-destination.route-edit-pending .plan-button { display: flex; }
body[data-view="search"] .quick-choice-icon.location { border-color: #a300bd; background: #252329; }
body[data-view="search"] .quick-choice-arrow { min-width: 20px; text-align: center; }
body[data-view="home"] .home-options-copy strong { max-width: 100%; }

/* Results occupy the available mobile viewport; only the route list scrolls. */
body[data-view="results"] .app-shell,
body[data-view="results"] .planner-panel {
  height: 100vh;
  height: 100dvh;
  max-height: none;
}
body[data-view="results"] .app-shell { min-height: 0; }
body[data-view="results"] #map,
body[data-view="results"] #google-map { display: none; }
body[data-view="results"] .planner-panel {
  position: fixed;
  inset: 0;
  width: 100vw;
  min-height: 0;
  flex-direction: column;
}
body[data-view="results"] #route-results {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Destination-first map flow: an unselected map starts at “Where to?” and
   becomes an address card with recenter and route actions after a pan. */
body[data-view="home"] .home-options-card {
  grid-template-columns: minmax(0, 1fr) 52px;
  background: linear-gradient(110deg, #155c36f5, #0d482af5);
}
body[data-view="home"] #home-options-label:empty { display: none; }
body[data-view="home"] .home-location-button,
body[data-view="home"] .home-plan-button { display: none; }
.home-set-home-button {
  display: grid;
  width: 48px;
  height: 48px;
  place-content: center;
  border: 0;
  border-left: 1px solid #ffffff35;
  background: transparent;
  color: #e8f8eb;
  font-size: 29px;
  line-height: 1;
  cursor: pointer;
}
.home-set-home-button span { margin: -10px 0 0 19px; font-size: 15px; }
.home-search-icon { display: grid; width: 32px; flex: 0 0 32px; place-items: center; color: #d4f1de; font-size: 36px; line-height: 1; }
body[data-view="home"] .home-options-card.map-selected {
  grid-template-columns: 54px minmax(0, 1fr) 82px;
  background: linear-gradient(110deg, #a000b6, #b400c6);
}
body[data-view="home"] .home-options-card.map-selected .home-options-select {
  order: 2;
  min-width: 0;
  justify-content: flex-start;
  padding: 0 13px;
  color: #fff;
}
body[data-view="home"] .home-options-card.map-selected .home-options-copy { gap: 1px; }
body[data-view="home"] .home-options-card.map-selected .home-options-copy small { color: #f4c8f8; font-size: 12px; }
body[data-view="home"] .home-options-card.map-selected .home-options-copy strong { color: #fff; font-size: clamp(18px, 2.2vw, 25px); }
body[data-view="home"] .home-options-card.map-selected .home-options-arrow,
body[data-view="home"] .home-options-card.map-selected .home-set-home-button,
body[data-view="home"] .home-options-card.map-selected .home-search-icon { display: none; }
body[data-view="home"] .home-options-card.map-selected .home-location-button {
  display: grid;
  order: 1;
  width: 52px;
  height: 52px;
  border-right: 1px solid #ffffff4a;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-size: 30px;
}
body[data-view="home"] .home-options-card.map-selected .home-plan-button {
  display: flex;
  order: 3;
  min-width: 0;
  height: 52px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 6px;
  border-left: 1px solid #ffffff4a;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-size: 12px;
}
body[data-view="home"] .home-options-card.map-selected .home-plan-button span:first-child { font-size: 27px; line-height: 1; }
body[data-view="home"] .home-options-card.map-selected .home-plan-button span:last-child { font-size: 12px; font-weight: 700; }
body[data-view="home"] .home-options-card.map-selected .home-options-select:hover,
body[data-view="home"] .home-options-card.map-selected .home-location-button:hover,
body[data-view="home"] .home-options-card.map-selected .home-plan-button:hover { background: #ffffff18; }
body[data-view="home"] .home-options-card:not(.map-selected) .home-options-copy strong { font-size: clamp(20px, 2.6vw, 29px); }
body[data-view="home"] .home-center-marker { display: none; }
body[data-view="home"].home-map-selected .home-center-marker {
  display: block;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
}
body[data-view="home"].home-map-selected .home-center-marker span {
  inset: 0;
  transform: none;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #a900bd;
}
body[data-view="home"].home-map-selected .home-center-marker span::after { display: none; }
body[data-view="search"] .saved-place-choice { min-height: 76px; }
body[data-view="search"] .quick-choice-icon.saved-place-icon { border: 0; background: #414247; font-size: 37px; }

/* Results header controls follow the Transit reference hierarchy: endpoints,
   a vertically centered swap action, then a left-to-right action row. */
body[data-view="results"] .panel-header {
  position: relative;
  z-index: 3;
  flex: 0 0 max(42px, env(safe-area-inset-top));
  min-height: max(42px, env(safe-area-inset-top));
  padding: 0;
}
body[data-view="results"] .swap-button {
  position: absolute;
  top: calc(max(42px, env(safe-area-inset-top)) + 28px);
  right: 16px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
}
body[data-view="results"] #route-form {
  position: relative;
  z-index: 2;
  overflow: visible;
  padding: 0 16px;
}
body[data-view="results"] .field-stack {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  padding-right: 52px;
}
body[data-view="results"] .place-field {
  width: 100%;
  height: 46px;
  min-width: 0;
  padding: 0 14px;
}
body[data-view="results"] .place-field input { font-size: 17px; }
body[data-view="results"] .search-actions {
  --result-action-size: clamp(44px, 5vw, 62px);
  --result-action-gap: clamp(8px, 1.9vw, 24px);
  display: flex;
  align-items: center;
  gap: var(--result-action-gap);
  margin: 10px 0 calc(var(--result-action-size) / -2);
}
body[data-view="results"] .choice-button {
  display: flex;
  flex: 0 0 var(--result-action-size);
  align-items: center;
  justify-content: center;
  width: var(--result-action-size);
  height: var(--result-action-size);
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #35363b;
  color: #fff;
}
body[data-view="results"] #time-choice {
  flex: 0 1 clamp(124px, 31.5vw, 340px);
  width: clamp(124px, 31.5vw, 340px);
  padding: 0 18px;
  border-radius: 999px;
  font-size: clamp(18px, 2vw, 30px);
}
body[data-view="results"] #time-choice .button-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body[data-view="results"] .choice-button .button-label { display: none; }
body[data-view="results"] #time-choice .button-label { display: block; }
body[data-view="results"] .choice-button .button-icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  color: #fff;
}
body[data-view="results"] .control-icon {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.2;
}
body[data-view="results"] .share-icon { stroke-width: 3; }
body[data-view="results"] .sliders-icon { stroke-width: 3.1; }
body[data-view="results"] #filters-open { position: relative; margin-left: auto; }
body[data-view="results"] .share-icon circle { fill: currentColor; }
body[data-view="results"] #filters-open .button-icon { width: 29px; height: 29px; }
body[data-view="results"] #filters-open .button-label { display: none; }
body[data-view="results"] #filters-open .filter-count { display: grid; position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; border: 2px solid #35363b; }
body[data-view="results"] .route-results { padding-top: calc(var(--result-action-size, clamp(44px, 5vw, 62px)) / 2 + 10px); }
body[data-view="results"] #refresh-results.is-loading .button-icon { animation: route-refresh-spin .8s linear infinite; transform-origin: center; }
@media (prefers-reduced-motion: reduce) {
  body[data-view="results"] #refresh-results.is-loading .button-icon { animation-duration: 1.8s; }
}
@media (max-width: 360px) {
  body[data-view="results"] .search-actions { --result-action-size: 40px; --result-action-gap: 6px; }
  body[data-view="results"] #time-choice { flex-basis: 112px; width: 112px; padding: 0 12px; }
  body[data-view="results"] .choice-button .button-icon,
  body[data-view="results"] #filters-open .button-icon { width: 25px; height: 25px; flex-basis: 25px; }
}
body[data-view="search"] #quick-downtown[hidden] { display: none; }
@media (max-width: 700px) {
  body[data-view="home"] .home-options-card { grid-template-columns: minmax(0, 1fr) 48px; }
  body[data-view="home"] .home-options-card.map-selected { grid-template-columns: 48px minmax(0, 1fr) 62px; }
  body[data-view="home"] .home-options-card.map-selected .home-location-button { width: 46px; height: 46px; }
  body[data-view="home"] .home-options-card.map-selected .home-plan-button { height: 46px; }
  body[data-view="home"] .home-options-card.map-selected .home-options-select { padding: 0 8px; }
  body[data-view="home"] .home-options-card.map-selected .home-options-copy strong { font-size: clamp(16px, 4.5vw, 22px); }
  .map-pick-hint:not([hidden]) { align-items: center; }
}

@media (max-width: 700px) {
  body[data-view="detail"] .route-detail-content {
    display: block;
    height: 30dvh;
    max-height: 30dvh;
    align-items: stretch;
    transition: height .22s ease;
  }
  body[data-view="detail"] .detail-panel {
    height: 30dvh;
    max-height: 30dvh;
    overflow: hidden;
    overscroll-behavior: contain;
    touch-action: pan-x;
    transition: height .22s ease, max-height .22s ease, border-radius .22s ease;
  }
}
body[data-view="detail"].route-detail-expanded .route-detail-content {
  top: 0;
  bottom: 0;
  height: 100dvh;
  max-height: 100dvh;
  align-items: stretch;
}
body[data-view="detail"].route-detail-expanded .detail-panel {
  height: 100dvh;
  max-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  padding-top: 42px;
  border-radius: 0;
  touch-action: auto;
}
body[data-view="detail"].route-detail-expanded .detail-grabber {
  position: absolute;
  top: 10px;
  left: 50%;
  display: block;
  width: 38px;
  height: 4px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: #7c8792;
  cursor: pointer;
  transform: translateX(-50%);
  touch-action: none;
}
body[data-view="detail"].route-detail-expanded .detail-map-actions { z-index: 1; }
@media (max-width: 700px) {
  body[data-view="detail"].route-detail-expanded .route-detail-content {
    top: auto;
    bottom: 0;
    height: auto;
    max-height: calc(100dvh - max(10px, env(safe-area-inset-top)));
  }
  body[data-view="detail"].route-detail-expanded .detail-panel {
    position: relative;
    height: auto;
    max-height: inherit;
    overflow-x: hidden;
    overflow-y: auto;
    padding-top: 42px;
    border-radius: 22px 22px 0 0;
    touch-action: pan-y;
  }
  body[data-view="detail"].route-detail-expanded.route-detail-tall .detail-panel {
    padding-top: max(84px, calc(76px + env(safe-area-inset-top)));
  }
}
