.routes-page #selectedLocationDisplay {
  flex: 1;
  word-wrap: break-word;
  white-space: normal;
  max-width: 100%;
  display: block;
  font-size: var(--text-sm);
}

.routes-page .map-container {
  flex: 1;
  min-height: 0;
  width: calc(100% - var(--space-lg));
  z-index: 0;
  overflow: hidden;
  position: relative;
  margin: 0 auto var(--space-sm) auto;
  padding: 0;
  border-radius: var(--radius-lg);
  background: var(--bg-body);
  isolation: isolate;
}

.routes-page .transit-api-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  padding: 0;
  margin: 0;
  z-index: 1000;
}

.routes-page .leaflet-control-attribution {
  margin-bottom: 0 !important;
}

.routes-page .transit-api-logo {
  max-height: 24px;
  width: auto;
  display: block;
}

/* --- Info Panels Wrapper --- */
.routes-page .info-containers-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: calc(100% - var(--space-lg));
  margin: 0 auto var(--bottom-nav-offset) auto;
  box-sizing: border-box;
  flex: 0 0 auto;
  flex-shrink: 0;
}

/* --- Route & Departures Panel --- */
.routes-page .route-arrivals-container {
  background-color: var(--brand-primary-dark);
  padding: var(--space-md) var(--space-lg) var(--space-sm);
  flex: 0 0 auto;
  height: 150px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.routes-page .route-arrivals-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.routes-page .route-arrivals-heading {
  color: white;
  font-size: var(--text-md);
  font-weight: 600;
  margin: 0;
  text-align: left;
}

.routes-page .route-search-pill {
  display: flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-xl);
  padding: var(--space-xs) var(--space-sm);
  width: auto;
  min-width: 80px;
  max-width: 130px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.routes-page .route-search-pill:focus-within {
  background-color: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
}

.routes-page .pill-search-icon {
  width: 12px;
  height: 12px;
  margin-right: 6px;
  filter: brightness(0) invert(1);
  opacity: 0.7;
  flex-shrink: 0;
}

.routes-page .route-search-pill input {
  background: none;
  border: none;
  color: white;
  font-size: var(--text-md);
  width: 145.45%;
  transform: scale(0.6875);
  transform-origin: left center;
  margin-right: -45.45%;
  outline: none;
  font-family: 'Inter', sans-serif;
  padding: 0;
}

.routes-page .route-search-pill input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.routes-page .route-arrivals-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  overflow-y: auto;
  min-height: 0;
  flex: 1 1 auto;
}

.routes-page .route-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) 0;
}

.routes-page .route-row+.route-row {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.routes-page .route-info {
  color: white;
  font-size: var(--text-base);
  font-weight: 500;
  flex: 1;
  line-height: 1.3;
}

.routes-page .arrival-info {
  color: white;
  font-size: var(--text-base);
  font-weight: 600;
  text-align: right;
  flex: 0 0 auto;
  margin-left: var(--space-md);
}

/* --- Shuttle Capacity Panel --- */
.routes-page .shuttle-capacity-container {
  background-color: var(--bg-surface);
  padding: var(--space-md) var(--space-lg) var(--space-sm);
  flex: 0 0 auto;
  height: 150px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  margin-bottom: 0;
}

.routes-page .shuttle-capacity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.routes-page .shuttle-capacity-heading {
  color: white;
  font-size: var(--text-md);
  font-weight: 600;
  margin: 0;
  text-align: left;
  flex: 1;
}

.routes-page .predicted-text {
  color: var(--gray-300);
  font-size: var(--text-xs);
  font-weight: 500;
  margin: 0 0 0 10px;
  text-align: right;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.routes-page .shuttle-capacity-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  overflow-y: auto;
  min-height: 0;
  flex: 1 1 auto;
}

.routes-page .shuttle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) 0;
}

.routes-page .shuttle-row+.shuttle-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.routes-page .shuttle-info {
  color: white;
  font-size: var(--text-base);
  font-weight: 500;
  flex: 1;
}

.routes-page .seats-info {
  color: white;
  font-size: var(--text-base);
  font-weight: 500;
  text-align: right;
  flex: 0 0 auto;
  margin-left: var(--space-md);
  display: flex;
  align-items: center;
  gap: 2px;
}

.routes-page .seats-info.low-capacity .capacity-count {
  color: var(--color-danger);
}

.routes-page .seats-info.medium-capacity .capacity-count {
  color: var(--color-warning);
}

.routes-page .seats-info.high-capacity .capacity-count {
  color: var(--color-success);
}

.routes-page .seats-info .capacity-label {
  font-size: 10px;
  font-weight: 600;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1;
}

.routes-page .seats-info.low-capacity .capacity-label {
  background-color: rgba(255, 107, 107, 0.15);
  color: var(--color-danger);
}

.routes-page .seats-info.medium-capacity .capacity-label {
  background-color: rgba(255, 209, 102, 0.15);
  color: var(--color-warning);
}

.routes-page .seats-info.high-capacity .capacity-label {
  background-color: rgba(6, 214, 160, 0.15);
  color: var(--color-success);
}

/* --- Routes Empty State --- */
.routes-page .routes-empty-state {
  display: none;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  padding: 3vh var(--space-xl) calc(var(--bottom-nav-offset) + var(--space-lg));
  text-align: center;
  width: calc(100% - var(--space-lg));
  margin: 0 auto;
}

.routes-page .routes-empty-state.visible {
  display: flex;
}

.routes-page .routes-empty-state img {
  width: 180px;
  height: 180px;
  margin-bottom: var(--space-lg);
}

.routes-page .routes-empty-state .empty-state-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
}

.routes-page .routes-empty-state .empty-state-description {
  font-size: var(--text-base);
  color: var(--gray-300);
  line-height: 1.5;
}

/* --- Skeleton Loading for Panels --- */
.routes-page .route-arrivals-container .skeleton-row,
.routes-page .shuttle-capacity-container .skeleton-row {
  padding: var(--space-sm) 0;
}

.routes-page .route-arrivals-container .skeleton-text,
.routes-page .shuttle-capacity-container .skeleton-text {
  height: 14px;
  border-radius: var(--radius-sm);
}

/* --- Stop Marker --- */
.routes-page .stop-marker {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* --- Layout --- */
.routes-page .main-content {
  margin-bottom: 0;
}

@media (display-mode: standalone) {
  .routes-page .main-content {
    margin-bottom: 0;
  }
}

@media (max-width: 480px) {
  .routes-page .page-title {
    font-size: var(--text-xl);
  }

  .routes-page .status-label {
    font-size: var(--text-lg);
  }
}