html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #d7d7d7;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

#app,
#map {
  width: 100%;
  height: 100%;
}

.map-compatibility-error {
  align-items: center;
  background: #20262d;
  color: #fff;
  display: flex;
  font: 600 16px/1.45 system-ui, sans-serif;
  height: 100%;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.device-location-marker {
  position: relative;
  width: 28px;
  height: 28px;
  pointer-events: none;
}

.device-location-marker__pulse,
.device-location-marker__dot {
  position: absolute;
  border-radius: 50%;
}

.device-location-marker__pulse {
  inset: 0;
  background: rgba(22, 116, 226, .36);
  animation: device-location-pulse 2s ease-out infinite;
}

.device-location-marker__dot {
  inset: 7px;
  border: 2px solid #fff;
  background: #1674e2;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .5);
}

@keyframes device-location-pulse {
  0% { opacity: .85; transform: scale(.4); }
  75%, 100% { opacity: 0; transform: scale(1.65); }
}

.service-limit-pill {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 20;
  padding: 6px 10px;
  border: 1px solid rgba(45, 50, 54, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #3c454d;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  pointer-events: none;
}

.service-limit-pill[hidden] {
  display: none;
}

.demo-map-coachmark .maplibregl-popup-content {
  padding: 14px 30px 14px 14px;
  border: 1px solid rgba(7, 29, 34, .22);
  border-radius: 14px;
  color: #071d22;
  box-shadow: 0 8px 26px rgba(7, 29, 34, .24);
}

.demo-map-coachmark .maplibregl-popup-close-button {
  width: 28px;
  height: 28px;
  color: #071d22;
  font-size: 22px;
}

.demo-coachmark-copy {
  margin: 0;
  font: 700 13px/1.4 Arial, sans-serif;
}

.demo-coachmark-legend {
  display: grid;
  gap: 8px;
  font: 700 13px/1.25 Arial, sans-serif;
}

.demo-coachmark-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.demo-coachmark-train-arrow {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.station-service-popup {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: min(500px, calc(100vw - 64px));
  max-height: calc(100vh - 48px);
  padding-top: 1px;
  font: 12px/1.15 Arial, sans-serif;
}

.station-service-map-popup.maplibregl-popup,
.station-service-map-popup .maplibregl-popup-content {
  max-height: calc(100vh - 24px);
}

.station-service-map-popup .maplibregl-popup-content {
  overflow: hidden;
}

.station-service-popup h2 {
  margin: 5px 0 3px;
  font-size: 14px;
  line-height: 1.15;
}

.station-service-control-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  min-height: 30px;
  padding: 0 0 4px;
  font-size: 11px;
  white-space: nowrap;
}

.station-service-state-controls {
  display: flex;
  align-items: center;
  gap: 9px;
}

.station-service-popup .station-service-close {
  width: auto;
  min-height: 24px;
  padding: 2px 9px;
  border: 0;
  border-radius: 999px;
  background: #111111;
  color: #ffffff;
  font-size: 11px;
  text-align: center;
}

.station-service-popup .station-service-close:hover,
.station-service-popup .station-service-close:focus-visible {
  background: #343434;
}

.station-service-state-pill {
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 24px;
  padding: 2px 7px;
  border: 1px solid #d9dde0;
  border-radius: 999px;
  background: #ffffff;
}

.station-service-state-controls input {
  margin: 0;
}

.station-service-state-pill--activated:has(input:checked) {
  border-color: #c8b968;
  background: #fff5bf;
}

.station-service-state-pill--terminated:has(input:checked) {
  border-color: #d9a2a0;
  background: #fde8e7;
}

.station-service-table {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.station-service-table.is-scrollable {
  padding-right: 3px;
  scrollbar-gutter: stable;
}

.station-service-table.has-station-toggles {
  padding-top: 27px;
}

.station-service-popup ul {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.station-service-section + .station-service-section {
  margin-top: 3px;
}

.station-service-rows[hidden] {
  display: none;
}

.station-service-station-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 27px;
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 700;
}

.station-service-station-toggle::before {
  content: "▶";
  width: 12px;
  font-size: 9px;
}

.station-service-station-toggle[aria-expanded="true"]::before {
  content: "▼";
}

.station-service-station-toggle span:first-child {
  flex: 1;
  padding: 0 5px;
}

.station-service-station-toggle span:last-child {
  color: #60676c;
  font-size: 10px;
}

.station-service-grid {
  display: grid;
  grid-template-columns: 34px 58px 38px minmax(62px, 1fr) minmax(76px, 1.25fr) 38px;
  gap: 5px;
  align-items: center;
}

.station-service-column-headings {
  padding: 0 5px 2px;
  color: #555;
  font-size: 9px;
  font-weight: 700;
}

.station-service-popup button {
  width: 100%;
  min-height: 24px;
  padding: 3px 5px;
  border: 1px solid #8d969d;
  border-radius: 5px;
  background: #f5f6f7;
  color: #111;
  font: 600 11px/1.15 Arial, sans-serif;
  text-align: left;
  cursor: pointer;
}

.station-service-popup button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-service-popup button:hover,
.station-service-popup button:focus-visible {
  background: #e3e7ea;
}

.station-service-popup button.is-activated {
  background: #fff5bf;
  border-color: #c8b968;
}

.station-service-popup button.is-activated:hover,
.station-service-popup button.is-activated:focus-visible {
  background: #ffec8f;
}

.station-service-popup button.is-terminated {
  background: #fde8e7;
  border-color: #d9a2a0;
}

.station-service-popup button.is-terminated:hover,
.station-service-popup button.is-terminated:focus-visible {
  background: #fbd4d2;
}

.station-service-continuation {
  margin: 2px 7px 5px;
  color: #3f484e;
  font: 600 10px/1.3 Arial, sans-serif;
}

@media (max-width: 600px) {
  .station-service-map-popup.maplibregl-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    width: calc(100vw - 24px);
    max-width: 550px !important;
    transform: translate(-50%, -50%) !important;
  }

  .station-service-map-popup .maplibregl-popup-tip {
    display: none;
  }

  .station-service-grid {
    grid-template-columns: 28px 50px 35px minmax(40px, 1fr) minmax(52px, 1.3fr) 35px;
    gap: 2px;
  }

  .station-service-popup button {
    font-size: 10px;
  }
}

#app {
  position: relative;
}

#map {
  position: absolute;
  inset: 0;
}

.opening-navigation-layer {
  position: absolute;
  left: 50%;
  bottom: calc(130px + env(safe-area-inset-bottom, 0px));
  z-index: 45;
  width: min(390px, calc(100% - 28px));
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 1;
  transition: opacity .25s ease;
}

.opening-navigation-layer[hidden] { display: none; }
.opening-navigation-layer.is-faded { opacity: 0; }
.opening-navigation-stack { width: 100%; }
.opening-navigation-logo { display: block; width: 100%; height: auto; }
.map-navigation-action[aria-disabled="true"] { cursor: default; }

@media (prefers-reduced-motion: reduce) {
  .opening-navigation-layer { transition: none; }
}

.map-action-stack {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  z-index: 60;
  display: flex;
  width: min(390px, calc(100% - 28px));
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transform: translateX(-50%);
  pointer-events: none;
}

