/* Choix avec recherche (choix.js) : fenêtre de recherche qui remplace la liste déroulante native des listes de plus de quelques éléments.
   Variables propres à ce fichier : seules valeurs « nouvelles » ; tout le reste vient des variables du thème. */
:root {
  --cb-ligne-h: 36px;                 /* hauteur d'une ligne (44 px au toucher, voir plus bas) */
  --cb-liste-h: 320px;                /* hauteur maximale de la liste sur grand écran */
  --cb-bord: var(--border-in, var(--border));
}

.cb-pop { position: fixed; z-index: var(--z-menu); display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--cb-bord); border-radius: var(--r-md); background: var(--surface); color: var(--fg); box-shadow: var(--e-4); font-size: 13px; }
.cb-tete { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2); border-bottom: 1px solid var(--border); }
.cb-q { flex: 1 1 auto; min-width: 0; height: var(--cb-ligne-h); padding: 0 var(--s-3); border: 1px solid var(--cb-bord); border-radius: var(--r-sm); background: var(--surface); color: var(--fg); font: inherit; }
.cb-q:focus { border-color: var(--accent); outline: none; }
.cb-ferme { display: none; width: var(--cb-ligne-h); height: var(--cb-ligne-h); border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.cb-liste { list-style: none; margin: 0; padding: var(--s-1); overflow-y: auto; overscroll-behavior: contain; max-height: var(--cb-liste-h); }
.cb-opt { display: flex; align-items: center; min-height: var(--cb-ligne-h); padding: var(--s-1) var(--s-3); border-radius: var(--r-sm); cursor: pointer; overflow-wrap: anywhere; }
.cb-opt.cb-actif { background: var(--accent-d); }
.cb-opt.cb-cur { font-weight: 600; color: var(--accent); }
.cb-opt.cb-off { opacity: .5; cursor: default; }
.cb-titre, .cb-sous { padding: var(--s-2) var(--s-3) var(--s-1); color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.cb-titre { border-top: 1px solid var(--border); margin-top: var(--s-1); }
.cb-titre:first-child { border-top: 0; margin-top: 0; }
.cb-plus, .cb-aucun { padding: var(--s-2) var(--s-3); color: var(--muted); }
.cb-fond { display: none; }

@media (max-width: 640px) {
  :root { --cb-ligne-h: 44px; }
  .cb-fond { display: block; position: fixed; inset: 0; z-index: var(--z-menu); background: var(--bg); opacity: .6; }
  .cb-pop { inset: auto 0 0 0; width: auto; max-height: 75vh; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .cb-pop .cb-liste { max-height: none; flex: 1 1 auto; }
  .cb-ferme { display: inline-flex; align-items: center; justify-content: center; }
  .cb-q { font-size: 16px; }
}

/* Recherche instantanée d'un tableau (Z.table, option recherche) : à gauche de la barre, « Colonnes » reste à droite */
.tb-bar { justify-content: space-between; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.tb-q { flex: 1 1 220px; max-width: 360px; min-width: 0; height: var(--cb-ligne-h); padding: 0 var(--s-3); font-size: 13px; }
.tb-bar .table-cols-btn { margin-left: auto; }
.tb-bar .tb-q[hidden], :root .tb-bar[hidden] { display: none; }
.panel-body .tb-bar { padding: var(--s-2) var(--s-3) 0; }
