/* BusPulse simple arrivals board. Reuses the shared theme variables in styles.css. */
html[data-bp-view="arrivals"],
html[data-bp-view="arrivals"] body {
  overflow: auto;
  min-height: 100%;
}

#predictionsApp {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
}

html[data-bp-view="arrivals"] #app {
  /* Keep the Mapbox container measurable during initialisation. `display:none`
     leaves it at 0x0 and Mapbox can remain permanently unloaded after Map is
     opened later. */
  display: grid;
  position: fixed;
  inset: 0;
  z-index: 0;
  visibility: visible;
  opacity: 0;
  pointer-events: none;
}

html[data-bp-view="arrivals"] #mapLoadingScreen,
html[data-bp-view="arrivals"] #frontPage,
html[data-bp-view="map"] #predictionsApp {
  display: none !important;
}

html[data-bp-view="map"] #app {
  display: grid;
  position: relative;
  inset: auto;
  z-index: 0;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

#frontPage {
  display: none !important;
}

.bp-arrivals-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.bp-arrivals-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.bp-header-inner {
  width: min(100% - 28px, 1060px);
  min-height: 68px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.bp-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 750;
  color: var(--text);
}

.bp-brand-mark {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg-card);
}

.bp-brand-mark svg {
  width: 20px;
  height: 20px;
}

.bp-view-toggle,
.bp-search-tabs {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elev-2);
}

.bp-view-option,
.bp-search-tab {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.bp-view-option {
  min-width: 104px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
}

.bp-view-option svg {
  width: 16px;
  height: 16px;
}

.bp-view-option.is-active,
.bp-view-option[aria-pressed="true"],
.bp-search-tab.is-active,
.bp-search-tab[aria-selected="true"] {
  background: var(--bg-elev);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(20, 30, 60, 0.12);
}

.bp-icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  justify-self: end;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
}

.bp-icon-button:hover,
.bp-icon-button:focus-visible {
  border-color: var(--accent);
}

.bp-icon-button svg {
  width: 18px;
  height: 18px;
}

.bp-arrivals-main {
  width: min(100% - 28px, 760px);
  margin: 0 auto;
  flex: 1;
  padding: 30px 0 18px;
}

.bp-search-hero {
  position: relative;
}

.bp-search-tabs {
  margin-bottom: 18px;
}

.bp-search-tab {
  min-width: 92px;
  padding: 0 15px;
}

.bp-search-panel[hidden] {
  display: none;
}

.bp-search-title {
  display: block;
  max-width: 620px;
  margin: 0 0 15px;
  font-size: clamp(28px, 7vw, 48px);
  line-height: 1.05;
  font-weight: 760;
  color: var(--text);
}

.bp-stop-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.bp-route-search {
  max-width: 600px;
}

.bp-input-wrap {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
}

.bp-input-wrap > svg {
  position: absolute;
  z-index: 2;
  left: 17px;
  width: 21px;
  height: 21px;
  color: var(--text-dim);
  pointer-events: none;
}

.bp-input-wrap input {
  width: 100%;
  min-width: 0;
  height: 58px;
  padding: 0 57px 0 50px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
  font-size: 18px;
  box-shadow: 0 10px 28px rgba(20, 30, 60, 0.06);
}

.bp-input-wrap input::placeholder {
  color: var(--text-dim);
  opacity: 0.72;
}

.bp-input-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent), 0 10px 28px rgba(20, 30, 60, 0.07);
}

.bp-search-submit {
  position: absolute;
  z-index: 3;
  right: 7px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: var(--text);
  color: var(--bg-card);
  cursor: pointer;
}

.bp-search-submit:hover,
.bp-search-submit:focus-visible {
  background: var(--accent);
  color: #ffffff;
}

.bp-search-submit svg {
  width: 19px;
  height: 19px;
}

.bp-near-me {
  min-width: 124px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 17px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 680;
  cursor: pointer;
}

.bp-near-me:hover,
.bp-near-me:focus-visible {
  border-color: var(--accent);
}

.bp-near-me:disabled {
  cursor: wait;
  opacity: 0.62;
}

.bp-near-me svg {
  width: 18px;
  height: 18px;
}

.bp-typeahead {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 330px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elev);
  box-shadow: var(--shadow);
}

.bp-typeahead[hidden] {
  display: none;
}