.map-action-stack:not(:has(> :not([hidden]))) { display: none; }

.map-navigation-pill {
  display: grid;
  grid-template-columns: repeat(3, minmax(68px, 1fr));
  width: 100%;
  padding: 6px;
  gap: 5px;
  border: 1px solid rgba(44, 44, 44, .55);
  border-radius: 17px;
  background: rgba(224, 227, 228, .82);
  box-shadow: 0 6px 20px rgba(25, 29, 32, .22);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  pointer-events: auto;
}

.map-navigation-pill[hidden] { display: none; }

.map-context-action-pill {
  display: flex;
  width: calc(100% - 20px);
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(44, 44, 44, .55);
  border-radius: 15px;
  background: rgba(224, 227, 228, .82);
  box-shadow: 0 5px 18px rgba(25, 29, 32, .2);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  pointer-events: auto;
}

.map-context-action-pill[hidden] { display: none; }

.map-trace-action-pill {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: calc(100% - 40px);
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(44, 44, 44, .55);
  border-radius: 14px;
  background: rgba(224, 227, 228, .82);
  box-shadow: 0 4px 14px rgba(25, 29, 32, .18);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  pointer-events: auto;
}

.map-trace-action-pill[hidden] { display: none; }

.map-context-action {
  min-height: 31px;
  min-width: 0;
  flex: 1 1 0;
  padding: 5px 7px;
  border: 1px solid #303438;
  border-radius: 9px;
  background: #e4e6e7;
  color: #080a0b;
  font: 750 10px/1.1 Arial, sans-serif;
  letter-spacing: .035em;
  text-transform: uppercase;
  cursor: pointer;
}

