:root {
  color-scheme: light;
  font-family: "Instrument Sans", system-ui, sans-serif;
  color: #142b32;
  background: #f7f8f4;
  --muted: #52666a;
  --border: #dbe3df;
  --accent: #007566;
}
* { box-sizing: border-box; }
body { margin: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 78px; padding: 13px 26px; background: #102d34; color: #f5fcfa;
}
.identity, .feed { display: flex; align-items: center; gap: 13px; }
.brand {
  background: #d4f2db; color: #123c37; padding: 10px; border-radius: 7px;
  font-weight: 800; letter-spacing: .045em; font-size: 13px;
}
h1, h2, p { margin: 0; }
h1 { font-size: 22px; line-height: 1.15; letter-spacing: -.025em; }
.identity p, .feed-time { font-size: 12px; color: #bcd2d3; margin-top: 3px; }
.status { padding: 6px 10px; border-radius: 5px; background: #26464e; font-size: 12px; font-weight: 650; }
.status[data-state="live"] { background: #ccebd7; color: #14533e; }
.status[data-state="stale"], .status[data-state="snapshot"], .status[data-state="empty"] { background: #ffebc1; color: #69450a; }
.status[data-state="offline"] { background: #f9d9d3; color: #782f29; }
main { display: grid; grid-template-columns: minmax(270px, 325px) minmax(0, 1fr); flex: 1; min-height: 0; }
aside { display: flex; flex-direction: column; min-height: 0; background: #fff; border-right: 1px solid var(--border); }
.filters { padding: 19px 18px 16px; border-bottom: 1px solid var(--border); }
#vehicle-controls { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.route-heading, .results-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
label, h2 { font-size: 13px; font-weight: 700; }
input, select, button { font: inherit; color: inherit; }
.toggle { display: flex; align-items: center; gap: 7px; margin-top: 12px; font-weight: 550; }
input[type="checkbox"] { accent-color: var(--accent); }
#fit { font-size: 12px; font-weight: 700; background: #edf5f0; border: 0; border-radius: 4px; padding: 5px 8px; color: #23544d; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.results-heading { padding: 12px 18px; background: #f4f7f4; }
#count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
#vehicle-list { margin: 0; padding: 0 10px 10px; overflow: auto; list-style: none; }
.vehicle {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px;
  text-align: left; width: 100%; padding: 10px 6px; border: 0;
  border-bottom: 1px solid #e9efeb; background: #fff;
}
.vehicle:hover, .vehicle[aria-pressed="true"] { background: #edf5f0; }
.vehicle-id { font-size: 13px; font-weight: 750; }
.age { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: #879792; flex: 0 0 auto; }
.dot.fresh { background: var(--route-color, #007566); }
.notice, .empty { padding: 10px 14px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.notice { background: #fff4de; color: #69450a; }
.map-panel { position: relative; min-height: 0; background: #e5ede7; isolation: isolate; }
#map { height: 100%; background: #e5ede7; }
.legend, .map-error {
  position: absolute; z-index: 500; background: #ffffffed; border: 1px solid var(--border);
  border-radius: 7px; box-shadow: 0 2px 10px #102d341a;
}
.legend { bottom: 26px; right: 12px; display: flex; flex-wrap: wrap; gap: 10px 14px; padding: 8px 10px; font-size: 11px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend .line { width: 15px; height: 3px; border-radius: 3px; background: #526f8e; }
.map-error { left: 50%; top: 16px; transform: translateX(-50%); padding: 10px; max-width: 75%; font-size: 12px; }
.popup { min-width: 168px; line-height: 1.45; }
.popup strong { font-size: 15px; }
.popup p { margin: 4px 0 0; }
.popup .age { color: #385054; }
#favorites {
  width: 100%; margin-top: 7px; border: 1px solid #c3d1cd; border-radius: 6px;
  padding: 7px 8px; background: #edf5f0; color: #23544d; font-size: 12px; font-weight: 700;
}
#favorites[aria-pressed="true"] { background: #d3eee1; border-color: #007566; }
.layers { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; }
.layers .toggle { margin: 0; font-size: 12px; }
.bus-icon > div { --bus-color: var(--route-color, #526764); }
.bus-icon.is-stale > div { opacity: .55; }
.bus-icon.is-estimated .bus-route { border-style: dashed; outline: 1px solid #372754; }
.bus-icon.is-selected .bus-route { box-shadow: 0 0 0 3px #102d34, 0 2px 5px #102d3460; }
.bus-route {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  min-width: 24px; height: 23px; padding: 0 3px; border: 2px solid white;
  border-radius: 6px; background: var(--bus-color); color: white; box-shadow: 0 1px 4px #102d3470;
  font: 800 11px/19px system-ui, sans-serif; text-align: center; white-space: nowrap;
}
.bus-heading {
  position: absolute; inset: 0; pointer-events: none;
}
.bus-heading::before {
  content: ""; position: absolute; left: 50%; top: 0;
  transform: translateX(-50%);
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-bottom: 8px solid var(--bus-color);
  filter: drop-shadow(0 0 1px white);
}
.dot.estimate { background: #64469a; border: 1px dashed white; outline: 1px solid #372754; }
.dot.stop { background: #fff; border: 2px solid #3f6486; }
.route-presets { display: flex; gap: 6px; margin: 8px 0; }
.route-presets button, .route-choice {
  padding: 5px 7px; border: 1px solid #d3deda; border-radius: 5px;
  background: #f1f4f2; color: #425854; font-size: 12px; font-weight: 700;
}
.route-presets #favorites { width: auto; margin: 0; }
.route-presets #all-routes[aria-pressed="true"] { background: #d3eee1; border-color: #007566; }
#route-options {
  display: flex; flex-wrap: wrap; gap: 4px; max-height: 126px; overflow-y: auto;
  padding: 2px; align-content: start;
}
.route-choice { min-width: 31px; padding: 4px 5px; }
.route-choice[aria-pressed="true"] { background: var(--route-color); border-color: var(--route-color); color: #fff; }
.route-choice:hover { box-shadow: inset 0 0 0 1px currentColor; }
.popup h3 { margin: 8px 0 4px; font-size: 12px; }
.stop-times { max-height: 230px; width: min(330px, 70vw); overflow-y: auto; overscroll-behavior: contain; }
.departure-list { list-style: none; margin: 0; padding: 0 5px 0 0; }
.departure-list li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px;
  padding: 5px 0; border-top: 1px solid #dbe3df;
}
.departure-route, .departure-clock strong { font-size: 12px; font-weight: 750; }
.departure-headsign, .departure-clock span { display: block; font-size: 10px; }
.departure-clock { text-align: right; white-space: nowrap; }
.legend .line.shared { background: #f7faf8; border: 1px solid #526f8e; }
.gps-key { color: #37434a; font-size: 9px; font-weight: 800; font-style: normal; }
.bus-fix .bus-route { background: #e5e9e8; border: 1px solid #56625f; color: #263434; }
.bus-fix .gps-key {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  line-height: 11px; padding: 0 2px; background: white; border-radius: 2px; white-space: nowrap;
}
.mobile-tools, .mobile-close, .sheet-heading, #stop-sheet { display: none; }

@media (max-width: 760px), (max-height: 480px) and (pointer: coarse) {
  .topbar {
    min-height: 54px; gap: 8px;
    padding: calc(6px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
      6px max(12px, env(safe-area-inset-left));
  }
  .identity { gap: 8px; }
  .identity p { display: none; }
  .brand { padding: 7px; font-size: 11px; }
  h1 { font-size: 16px; }
  .feed { min-width: 0; flex-direction: column; align-items: flex-end; gap: 0; }
  .feed-time { font-size: 10px; }
  .status { font-size: 11px; padding: 4px 6px; text-align: right; }
  main { position: relative; display: flex; flex-direction: column; isolation: isolate; }
  .map-panel { flex: 1; }
  #map .leaflet-control-zoom a { width: 44px; height: 44px; line-height: 44px; }
  .mobile-tools {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
    background: white; border-top: 1px solid var(--border); z-index: 4;
    padding: 5px max(8px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }
  .mobile-tools button, .mobile-close {
    min-height: 44px; border: 0; border-radius: 8px; background: #eff4f1;
    font-weight: 700; font-size: 13px;
  }
  .mobile-tools button[aria-expanded="true"] { background: #d3eee1; color: #185443; }
  aside, #stop-sheet, .legend {
    position: absolute; left: max(6px, env(safe-area-inset-left)); right: max(6px, env(safe-area-inset-right));
    bottom: calc(58px + env(safe-area-inset-bottom)); max-height: calc(100% - 66px - env(safe-area-inset-bottom));
    background: white; border: 1px solid var(--border); border-radius: 14px;
    box-shadow: 0 4px 24px #102d3433; z-index: 3; overflow: auto; overscroll-behavior: contain;
  }
  aside, .legend, #route-controls, #vehicle-controls { display: none; }
  #app[data-panel="routes"] aside, #app[data-panel="vehicles"] aside,
  #app[data-panel="routes"] #route-controls, #app[data-panel="vehicles"] #vehicle-controls {
    display: block;
  }
  #app[data-panel="vehicles"] aside { max-height: min(49%, 380px); }
  #app[data-panel="legend"] .legend {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  }
  .legend { bottom: 5px; max-height: calc(100% - 10px); padding: 10px 12px 14px; z-index: 800; }
  .legend .sheet-heading { grid-column: 1 / -1; }
  .sheet-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .mobile-close { display: block; flex: 0 0 44px; width: 44px; font-size: 23px; font-weight: 500; }
  #fit { min-height: 44px; margin-left: auto; padding-inline: 12px; }
  .filters { padding: 8px 12px 10px; border-bottom: 0; }
  .route-presets { margin: 6px 0; flex-wrap: wrap; }
  .route-presets button { min-height: 44px; padding-inline: 10px; }
  #route-options {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 5px; max-height: none; overflow: visible;
  }
  .route-choice { min-height: 44px; }
  .route-choice[data-route-choice=""] { grid-column: span 2; }
  .layers { margin-top: 6px; gap: 4px 14px; }
  .layers .toggle { min-height: 44px; }
  .results-heading { padding: 5px 10px 5px 14px; }
  #count { margin-left: auto; }
  #vehicle-list { overflow: visible; }
  .vehicle { min-height: 48px; }
  #stop-sheet:not([hidden]) { display: block; padding: 8px 12px 12px; max-height: min(51%, 400px); }
  #stop-sheet-title { font-size: 15px; }
  #stop-sheet .stop-times { width: auto; max-height: none; overflow: visible; }
  #stop-sheet .departure-list li { padding: 9px 0; }
  #stop-sheet .departure-headsign, #stop-sheet .departure-clock span { font-size: 11px; }
}

[hidden] { display: none !important; }
.header-actions, .transit-actions { display: flex; gap: 6px; }
.header-actions { margin-left: auto; }
.header-actions button, .transit-actions button, .stop-board-button,
#clear-trip, #planner-form button, .trip-card button {
  border: 1px solid #bacdc7; border-radius: 7px; background: #eef5f1;
  color: #153d35; min-height: 38px; padding: 6px 10px; font-size: 13px; font-weight: 700;
}
.stop-board-button { margin: 8px 0 4px; }
#clear-trip { position: absolute; top: 12px; left: 12px; z-index: 500; }
#transit-view {
  position: fixed; inset: 0; margin: 0; border: 0; max-width: none; max-height: none;
  width: 100%; height: 100%; padding: 0; background: #10252d; color: #f4f9f7;
}
.transit-shell {
  max-width: 1100px; margin: auto;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}
.transit-header {
  display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap;
  gap: 12px; padding-bottom: 16px; border-bottom: 1px solid #37545d;
}
.transit-header h2 { font-size: clamp(22px, 4vw, 42px); }
#transit-subtitle { color: #b9ced3; margin-top: 4px; }
.board-controls, #planner-form { margin: 14px 0; }
.board-controls { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; }
.board-controls label { display: grid; gap: 5px; max-width: 100%; }
.board-controls input, .board-controls select, .planner-field input {
  width: min(310px, 100%); min-height: 44px; padding: 6px 10px; color: #142b32;
  border: 1px solid #b7cac6; border-radius: 6px; background: white; font-size: 16px;
}
.board-controls label:first-child select { width: 110px; }
.board-table { width: 100%; border-collapse: collapse; table-layout: auto; }
.board-table th, .board-table td { border-bottom: 1px solid #3a5660; padding: 9px 8px; text-align: left; }
.board-table th { color: #b9ced3; font-size: 12px; }
.board-table small { display: block; margin-top: 3px; color: #b9ced3; }
.board-table td:nth-child(3), .board-due { white-space: nowrap; }
.board-route { display: inline-block; padding: 3px 7px; border-radius: 5px; font-weight: 750; color: white; }
.board-due { color: #fbd47f; font-weight: 750; font-variant-numeric: tabular-nums; }
.recent-stops { padding: 8px 0; }
.recent-stops h3 { margin: 4px 0; font-size: 13px; }
.recent-stops ul { list-style: none; margin: 0; padding: 0; }
.recent-stops li { display: flex; flex-wrap: wrap; gap: 2px 8px; padding: 4px 0; font-size: 12px; }
.recent-stops li strong { font-size: 12px; }
.recent-stops li span { opacity: .85; }
.planner-field { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.planner-field label { width: 42px; }
#planner-status { margin-top: 8px; }
.trip-card { padding: 12px; margin: 8px 0; border: 1px solid #3c5761; border-radius: 8px; background: #1b3640; }
.trip-card h3 { margin: 0 0 8px; font-size: 16px; }
.trip-card p { margin: 5px 0; }
.trip-card button { margin: 6px 6px 0 0; }
#trip-reminder {
  position: fixed; z-index: 1000; top: max(8px, env(safe-area-inset-top)); left: 50%;
  transform: translateX(-50%); width: min(380px, 94vw); padding: 12px;
  border-radius: 8px; background: #d3eee1; color: #153d35; box-shadow: 0 4px 18px #102d3455;
}
@media (max-width: 760px), (max-height: 480px) and (pointer: coarse) {
  .header-actions { gap: 4px; }
  .header-actions button { min-height: 44px; font-size: 11px; padding-inline: 6px; }
  .topbar .identity h1 { display: none; }
  .transit-shell { padding-inline: max(10px, env(safe-area-inset-left), env(safe-area-inset-right)); }
  .transit-actions button, .stop-board-button, #planner-form button, .trip-card button { min-height: 44px; }
  .board-table { font-size: 12px; }
  .board-table th, .board-table td { padding: 7px 4px; }
  .board-table small { font-size: 10px; }
}

#alert-count {
  display: inline-block; margin-left: 4px; padding: 0 4px;
  border-radius: 4px; background: #f9dfad; color: #54380c; font-variant-numeric: tabular-nums;
}
.alerts-status { margin: 14px 0 8px; color: #b9ced3; }
.service-alert {
  margin: 8px 0; padding: 12px; border: 1px solid #3a5660; border-left: 3px solid #fbd47f;
  border-radius: 6px; background: #1b3640; overflow-wrap: anywhere;
}
.service-alert h3 { margin: 0 0 5px; font-size: 16px; }
.service-alert p { margin: 5px 0; }
.service-alert .alert-scope { font-size: 12px; opacity: .88; }
.service-alert a, .alerts-contact a { color: #bdebdc; }
.alerts-contact { margin-top: 16px; color: #b9ced3; font-size: 13px; }
.service-alert.compact { font-size: 12px; padding: 8px; }
.service-alert.compact h3 { margin: 0; }
.stop-times .service-alert {
  background: #fff4de; border-color: #f2d496; color: #573b12;
}
.stop-times .service-alert a { color: #31564e; }
.board-disrupted { color: #ffc0aa; font-weight: 700; }
.departure-clock .departure-disrupted { color: #a23623; }
.departure-clock { white-space: normal; }
@media (max-width: 420px) {
  .board-table td:nth-child(3) { white-space: normal; }
  .header-actions button { padding-inline: 4px; }
  #alert-count { margin-left: 2px; padding-inline: 3px; }
}

.rail-controls { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.rail-controls .toggle { margin: 0; }
#open-rail, .rail-route {
  border: 1px solid #c8bdd8; border-radius: 6px; background: #f1edf7;
  color: #44316b; padding: 6px 8px; font-size: 12px; font-weight: 700;
}
#rail-routes { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.rail-route[aria-pressed="true"] { background: #574078; color: #fff; }
.rail-status { font-size: 11px; color: var(--muted); margin-top: 6px; }
.rail-marker-face {
  position: absolute; inset: 8px 0; display: flex; align-items: center; justify-content: center;
  gap: 4px; border: 2px solid #fff; border-radius: 12px;
  background: var(--rail-color); color: #fff; font-size: 11px; font-weight: 800;
  box-shadow: 0 1px 5px #102d3466; white-space: nowrap;
}
.rail-station-marker .rail-marker-face { background: #fff; border-color: var(--rail-color); color: var(--rail-color); border-radius: 5px; }
.rail-pictogram {
  position: relative; display: inline-block; flex: 0 0 10px; width: 10px; height: 12px;
  border: 1.5px solid currentColor; border-radius: 3px 3px 2px 2px;
  background: radial-gradient(circle at 2px 7px, currentColor 1px, transparent 1.3px),
    radial-gradient(circle at 5px 7px, currentColor 1px, transparent 1.3px);
}
.rail-pictogram::before { content: ""; position: absolute; inset: 1px 1px auto; height: 3px; border: 1px solid currentColor; }
.rail-pictogram::after {
  content: ""; position: absolute; left: 1px; right: 1px; bottom: -4px;
  height: 2px; border-inline: 1.5px solid currentColor;
}
.rail-heading { position: absolute; inset: -8px 4px; pointer-events: none; }
.rail-heading::before {
  content: ""; position: absolute; top: -1px; left: calc(50% - 4px); width: 0; height: 0;
  border-inline: 4px solid transparent; border-bottom: 6px solid var(--rail-color);
}
.rail-legend { width: 12px; height: 9px; display: inline-block; border: 2px solid #574078; border-radius: 3px; }
.rail-legend.train { background: #574078; border-radius: 5px; }
.rail-credit, .rail-board-note { color: #b9ced3; font-size: 13px; margin: 12px 0; }
.rail-credit a, .rail-station-link { color: #bdebdc; }
.rail-station-link { display: inline-block; margin-top: 12px; }
.rail-board-table td:nth-child(3), .rail-board-table td:nth-child(4) { white-space: normal; }
@media (max-width: 760px), (max-height: 480px) and (pointer: coarse) {
  #open-rail, .rail-route { min-height: 44px; }
}

#breeze-routes { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.breeze-route[aria-pressed="true"] { background: var(--breeze-route); border-color: var(--breeze-route); color: #fff; }
.breeze-controls #open-breeze { margin: 0; }
.breeze-marker-face {
  position: absolute; inset: 9px 0; display: flex; align-items: center; justify-content: center;
  gap: 4px; border: 2px solid #974118; border-radius: 4px; background: #fff9f2; color: #763010;
  font-size: 11px; font-weight: 800; box-shadow: 0 1px 5px #102d3466;
}
.breeze-pictogram {
  position: relative; width: 13px; height: 9px; display: inline-block;
  border: 1.5px solid currentColor; border-radius: 2px;
}
.breeze-pictogram::after {
  content: ""; position: absolute; bottom: -3px; left: 1px; width: 3px; height: 3px;
  background: currentColor; box-shadow: 6px 0 currentColor; border-radius: 50%;
}
.breeze-legend { width: 12px; height: 9px; border: 2px solid #974118; border-radius: 2px; }
.breeze-board-table td:nth-child(3) { white-space: normal; }

.basemap-toggle { margin: 0; font-size: 11px; }
.regional-station .rail-marker-face, .regional-station .breeze-marker-face {
  inset: 13px 8px; border-width: 1px; font-size: 10px;
}
.regional-station .rail-pictogram, .regional-station .breeze-pictogram { display: none; }
.leaflet-zoom-animated.regional-station:hover .rail-marker-face,
.leaflet-zoom-animated.regional-station:focus-visible .rail-marker-face,
.leaflet-zoom-animated.regional-station:hover .breeze-marker-face,
.leaflet-zoom-animated.regional-station:focus-visible .breeze-marker-face { border-width: 2px; }

/* Nearby and saved departures */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
#app { grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); }
#app[data-view="map"] { grid-template-columns: minmax(270px, 325px) minmax(0, 1fr); }
#app[data-view="map"] #departures, #app:not([data-view="map"]) #controls { display: none; }
#departures {
  min-height: 0; overflow: auto; overscroll-behavior: contain;
  border-right: 1px solid var(--border); background: #f5f8f5;
}
.departure-tools { padding: 14px 14px 8px; }
.desktop-views { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.map-views { padding: 12px 16px 0; }
.departure-tools button, .departure-footer button, .saved-empty button, .desktop-views button,
.trip-actions button, .layer-shortcuts button {
  min-height: 36px; padding: 6px 10px; border-radius: 8px; border: 1px solid #c4d6ce;
  background: #fff; color: #215247; font-size: 13px; font-weight: 700;
}
.desktop-views button[aria-pressed="true"], .mobile-tools button[aria-pressed="true"],
.departure-footer button[aria-pressed="true"], .saved-empty button[aria-pressed="true"],
.trip-actions button[aria-pressed="true"] {
  background: #d3eee1; border-color: #007566; color: #124e3e;
}
#departure-title { margin: 13px 0 10px; font-size: 23px; letter-spacing: -.025em; }
#departure-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
#departure-search input, #departure-stop input {
  min-width: 0; width: 100%; min-height: 42px; border: 1px solid #aabfb7; border-radius: 8px;
  padding: 8px 10px; background: white; font-size: 16px;
}
#departure-matches { display: grid; gap: 5px; margin-top: 6px; }
#departure-matches button { text-align: left; }
.departure-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
#departure-status { color: var(--muted); margin-top: 8px; font-size: 12px; line-height: 1.4; }
.chosen-stop {
  display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap;
  margin-top: 10px; color: #173c34;
}
.chosen-stop strong { font-size: 15px; }
.chosen-stop small { color: var(--muted); }
#departure-cards { display: grid; gap: 7px; padding: 0 14px 15px; }
.departure-card {
  border: 1px solid var(--border); border-radius: 12px; background: white;
  box-shadow: 0 1px 1px #102d3408; min-width: 0;
}
.departure-main {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start;
  width: 100%; min-height: 54px; padding: 10px; gap: 8px;
  border: 0; border-radius: 12px; background: transparent; text-align: left;
}
.departure-main:hover { background: #eff6f1; }
.departure-badge {
  display: grid; place-items: center; min-width: 34px; padding: 3px 5px; border-radius: 5px;
  color: white; font-size: 13px; font-weight: 800;
}
.departure-description, .departure-eta { display: grid; gap: 3px; }
.departure-description strong { font-size: 14px; overflow-wrap: anywhere; }
.departure-description small, .departure-eta small, .departure-footer span { font-size: 11px; color: var(--muted); }
.departure-eta { text-align: right; align-self: center; }
.departure-eta strong { font-size: 19px; font-variant-numeric: tabular-nums; letter-spacing: -.045em; white-space: nowrap; }
.departure-eta .departure-warning { font-size: 14px; letter-spacing: 0; }
.departure-warning, .departure-footer .departure-warning { color: #9d321f; font-weight: 750; }
.departure-footer { display: flex; align-items: center; gap: 8px; padding: 0 10px 8px; }
.departure-footer button { margin-left: auto; min-height: 32px; font-size: 11px; }
.departure-footer .next-ride { margin-left: 0; text-align: left; background: #edf5f0; }
.departure-detail-link { border: 0; background: transparent; color: #006454; padding: 4px 0; text-decoration: underline; }
.saved-empty { padding: 10px; font-size: 13px; }
.saved-empty p { margin: 4px 0 7px; color: var(--muted); }
.layer-shortcuts { display: none; }
#trip-evidence { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.trip-source {
  display: grid; align-content: start; gap: 4px; padding: 11px;
  border: 1px solid #4a636c; border-radius: 10px; background: #1b3640;
}
.trip-source strong { font-size: clamp(16px, 4vw, 25px); }
.trip-source span { color: #c8dce0; font-size: 13px; }
#departure-trip-view .departure-warning { color: #ffc0aa; }
#departure-trip-view h3 { margin-bottom: 9px; }
#trip-timeline {
  margin: 0; padding: 0; max-height: 56dvh; overflow: auto; overscroll-behavior: contain;
  list-style: none; position: relative;
}
#trip-timeline li {
  display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: start; gap: 9px;
  min-height: 48px; padding: 8px 10px; border-bottom: 1px solid #34515b; font-size: 13px;
}
#trip-timeline li::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #82b5ac; margin-top: 3px;
}
#trip-timeline li.is-boarding { background: #224941; border-radius: 8px; }
#trip-timeline li.is-boarding::before { background: #b4ead8; border-color: #b4ead8; }
#trip-timeline li:not(:has(time)) { display: block; }
#trip-timeline li:not(:has(time))::before { display: none; }
.timeline-info { display: grid; gap: 3px; }
.timeline-info small { color: #c8dce0; }
#trip-timeline time { white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 760px), (max-height: 480px) and (pointer: coarse) {
  #app .desktop-views { display: none; }
  #app .map-panel { order: 0; }
  #app #departures { order: 1; z-index: 2; flex: 0 1 min(49%, 430px); border-right: 0; border-top: 1px solid #b4cbc0; }
  #app[data-view="nearby"] .map-panel, #app[data-view="saved"] .map-panel { min-height: 95px; }
  .mobile-tools { order: 2; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .departure-tools { padding-top: 7px; }
  #departure-title { margin: 2px 0 7px; font-size: 19px; }
  .departure-actions button, .departure-footer button, .saved-empty button, .trip-actions button,
  .layer-shortcuts button, #departure-search button, #departure-matches button { min-height: 44px; }
  .departure-tools .departure-actions { margin-top: 5px; }
  .departure-detail-link { min-height: 44px; }
  .layer-shortcuts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
  .leaflet-popup .stop-board-button, #stop-sheet .stop-board-button { margin-right: 5px; }
}

#legend-toggle {
  position: absolute; right: 12px; bottom: 38px; z-index: 801;
  min-height: 44px; padding: 0 11px; border: 1px solid #aabfb7;
  border-radius: 8px; background: white; color: #215247; font-size: 13px; font-weight: 700;
}
#legend { bottom: 88px; display: flex; max-width: min(420px, calc(100% - 24px)); max-height: calc(100% - 100px); overflow: auto; }
.stop-times { scrollbar-color: #597c70 #e9efeb; scrollbar-width: auto; scrollbar-gutter: stable; padding-right: 6px; }
.stop-board-button + .stop-board-button { margin-left: 10px; }
.address-note { color: #b9ced3; font-size: 12px; margin-bottom: 8px; }
@media (max-width: 760px), (max-height: 480px) and (pointer: coarse) {
  #legend { left: auto; }
  #stop-sheet { scrollbar-color: #597c70 #e9efeb; scrollbar-gutter: stable; }
}
#open-rail, #open-breeze {
  flex: 0 0 116px; min-height: 44px; margin: 0; padding: 6px 8px;
  border: 1px solid transparent; border-radius: 7px; color: white; font-size: 13px; font-weight: 700;
}
#open-rail, .rail-route[aria-pressed="true"], .rail-legend.train { background: #00537e; }
#open-breeze { background: #663181; }
.rail-legend.station { border-color: #00537e; }
.breeze-marker-face, .breeze-legend { border-color: #663181; }
.breeze-marker-face { color: #663181; background: #fbf6fd; }

#legend-toggle { display: inline-flex; align-items: center; gap: 7px; }
.legend-chevron {
  width: 6px; height: 6px; margin: 3px 1px 0;
  border: solid currentColor; border-width: 1.5px 1.5px 0 0; transform: rotate(-45deg);
}
#legend-toggle[aria-expanded="true"] .legend-chevron { margin-top: -3px; transform: rotate(135deg); }

.recent-stops {
  padding: 7px 9px;
  border-radius: 7px;
  background: #eef2ef;
  color: #455c55;
}
#transit-view .recent-stops {
  background: #243d46;
  color: #c8d8db;
}
.timeline-departed { color: #b5c7cb; }

/* Map workspace */
:root {
  --ink: #132b3a;
  --surface: #fbfdfc;
  --map-shadow: 0 5px 18px #182d3026, 0 1px 2px #182d301c;
}
.topbar {
  position: relative; z-index: 20; min-height: 64px; padding: 10px 19px;
  display: grid; grid-template-columns: minmax(168px, 1fr) minmax(220px, 470px) minmax(168px, 1fr);
  gap: 16px; background: var(--surface); color: var(--ink); border-bottom: 1px solid #cddbd5;
}
.topbar .identity { gap: 9px; }
.topbar .identity p { color: #4e6768; font-size: 11px; margin-top: 1px; }
.topbar h1 { font-size: 19px; }
.topbar .brand { display: grid; place-items: center; width: 37px; height: 37px; padding: 0; background: #14493f; color: #e8fff0; }
.header-actions { justify-self: end; margin: 0; }
.header-actions button { white-space: nowrap; background: #f1f6f3; border-color: #d2dfd8; min-height: 36px; }
#map-search { position: relative; width: 100%; }
#map-query {
  width: 100%; height: 40px; border: 1px solid #c5d6ce; border-radius: 9px; background: #f1f6f3;
  padding: 0 11px 0 34px; font-size: 15px;
}
.search-symbol {
  position: absolute; inset: 12px auto auto 12px; border: 1.8px solid #486460; border-radius: 50%;
  width: 11px; height: 11px; pointer-events: none;
}
.search-symbol::after {
  content: ""; position: absolute; inset: 8px auto auto 7px; width: 6px; height: 2px;
  border-radius: 2px; transform: rotate(45deg); background: #486460;
}
#map-results {
  position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 30; border: 1px solid #c5d6ce;
  border-radius: 10px; padding: 4px; background: white; box-shadow: var(--map-shadow);
  max-height: min(52dvh, 420px); overflow: auto;
}
#map-results p { padding: 9px; font-size: 13px; color: var(--muted); }
.search-result {
  text-align: left; display: grid; gap: 3px; width: 100%; min-height: 42px; border: 0; border-radius: 6px;
  padding: 6px 9px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 740;
}
.search-result:hover, .search-result:focus { background: #edf5ef; }
.search-result small { font-size: 11px; color: #4b6264; font-weight: 550; }

#app { position: relative; isolation: isolate; }
#app[data-view="map"] { grid-template-columns: 1fr; }
#app[data-view="map"][data-panel="routes"],
#app[data-view="map"][data-panel="vehicles"] { grid-template-columns: minmax(270px, 325px) minmax(0, 1fr); }
#app[data-view="map"]:not([data-panel="routes"]):not([data-panel="vehicles"]) #controls { display: none; }
#app[data-view="map"] #controls { overflow: auto; }
#app[data-panel="routes"] #vehicle-controls { display: none; }
#app[data-panel="vehicles"] #route-controls { display: none; }
#app .mobile-tools {
  display: grid; position: absolute; z-index: 4; inset: 12px auto auto 12px; bottom: auto; right: auto;
  grid-template-columns: repeat(3, auto); gap: 2px; padding: 3px; border-radius: 9px;
  border: 1px solid #cbdad3; background: var(--surface); box-shadow: var(--map-shadow);
}
#app .mobile-tools button {
  min-height: 34px; border: 0; border-radius: 6px; background: transparent;
  padding: 0 9px; color: #244943; font-size: 12px; font-weight: 750;
}
#app .mobile-tools button[aria-pressed="true"] { background: #dcefe4; color: #104839; }
#app .mobile-tools button[data-panel="routes"] { display: none; }
#app[data-view="map"][data-panel="routes"] .mobile-tools,
#app[data-view="map"][data-panel="vehicles"] .mobile-tools { left: 12px; }
#departures { padding-top: 47px; }
#controls { padding-top: 47px; }
#app[data-view="map"][data-panel="routes"] .filters { padding-top: 8px; }
.agency-route-heading { flex-basis: 100%; font-size: 11px; font-weight: 740; color: #4d6766; margin-top: 3px; }
.layer-shortcuts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.map-toolbar {
  position: absolute; z-index: 501; top: 12px; left: 214px; display: flex; gap: 3px; padding: 3px;
  border: 1px solid #cbdad3; border-radius: 9px; background: var(--surface); box-shadow: var(--map-shadow);
}
#app:not([data-view="map"]) .map-toolbar,
#app[data-panel="routes"] .map-toolbar, #app[data-panel="vehicles"] .map-toolbar { left: 12px; }
.map-toolbar button, .map-toolbar select, .map-dock button {
  min-height: 34px; display: inline-flex; align-items: center; gap: 6px; background: transparent;
  border: 0; border-radius: 6px; padding: 0 8px; color: #244943; font-size: 12px; font-weight: 740;
}
.map-toolbar button[aria-expanded="true"], .map-dock button[aria-expanded="true"] { background: #e0eee6; }
.map-toolbar select { background: #eef5f0; padding-right: 3px; }
.layer-symbol {
  display: inline-block; width: 10px; height: 10px; margin-right: 2px; border: 1.5px solid currentColor;
  transform: rotate(45deg); border-radius: 2px; box-shadow: 2px 2px #9ab5a9;
}
#clear-trip { left: auto; right: 54px; min-height: 34px; }
.map-dock {
  display: flex; gap: 3px; position: absolute; z-index: 502; left: 12px; bottom: 32px; padding: 4px;
  border: 1px solid #cbdad3; border-radius: 10px; background: var(--surface); box-shadow: var(--map-shadow);
}
.map-dock button + button { border-left: 1px solid #dce6e1; border-radius: 0 6px 6px 0; }
#feed-outage {
  position: absolute; z-index: 502; left: 12px; bottom: 82px; min-height: 35px; padding: 5px 9px;
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid #b78539; border-radius: 8px;
  background: #fff4de; color: #573b12; font-size: 12px; font-weight: 750; box-shadow: var(--map-shadow);
}
.dock-count {
  display: inline-block; padding: 1px 4px; border-radius: 4px; background: #e5efe9;
  color: #315d51; font-size: 10px; font-variant-numeric: tabular-nums;
}
#alert-count { background: #fae4b8; color: #593a13; margin: 0; }
.alert-symbol { display: grid; place-items: center; width: 13px; height: 13px; border: 1px solid #78520e; border-radius: 50%; color: #78520e; font-size: 10px; font-weight: 800; }
#legend-toggle { bottom: 32px; min-height: 42px; border-color: #cbdad3; box-shadow: var(--map-shadow); }
#legend { bottom: 81px; }
#feed-panel {
  position: absolute; z-index: 803; inset: auto auto 81px 12px; width: min(350px, calc(100% - 24px));
  max-height: calc(100% - 92px); overflow: auto; overscroll-behavior: contain;
  border: 1px solid #cbdad3; border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: var(--map-shadow);
  padding: 8px 12px;
}
#feed-panel header { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
#feed-panel h2 { font-size: 16px; }
#close-feed, #vehicle-close {
  border: 0; border-radius: 6px; background: #eef4ef; min-width: 35px; min-height: 35px;
  color: var(--ink); font-size: 21px; line-height: 1;
}
.feed-card { border-top: 1px solid #dde7e1; padding: 8px 0 4px; }
.feed-card-heading { display: flex; gap: 7px; align-items: baseline; }
.feed-card-heading a { font-size: 13px; font-weight: 780; color: #125748; text-decoration: none; }
.feed-card-heading a:hover { text-decoration: underline; }
.feed-card-heading small { font-size: 11px; color: var(--muted); }
.feed-card-heading button {
  margin-left: auto; border: 1px solid #d2dfd8; border-radius: 5px;
  min-height: 30px; padding: 3px 7px; background: #f1f6f3; font-size: 11px; font-weight: 700;
}
.feed-card dl { margin: 4px 0 0; display: grid; gap: 4px; font-size: 11px; }
.feed-component { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.feed-component dd { display: inline-flex; align-items: center; gap: 5px; margin: 0; font-variant-numeric: tabular-nums; }
.feed-component dt, .feed-credit { color: #486461; }
.feed-credit { padding-top: 6px; font-size: 10px; }
.feed-credit a { color: #0c5e4d; }
.state-dot { display: inline-block; border-radius: 50%; width: 7px; height: 7px; flex: 0 0 auto; background: #82948c; }
.state-offline, .state-stale, .state-empty, .state-unavailable { background: #ab7217; }
.live-pulse {
  display: inline-block; position: relative; isolation: isolate; width: 8px; height: 8px; flex: 0 0 8px;
  border-radius: 50%; background: #079365; vertical-align: middle; line-height: 1;
}
.live-pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; border: 1px solid currentColor;
  color: #00835a; animation: signal-pulse 2.3s ease-out infinite;
}
#feed-indicator:not(.is-live) { background: #7c958a; }
#feed-indicator:not(.is-live)::after { display: none; }
@keyframes signal-pulse { 0%, 16% { opacity: .58; transform: scale(1); } 80%, 100% { opacity: 0; transform: scale(2.6); } }
@media (prefers-reduced-motion: reduce) { .live-pulse::after { animation: none; opacity: .4; transform: scale(1.4); } }
.timing-source { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.departure-clock .timing-source { display: flex; }
.board-table .timing-source { display: flex; justify-content: flex-start; margin-top: 7px; }
.timing-source .live-pulse { display: inline-block; }
.departure-eta .timing-source { min-height: 12px; }
#departures .recent-stops { margin-bottom: 3px; }
.departure-list .is-departed { color: #596c65; background: #eef2ef; }
.board-table .is-departed { color: #bdd0cf; background: #243d46; }
.board-table .is-departed .board-due { color: inherit; }
.is-departed .live-pulse { animation: none; background: #82948c; }
.is-departed .live-pulse::after { display: none; }

.map-stop { display: grid; place-items: center; }
.stop-symbol {
  display: inline-block; position: relative; width: 22px; height: 22px; border-radius: 6px;
  border: 1.5px solid #fff; background: #1f3f4a; color: white; box-shadow: 0 1px 4px #102d344a;
}
.stop-symbol::before {
  content: ""; position: absolute; inset: 4px 4px 5px; border: 1.4px solid currentColor; border-radius: 3px;
  background: linear-gradient(currentColor, currentColor) center 4px / 100% 1px no-repeat;
}
.stop-symbol::after {
  content: ""; position: absolute; bottom: 4px; left: 5px; width: 2px; height: 3px;
  border-radius: 1px; background: currentColor; box-shadow: 7px 0 currentColor;
}
#legend .stop-symbol { transform: scale(.75); margin: -2px; }
.map-stop:focus-visible .stop-symbol { background: #004e47; }
.highlighted-stop .stop-symbol { background: #007664; box-shadow: 0 0 0 4px #0d856e4a; }
.stop-cluster { display: grid; place-items: center; }
.stop-cluster-count {
  display: grid; place-items: center; min-width: 28px; min-height: 28px; padding: 0 4px;
  border: 1.5px solid #f4fbf8; border-radius: 50%; box-shadow: 0 0 0 3px #28695730, 0 2px 5px #29473b30;
  background: #2c6a5a; color: #fff; font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.stop-popup > .stop-times { border-top: 1px solid #dde7e1; margin-top: 4px; padding-top: 3px; }
.running-bus .bus-marker-content { position: absolute; inset: 0; }
.running-bus .bus-heading { display: grid; place-items: center; }
.running-bus .bus-heading::before { display: none; }
.bus-sprite { width: 14px; height: 41px; object-fit: fill; filter: drop-shadow(0 0 1px #fff) drop-shadow(0 1px 2px #102d34a0); }
.running-bus .bus-route {
  top: 33px; left: 39px; transform: translateX(-50%); height: 15px; min-width: 18px;
  padding: 0 3px; border: 1px solid #fff; border-radius: 4px; font-size: 9px; line-height: 13px;
}
.running-bus.is-selected { border-radius: 50%; background: color-mix(in srgb, var(--route-color, #198674) 24%, transparent); }
#app[data-detail="overview"] .running-bus .bus-sprite { width: 10px; height: 29px; }
#app[data-detail="overview"] .running-bus .bus-route { top: 29px; left: 34px; }
.bus-fix .bus-route { min-width: 19px; height: 16px; line-height: 14px; font-size: 9px; opacity: .72; }
.bus-fix .gps-key { font-size: 8px; bottom: 3px; }

#vehicle-inspector {
  z-index: 706; position: absolute; inset: 62px auto auto 12px; width: min(700px, calc(100% - 62px));
  padding: 10px 12px 8px; border-radius: 12px; border: 1px solid #cbdad3;
  background: #fbfdfcf7; color: var(--ink); box-shadow: var(--map-shadow);
}
.inspector-header, #vehicle-inspector-title, .inspector-actions { display: flex; align-items: center; gap: 8px; }
.inspector-header { justify-content: space-between; }
#vehicle-inspector-title { min-width: 0; }
.inspector-destination { min-width: 0; }
.inspector-destination h2 { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inspector-destination p, #vehicle-inspector-status { color: #4c6565; font-size: 11px; }
#vehicle-inspector-status { display: flex; align-items: center; gap: 7px; margin: 4px 0 0; }
#vehicle-focus {
  border: 1px solid #d2dfd8; border-radius: 6px; white-space: nowrap; min-height: 35px;
  background: #eff5f1; color: #184f42; font-size: 12px; font-weight: 750;
}
.inspector-track { display: grid; grid-template-columns: 26px minmax(0, 1fr) 26px; align-items: center; margin-top: 6px; }
.sequence-arrow { border: 0; background: transparent; min-height: 38px; font-size: 24px; color: #3b665c; }
.stop-sequence, #trip-timeline.stop-sequence {
  display: flex; align-items: stretch; margin: 0; padding: 0 0 5px; max-height: none; list-style: none;
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #91ab9f transparent;
  position: relative;
}
#trip-timeline.stop-sequence { padding-block: 8px; }
.stop-sequence .sequence-stop, #trip-timeline li.sequence-stop {
  position: relative; width: 125px; flex: 0 0 125px; min-width: 0; padding: 0; display: block; border: 0;
}
.stop-sequence .sequence-stop::before, #trip-timeline li.sequence-stop::before {
  content: ""; display: block; position: absolute; inset: 41px 0 auto; height: 2px;
  width: auto; margin: 0; border: 0; border-radius: 0; background: #aac5b7;
}
.stop-sequence .sequence-stop:first-child::before { left: 50%; }
.stop-sequence .sequence-stop:last-child::before { right: 50%; }
.stop-sequence .sequence-stop[data-state="past"]::before { background: #cfdad4; }
.sequence-select {
  display: flex; position: relative; flex-direction: column; justify-content: flex-start; align-items: center; text-align: center;
  width: 100%; min-height: 83px; padding: 0 4px; border: 0; border-radius: 6px; background: transparent;
  color: inherit; line-height: 1.18; gap: 4px;
}
.sequence-select:hover, .sequence-select:focus-visible { background: #6aab8724; }
.sequence-name {
  font-size: 11px; font-weight: 710; height: 33px; overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; align-content: center;
}
.sequence-node { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #548f79; background: #fff; }
.sequence-time { font-size: 11px; font-variant-numeric: tabular-nums; }
.sequence-source { color: #496861; font-size: 9px; min-height: 9px; }
.sequence-stop[data-state="next"] .sequence-node { background: #007864; border-color: #007864; box-shadow: 0 0 0 3px #21806535; }
.sequence-stop[data-state="next"] .sequence-time { color: #006154; }
.sequence-stop[data-state="past"] { color: #657870; }
.sequence-stop[data-state="past"] .sequence-node { border-color: #a6b8af; }
.sequence-empty { padding: 12px 0; font-size: 12px; color: var(--muted); }
#transit-view .sequence-source, #transit-view .sequence-stop[data-state="past"] { color: #b1c6c9; }
#transit-view .sequence-stop[data-state="next"] .sequence-time { color: #8cebd2; }
#transit-view .sequence-empty { color: #b1c6c9; }
#trip-timeline li.sequence-empty { display: block; }

@media (min-width: 761px) and (hover: hover) {
  #app .mobile-tools button[data-panel="routes"] { display: none; }
}
@media (max-width: 760px), (max-height: 480px) and (pointer: coarse) {
  .topbar { grid-template-columns: auto 1fr; padding: max(6px, env(safe-area-inset-top)) 9px 7px; gap: 5px 8px; }
  .topbar .identity h1 { display: block; font-size: 15px; }
  .topbar .brand { width: 30px; height: 30px; }
  .header-actions { grid-row: 1; grid-column: 2; }
  .header-actions button { min-height: 38px; font-size: 12px; padding-inline: 7px; }
  #map-search { grid-column: 1 / -1; }
  #map-query { height: 39px; font-size: 16px; }
  #app .mobile-tools {
    position: relative; inset: auto; left: auto !important; bottom: auto; width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
    box-shadow: none; border: 0; border-top: 1px solid #cbdad3; border-radius: 0;
  }
  #app .mobile-tools button { min-height: 44px; }
  #app .mobile-tools button[data-panel="routes"] { display: block; }
  #app #controls, #app #departures { padding-top: 0; }
  #app[data-panel="routes"] #controls, #app[data-panel="vehicles"] #controls { z-index: 5; }
  #stop-sheet { z-index: 5; }
  .map-toolbar, #app:not([data-view="map"]) .map-toolbar { left: 9px; top: 8px; }
  .map-toolbar button, .map-toolbar select, .map-dock button { min-height: 40px; }
  .map-dock { left: 8px; bottom: 39px; }
  #feed-outage { left: 8px; bottom: 93px; min-height: 44px; }
  #legend-toggle { right: 8px; bottom: 39px; }
  #legend, #feed-panel { bottom: 91px; max-height: calc(100% - 97px); }
  #feed-panel { left: 8px; }
  #vehicle-inspector { inset: auto 8px 91px; width: auto; padding: 7px 8px 4px; }
  .inspector-destination h2 { font-size: 13px; }
  .sequence-arrow { min-height: 44px; }
  #vehicle-close, #close-feed { min-width: 40px; min-height: 40px; }
  .stop-sequence .sequence-stop, #trip-timeline li.sequence-stop { width: 112px; flex-basis: 112px; }
  #app:not([data-view="map"]) #vehicle-inspector { inset: 57px 8px auto; max-height: calc(100% - 62px); overflow-y: auto; }
}
@media (max-width: 340px) {
  .topbar h1 { display: none !important; }
  #legend-toggle { gap: 4px; padding-inline: 6px; font-size: 11px; }
  .map-dock button { padding-inline: 5px; }
}
