:root {
  color-scheme: light;
  --bg: #f7f7f4;
  --panel: #ffffff;
  --ink: #151817;
  --muted: #66706b;
  --line: #dde2df;
  --accent: #0f766e;
  --accent-dark: #0a514c;
  --danger: #a7364b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body.is-pulling-refresh {
  overscroll-behavior-y: contain;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.app {
  width: min(960px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 36px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  gap: 12px;
  padding: 14px 0;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
  min-width: 0;
  color: inherit;
}

.brand-home {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 0;
}

.brand-home:hover + .brand-copy h1,
.brand-home:focus + .brand-copy h1 {
  color: var(--accent-dark);
}

.brand-copy {
  min-width: 0;
}

.status-row {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}

.refresh-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 4px 0 0;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

.refresh-button:hover,
.refresh-button:focus {
  color: var(--accent-dark);
  text-decoration-color: currentColor;
}

.refresh-button:disabled {
  color: var(--muted);
  cursor: wait;
}

.refresh-button #loadStatus {
  color: inherit;
  line-height: 1.4;
}

.refresh-button svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--accent-dark);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.refresh-button.is-refreshing svg,
.pull-refresh-indicator.is-refreshing svg {
  animation: refreshSpin 800ms linear infinite;
}

.pull-refresh-indicator {
  position: fixed;
  top: 10px;
  left: 50%;
  z-index: 5;
  display: none;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark);
  padding: 0 12px;
  box-shadow: 0 8px 24px rgba(21, 24, 23, 0.08);
  font-size: 12px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -54px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.pull-refresh-indicator.is-visible {
  opacity: 1;
  transform: translate(-50%, var(--pull-offset, 0px));
}

.pull-refresh-indicator.is-armed,
.pull-refresh-indicator.is-complete {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
  background: #eef8f5;
}

.pull-refresh-indicator svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

@keyframes refreshSpin {
  to {
    transform: rotate(360deg);
  }
}

.header-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 4px;
}

.header-link {
  width: fit-content;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  padding: 0;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.header-link:hover,
.header-link:focus {
  color: var(--accent);
}

.logo {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--accent);
  overflow: hidden;
}

.logo svg,
.logo img {
  display: block;
  width: 100%;
  height: 100%;
}

.logo-bus {
  transform-box: fill-box;
  transform-origin: center;
  transform: translate(74px, 262px);
}

.logo.is-spinning .logo-bus {
  animation: logoBusDrive 920ms cubic-bezier(0.26, 0.92, 0.32, 1) both;
}

@keyframes logoBusDrive {
  0% {
    transform: translate(74px, 262px) rotate(0deg) scale(1);
  }

  26% {
    transform: translate(120px, 152px) rotate(-48deg) scale(0.92);
  }

  50% {
    transform: translate(78px, 66px) rotate(180deg) scale(0.9);
  }

  74% {
    transform: translate(12px, 154px) rotate(135deg) scale(0.92);
  }

  100% {
    transform: translate(74px, 262px) rotate(360deg) scale(1);
  }
}

h1 {
  font-size: 21px;
  line-height: 1.15;
}

p,
small {
  color: var(--muted);
  line-height: 1.4;
}

.controls {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}

.search {
  display: grid;
  flex: 1 1 260px;
  gap: 5px;
}

.search span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 11px;
}

.search input {
  width: 100%;
}

input:focus,
button:focus {
  outline: 3px solid rgba(15, 118, 110, 0.2);
  outline-offset: 1px;
}

.small-button {
  min-height: 40px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 0 13px;
  font-weight: 800;
}

.small-button.ghost {
  border-color: var(--line);
  background: #fff;
  color: var(--accent-dark);
}

.small-button:disabled {
  border-color: var(--line);
  background: #edf0ed;
  color: var(--muted);
  cursor: wait;
}

.gps-button {
  display: grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent-dark);
  padding: 0;
}

.gps-button:hover,
.gps-button:focus {
  border-color: var(--accent);
  background: #f6faf8;
}

.gps-button:disabled {
  border-color: var(--line);
  background: #edf0ed;
  color: var(--muted);
  cursor: wait;
}

.gps-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gps-button.is-loading svg {
  animation: gpsPulse 900ms ease-in-out infinite alternate;
}

