/* KInvoice — autocomplétion « entreprise » (js/company-lookup.js).
   La liste flotte sous le champ, sur toute sa largeur : elle ne dépasse jamais de l'écran. */
.lookup { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lookup > * { margin: 0; }
.lookup > input { width: 100%; max-width: 100%; }

.lookup.is-loading > input {
  background-image: linear-gradient(90deg, transparent 0, var(--accent-tint) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: lookup-pulse 1.2s linear infinite;
}
@keyframes lookup-pulse { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .lookup.is-loading > input { animation: none; } }

.lookup__list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
  margin: 0; padding: 5px;
  max-width: 100%; max-height: min(340px, var(--lookup-max, 60vh)); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--edge-2); border-radius: var(--r-ctl);
  box-shadow: var(--shadow-2);
  display: flex; flex-direction: column; gap: 2px;
}
.lookup__list[hidden] { display: none; }
/* Pas la place dessous (écran court, champ bas de page) : la liste remonte au-dessus du champ.
   --lookup-max est mesuré par le script : le bas de la liste reste toujours dans la fenêtre. */
.lookup__list--up { top: auto; bottom: calc(100% + 6px); }

.lookup__option {
  min-height: var(--tap); padding: 7px 11px; border-radius: 9px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0;
}
.lookup__option:hover { background: var(--bg-2); }
.lookup__option.is-active { background: var(--accent-tint); }
.lookup__name { font-weight: 650; color: var(--ink); overflow-wrap: anywhere; }
.lookup__meta { font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.lookup__option.is-active .lookup__name { color: var(--accent-ink); }
.lookup__badge {
  display: inline-block; padding: 1px 8px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 650; background: var(--bad-bg); color: var(--bad-fg);
  vertical-align: 1px; white-space: nowrap;
}

.lookup__status { font-size: 12px; color: var(--ink-2); }
.lookup__status[hidden] { display: none; }
.lookup__status--error { color: var(--bad-fg); }
/* Compteur de résultats : annoncé aux lecteurs d'écran, invisible à l'écran (la liste suffit). */
.lookup__status--sr {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