.bp-typeahead-option {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.bp-typeahead-option:hover,
.bp-typeahead-option.is-highlighted {
  background: var(--bg-elev-2);
}

.bp-typeahead-option span {
  min-width: 0;
  display: grid;
  gap: 2px;
  font-size: 13px;
}

.bp-typeahead-option strong {
  font-size: 15px;
}

.bp-typeahead-option small {
  flex: none;
  color: var(--text-dim);
  font-size: 12px;
}

.bp-selected-stop {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding: 10px 10px 10px 15px;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--bg-elev-2) 72%, transparent);
}

.bp-selected-stop[hidden] {
  display: none;
}

.bp-selected-stop > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.bp-selected-stop strong {
  overflow-wrap: anywhere;
  font-size: 16px;
}

.bp-selected-stop small {
  color: var(--text-dim);
  font-size: 12px;
}

.bp-favourite-button {
  flex: none;
  background: transparent;
}

.bp-favourite-button.is-active {
  border-color: var(--early);
  color: var(--early);
}

.bp-saved-stops {
  display: grid;
  gap: 10px;
  margin: 22px 0 4px;
}

.bp-saved-stops[hidden],
.bp-stop-pills[hidden] {
  display: none;
}

.bp-stop-pills {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.bp-pill-label {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 650;
}

.bp-pill-list,
.bp-route-options {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 5px;
  scrollbar-width: thin;
}

.bp-stop-pill,
.bp-route-pill {
  min-height: 44px;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.bp-stop-pill:hover,
.bp-stop-pill:focus-visible,
.bp-route-pill:hover,
.bp-route-pill:focus-visible,
.bp-route-pill.is-active {
  border-color: var(--accent);
}

.bp-stop-pill span {
  max-width: 150px;
  overflow: hidden;
  color: var(--text-dim);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bp-route-options {
  margin-top: 12px;
}

.bp-route-pill > span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bp-route-color);
}

.bp-route-pill.is-active {
  background: var(--text);
  color: var(--bg-card);
}

.bp-route-pill--bus {
  gap: 8px;
}

.bp-route-pill--bus svg {
  width: 15px;
  height: 15px;
}

.bp-route-pill--bus strong {
  font-weight: 700;
}

.bp-route-pill--bus em {
  color: var(--text-dim);
  font-size: 11px;
  font-style: normal;
}

.bp-route-empty {
  color: var(--text-dim);
  font-size: 13px;
}

.bp-board-section {
  margin-top: 30px;
}

.bp-board-heading {
  min-height: 38px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.bp-board-heading h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 730;
}

.bp-board-heading span {
  color: var(--text-dim);
  font-size: 12px;
}

.bp-first-run-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto 16px;
  max-width: 620px;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-elev));
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.4;
}
.bp-first-run-hint[hidden] { display: none; }
.bp-first-run-hint i { color: var(--accent); flex: none; }
.bp-first-run-hint__close {
  margin-left: auto;
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
}
.bp-first-run-hint__close:hover { background: var(--bg-elev-2); color: var(--text); }
.bp-first-run-hint__close:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.bp-board-message {
  padding: 28px 0;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 14px;
}

.bp-board-message[hidden] {
  display: none;
}

.bp-arrivals-board {
  display: grid;
  gap: 8px;
}

/* Visually hidden live region for screen-reader announcements. */
.bp-a11y-announce {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── Empty states (first visit / no arrivals / filtered out) ─────────── */
.bp-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 18px 4px;
  text-align: left;
}
.bp-empty--compact { padding: 12px 4px; }
.bp-empty__icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--bg-elev-2);
  color: var(--text-dim);
  margin-bottom: 2px;
}
.bp-empty__title { font-size: 17px; letter-spacing: -0.01em; }
.bp-empty__text { margin: 0; color: var(--text-dim); font-size: 13.5px; line-height: 1.45; max-width: 46ch; }
.bp-empty__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.bp-empty-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, transform .12s, background .15s;
}
.bp-empty-cta:hover { border-color: var(--accent); transform: translateY(-1px); }
.bp-empty-cta:active { transform: translateY(0) scale(0.98); }
.bp-empty-cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bp-empty-cta--primary { background: var(--accent); color: #fff; border-color: transparent; }
.bp-empty-cta--primary:hover { filter: brightness(1.08); }

/* ── Status: dot + explicit label (not color-only) ───────────────────── */
.bp-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
}
.bp-status-label { font-size: 10.5px; font-weight: 600; color: var(--text-dim); letter-spacing: 0.02em; }
.bp-status[data-status="late"] { border-color: color-mix(in srgb, var(--late) 45%, var(--border)); }
.bp-status[data-status="late"] .bp-status-label { color: var(--late); }
.bp-status[data-status="early"] { border-color: color-mix(in srgb, var(--early) 45%, var(--border)); }
.bp-status[data-status="early"] .bp-status-label { color: var(--early); }