.install-prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 8px;
  background: #eef8f5;
  padding: 10px;
}

.install-prompt div {
  flex: 1 1 auto;
  min-width: 0;
}

.install-prompt strong {
  display: block;
  color: var(--accent-dark);
  font-size: 13px;
  line-height: 1.2;
}

.install-prompt p {
  font-size: 12px;
}

.install-prompt .small-button {
  min-height: 34px;
  padding: 0 12px;
}

.dismiss-button {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.dismiss-button:hover,
.dismiss-button:focus {
  color: var(--accent-dark);
  border-color: var(--accent);
}

.stops-section {
  padding-top: 14px;
}

.stop-list {
  display: grid;
  gap: 10px;
}

.stop-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.stop-card {
  cursor: pointer;
  overflow: hidden;
}

.stop-card:hover {
  border-color: var(--accent);
}

.stop-card.is-open {
  box-shadow: inset 4px 0 0 var(--accent);
}

.location-card {
  box-shadow: inset 4px 0 0 #7c9089;
}

.stop-top {
  display: flex;
  align-items: start;
  gap: 8px;
  padding: 16px 16px 6px;
}

.stop-button {
  display: grid;
  gap: 9px 12px;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
}

.stop-button:hover {
  color: var(--accent-dark);
}

.stop-button strong {
  display: block;
  margin-bottom: 3px;
  font-size: 17px;
}

.stop-title-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.location-type {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.service-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 16px 14px;
}

.service-chip {
  border: 0;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  min-height: 28px;
  border-radius: 8px;
  padding: 0 8px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.service-chip:hover,
.service-chip:focus {
  filter: brightness(0.94) saturate(1.08);
}

.service-chip.is-passive {
  cursor: default;
  opacity: 0.68;
}

.service-chip.is-passive:hover,
.service-chip.is-passive:focus {
  filter: none;
}

.no-services {
  color: var(--muted);
  font-size: 13px;
}

.distance {
  margin-left: auto;
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.pin-button {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
}

.pin-button:hover,
.pin-button[aria-pressed="true"] {
  border-color: #d83b68;
  color: #d83b68;
}

.pin-button[aria-pressed="true"] {
  background: #fff1f5;
}

.inline-arrivals {
  display: grid;
  gap: 9px;
  padding: 10px 14px 14px;
}

.service-card {
  display: grid;
  grid-template-columns: auto minmax(96px, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  padding: 14px;
  text-align: left;
}

.service-card:hover {
  border-color: var(--accent);
  background: #f6faf8;
}

.service-card.is-passive {
  cursor: default;
}

.service-card.is-passive:hover {
  border-color: var(--line);
  background: #fbfcfb;
}

.service-header {
  display: contents;
}

.service-destination {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-badge {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 36px;
  border-radius: 8px;
  padding: 0 8px;
  font-size: 16px;
  font-weight: 900;
}

.arrival-grid {
  display: grid;
  grid-template-columns: repeat(3, 82px);
  justify-content: end;
  gap: 8px;
}

.arrival {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.arrival small {
  display: none;
  color: var(--muted);
  font-size: 12px;
}

.arrival strong {
  font-size: 24px;
  line-height: 1.05;
}

.arrival-time,
.route-stop-eta {
  display: grid;
  grid-auto-flow: column;
  align-content: center;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  width: 100%;
  min-width: 72px;
  height: 40px;
  border-radius: 12px;
  padding: 0 8px;
  font-weight: 500;
  line-height: 1;
  overflow: hidden;
  white-space: nowrap;
}

.arrival-time .eta-number,
.route-stop-eta .eta-number {
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.arrival-time .eta-unit,
.route-stop-eta .eta-unit {
  margin-left: 1px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  opacity: 0.78;
}

.arrival-time.is-text,
.route-stop-eta.is-text {
  font-size: 15px;
  font-weight: 800;
}

.arrival-time.is-arriving,
.route-stop-eta.is-arriving {
  font-size: 22px;
}

.arrival-time.load-low {
  background: #eaf7ef;
  color: #157347;
}

.arrival-time.load-medium {
  background: #fff4d6;
  color: #9a5a00;
}

.arrival-time.load-high {
  background: #ffe7eb;
  color: #b42342;
}

.arrival-time.load-unknown {
  background: #eef3ef;
  color: var(--ink);
}

.arrivals-just-refreshed .arrival-time,
.arrivals-just-refreshed .route-stop-eta {
  animation: etaChipRefresh 560ms ease-out;
}

.arrivals-just-refreshed .arrival-time .eta-number,
.arrivals-just-refreshed .route-stop-eta .eta-number,
.arrivals-just-refreshed .arrival-time.is-text,
.arrivals-just-refreshed .route-stop-eta.is-text {
  animation: etaNumberRefresh 520ms ease-out;
}

@keyframes etaChipRefresh {
  0% {
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0);
    filter: brightness(1);
  }

  42% {
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.16), 0 4px 12px rgba(15, 118, 110, 0.08);
    filter: brightness(1.025);
  }

  100% {
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0);
    filter: brightness(1);
  }
}

@keyframes etaNumberRefresh {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0.9;
  }

  38% {
    transform: translateY(-2px) scale(1.035);
    opacity: 1;
  }

  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .arrivals-just-refreshed .arrival-time,
  .arrivals-just-refreshed .route-stop-eta,
  .arrivals-just-refreshed .arrival-time .eta-number,
  .arrivals-just-refreshed .route-stop-eta .eta-number,
  .arrivals-just-refreshed .arrival-time.is-text,
  .arrivals-just-refreshed .route-stop-eta.is-text {
    animation: none;
  }
}

.empty-state {
  padding: 18px;
  color: var(--muted);
}

.empty-state.compact {
  padding: 12px;
}

.error {
  border-color: rgba(167, 54, 75, 0.35);
  color: var(--danger);
}

[hidden] {
  display: none !important;
}

.route-view {
  display: grid;
  gap: 14px;
  padding: 14px 0 36px;
}

.route-view-header,
.route-stops-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.route-view-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.route-view-header h2 {
  font-size: 22px;
  line-height: 1.15;
}

.route-body {
  display: grid;
  gap: 12px;
}

.route-stops-card {
  padding: 16px;
}

.directions-view {
  display: grid;
  gap: 12px;
  padding: 14px 0 36px;
}

.directions-header,
.directions-form,
.directions-suggestions,
.directions-plan-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.directions-header {
  padding: 16px;
}

.directions-header h2 {
  font-size: 22px;
  line-height: 1.15;
}

.directions-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr) 42px;
  align-items: end;
  gap: 8px;
  padding: 14px;
}

.direction-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.direction-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.swap-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.directions-gps-button {
  display: grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent-dark);
  padding: 0;
}

