/* Choix du modèle d'IA dans la zone de saisie : pastille + menu ancré au-dessus.
   Complète app.css (mêmes jetons de couleur) ; chargé après lui. */

#model-picker { position: relative; flex: none; display: flex; align-items: center; }

.model-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 10px;
  background: transparent; border: 1px solid var(--line-strong);
  color: var(--sand); font-size: 12px; line-height: 1; cursor: pointer;
  max-width: 180px; white-space: nowrap;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.model-pill .mp-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-pill .ico { flex: none; opacity: .75; }
.model-pill:hover { color: var(--ivory); background: rgba(246,242,234,.06); border-color: rgba(59,217,219,.45); }
.model-pill:focus-visible { outline: 1px solid var(--turq); outline-offset: 1px; }
.model-pill.disabled { opacity: .5; }
.model-pill[aria-expanded="true"] { color: var(--ivory); border-color: rgba(59,217,219,.6); }

.model-menu {
  position: absolute; left: 0; bottom: calc(100% + 8px);
  width: 320px; max-height: 360px; overflow: auto;
  background: #131D40; border: 1px solid var(--line-strong);
  box-shadow: 0 18px 40px rgba(15,23,51,.55);
  z-index: 30; animation: mnFade .12s ease;
}

.mm-search { position: sticky; top: 0; background: #131D40; padding: 8px; border-bottom: 1px solid var(--line); }
.mm-search input {
  width: 100%; padding: 8px 10px; font-size: 13px;
  background: rgba(246,242,234,.05); border: 1px solid var(--line-strong);
  color: var(--ivory); outline: none;
}
.mm-search input:focus { border-color: rgba(59,217,219,.6); }
.mm-search input::placeholder { color: var(--mute); }

.mm-body { padding: 4px 0; }
.mm-group + .mm-group { border-top: 1px solid var(--line); }
.mm-head { padding: 10px 10px 6px; font-size: 10px; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; color: var(--mute); }

.model-opt {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; text-align: left;
  background: transparent; border: 0; color: var(--ivory); font-size: 13px; cursor: pointer;
}
.model-opt:hover { background: rgba(246,242,234,.06); }
.model-opt .mo-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-opt .mo-check { flex: none; width: 14px; height: 14px; display: grid; place-items: center; }
.model-opt.current { color: var(--turq); }

.mm-chip { flex: none; padding: 2px 6px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--mute); border: 1px solid var(--line-strong); }

.model-empty { padding: 14px 12px; font-size: 12px; color: var(--mute); line-height: 1.5; }
.mm-foot { position: sticky; bottom: 0; background: #131D40; padding: 8px 10px;
  border-top: 1px solid var(--line); font-size: 11px; color: var(--mute); }

@media (max-width: 860px) {
  .model-pill { max-width: 120px; padding: 0 8px; }
  /* Ancré à droite de la pastille : le menu ne peut pas déborder du bord de l'écran. */
  .model-menu { left: auto; right: 0; width: min(320px, calc(100vw - 32px)); }
  .model-opt { min-height: 40px; padding: 9px 10px; }
  .mm-search input { min-height: 38px; }
}

@media (max-width: 560px) {
  /* Téléphone : la pastille est dans la rangée d'outils, trop à gauche pour ancrer un menu de 320 px.
     On se cale alors sur la zone de saisie elle-même (#model-picker passe en position statique). */
  #model-picker { position: static; flex: 0 1 auto; min-width: 0; }
  .model-pill { max-width: 140px; }
  .model-menu { left: 0; right: 0; width: auto; max-height: min(360px, 50dvh); }
}
