body.ref-page {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.ref-page .parc-shell {
  flex: 1;
  min-height: 0;
  padding-bottom: 0.75rem;
}

#ref-travail {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#ref-travail[hidden],
.ref-barre[hidden] {
  display: none;
}

.ref-intro {
  padding: 1rem 1.15rem;
}

.ref-outils {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
}

.ref-onglets,
.ref-choix {
  display: flex;
  align-items: stretch;
}

.ref-onglet,
.ref-source {
  background: #fff;
  border: 1px solid rgba(22, 58, 92, 0.14);
  color: #163a5c;
  cursor: pointer;
  font-weight: 600;
}

.ref-onglet {
  padding: 0.4rem 0.85rem;
}

.ref-onglet:first-child,
.ref-source:first-child {
  border-radius: 0.55rem 0 0 0.55rem;
}

.ref-onglet:last-child,
.ref-source:last-child {
  border-radius: 0 0.55rem 0.55rem 0;
  margin-left: -1px;
}

.ref-onglet.is-actif {
  background: #3d8fc4;
  border-color: #3d8fc4;
  color: #fff;
  position: relative;
}

.ref-source {
  text-align: left;
  padding: 0.35rem 0.75rem;
  min-width: 0;
}

.ref-source strong,
.ref-source span {
  display: block;
  line-height: 1.2;
}

.ref-source span {
  font-weight: 500;
  font-size: 0.75rem;
  color: rgba(22, 58, 92, 0.6);
}

.ref-source.is-actif {
  background: #f2f7fb;
  border-color: #3d8fc4;
  position: relative;
}

.ref-recherche {
  flex: 0 0 14rem;
  width: 14rem;
  margin-left: auto;
}

.ref-corps {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 18rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: stretch;
}

.ref-colonne {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ref-colonne__head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(22, 58, 92, 0.14);
  font-weight: 700;
  color: #163a5c;
}

.ref-colonne__head > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ref-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
}

.ref-ajout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(22, 58, 92, 0.14);
}

.ref-ajout .parc-input,
.ref-ajout .parc-select {
  width: 10.5rem;
  flex: 0 0 auto;
}

.ref-ajout .parc-input[name="sous"],
.ref-ajout .parc-input[name="libelle"] {
  width: 14rem;
}

.ref-ajout .parc-input[name="code"] {
  width: 5.5rem;
}

.ref-noeud {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.28rem 0.65rem;
  color: #163a5c;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.ref-noeud:hover,
.ref-noeud.is-actif {
  background: rgba(61, 143, 196, 0.1);
}

.ref-noeud--famille {
  font-weight: 700;
  padding-left: 0.45rem;
  border-top: 1px solid rgba(22, 58, 92, 0.08);
}

.ref-noeud--feuille {
  padding-left: 2.1rem;
  font-weight: 500;
}

.ref-noeud input[type="checkbox"] {
  width: 0.95rem;
  height: 0.95rem;
  accent-color: #3d8fc4;
  flex: 0 0 auto;
}

.ref-feuille {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.ref-nom {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ref-compte,
.ref-code {
  flex: 0 0 auto;
  color: rgba(22, 58, 92, 0.55);
  font-size: 0.75rem;
  font-weight: 600;
}

.ref-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2a6fa0;
  cursor: pointer;
  flex: 0 0 auto;
}

.ref-chevron svg {
  width: 0.95rem;
  height: 0.95rem;
  transition: transform 0.15s ease;
}

.ref-chevron.is-ouvert svg {
  transform: rotate(90deg);
}

.ref-mini {
  background: transparent;
  border: 0;
  color: #2a6fa0;
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0.1rem 0.2rem;
  flex: 0 0 auto;
}

.ref-icone {
  display: inline-flex;
  color: #2a6fa0;
  background: transparent;
  border: 0;
  padding: 0.1rem;
  cursor: pointer;
}

.ref-icone svg {
  width: 0.95rem;
  height: 0.95rem;
}

.ref-vide {
  margin: 0;
  padding: 0.8rem 0.75rem;
  color: rgba(22, 58, 92, 0.65);
}

.ref-barre {
  position: static;
  flex: 0 0 auto;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: min(1600px, calc(100% - 2.5rem));
  margin: 0 auto 0.75rem;
  padding: 0.55rem 1.25rem;
  background: #fff;
  border: 1px solid rgba(22, 58, 92, 0.14);
  border-radius: 0.75rem;
}

.ref-barre p {
  margin: 0;
  color: #163a5c;
  font-weight: 600;
}

#msg-referentiel:empty {
  display: none;
}

#msg-referentiel {
  margin: 0.45rem 0.75rem 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 860px) {
  body.ref-page {
    height: auto;
    overflow: auto;
    display: block;
  }

  body.ref-page .parc-shell {
    height: auto;
  }

  .ref-corps {
    grid-template-columns: 1fr;
  }

  .ref-recherche {
    margin-left: 0;
  }

  .ref-scroll {
    max-height: 50vh;
    flex: none;
  }
}