.directions-gps-button:hover,
.directions-gps-button:focus {
  border-color: var(--accent);
  background: #f6faf8;
}

.directions-gps-button:disabled {
  border-color: var(--line);
  background: #edf0ed;
  color: var(--muted);
  cursor: wait;
}

.directions-gps-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.directions-gps-button.is-loading svg {
  animation: gpsPulse 900ms ease-in-out infinite alternate;
}

.directions-submit-button {
  display: none;
}

@keyframes gpsPulse {
  from {
    transform: scale(0.92);
    opacity: 0.55;
  }

  to {
    transform: scale(1.04);
    opacity: 1;
  }
}

.directions-suggestions {
  display: grid;
  gap: 0;
  overflow: hidden;
}

.direction-suggestion {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 62px;
  border: 0;
  border-top: 1px solid var(--line);
  background: #fff;
  color: inherit;
  padding: 9px 12px;
  text-align: left;
}

.direction-suggestion:first-child {
  border-top: 0;
}

.direction-suggestion:hover,
.direction-suggestion:focus {
  background: #f6faf8;
}

.direction-suggestion-icon {
  display: grid;
  place-items: center;
  min-width: 38px;
  height: 34px;
  border-radius: 8px;
  background: #eef3ef;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 900;
}

.direction-suggestion strong,
.direction-suggestion small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directions-result {
  display: grid;
  gap: 12px;
}

.directions-stop-advisory {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #b7d1cb;
  border-radius: 8px;
  background: #f1faf7;
  color: var(--accent-dark);
  padding: 12px 14px;
  font-size: 13px;
}