.map-context-action:hover { background: #f3f4f4; }
.map-context-action:focus-visible { outline: 2px solid #30383d; outline-offset: 2px; }
.map-context-action[aria-current="page"] { background: #5f666b; color: #fff; }
.map-context-action[hidden] { display: none; }

.map-trace-action {
  min-width: 0;
  min-height: 30px;
  padding: 4px 5px;
  overflow: hidden;
  border: 1px solid #303438;
  border-radius: 8px;
  background: #e4e6e7;
  color: #080a0b;
  font: 750 9px/1.1 Arial, sans-serif;
  letter-spacing: .025em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}

.map-trace-action:hover { background: #f3f4f4; }
.map-trace-action:focus-visible { outline: 2px solid #30383d; outline-offset: 2px; }
.map-trace-action[aria-pressed="true"] { background: #5f666b; color: #fff; }

.map-navigation-action {
  display: flex;
  min-width: 0;
  min-height: 33px;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid #303438;
  border-radius: 10px;
  background: #e4e6e7;
  color: #080a0b;
  font: 750 11px/1.1 Arial, sans-serif;
  letter-spacing: .035em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

.map-navigation-action.is-current { background: #5f666b; color: #fff; }
.map-navigation-action:hover { background: #f3f4f4; }
.map-navigation-action.is-current:hover { background: #51585d; }
.map-navigation-action:focus-visible { outline: 2px solid #30383d; outline-offset: 2px; }

.app-popup-layer {
  --action-stack-reserve: 88px;
  position: absolute;
  inset: 0;
  z-index: 50;
  display: grid;
  padding: max(16px, env(safe-area-inset-top, 0px)) 14px calc(var(--action-stack-reserve) + env(safe-area-inset-bottom, 0px));
  place-items: center;
  background: rgba(72, 77, 81, .16);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.app-popup-layer.is-hidden { display: none; }
.app-popup-layer.has-secondary-actions { --action-stack-reserve: 124px; }
.app-popup-layer.has-tertiary-actions { --action-stack-reserve: 164px; }
.app-popup-layer.is-detail-popup { padding: 0 0 calc(var(--action-stack-reserve) + env(safe-area-inset-bottom, 0px)); }
.app-popup-layer.is-schedule-popup {
  padding: max(16px, env(safe-area-inset-top, 0px)) 14px calc(var(--action-stack-reserve) + env(safe-area-inset-bottom, 0px));
  background: rgba(72, 77, 81, .24);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.app-popup-layer.is-journey-replayer { padding: 0; }
.app-popup--journey-replayer > .app-popup-head { display: none; }

.app-popup {
  display: flex;
  width: min(680px, 100%);
  max-height: 100%;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(44, 44, 44, .5);
  border-radius: 20px;
  background: rgba(242, 244, 246, .86);
  color: #182026;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .3);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.app-popup[hidden] { display: none; }
.app-popup--menu { width: min(430px, 100%); }
.app-popup--settings { width: min(580px, 100%); }
.app-popup--reading { width: min(660px, 100%); }
.app-popup--schedule { height: min(88dvh, 900px); }
.app-popup--trace { width: 100%; height: 100%; max-height: none; min-height: 0; border: 0; border-radius: 0; }
.app-popup--replayer { width: min(760px, 100%); height: min(88dvh, 900px); }
.app-popup--unit-history { width: min(760px, 100%); height: min(94dvh, 1100px); }
.app-popup--replayer.app-popup--journey-replayer {
  width: 100%;
  height: 100%;
  max-height: none;
  border: 0;
  border-radius: 0;
}

.app-popup-head {
  display: flex;
  min-height: 68px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px 10px 20px;
  border-bottom: 1px solid rgba(44, 44, 44, .17);
  background: rgba(235, 238, 240, .76);
}

.app-popup-head h2,
.app-popup-head h1 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: clamp(20px, 3vw, 28px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-popup-heading { min-width: 0; }

#mapLiveServiceTracePopupSummary {
  margin: 3px 0 0;
  overflow: hidden;
  font-size: clamp(10px, 1.5vw, 14px);
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-popup-close {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  padding: 0;
  place-items: center;
  border: 1px solid #555;
  border-radius: 50%;
  background: #5f666b;
  color: #fff;
  font-size: 31px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.app-popup-back,
.back-pill {
  min-width: 72px;
  min-height: 42px;
  flex: 0 0 auto;
  padding: 8px 16px;
  border: 1px solid #555;
  border-radius: 9px;
  background: #737a7f;
  color: #fff;
  font: 750 15px/1 Arial, sans-serif;
  cursor: pointer;
}

.app-popup-close:focus-visible,
.app-popup-back:focus-visible,
.back-pill:focus-visible { outline: 2px solid #222; outline-offset: 3px; }
.app-popup-body { min-height: 0; overflow: auto; padding: 18px; }
.app-popup-menu { display: grid; gap: 10px; }
.app-popup-note { margin: 4px; color: #59656d; text-align: center; }
.test-help-divider { height: 1px; margin: 4px 0 2px; background: rgba(44, 44, 44, .18); }
.test-help-heading { margin: 8px 4px 0; color: #59656d; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; }
.test-help-control-form { display: contents; }
.selected-service-options { display: grid; gap: 10px; }
.selected-service-options[hidden] { display: none; }
.selected-service-options h3 { margin: 2px 4px 0; font-size: 16px; }
.app-popup-menu-action {
  min-height: 54px;
  padding: 10px 18px;
  border: 1px solid rgba(60, 69, 74, .28);
  border-radius: 13px;
  background: rgba(255, 255, 255, .58);
  color: #20272b;
  font: 750 17px/1.2 Arial, sans-serif;
  text-align: left;
  cursor: pointer;
}
.app-popup-menu-action:hover { background: rgba(255, 255, 255, .86); }
.app-popup-menu-action[hidden] { display: none; }
.app-popup-menu-action:is(a) {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.test-help-control-form .app-popup-menu-action { width: 100%; }
.service-finder-body { display: grid; gap: 10px; }
.service-finder-body label { margin-top: 4px; font-size: 16px; font-weight: 800; }
.service-finder-body input,
.service-finder-body select {
  width: 100%;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid rgba(60, 69, 74, .45);
  border-radius: 10px;
  background: rgba(255, 255, 255, .8);
  color: #20272b;
  font: 700 16px/1.2 Arial, sans-serif;
}
.service-finder-body input:focus-visible,
.service-finder-body select:focus-visible { outline: 2px solid #30383d; outline-offset: 2px; }
.service-finder-station-options {
  display: grid;
  max-height: min(42dvh, 330px);
  margin-top: -6px;
  overflow-y: auto;
  border: 1px solid rgba(60, 69, 74, .3);
  border-radius: 10px;
  background: rgba(255, 255, 255, .94);
}
.service-finder-station-options[hidden] { display: none; }
.service-finder-station-option {
  min-height: 46px;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid rgba(60, 69, 74, .14);
  background: transparent;
  color: #20272b;
  font: 700 15px/1.25 Arial, sans-serif;
  text-align: left;
  cursor: pointer;
}
.service-finder-station-option:last-child { border-bottom: 0; }
.service-finder-station-option:hover,
.service-finder-station-option:focus-visible { background: rgba(218, 229, 234, .72); outline: none; }
.service-finder-status { min-height: 36px; margin: 2px 0; color: #59656d; font-size: 14px; line-height: 1.35; }
.service-finder-service-field { display: grid; gap: 10px; padding-top: 8px; border-top: 1px solid rgba(44, 44, 44, .16); }
.service-finder-service-field[hidden] { display: none; }
.trace-display-options { display: grid; gap: 8px; }
.trace-display-options[hidden] { display: none; }
.trace-display-options h3 { margin: 2px 4px 8px; font-size: 16px; }
.app-popup-option-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 10px 16px;
  border: 1px solid rgba(60, 69, 74, .28);
  border-radius: 13px;
  background: rgba(255, 255, 255, .58);
  font-size: 17px;
  font-weight: 750;
  cursor: pointer;
}
.app-popup-option-toggle input { width: 24px; height: 24px; accent-color: #1b6574; }
.app-popup-reading-copy { padding: clamp(18px, 4vw, 34px); font-size: 16px; line-height: 1.55; }
.app-popup-reading-copy > :first-child { margin-top: 0; }
.app-popup-reading-copy h3 { margin: 26px 0 8px; }
.app-popup-reading-copy a { color: #205c75; }
.app-popup-source-note { padding-top: 18px; border-top: 1px solid rgba(44,44,44,.16); color: #59656d; font-size: 14px; }
.about-details { display: grid; gap: 8px; margin: 24px 0; }
.about-details div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; }
.about-details dt { color: #68747b; font-weight: 700; }
.about-details dd { margin: 0; font-weight: 750; }
.app-popup-frame { width: 100%; min-height: 0; flex: 1 1 auto; border: 0; background: #f3f5f7; }

.map-overlay-settings { display: grid; gap: 4px; }
.map-overlay-settings h3 { margin: 0 0 8px; font-size: 18px; }
.map-overlay-setting {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(44,44,44,.12);
}
.map-overlay-setting-copy { display: grid; gap: 3px; }
.map-overlay-setting-copy strong { font-size: 16px; }
.map-overlay-setting-copy small { color: #6b757c; }
.map-overlay-setting input { width: 23px; height: 23px; accent-color: #4e5a60; }
.map-overlay-setting.is-unavailable { color: #7a8388; }
.map-overlay-setting-status { padding: 4px 8px; border-radius: 999px; background: rgba(100,108,113,.12); font-size: 12px; font-weight: 700; }
.development-settings { margin-top: 28px; padding-top: 20px; border-top: 1px solid rgba(44,44,44,.18); }

.map-corner-actions {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 28px);
  right: calc(env(safe-area-inset-right, 0px) + 28px);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
}

.map-corner-button {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border: 0;
  padding: 0;
  background: transparent;
  color: rgba(92, 92, 92, 0.96);
  cursor: pointer;
}

.ideas-button {
  font: 700 46px/54px Arial, sans-serif;
  text-align: center;
}

.map-corner-button svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.data-sources-icon-cutout {
  fill: #d7d7d7;
}

.map-corner-button:hover {
  color: rgba(70, 70, 70, 1);
}

.map-corner-button:focus-visible,
.back-pill:focus-visible {
  outline: 2px solid rgba(70, 70, 70, 0.9);
  outline-offset: 4px;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  overflow: hidden;
  background: rgba(72, 77, 81, .16);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.overlay.is-hidden {
  display: none;
}

.outer-frame {
  display: none;
}

.info-panel { position: relative; }

.info-panel-body {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: calc(78px + env(safe-area-inset-top, 0px)) 24px 24px;
  color: #222;
}

.info-copy {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #2c2c2c;
  letter-spacing: 0.05em;
  padding: 24px;
}

.info-title {
  font-size: clamp(28px, 4vw, 56px);
  font-weight: 500;
}

.info-subtitle {
  margin-top: 18px;
  font-size: clamp(15px, 1.9vw, 26px);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.map-panel-controls {
  position: absolute;
  top: calc(18px + env(safe-area-inset-top, 0px));
  right: 18px;
  z-index: 2;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.map-panel-controls [hidden] {
  display: none;
}

.refresh-service-button {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  padding: 0;
  place-items: center;
  border: 1px solid #555;
  border-radius: 999px;
  background: #5f666b;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.refresh-service-button[hidden] { display: none; }
.refresh-service-button:focus-visible { outline: 2px solid #222; outline-offset: 3px; }
.refresh-service-button.is-refreshing span { animation: service-refresh-spin .8s linear infinite; }
@keyframes service-refresh-spin { to { transform: rotate(360deg); } }

.trace-button-group {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 3;
  display: flex;
  gap: 8px;
  max-width: calc(100% - 190px);
}

.trace-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #555;
  border-radius: 8px;
  background: #5f666b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-decoration: none;
}

.trace-button:focus-visible { outline: 2px solid #222; outline-offset: 3px; }
.trace-button[hidden] { display: none; }

button.trace-button { cursor: pointer; }

.map-schedule-dialog {
  width: min(680px, calc(100% - 24px));
  max-height: calc(100dvh - 30px);
  padding: 0;
  border: 1px solid rgba(44, 44, 44, .5);
  border-radius: 18px;
  background: rgba(242, 244, 246, .82);
  color: #182026;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .3);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.map-schedule-dialog::backdrop {
  background: rgba(55, 60, 64, .18);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.app-popup--formation {
  width: min(1120px, calc(100% - 24px));
  max-height: 100%;
  background: #f7f8f9;
}

.formation-drawing-dialog-body {
  min-height: 0;
  max-height: none;
  flex: 1 1 auto;
  padding: 18px;
  overflow: auto;
}

.app-popup--formation .app-popup-head h2 span {
  font-size: .72em;
  font-weight: 600;
}

.formation-leg-drawing + .formation-leg-drawing {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid #cbd1d5;
}

.formation-leg-drawing h3 {
  margin: 0 0 12px;
  font-size: 17px;
}

.formation-train-option + .formation-train-option { margin-top: 14px; }
.formation-alternative-label { margin: 0 0 5px 27px; color: #596775; font-size: 12px; font-weight: 700; }
.formation-train-scroll { overflow-x: auto; padding: 2px 3px 12px; }

.formation-train {
  display: inline-flex;
  min-width: max-content;
  align-items: flex-start;
}

.formation-direction {
  order: 2;
  flex: 0 0 27px;
  margin-top: 25px;
  color: #080808;
  font-size: 25px;
  font-weight: 900;
  line-height: 30px;
  text-align: center;
}

.formation-unit { display: inline-grid; min-width: 51px; }
.formation-unit + .formation-unit { margin-left: 4px; }
.formation-unit-vehicles { display: flex; align-items: flex-start; }

.formation-vehicle-wrap {
  display: inline-grid;
  flex: 0 0 var(--vehicle-width);
  width: var(--vehicle-width);
  min-width: 32px;
  grid-template-rows: 19px 27px minmax(25px, auto);
  align-items: end;
}

.formation-vehicle-wrap + .formation-vehicle-wrap { margin-left: 3px; }

.formation-features {
  grid-row: 1;
  display: flex;
  min-height: 16px;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.formation-feature {
  display: inline-grid;
  min-width: 13px;
  height: 13px;
  padding: 0 2px;
  place-items: center;
  border: 1px solid #1f272c;
  border-radius: 3px;
  background: #fff;
  color: #111;
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
}

.formation-vehicle-art {
  grid-row: 2;
  display: block;
  width: 100%;
  height: auto;
  max-height: 27px;
  transform-origin: center;
}

.formation-vehicle-art--mirrored { transform: scaleX(-1); }

.formation-id-rule {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(7px, 1fr) auto minmax(7px, 1fr);
  align-items: center;
  gap: 6px;
  padding: 2px 1px 0;
  color: #111;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.formation-id-rule::before,
.formation-id-rule::after {
  position: absolute;
  top: 50%;
  width: 1px;
  height: 8px;
  background: #15191c;
  content: "";
  transform: translateY(-100%);
}

.formation-id-rule::before { left: 0; }
.formation-id-rule::after { right: 0; }
.formation-id-rule-line { border-top: 1.5px solid #15191c; }
.formation-id-rule-text { padding: 0 2px; }
.formation-vehicle-id { grid-row: 3; align-self: start; margin-top: 5px; font-size: 12px; }
.formation-unit-id { margin-top: 3px; }

.formation-drawing-empty {
  margin: 16px 0 0;
  color: #596775;
  font-size: 12px;
  line-height: 1.45;
}
.map-schedule-dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(44, 44, 44, .22);
  background: rgba(235, 238, 240, .88);
}
.map-schedule-dialog-head h2 { margin: 0; font-size: 20px; }
.map-schedule-dialog-head button {
  width: 40px;
  height: 40px;
  border: 1px solid #555;
  border-radius: 999px;
  background: #5f666b;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.map-schedule-dialog-body { max-height: calc(100dvh - 100px); padding: 10px; overflow: auto; }
.map-full-schedule { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 12px; }
.map-full-schedule col.location { width: 32%; }
.map-full-schedule col.schedule-variation-column { width: 8%; }
.map-full-schedule col.schedule-time-column { width: 15%; }
.map-full-schedule th { position: sticky; top: 0; z-index: 1; padding: 6px 4px; background: #e9eef2; }
.map-full-schedule thead tr:first-child th { padding-bottom: 2px; border-bottom: 0; }
.map-full-schedule thead tr:last-child th { top: 24px; padding-top: 2px; }
.map-full-schedule td { padding: 6px 3px; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.map-full-schedule .schedule-location { padding-left: 5px; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.map-full-schedule .schedule-variation { padding-right: 0; padding-left: 0; }
.map-full-schedule .schedule-variation .timing-variation { margin-left: 0; }
.map-full-schedule td:not(.schedule-location) { white-space: nowrap; }
.map-full-schedule tr.passenger td { font-weight: 800; }
.map-full-schedule tr.timing-point td { color: #596775; }
.map-full-schedule tr.current-location td { font-weight: 800; }
.map-full-schedule tr.current-location td {
  border-top: 1px solid #075f2e;
  border-bottom: 1px solid #075f2e;
}
.map-full-schedule tr.current-location td:first-child {
  border-left: 1px solid #075f2e;
  border-radius: 5px 0 0 5px;
}
.map-full-schedule tr.current-location td:last-child {
  border-right: 1px solid #075f2e;
  border-radius: 0 5px 5px 0;
}
.map-full-schedule tr.current-location--green td { background: #dff2e5; color: #075f2e; }
.map-full-schedule tr.current-location--amber td { background: hsl(40 42% 91%); color: #6b4c00; }
.map-full-schedule tr.current-location--red td { background: hsl(4 42% 91%); color: #8a2118; }
.map-full-schedule tr.finder-selected-location td {
  border-top: 2px solid #20272b;
  border-bottom: 2px solid #20272b;
}
.map-full-schedule tr.finder-selected-location td:first-child { border-left: 2px solid #20272b; }
.map-full-schedule tr.finder-selected-location td:last-child {
  border-right: 2px solid #20272b;
  background: #dff2e5;
}

.map-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 5px 14px;
  border: 1px solid #555555;
  border-radius: 4px;
  background: #5f666b;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
}

.map-status-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.map-status-headline {
  text-transform: uppercase;
}

.map-status-detail {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.05;
  text-transform: none;
}

.map-status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: transparent;
}

.map-status-dot--running {
  background: #20c20e;
}

.map-status-dot--platform {
  background: #d48a00;
}

.map-status-dot--ready {
  background: #d62828;
  animation: map-status-ready-pulse 1s steps(2, end) infinite;
}

.map-status-dot--delayed {
  background: #d62828;
  animation: map-status-ready-pulse 1s steps(2, end) infinite;
}

@keyframes map-status-ready-pulse {
  50% { opacity: .15; }
}

.map-status-dot--terminated {
  background: #d93025;
}

.settings-option {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  color: #222;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  user-select: none;
  cursor: pointer;
}

.settings-option-checkbox {
  width: 22px;
  height: 22px;
  accent-color: #5f6368;
  cursor: pointer;
}

.settings-option-label {
  display: inline-block;
}

.settings-option--stacked {
  align-items: center;
  justify-content: space-between;
}

.settings-select {
  min-width: 92px;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid #aeb5ba;
  border-radius: 8px;
  background: #fff;
  color: #202428;
  font: inherit;
}

.settings-link {
  display: inline-block;
  margin-top: 24px;
  color: #30343b;
  font-size: 16px;
  font-weight: 600;
  text-underline-offset: 3px;
}

.settings-link:hover {
  color: #000;
}

.ideas-challenge-form label {
  display: block;
  margin: 22px 0 8px;
  color: #333;
  font-size: 15px;
  font-weight: 700;
}

.ideas-challenge-form input[type="text"] {
  box-sizing: border-box;
  width: 100%;
  margin-top: 24px;
  border: 1px solid #9aa0a6;
  border-radius: 8px;
  padding: 12px 14px;
  font: 600 22px/1.2 monospace;
  letter-spacing: 0.2em;
}

.ideas-challenge-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.ideas-challenge-actions .secondary-button {
  background: #e4e7eb;
  color: #222;
}

.debug-panel {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 999999;
  display: none;
  min-width: 320px;
  max-width: 520px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(32, 36, 40, 0.92);
  color: #ffffff;
  font: 12px/1.45 Arial, Helvetica, sans-serif;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
  white-space: normal;
}

.debug-detail-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin: 0 0 7px auto;
  cursor: pointer;
  font-weight: 700;
}

.debug-summary-table {
  width: 100%;
  margin: 6px 0;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.debug-summary-table th,
.debug-summary-table td {
  padding: 2px 6px;
  text-align: right;
  white-space: nowrap;
}

.debug-summary-table th:first-child {
  padding-left: 0;
  text-align: left;
}

.debug-count--activated { color: #e2bd20; }
.debug-count--terminated { color: #ff5b52; }
.debug-detail-section { margin-top: 6px; }

.maplibregl-ctrl-top-right {
  top: calc(env(safe-area-inset-top, 0px) + 92px);
  right: calc(env(safe-area-inset-right, 0px) + 18px);
}

.maplibregl-ctrl-group {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.map-service-summary {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 10px 28px;
  align-content: start;
  max-width: 980px;
  margin: 0;
  padding-top: 8px;
}

.service-detail-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(360px, 1fr);
  gap: 24px;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.service-route-map-wrap {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: 22px minmax(0, 1fr);
  gap: 6px;
  min-height: 320px;
  overflow: visible;
  border: 0;
  background: transparent;
}

.service-route-map {
  position: relative;
  min-width: 0;
  min-height: 0;
  z-index: 0;
  overflow: hidden;
  border: 1px solid rgba(44, 44, 44, .35);
  border-radius: 18px;
  background: #d7d7d7;
}
.service-route-expand-hint {
  align-self: center;
  justify-self: center;
  padding: 3px 10px;
  border: .5px solid #000;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.2;
  white-space: nowrap;
}
.service-route-expanded-summary {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: calc(env(safe-area-inset-left, 0px) + 10px);
  z-index: 50;
  display: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px 8px;
  width: max-content;
  max-width: calc(100% - 76px);
  padding: 6px 12px;
  border: .5px solid #000;
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: #000;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.2;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .16);
  pointer-events: none;
}
.service-route-expanded-origin,
.service-route-expanded-destination { white-space: nowrap; }
.service-route-label-toggle {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: calc(env(safe-area-inset-left, 0px) + 10px);
  z-index: 49;
  padding: 4px 9px;
  border: 0;
  border-radius: 999px;
  background: #111111;
  color: #fff;
  font: 700 11px/1.2 Arial, Helvetica, sans-serif;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}
.service-route-label-toggle[hidden] { display: none; }
.service-route-label-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
button.service-route-fullscreen-button {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  right: calc(env(safe-area-inset-right, 0px) + 10px);
  z-index: 50;
  display: none;
  width: 48px;
  height: 48px;
  padding: 11px;
  place-items: center;
  border: 1px solid rgba(44, 44, 44, .45);
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  color: #30383e;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
button.service-route-fullscreen-button svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
button.service-route-fullscreen-button:focus-visible { outline: 2px solid #222; outline-offset: 2px; }
.service-status-mobile-slot { display: none; }
.info-panel.is-route-map-expanded { top: 0; left: 0; width: 100%; height: 100%; transform: none; border: 0; border-radius: 0; background: #d7d7d7; }
.info-panel.is-route-map-expanded .info-panel-body { padding: 0; }
.info-panel.is-route-map-expanded .service-detail-layout { display: block; height: 100%; }
.info-panel.is-route-map-expanded .service-route-map-wrap { width: 100%; height: 100%; border: 0; border-radius: 0; }
.info-panel.is-route-map-expanded .service-route-map { border: 0; border-radius: 0; }
.info-panel.is-route-map-expanded .service-status-mobile-slot,
.info-panel.is-route-map-expanded .service-summary-wrap,
.info-panel.is-route-map-expanded .trace-button-group,
.info-panel.is-route-map-expanded .map-panel-controls { display: none; }
.service-route-map-wrap.is-route-map-expanded { grid-template-rows: minmax(0, 1fr); gap: 0; overflow: hidden; background: #d7d7d7; }
.service-route-map-wrap.is-route-map-expanded .service-route-expand-hint { display: none; }
.service-route-map-wrap.is-route-map-expanded .service-route-expanded-summary,
.service-route-map-wrap:fullscreen .service-route-expanded-summary { display: flex; }
.service-route-map-wrap.is-route-map-expanded .service-route-label-toggle,
.service-route-map-wrap:fullscreen .service-route-label-toggle {
  top: calc(env(safe-area-inset-top, 0px) + 68px);
}
.service-route-map-wrap.is-route-map-expanded button.service-route-fullscreen-button { display: grid; }
.service-route-map-wrap:fullscreen { width: 100vw; height: 100vh; border: 0; border-radius: 0; }
.service-route-map-wrap:fullscreen .service-route-map { border: 0; border-radius: 0; }
.service-route-error {
  position: absolute;
  inset: auto 12px 12px;
  z-index: 2;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 229, 229, .94);
  color: #900;
}
.service-summary-wrap { min-width: 0; overflow: auto; padding: 0 8px 12px 0; }
.welcome-dialog {
  width: min(460px, calc(100% - 32px));
  padding: 0;
  border: 1px solid #454b50;
  border-radius: 22px;
  background: #f5f6f7;
  color: #222;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .38);
}
.welcome-dialog::backdrop { background: rgba(45, 49, 52, .68); }
.welcome-dialog-content { padding: 34px; text-align: center; }
.welcome-dialog h1 { margin: 0; font-size: clamp(28px, 6vw, 42px); }
.welcome-dialog p { margin: 20px 0 28px; font-size: 16px; }
.welcome-dialog button { min-width: 120px; min-height: 48px; border: 1px solid #444; border-radius: 999px; background: #5f666b; color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; }
.visitor-analytics-dialog-content { max-width: 620px; text-align: left; }
.visitor-analytics-dialog-content p { margin: 18px 0 0; line-height: 1.5; }
.visitor-analytics-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin-top: 28px; }
.visitor-analytics-actions .secondary-button { background: #fff; color: #333; }

.attribution-copy {
  font-size: 17px;
  line-height: 1.55;
}

.attribution-copy a {
  color: #164f9c;
  text-underline-offset: 3px;
}

.attribution-dialog {
  max-height: calc(100% - 32px);
}

.attribution-dialog .welcome-dialog-content {
  overflow: auto;
}

.attribution-dialog h2 {
  margin: 22px 0 6px;
  font-size: 18px;
}

.attribution-dialog h2 + p {
  margin-top: 0;
}

.map-service-summary-title {
  grid-column: 1 / -1;
  margin: 0 0 6px;
  font-size: clamp(22px, 3vw, 40px);
  font-weight: 700;
  letter-spacing: 0;
  color: #111;
}

.map-service-summary-headline {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  font-size: clamp(18px, 2.1vw, 28px);
  font-weight: 700;
  color: #111;
}

.map-service-summary-headline-context {
  grid-column: 1 / -1;
  margin: 0 0 14px;
  font-size: clamp(17px, 1.7vw, 23px);
  font-weight: 700;
  color: #4b4b4b;
}

.map-service-summary-headline:not(:has(+ .map-service-summary-headline-context)) {
  margin-bottom: 14px;
}

.map-service-summary-spacer {
  grid-column: 1 / -1;
  height: 10px;
}

.map-service-formation-block {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  column-gap: 28px;
  row-gap: 0;
}

.map-service-formation-relationship {
  grid-column: 2;
  margin: 0;
  color: #4b4b4b;
  font-size: clamp(13px, 1.12vw, 16px);
  line-height: 1.25;
}

.map-service-consist-legs {
  display: grid;
  gap: 0.45rem;
}

.map-service-consist-leg {
  display: grid;
  gap: 0.08rem;
}

.map-service-consist-leg-route {
  color: #5f6b76;
  font-size: 0.78em;
  line-height: 1.2;
}

.map-service-consist-leg-value {
  line-height: 1.25;
}

.map-service-summary-key {
  font-size: clamp(15px, 1.25vw, 18px);
  font-weight: 700;
  color: #2d2d2d;
}

.formation-show-link {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1558d6;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.formation-show-link:focus-visible { outline: 2px solid #1558d6; outline-offset: 2px; }

.map-service-summary-value {
  min-width: 0;
  word-break: break-word;
  font-size: clamp(15px, 1.35vw, 19px);
  color: #111;
}

.map-service-summary-value a {
  color: #1558d6;
  text-decoration: none;
  font-weight: 700;
}

.timing-variation {
  display: inline-block;
  margin-left: 0.28em;
  font-weight: 800;
  white-space: nowrap;
}

.timing-variation--late { color: #b42318; }
.timing-variation--early { color: #18753c; }

.map-service-summary-empty,
.map-service-summary-loading,
.map-service-summary-error {
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 0 0;
  font-size: 20px;
  color: #222;
}

.map-service-summary-error h2 {
  margin: 0 0 14px;
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.08;
}

.map-service-summary-error p {
  max-width: 620px;
  margin: 0 0 12px;
  font-size: 17px;
  line-height: 1.5;
}

.map-service-error-reference {
  display: inline-block;
  margin-top: 2px;
  padding: 9px 12px;
  border: 1px solid rgba(44, 44, 44, .28);
  border-radius: 7px;
  background: rgba(255, 255, 255, .55);
  font: 700 15px/1.2 Consolas, "Courier New", monospace;
  letter-spacing: .04em;
}

.map-service-terminated {
  max-width: 680px;
  margin: clamp(20px, 8vh, 80px) auto 0;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid rgba(44, 44, 44, .22);
  border-left: 6px solid #6b7379;
  border-radius: 16px;
  background: #fff;
  color: #222;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .12);
}

.map-service-terminated h2 {
  margin: 0 0 22px;
  font-size: clamp(23px, 3vw, 32px);
  line-height: 1.2;
}

.map-service-terminated p {
  margin: 0 0 18px;
  font-size: clamp(17px, 1.8vw, 20px);
  line-height: 1.55;
}

.map-service-terminated p:last-child { margin-bottom: 0; }

.map-archived-service-summary {
  display: grid;
  gap: 9px;
  margin-top: 4px;
  padding: 16px 18px;
  border-radius: 10px;
  background: #f2f4f5;
  font-size: clamp(17px, 1.8vw, 20px);
  line-height: 1.4;
}

.map-archived-service-summary > div:first-child {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.map-archived-service-summary > div:first-child span { color: #5f686e; }
.map-archived-service-summary strong { font-size: 1.08em; }
.map-archived-service-timing { white-space: nowrap; }
.map-archived-service-auto-termination {
  margin-top: 3px;
  padding-top: 10px;
  border-top: 1px solid rgba(44, 44, 44, .16);
  font-weight: 650;
}
.map-archived-service-unavailable { color: #5f686e; font-size: 17px; }

@media (min-width: 701px) {
  .map-action-stack {
    width: 60vw;
    padding: 9px 0;
    border: 3px solid rgba(44, 48, 51, .72);
    border-radius: 24px;
    background: rgba(220, 224, 225, .42);
    box-shadow: 0 9px 30px rgba(25, 29, 32, .24);
    backdrop-filter: blur(18px) grayscale(.55) saturate(.45);
    -webkit-backdrop-filter: blur(18px) grayscale(.55) saturate(.45);
  }

  .map-navigation-pill { width: min(390px, calc(100% - 24px)); }
  .map-context-action-pill { width: min(370px, calc(100% - 44px)); }
  .map-trace-action-pill { width: min(350px, calc(100% - 64px)); }

  .overlay {
    display: grid;
    padding: 0 0 calc(160px + env(safe-area-inset-bottom, 0px));
    place-items: center;
  }

  .app-popup-layer { --action-stack-reserve: 112px; }
  .app-popup-layer.has-secondary-actions { --action-stack-reserve: 160px; }
  .app-popup-layer.has-tertiary-actions { --action-stack-reserve: 198px; }

  .app-popup--trace {
    width: 80%;
    height: 90%;
    border: 1px solid rgba(44, 44, 44, .5);
    border-radius: 20px;
  }

  .app-popup--replayer.app-popup--journey-replayer {
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    border: 1px solid rgba(44, 44, 44, .5);
    border-radius: 20px;
  }
}

@media (max-width: 700px) {
  .map-action-stack {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
    width: calc(100% - 18px);
    gap: 5px;
  }

  .map-navigation-pill {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 5px;
    gap: 5px;
    border-radius: 16px;
  }

  .map-context-action-pill { width: calc(100% - 18px); }
  .map-trace-action-pill { width: calc(100% - 36px); }

  .map-navigation-action { min-height: 33px; font-size: 10px; }
  .app-popup-layer { padding: max(8px, env(safe-area-inset-top, 0px)) 8px calc(var(--action-stack-reserve) + env(safe-area-inset-bottom, 0px)); }
  .app-popup-layer.is-detail-popup { padding: 0 0 calc(var(--action-stack-reserve) + env(safe-area-inset-bottom, 0px)); }
  .app-popup-layer.is-schedule-popup { padding: max(8px, env(safe-area-inset-top, 0px)) 8px calc(var(--action-stack-reserve) + env(safe-area-inset-bottom, 0px)); }
  .app-popup-head {
    min-height: calc(60px + env(safe-area-inset-top, 0px));
    padding: calc(7px + env(safe-area-inset-top, 0px)) 9px 7px 15px;
  }
  .app-popup-close { width: 44px; height: 44px; flex-basis: 44px; }
  .app-popup-back, .back-pill { min-width: 68px; min-height: 40px; padding: 7px 13px; font-size: 14px; }
  .app-popup--trace, .app-popup--schedule { height: 100%; }

  .map-corner-actions {
    top: calc(env(safe-area-inset-top, 0px) + 20px);
    right: calc(env(safe-area-inset-right, 0px) + 20px);
    gap: 12px;
  }

  .map-corner-button {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .ideas-button {
    font-size: 40px;
    line-height: 48px;
  }

  .info-panel.is-route-map-expanded {
    bottom: calc(82px + env(safe-area-inset-bottom, 0px));
    height: auto;
  }

  .info-panel-body {
    overflow-x: hidden;
    padding: calc(70px + env(safe-area-inset-top, 0px)) 12px 12px;
  }

  .map-panel-controls {
    top: calc(14px + env(safe-area-inset-top, 0px));
    right: 14px;
    left: 14px;
  }

  .map-panel-controls .back-pill { margin-left: auto; }
  .map-panel-controls .refresh-service-button { margin-left: auto; }
  .map-panel-controls .refresh-service-button + .back-pill { margin-left: 0; }
  .service-status-mobile-slot { display: flex; justify-content: center; min-height: 33px; overflow: hidden; }
  .service-status-mobile-slot:empty { display: none; }
  .service-status-mobile-slot,
  .service-status-mobile-slot .map-status-pill,
  .service-status-mobile-slot .map-status-copy {
    min-width: 0;
    max-width: 100%;
  }
  .service-status-mobile-slot .map-status-pill {
    position: static;
    width: 100%;
    transform: none;
    white-space: normal;
  }
  .service-status-mobile-slot .map-status-copy { flex: 1 1 auto; }
  .service-status-mobile-slot .map-status-headline,
  .service-status-mobile-slot .map-status-detail {
    overflow-wrap: anywhere;
    line-height: 1.2;
  }

  .trace-button-group { top: 14px; left: 14px; gap: 5px; max-width: calc(100% - 190px); }
  .trace-button { padding: 0 8px; font-size: 8px; }

  body.demo-mode .info-panel-body {
    overflow-x: hidden;
  }

  body.demo-mode .map-panel-controls {
    left: auto;
  }

  body.demo-mode .trace-button-group {
    top: 66px;
    right: 14px;
    width: auto;
    max-width: none;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.demo-mode .trace-button {
    min-width: 0;
    padding: 4px;
    line-height: 1.15;
    overflow-wrap: anywhere;
    text-align: center;
  }

  body.demo-mode .service-detail-layout,
  body.demo-mode .service-route-map-wrap,
  body.demo-mode .service-summary-wrap,
  body.demo-mode .map-service-summary,
  body.demo-mode .map-service-formation-block {
    min-width: 0;
    max-width: 100%;
  }

  body.demo-mode .service-summary-wrap {
    overflow: hidden;
  }

  body.demo-mode .map-service-summary-title,
  body.demo-mode .map-service-summary-headline,
  body.demo-mode .map-service-summary-headline-context,
  body.demo-mode .map-service-summary-key,
  body.demo-mode .map-service-summary-value {
    overflow-wrap: anywhere;
  }

  body.demo-mode .service-status-mobile-slot .map-status-pill {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
  }

  .service-detail-layout,
  .service-route-map-wrap,
  .service-summary-wrap,
  .map-service-summary,
  .map-service-formation-block {
    min-width: 0;
    max-width: 100%;
  }
  .service-detail-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(230px, 38vh) auto auto; gap: 14px; height: auto; }
  .service-route-map-wrap { min-height: 230px; grid-template-rows: minmax(0, 1fr); gap: 0; }
  .service-route-expand-hint {
    position: absolute;
    top: 14px;
    left: 50%;
    z-index: 2;
    max-width: calc(100% - 116px);
    overflow: hidden;
    text-overflow: ellipsis;
    transform: translateX(-50%);
  }
  .service-summary-wrap { overflow: visible; padding: 0 4px 16px; }

  .map-service-summary {
    grid-template-columns: minmax(105px, 42%) minmax(0, 1fr);
    gap: 8px 16px;
    max-width: none;
    padding-top: 14px;
  }

  .map-service-formation-block {
    grid-template-columns: minmax(105px, 42%) minmax(0, 1fr);
    column-gap: 16px;
  }

  .map-service-summary-key {
    margin-top: 0;
  }

  .map-service-summary-spacer {
    height: 8px;
  }

  .map-service-summary-title,
  .map-service-summary-headline,
  .map-service-summary-headline-context,
  .map-service-summary-key,
  .map-service-summary-value {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}

@media (min-width: 701px) and (orientation: portrait) {
  .service-detail-layout { grid-template-columns: 1fr; grid-template-rows: minmax(300px, 42%) auto; }
  .service-summary-wrap { overflow: visible; }
}

@media (prefers-reduced-motion: reduce) {
  .refresh-service-button.is-refreshing span { animation: none; }
  .device-location-marker__pulse { animation: none; opacity: .3; }
}

.motion-debug-label {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  pointer-events: none;
  white-space: pre;
  padding: 5px 8px;
  border: 1px solid #64748b;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.94);
  color: #18212d;
  font: 12px/1.45 ui-monospace, Consolas, monospace;
  box-shadow: 0 1px 4px #0003;
}

.line-speed-indicator {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 16;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  box-sizing: border-box;
  border: 4px solid #d71920;
  border-radius: 50%;
  background: rgba(255, 255, 255, .97);
  color: #111;
  font: 800 22px/1 Arial, Helvetica, sans-serif;
  letter-spacing: -.04em;
  pointer-events: none;
  box-shadow: 0 1px 5px #0004;
}

.line-speed-indicator[hidden] { display: none; }

.motion-zoom-readout {
  padding: 5px 8px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .95);
  color: #18212d;
  font: 12px/1.4 ui-monospace, Consolas, monospace;
  box-shadow: 0 1px 4px #0003;
}
html.grm-native-presentation #mapActionStack,
html.grm-native-presentation #infoOverlay,
html.grm-native-presentation #appPopupLayer,
html.grm-native-presentation #visitorAnalyticsDialog {
  display: none !important;
}

/* Live Status Trace uses the available map area on phones and desktops. */
.app-popup-layer.is-detail-popup:has(#mapLiveStatusTracePopup:not([hidden])) { padding: 12px; }
#mapLiveStatusTracePopup, #serviceSummaryPopup { width: 100%; height: 100%; }
#mapLiveStatusTracePopup .app-popup-head,
#serviceSummaryPopup .app-popup-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 10px; }
#mapLiveStatusTracePopup .app-popup-heading,
#serviceSummaryPopup .app-popup-heading { display: contents; }
#mapLiveStatusTracePopupSummary,
.service-summary-heading { display: block; grid-column: 1 / -1; grid-row: 2; margin: 0; font-size: 13px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.status-trace-follow { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; font-size: 12px; white-space: nowrap; }
.status-trace-follow input { margin: 0; width: 16px; height: 16px; }
#mapLiveStatusTracePopup .app-popup-back { min-width: 60px; grid-column: 3; grid-row: 1; }
@media (min-width: 701px) {
  #app:has(#mapReplayerPopup.app-popup--journey-replayer:not([hidden])) .map-action-stack,
  #app:has(#mapLiveStatusTracePopup:not([hidden])) .map-action-stack {
    width: min(418px, calc(100% - 24px));
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
@media (max-width: 700px) {
  .app-popup-layer.is-detail-popup:has(#mapLiveStatusTracePopup:not([hidden])) { padding: 0; }
  #mapLiveStatusTracePopupTitle, .info-panel-head h1 { font-size: clamp(16px, 4.6vw, 18px); }
}

/* Selected service: map first, with a compact header and tabulated detail. */
.overlay { padding: 12px; }
#serviceSummaryPopup .info-panel-head h1 { white-space: normal; overflow-wrap: anywhere; }
#serviceSummaryPopup .map-panel-controls { position: static; grid-column: 2 / 4; grid-row: 1; gap: 6px; align-self: start; }
.service-summary-heading[hidden] { display: none; }
.summary-service-identity { color: inherit; font-weight: inherit; }
.summary-service-identity a { color: #1558d6; }
.summary-service-route > span { display: inline-block; max-width: 100%; overflow-wrap: anywhere; }
.service-summary-status-slot { position: absolute; z-index: 3; top: var(--summary-header-bottom, 160px); right: 54px; max-width: calc(100% - 150px); }
.service-summary-status-slot .map-status-pill { min-height: 34px; padding: 5px 9px; border-radius: 5px; letter-spacing: normal; font-size: 12px; }
.map-panel-controls .refresh-service-button { width: 42px; height: 42px; flex-basis: 42px; }
.map-panel-controls .back-pill { min-width: 60px; min-height: 42px; padding: 8px 16px; }
.info-panel-body { flex: 1 1 auto; min-height: 0; height: auto; padding: 0; overflow: hidden; }
.service-detail-layout { display: block; height: 100%; }
.service-route-map-wrap { position: absolute; inset: 0; display: block; min-height: 0; }
.service-route-map { position: absolute; inset: 0; border: 0; border-radius: 0; }
.service-route-expand-hint { display: none; }
.service-route-label-toggle { top: 10px; }
.service-summary-wrap, body.demo-mode .service-summary-wrap { position: absolute; z-index: 1; right: 10px; bottom: calc(120px + env(safe-area-inset-bottom, 0px)); width: min(560px, calc(100% - 20px)); max-height: calc(100% - 142px); padding: 0; overflow: auto; border: 1px solid rgba(35,42,47,.72); border-radius: 9px; background: rgba(255,255,255,.94); color: #182027; box-shadow: 0 3px 13px rgba(0,0,0,.26); font-size: 11px; }
.map-service-summary { --summary-label-width: 100px; display: grid; grid-template-columns: var(--summary-label-width) minmax(0, 1fr); gap: 0; padding: 0; max-width: none; }
.map-service-summary-key, .map-service-summary-value { padding: 3px; border-bottom: 1px solid #c5cbd0; font-size: inherit; line-height: 1.35; }
.map-service-summary-key { border-right: 1px solid #c5cbd0; background: rgba(225,229,232,.97); font-weight: 700; }
.map-service-summary-value { overflow-wrap: anywhere; }
.map-service-formation-block { display: grid; grid-template-columns: var(--summary-label-width) minmax(0, 1fr); gap: 0; min-width: 0; border-bottom: 1px solid #c5cbd0; }
.map-service-formation-block h2 { margin: 0; padding: 3px; border-right: 1px solid #c5cbd0; font-weight: 700; line-height: 1.35; font-size: inherit; background: rgba(225,229,232,.97); }
.map-service-formation-relationship { padding: 3px; font-size: inherit; }
.map-service-formation-relationship[hidden] { display: none; }
.summary-formation-details { min-width: 0; overflow-wrap: anywhere; }
.summary-formation-table { table-layout: fixed; width: 100%; border-collapse: collapse; font-size: inherit; }
.summary-formation-table th, .summary-formation-table td { padding: 3px; border-bottom: 1px solid #c5cbd0; text-align: left; vertical-align: top; }
.summary-formation-table th { width: 60%; border-right: 1px solid #c5cbd0; font-weight: 500; }
.summary-formation-table tr:nth-child(even) { background: #f5f7f8; }
.summary-formation-table tr:last-child > * { border-bottom: 0; }
.summary-formation-table a { color: #1558d6; font-weight: 700; }
.map-service-consist-leg-route { font: inherit; text-align: left; }
#app:has(#infoOverlay:not(.is-hidden)) .map-action-stack { width: min(418px, calc(100% - 18px)); padding: 0; border: 0; background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
@media (max-width: 700px) {
  .overlay { padding: 0; }
  .map-panel-controls .back-pill { min-height: 40px; padding: 7px 13px; font-size: 14px; }
  .map-panel-controls .refresh-service-button { width: 40px; height: 40px; flex-basis: 40px; }
  .service-summary-status-slot { right: 48px; max-width: calc(100% - 140px); }
  .service-summary-status-slot .map-status-pill { min-width: 0; max-width: 100%; min-height: 30px; font-size: 12px; }
  .service-summary-status-slot .map-status-copy { min-width: 0; }
  .service-summary-status-slot .map-status-headline { overflow-wrap: anywhere; }
  .service-summary-wrap, body.demo-mode .service-summary-wrap { left: 5px; right: 5px; bottom: calc(112px + env(safe-area-inset-bottom, 0px)); width: auto; max-height: min(34dvh, calc(100% - 200px)); border-radius: 9px; overflow: auto; font-size: clamp(9px, 1.15vw, 13px); }
  .map-service-summary { --summary-label-width: 96px; }
  .map-service-summary-key, .map-service-summary-value { padding: 3px 2px; font-size: inherit; }
  .map-service-formation-block h2 { padding: 3px 2px; }
  .summary-formation-table th, .summary-formation-table td { padding: 3px 2px; font-size: inherit; }
}

.info-panel.is-route-map-expanded .info-panel-head,
.info-panel.is-route-map-expanded .service-summary-status-slot { display: none; }

.info-panel-body > :not(.service-detail-layout) { position: relative; margin-top: 10px; max-height: calc(100% - 130px); overflow: auto; }

.service-route-map .maplibregl-ctrl-top-right { top: 10px; }
.service-route-map .line-speed-indicator { top: 50px; bottom: auto; }
.service-route-map-wrap.is-route-map-expanded .maplibregl-ctrl-top-right,
.service-route-map-wrap:fullscreen .maplibregl-ctrl-top-right { top: 60px; }
.service-route-map-wrap.is-route-map-expanded .line-speed-indicator,
.service-route-map-wrap:fullscreen .line-speed-indicator { top: auto; bottom: 12px; }

.summary-service-route { font-weight: 600; overflow-wrap: anywhere; }
.summary-service-origin { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2px 12px; color: #4d5960; }
.service-route-map .motion-zoom-readout { display: none; }