.bp-arrival-card {
  min-height: 86px;
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) auto;
  gap: 15px;
  align-items: center;
  padding: 12px 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elev);
  box-shadow: 0 4px 16px rgba(20, 30, 60, 0.04);
  cursor: pointer;
  transition: border-color .15s ease, transform .12s ease, box-shadow .15s ease;
  animation: bp-card-in .22s ease both;
}
.bp-arrival-card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(20, 30, 60, 0.08); }
.bp-arrival-card:active { transform: translateY(0) scale(0.99); }
.bp-arrival-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@keyframes bp-card-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.bp-route-chip {
  min-width: 52px;
  min-height: 38px;
  display: grid;
  place-items: center;
  justify-self: start;
  padding: 5px 9px;
  border-radius: 6px;
  background: var(--bp-route-color);
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.bp-arrival-destination {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bp-arrival-service {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.bp-arrival-service strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bp-arrival-service small {
  min-width: 0;
  overflow: hidden;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bp-status-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--ontime);
}

.bp-status-dot--early {
  background: var(--early);
}

.bp-status-dot--late {
  background: var(--late);
}

.bp-arrival-time {
  min-width: 92px;
  display: grid;
  justify-items: end;
  gap: 3px;
  text-align: right;
}

.bp-arrival-time strong {
  color: var(--text);
  font-size: 27px;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.bp-arrival-time time {
  color: var(--text-dim);
  font-size: 12px;
}

.bp-countdown.is-due {
  color: var(--late);
  animation: bp-due-pulse 1.4s ease-in-out infinite;
}

.bp-arrival-card--loading {
  pointer-events: none;
}

.bp-loading-block {
  display: block;
  height: 14px;
  border-radius: 4px;
  background: var(--bg-elev-2);
  animation: bp-loading-pulse 1.2s ease-in-out infinite;
}

.bp-loading-route {
  width: 52px;
  height: 38px;
}

.bp-loading-destination {
  width: min(70%, 250px);
}

.bp-loading-time {
  width: 78px;
  height: 28px;
}

.bp-arrivals-footer {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
  color: var(--text-dim);
  font-size: 11px;
}

.bp-map-return {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  z-index: 45;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elev);
  color: var(--text);
  box-shadow: var(--shadow);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* On desktop the old app's sidebar occupies the left 380px — place the
   return control just inside the map area instead of over the sidebar. */
@media (min-width: 861px) {
  .bp-map-return {
    left: max(394px, env(safe-area-inset-left));
  }
}

.bp-map-return svg {
  width: 17px;
  height: 17px;
}

html:not([data-bp-view="map"]) .bp-map-return {
  display: none;
}

@keyframes bp-due-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@keyframes bp-loading-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@media (max-width: 620px) {
  .bp-header-inner {
    width: min(100% - 20px, 1060px);
    min-height: 62px;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
  }

  .bp-brand {
    font-size: 18px;
  }

  .bp-brand-mark {
    width: 32px;
    height: 32px;
  }

  .bp-view-option {
    min-width: 40px;
    width: 40px;
    padding: 0;
  }

  .bp-view-option span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .bp-arrivals-main {
    width: min(100% - 20px, 760px);
    padding-top: 22px;
  }

  .bp-search-title {
    margin-bottom: 13px;
  }

  .bp-stop-search {
    grid-template-columns: minmax(0, 1fr);
  }

  .bp-near-me {
    width: 100%;
    min-width: 0;
    height: 46px;
  }

  .bp-stop-pills {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .bp-arrival-card {
    min-height: 78px;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px;
  }

  .bp-route-chip {
    min-width: 48px;
    min-height: 36px;
    padding: 4px 6px;
    font-size: 15px;
  }

  .bp-arrival-service strong {
    font-size: 14px;
  }

  .bp-arrival-time {
    min-width: 74px;
  }

  .bp-arrival-time strong {
    font-size: 21px;
  }
}

@media (max-width: 360px) {
  .bp-brand > span:last-child {
    display: none;
  }

  .bp-arrival-card {
    grid-template-columns: 48px minmax(0, 1fr) 66px;
    gap: 8px;
  }

  .bp-route-chip {
    min-width: 44px;
    font-size: 14px;
  }

  .bp-arrival-time strong {
    font-size: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bp-countdown.is-due,
  .bp-loading-block,
  .bp-arrival-card {
    animation: none;
  }
  .bp-arrival-card { transition: none; }
}

/* ── Journey detail panel (tap a bus card) ──────────────────────────── */
.bp-journey-panel {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.bp-journey-panel[hidden] {
  display: none;
}

.bp-journey-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--bg, #121212) 72%, transparent);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.bp-journey-sheet {
  position: relative;
  width: min(100%, 560px);
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -18px 60px rgb(0 0 0 / 0.28);
  animation: bp-sheet-up 220ms ease-out;
}

@keyframes bp-sheet-up {
  from { transform: translateY(40px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}

.bp-journey-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.bp-journey-back {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.bp-journey-back:hover {
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

.bp-journey-heading {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.bp-journey-title {
  font-size: 17px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bp-journey-subtitle {
  font-size: 12.5px;
  opacity: 0.68;
}

.bp-journey-countdown {
  flex: 0 0 auto;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.bp-journey-map-btn {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent, #d85a28) 12%, transparent);
  color: var(--accent, #d85a28);
  cursor: pointer;
}

.bp-journey-map-btn:hover {
  background: color-mix(in srgb, var(--accent, #d85a28) 22%, transparent);
}

.bp-journey-map-btn svg {
  width: 18px;
  height: 18px;
}

.bp-journey-countdown.is-due {
  color: var(--accent, #d85a28);
  animation: bp-due-pulse 1.4s ease-in-out infinite;
}

@keyframes bp-due-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.bp-journey-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 14px 18px;
  -webkit-overflow-scrolling: touch;
}

.bp-journey-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.bp-journey-stop {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 10px;
  padding: 11px 4px;
  border-bottom: 1px dashed color-mix(in srgb, var(--border) 65%, transparent);
}

.bp-journey-stop:last-child {
  border-bottom: none;
}

.bp-journey-marker {
  justify-self: center;
  font-size: 13px;
  color: var(--accent, #d85a28);
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  transform: translateY(2px);
}

.bp-journey-stop-name {
  min-width: 0;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bp-journey-here {
  display: block;
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent, #d85a28);
  margin-top: 2px;
}

.bp-journey-stop-time {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  font-variant-numeric: tabular-nums;
}

.bp-journey-stop-time time {
  font-size: 13.5px;
  opacity: 0.85;
}

.bp-journey-countdown-label {
  font-size: 15px;
  font-weight: 700;
}

.bp-journey-countdown-label.is-due {
  color: var(--accent, #d85a28);
  animation: bp-due-pulse 1.4s ease-in-out infinite;
}

.bp-journey-stop.is-passed {
  opacity: 0.42;
}

.bp-journey-stop.is-passed .bp-journey-marker {
  border-color: currentColor;
}

.bp-journey-stop.is-here {
  background: color-mix(in srgb, var(--accent, #d85a28) 7%, transparent);
  border-radius: 10px;
}

.bp-journey-stop.is-here .bp-journey-stop-name {
  font-weight: 600;
}

/* The user's selected stop inside the journey list */
.bp-journey-stop.is-selected {
  background: color-mix(in srgb, var(--accent, #d85a28) 12%, transparent);
  border-left: 3px solid var(--accent, #d85a28);
  border-radius: 10px;
}

.bp-journey-stop.is-selected .bp-journey-stop-name {
  font-weight: 700;
}

.bp-journey-your-stop {
  font-style: normal;
  font-weight: 700;
  color: var(--accent, #d85a28);
}

.bp-journey-empty {
  padding: 40px 16px;
  text-align: center;
  font-size: 14px;
  opacity: 0.7;
}

@media (max-width: 480px) {
  .bp-journey-sheet {
    border-radius: 18px 18px 0 0;
  }

  .bp-journey-title {
    font-size: 15.5px;
  }

  .bp-journey-stop {
    padding: 10px 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bp-journey-sheet,
  .bp-journey-countdown.is-due,
  .bp-journey-countdown-label.is-due {
    animation: none;
  }
}

/* Ghost-bus no-show flag: soft amber warning on at-risk departures
   (annotate-only — the row is never hidden or reordered). Amber matches the
   existing --early warning tone used for degradations. */
.bp-may-not-show {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(245, 184, 0, 0.3);
  background: rgba(245, 184, 0, 0.13);
  color: var(--early, #f5b800);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

