/* L'aide tirée de la base : références proposées à la frappe, classement à parcourir, équivalents, aperçus 3D. */

/* ------------------------------------------------------------------ références proposées pendant la frappe */
/* La liste se déploie par-dessus la suite de la page, sans la pousser : un clic donné ailleurs pendant qu'elle est
   ouverte tombe bien là où on l'a visé. L'ancre n'a pas de hauteur et reste toujours en place : rien ne bouge. */
.sug-ancre { position: relative; width: 100%; height: 0; z-index: 30; }
.sug-liste[hidden] { display: none; }
.sug-liste { position: absolute; top: -6px; left: 0; right: 0; list-style: none; margin: 0; padding: 4px; max-height: min(52vh, 420px); overflow-y: auto; background: var(--papier); border: 1px solid var(--trait-fort); border-radius: var(--rayon); box-shadow: 0 12px 28px -10px rgba(28, 28, 31, 0.45); display: grid; gap: 2px; }
.sug-option { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; min-height: 48px; padding: 8px 12px; border-radius: 6px; cursor: pointer; }
.sug-option:hover, .sug-option[aria-selected='true'] { background: var(--accent-clair); }
.sug-option[aria-selected='true'] { outline: 2px solid var(--accent); outline-offset: -2px; }
.sug-reference { font-family: var(--mono); font-weight: 500; font-size: 16px; color: var(--encre); overflow-wrap: anywhere; }
.sug-composant { justify-self: end; padding: 2px 9px; border-radius: 99px; font-size: 12.5px; font-weight: 650; background: var(--info-clair); color: var(--info); text-align: center; }
.sug-composant.inconnu { background: var(--papier2); color: var(--texte-doux); border: 1px solid var(--trait); font-weight: 500; }
.sug-designation { grid-column: 1 / -1; font-size: 13.5px; line-height: 1.35; color: var(--texte-doux); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ classement à parcourir (fournitures) */
.cl-panneau { display: grid; gap: 10px; }
.cl-panneau[hidden] { display: none; }
.cl-fil { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 15px; }
.cl-fil .lien { min-height: 32px; color: var(--texte-doux); }
.cl-fil .lien:hover { color: var(--accent-sombre); }
.cl-separateur { color: var(--trait-fort); }
.cl-ici { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; color: var(--encre); }
.cl-branches { display: flex; flex-wrap: wrap; gap: 8px; }
.cl-branches[hidden] { display: none; }
.cl-branche { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; background: var(--papier); border: 1px solid var(--trait-fort); border-radius: 99px; color: var(--texte); font: inherit; font-size: 14.5px; text-align: left; cursor: pointer; }
.cl-branche:hover { border-color: var(--encre); }
.cl-branche:focus-visible, .cl-fil .lien:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cl-panneau .compte, .eq-groupe .compte { display: inline-block; min-width: 24px; padding: 1px 8px; border-radius: 99px; background: var(--papier2); border: 1px solid var(--trait); color: var(--texte-doux); font-size: 12.5px; font-weight: 600; text-align: center; }

/* ------------------------------------------------------------------ aperçu 3D d'un article */
.ap-vignette { flex: none; display: grid; place-items: center; width: 84px; height: 64px; padding: 0; background: var(--papier2); border: 1px solid var(--trait); border-radius: 6px; color: var(--texte-doux); cursor: pointer; overflow: hidden; }
.ap-vignette:hover { border-color: var(--accent); color: var(--accent-sombre); }
.ap-vignette:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ap-vignette svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ap-vignette img { width: 100%; height: 100%; object-fit: cover; }
.ap-vignette img[hidden] { display: none; }
.ap-vignette.prete { background: var(--papier); }
.ap-vignette.prete svg { display: none; }
.fo-article .ap-vignette { align-self: center; }
.fo-article .fo-identite { flex: 1 1 auto; }
.ap-boite .fo-cadre { width: min(920px, 100%); }
.ap-vue { position: relative; width: 100%; height: min(62vh, 560px); min-height: 260px; background: var(--papier2); border: 1px solid var(--trait); border-radius: var(--rayon); overflow: hidden; touch-action: none; }
.ap-vue canvas { display: block; width: 100%; height: 100%; }
.ap-designation { color: var(--texte-doux); font-size: 14.5px; }
.ap-legende { padding: 0; }

/* ------------------------------------------------------------------ composant correspondant et équivalents (fin de fiche) */
.eq-bloc { justify-items: start; }
.eq-etat:empty { display: none; }
.eq-resultats { display: grid; gap: 14px; width: 100%; }
.eq-resultats:empty { display: none; }
/* Le relevé a changé depuis cette liste : elle s'estompe le temps que la nouvelle arrive. */
.eq-resultats { transition: opacity 0.15s; }
.eq-resultats.perime { opacity: 0.5; }
.eq-suivi[hidden] { display: none; }
.eq-carte .ap-vignette { width: 132px; height: 100px; }
.eq-criteres { display: grid; gap: 6px; }
.eq-criteres ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.eq-criteres li { padding: 4px 10px; border-radius: 6px; background: var(--papier2); border: 1px solid var(--trait); font-size: 13.5px; color: var(--texte-doux); }
.eq-criteres li strong { color: var(--encre); font-weight: 650; }
.eq-criteres li.catalogue { border-style: dashed; }
.eq-criteres li em { font-style: normal; font-size: 12.5px; }
.eq-groupe { display: grid; gap: 10px; }
.eq-groupe > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 17px; font-weight: 650; color: var(--encre); cursor: pointer; }
.eq-groupe > .aide { margin-bottom: 4px; }
.eq-liste { display: grid; gap: 10px; }
.eq-carte { display: flex; gap: 14px; padding: 12px 14px; background: var(--papier); border: 1px solid var(--trait); border-left: 4px solid var(--succes); border-radius: var(--rayon); }
.eq-carte.reference { border-left-color: var(--info); background: var(--info-clair); }
.eq-carte.aConfirmer { border-left-color: var(--trait-fort); }
.eq-carte.proche, .eq-carte.ecarts { border-left-color: #d08a1e; }
.eq-carte .ap-vignette { align-self: start; }
.eq-corps { display: grid; gap: 4px; min-width: 0; justify-items: start; }
.eq-corps h3 { font-size: 17px; line-height: 1.25; overflow-wrap: anywhere; }
.eq-marque { font-weight: 600; color: var(--texte); }
.eq-reference { font-family: var(--mono); font-weight: 500; color: var(--encre); }
.eq-designation { font-size: 14px; color: var(--texte-doux); }
.eq-bilan { font-size: 14px; font-weight: 650; color: var(--succes); }
.eq-bilan.ecart { color: var(--alerte); }
.eq-differences { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 3px; font-size: 14.5px; }
.eq-differences li { padding-left: 16px; position: relative; }
.eq-differences li::before { content: ''; position: absolute; left: 2px; top: 0.6em; width: 7px; height: 7px; border-radius: 50%; background: var(--trait-fort); }
.eq-differences li.ecart { color: #5d3804; font-weight: 600; }
.eq-differences li.ecart::before { background: #d08a1e; }
.eq-differences li.convient::before { background: var(--succes); }
.eq-differences li.info { color: var(--texte-doux); }
.eq-source { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; color: var(--texte-doux); }
.eq-source:empty { display: none; }

@media (max-width: 640px) {
  .sug-option { min-height: 52px; }
  .sug-reference { font-size: 17px; }
  .eq-carte { padding: 12px; gap: 10px; }
  .eq-carte .ap-vignette { width: 96px; height: 76px; }
  .fo-article .ap-vignette { width: 68px; height: 56px; }
  .cl-branches { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .cl-branche { flex: none; }
  .ap-vue { height: 56vh; }
}
