/* Iroc Hub : le plan de lignes en colonne. Le besoin allume le trajet depuis le Hub.
   Jetons seulement (--texte, --accent, --filet, --releve, --carte, --discret) : le thème suit. */

/* Les besoins : des puces en ligne, pas une liste d'options. */
.m-hub-besoins {
  display: flex;
  flex-wrap: wrap;
  gap: var(--e1);
  margin: 0;
  padding: var(--e2) var(--e2) var(--e3);
  border: 0;
  min-width: 0;
}

.m-hub-besoins label {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--e3);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--filet);
  font-size: 14px;
  line-height: 1.2;
  color: var(--second);
  cursor: pointer;
  transition: background-color .45s var(--courbe), color .45s var(--courbe), box-shadow .45s var(--courbe);
}

.m-hub-besoins label:hover {
  background: var(--releve);
  color: var(--texte);
}

.m-hub-besoins input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.m-hub-besoins label:has(input:checked) {
  background: var(--texte);
  color: var(--carte);
  box-shadow: none;
  font-weight: 500;
}

.m-hub-besoins label:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Le plan : une voie par division, une station par ligne, le trait du Hub qui descend. */
.m-hub-voies {
  list-style: none;
  margin: 0;
  padding: var(--e2) var(--e3);
  border-top: 1px solid var(--filet);
  font-size: 14px;
}

.m-hub-voies li {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0 var(--e2);
  min-height: 36px;
  color: var(--discret);
}

/* Le tronc : une seule ligne neutre, du Hub à la dernière division. */
.m-hub-voies li::before,
.m-hub-voies li::after {
  content: "";
  position: absolute;
  left: 11px;
  width: 2px;
  background: var(--filet);
  transition: background-color .45s var(--courbe);
}

.m-hub-voies li::before {
  top: 0;
  height: 50%;
}

.m-hub-voies li::after {
  top: 50%;
  bottom: 0;
}

.m-hub-voies li:first-child::before,
.m-hub-voies li:last-child::after {
  display: none;
}

.m-hub-voies .m-station {
  position: relative;
  z-index: 1;
  justify-self: center;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--carte);
  box-shadow: inset 0 0 0 1.5px var(--discret);
  transition: background-color .45s var(--courbe), box-shadow .45s var(--courbe);
}

.m-hub-voies .m-depart .m-station {
  width: 16px;
  height: 16px;
  background: var(--texte);
  box-shadow: none;
}

.m-hub-voies .m-nom {
  min-width: 0;
  overflow-wrap: anywhere;
}

.m-hub-voies .m-role {
  font-size: 12px;
  color: var(--discret);
  text-align: right;
}

.m-hub-voies .m-depart .m-nom {
  color: var(--texte);
  font-weight: 500;
}

/* Une destination allumée : le nom passe en texte plein, la station prend l'accent. */
.m-hub-voies li.m-on {
  color: var(--texte);
}

.m-hub-voies li.m-on .m-station {
  background: var(--accent);
  box-shadow: none;
}

.m-hub-voies li.m-lead .m-role {
  color: var(--accent);
  font-weight: 500;
}

/* Le pied : ce qui est demandé, puis qui mène et qui appuie. */
.m-hub-pied {
  align-items: flex-start;
  flex-direction: column;
  gap: var(--e1);
}

.m-hub-cibles {
  display: grid;
  gap: 2px;
  font-size: 13px;
  color: var(--second);
}

.m-hub-cibles [data-lead] {
  color: var(--texte);
  font-weight: 500;
}

@media (min-width: 560px) {
  .m-hub-pied {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .m-hub-cibles {
    text-align: right;
  }
}