.directions-stop-advisory strong {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.directions-stop-advisory span {
  min-width: 0;
  color: var(--ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.directions-plan-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.directions-plan-card.is-timing-unavailable {
  background: #fbfcfb;
  color: var(--muted);
}

.directions-plan-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.directions-mode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 58px;
  height: 36px;
  border-radius: 8px;
  background: #eef3ef;
  color: var(--accent-dark);
}

.directions-mode-icon {
  flex: 0 0 auto;
  display: block;
  width: 22px;
  height: 22px;
  fill: currentColor;
  overflow: visible;
}

.directions-mode.is-bus,
.directions-mode.is-mixed {
  background: color-mix(in srgb, var(--accent) 13%, #ffffff);
}

.directions-mode.is-mixed {
  gap: 7px;
}

.directions-mode-person {
  width: 22px;
  height: 22px;
}

.directions-mode-bus-icon {
  width: 22px;
  height: 22px;
}

.directions-plan-head > div {
  min-width: 0;
}

.directions-plan-head h3 {
  font-size: 22px;
  line-height: 1.05;
}

.directions-plan-card.is-timing-unavailable .directions-plan-head h3,
.directions-plan-card.is-timing-unavailable .directions-plan-head p {
  color: var(--muted);
}

.directions-plan-card.is-timing-unavailable .directions-mode,
.directions-plan-card.is-timing-unavailable .directions-leg-route {
  background: #f3f5f3 !important;
  color: var(--muted) !important;
}

.directions-plan-card.is-timing-unavailable .directions-arrival-chips .route-stop-eta {
  background: #f3f5f3;
  color: var(--muted);
}

.directions-plan-card.is-timing-unavailable .directions-walk-meta,
.directions-plan-card.is-timing-unavailable .directions-walk-note,
.directions-plan-card.is-timing-unavailable .directions-transfer-count {
  background: #f3f5f3;
  color: var(--muted);
}

.directions-plan-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}

.directions-plan-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.directions-walk-meta,
.directions-walk-note {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.directions-walk-meta {
  background: color-mix(in srgb, var(--accent) 11%, #ffffff);
  color: var(--accent-dark);
  font-weight: 600;
}

.directions-walk-note {
  background: #fff4d6;
  color: #8a4b00;
  font-weight: 600;
}

.directions-transfer-count {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #fff4d6;
  color: #8a4b00;
  padding: 2px 8px;
  font-size: 14px;
  font-weight: 900;
}

.directions-leg-list {
  --directions-badge-width: 58px;
  --directions-leg-gap: 10px;
  display: grid;
  gap: 10px;
}

.directions-leg {
  display: grid;
  grid-template-columns: var(--directions-badge-width) minmax(0, 1fr);
  gap: var(--directions-leg-gap);
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.directions-leg-route {
  align-self: start;
}

.directions-service-row .directions-leg-route {
  justify-self: start;
}

.directions-route-link {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.directions-leg-route-icon {
  width: var(--directions-badge-width);
  min-width: var(--directions-badge-width);
  min-height: 34px;
  background: #eef3ef;
  color: var(--accent-dark);
  font-size: 14px;
  padding: 0;
}

.directions-leg-route-icon .directions-leg-icon {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: transparent;
}

.directions-leg-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title title"
    "duration distance";
  gap: 8px 12px;
  min-width: 0;
}

.directions-walk-title {
  grid-area: title;
  min-width: 0;
  overflow-wrap: break-word;
}

.directions-walk-distance {
  grid-area: distance;
  align-self: baseline;
  justify-self: end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.directions-leg-body .directions-transfer-note {
  grid-area: duration;
  margin: 0;
}

.directions-arrival-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.directions-arrival-chips .route-stop-eta {
  width: 100%;
  min-width: 0;
  height: 44px;
}

.directions-service-options {
  display: grid;
  gap: 0;
  padding-top: 12px;
  border-top: 1px solid transparent;
}

.directions-bus-top {
  display: grid;
  grid-template-columns: var(--directions-badge-width) minmax(0, 1fr);
  gap: var(--directions-leg-gap);
  align-items: start;
}

.directions-bus-body {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.directions-bus-head {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.directions-bus-head strong {
  min-width: 0;
  overflow-wrap: break-word;
}

.directions-bus-head span {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.directions-service-option {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.directions-service-row {
  display: grid;
  grid-template-columns: var(--directions-badge-width) minmax(0, 1fr);
  gap: var(--directions-leg-gap);
  align-items: center;
}

.directions-service-content {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding-left: calc(var(--directions-badge-width) + var(--directions-leg-gap));
}

.directions-service-option + .directions-service-option {
  border-top: 1px solid transparent;
  padding-top: 10px;
}

.directions-bus-leg {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.directions-bus-shared {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding-left: calc(var(--directions-badge-width) + var(--directions-leg-gap));
}

.directions-stop-trail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.directions-stop-trail li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

.directions-stop-trail li::after {
  content: "→";
  color: var(--accent-dark);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.directions-stop-trail li:last-child::after {
  content: "";
}

.directions-stop-link {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  padding: 0;
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.directions-stop-trail li:first-child .directions-stop-link,
.directions-stop-trail li:last-child .directions-stop-link {
  color: var(--accent-dark);
}

.directions-stop-link:hover,
.directions-stop-link:focus {
  color: var(--accent);
}

.directions-transfer-note {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.directions-leg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: #eef3ef;
  color: var(--accent-dark);
  flex: 0 0 auto;
}

.directions-leg-icon-bus {
  background: color-mix(in srgb, var(--accent) 13%, #ffffff);
}

.directions-leg-icon-svg {
  width: 20px;
  height: 20px;
}

.app-footer {
  margin-top: 18px;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
}

.app-footer h2 {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
}

.app-footer p {
  max-width: 620px;
  font-size: 13px;
}

.app-footer a {
  color: var(--accent-dark);
  font-weight: 800;
}

.route-stops-header {
  margin-bottom: 10px;
}

.route-stops-header h3 {
  font-size: 18px;
}

.route-stop-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  position: relative;
  isolation: isolate;
}

.route-stop-list::before {
  content: "";
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 17px;
  width: 4px;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.3;
  z-index: 0;
}

.route-stop-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: stretch;
  gap: 8px;
  min-height: 88px;
  padding: 0;
  border-top: 1px solid var(--line);
  position: relative;
  z-index: 1;
}

.route-stop-item:first-child {
  border-top: 0;
}

.route-track {
  position: relative;
  z-index: 1;
  display: grid;
  align-items: center;
  min-height: 88px;
}

.stop-sequence {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #eef3ef;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 900;
  border: 4px solid #fff;
}

.route-stop-item.has-stopped-bus .stop-sequence {
  background: var(--bus-bg, var(--accent));
  color: var(--bus-fg, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bus-bg, var(--accent)) 22%, transparent);
}

.route-stop-content {
  display: grid;
  gap: 5px;
  justify-items: start;
  align-content: center;
  align-self: stretch;
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  padding: 4px 6px;
  text-align: left;
}

.route-stop-content:hover,
.route-stop-content:focus {
  background: #f6faf8;
  color: var(--accent-dark);
}

.route-stop-content strong,
.route-stop-content small {
  display: block;
}

.route-stop-content strong {
  font-weight: 500;
}

.route-stop-content .route-stop-eta {
  display: inline-grid;
  width: auto;
  min-width: 76px;
  height: 38px;
  padding: 0 12px;
}

.route-stop-eta.load-low {
  background: #eaf7ef;
  color: #157347;
}

.route-stop-eta.load-medium {
  background: #fff4d6;
  color: #9a5a00;
}

.route-stop-eta.load-high {
  background: #ffe7eb;
  color: #b42342;
}

.route-stop-eta.load-unknown {
  background: #eef3ef;
  color: var(--ink);
}

.route-stop-eta.is-muted {
  background: #f3f5f3;
  color: var(--muted);
  font-weight: 500;
}

.route-stop-eta.is-placeholder.is-text {
  font-size: 20px;
  font-weight: 700;
}

.route-bus-marker {
  position: absolute;
  left: var(--bus-left, 62px);
  top: var(--bus-top, -18px);
  display: grid;
  justify-items: center;
  width: 48px;
  color: var(--bus-bg, var(--accent-dark));
  cursor: help;
  z-index: 1;
}

.route-bus-marker::before,
.route-bus-marker::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.route-bus-marker::before {
  top: 17px;
  left: calc(18px - var(--bus-left, 62px));
  width: calc(var(--bus-left, 62px) - 18px + 5px);
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.45;
  z-index: 0;
}

.route-bus-marker::after {
  top: 12px;
  left: calc(18px - var(--bus-left, 62px) - 3px);
  width: 9px;
  height: 9px;
  border: 2px solid currentColor;
  border-radius: 999px;
  background: #fff;
  z-index: 1;
}

.route-bus-marker.is-moving {
  animation: bus-travel 1s ease-out both;
}

.route-bus-marker:focus {
  outline: 2px solid color-mix(in srgb, var(--bus-bg, var(--accent)) 45%, transparent);
  outline-offset: 3px;
}

.mini-bus {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  min-width: 46px;
  height: 25px;
  border-radius: 7px;
  background: var(--bus-bg, var(--accent-dark));
  color: var(--bus-fg, #fff);
  font-size: 8px;
  font-weight: 900;
  border: 2px solid #fff;
}

.mini-bus::before,
.mini-bus::after {
  content: "";
  position: absolute;
  bottom: -5px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
}

.mini-bus::before {
  left: 5px;
}

.mini-bus::after {
  right: 5px;
}

@keyframes bus-travel {
  from {
    top: var(--bus-start-top, -36px);
  }

  to {
    top: var(--bus-top, -18px);
  }
}

@media (max-width: 620px) {
  .pull-refresh-indicator {
    display: inline-flex;
  }

  .app {
    width: min(100% - 20px, 960px);
    padding-top: 10px;
  }

  .app-header {
    padding-top: 10px;
  }

  .small-button {
    flex: 1 1 120px;
  }

  .stop-button {
    flex: 1 1 auto;
  }

  .distance {
    justify-self: start;
  }

  .inline-arrivals {
    gap: 7px;
    padding: 8px 10px 10px;
  }

  .service-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 10px;
  }

  .service-header {
    display: flex;
    gap: 8px;
  }

  .service-header > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .route-badge {
    min-width: 38px;
    min-height: 32px;
    font-size: 14px;
  }

  .directions-form {
    grid-template-columns: minmax(0, 1fr) 48px;
    align-items: end;
    gap: 12px 10px;
  }

  .directions-form .direction-field {
    grid-column: 1;
  }

  .directions-form .direction-field:first-of-type {
    grid-row: 1;
  }

  .directions-form .direction-field:nth-of-type(2) {
    grid-row: 2;
  }

  .directions-gps-button {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: end;
    width: 48px;
    min-width: 48px;
    height: 40px;
    margin: 0;
  }

  .swap-button {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    align-self: end;
    width: 48px;
    height: 40px;
    margin: 0;
  }

  .directions-plan-head {
    align-items: flex-start;
  }

  .directions-plan-head h3 {
    font-size: 22px;
  }

  .directions-plan-head p {
    font-size: 13px;
  }

  .directions-stop-advisory {
    align-items: flex-start;
    display: grid;
    gap: 4px;
  }

  .directions-leg {
    --directions-badge-width: 48px;
    --directions-leg-gap: 10px;
    grid-template-columns: var(--directions-badge-width) minmax(0, 1fr);
  }

  .directions-bus-leg {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .directions-leg-route-icon {
    width: var(--directions-badge-width);
    min-width: var(--directions-badge-width);
  }

  .directions-bus-head {
    display: grid;
    gap: 3px;
  }

  .directions-leg-top {
    display: grid;
    gap: 3px;
  }

  .arrival-grid {
    display: grid;
    grid-template-columns: repeat(3, 68px);
    justify-content: end;
    gap: 6px;
    min-width: 0;
  }

  .arrival {
    display: block;
    min-height: 0;
    border: 0;
    background: transparent;
    padding: 0;
  }

  .arrival small {
    display: none;
  }

  .arrival strong {
    display: grid;
    grid-auto-flow: column;
    align-content: center;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
    width: 100%;
    min-width: 0;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 0 6px;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
  }

  .arrival strong .eta-number {
    font-size: 17px;
  }

  .arrival strong .eta-unit {
    font-size: 9px;
  }

  .arrival strong.is-arriving {
    font-size: 18px;
  }
}
