/* Sélecteur de modèle : déclencheur + menu groupé (ouvert vers le haut). */
.model-picker { position: relative; }
.model-picker__trigger { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 36px; max-width: 100%; padding: 0 var(--space-3) 0 var(--space-2); border: 1px solid transparent; border-radius: var(--radius-full); background: var(--color-surface-2); cursor: pointer; font-size: var(--text-sm); font-weight: var(--weight-medium); }
.model-picker__trigger:hover:not(:disabled) { border-color: var(--color-border-strong); }
.model-picker__trigger:disabled { opacity: 0.6; cursor: not-allowed; }
.model-picker__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-picker__chevron { color: var(--color-text-subtle); font-size: var(--text-xs); }
.model-picker__menu { position: absolute; bottom: calc(100% + var(--space-2)); left: 0; z-index: calc(var(--z-popover) + 1); min-width: 260px; max-width: min(360px, 90vw); max-height: min(60vh, 420px); overflow-y: auto; padding: var(--space-2); border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface-overlay); box-shadow: var(--shadow-lg); }
.model-picker__group { padding: var(--space-2) var(--space-2) var(--space-1); font-size: var(--text-xs); font-weight: var(--weight-semibold); text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-subtle); }
.model-picker__option { display: flex; align-items: center; gap: var(--space-2); width: 100%; min-height: 40px; padding: 0 var(--space-2); border: 0; border-radius: var(--radius-md); background: none; cursor: pointer; text-align: left; font-size: var(--text-sm); }
.model-picker__option:hover, .model-picker__option:focus-visible { background: var(--color-surface-2); }
.model-picker__option.is-selected { font-weight: var(--weight-medium); }
.model-picker__option .model-picker__name { flex: 1; }
.model-picker__check { color: var(--color-accent); }
.model-logo { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex: none; border-radius: var(--radius-full); font-size: 12px; font-weight: var(--weight-semibold); color: #fff; background: var(--color-text-muted); }
.model-logo--anthropic { background: #c15f3c; }
.model-logo--openai { background: #10a37f; }
.model-logo--google { background: #4285f4; }
.model-logo--meta { background: #0866ff; }
.model-logo--mistral { background: #fa520f; }
.model-logo--deepseek { background: #4d6bfe; }
.model-logo--stub { background: #7a5af8; }

/* ---- Beautify (m0-beautify) -------------------------------------------
   QUOI : the menu grows out of its trigger (scale .96 + fade + 4 px rise,
   origin bottom-left); options get a sliding fill, the selected one a violet
   tint + check; the chevron turns when open; logos get a lit edge.
   POURQUOI : continuity — the menu visibly comes FROM the chip.
   COMMENT : the menu is inserted on open, so an @keyframes on insertion is
   enough; the chevron reads aria-expanded set by model_picker.dart. */
.model-picker__trigger { transition: border-color var(--duration-fast) var(--ease-standard), background var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard); }
.model-picker__trigger:hover:not(:disabled) { background: var(--color-surface-raised); }
.model-picker__trigger:active:not(:disabled) { transform: scale(0.97); }
.model-picker__trigger[aria-expanded="true"] { border-color: var(--color-accent); background: var(--color-accent-soft); color: var(--color-accent-soft-text); }
.model-picker__chevron { display: inline-block; transition: transform var(--duration-base) var(--ease-standard); }
.model-picker__trigger[aria-expanded="true"] .model-picker__chevron { transform: rotate(180deg); color: inherit; }
.model-picker__menu { transform-origin: bottom left; animation: nx-pop-in var(--duration-enter) var(--ease-emphasized) both; box-shadow: var(--shadow-lg), var(--shadow-inset-highlight); }
.model-picker__option { transition: background var(--duration-fast) var(--ease-standard), padding var(--duration-fast) var(--ease-standard); }
.model-picker__option:hover, .model-picker__option:focus-visible { padding-left: var(--space-3); }
.model-picker__option.is-selected { background: var(--color-accent-soft); color: var(--color-accent-soft-text); }
.model-picker__check { color: inherit; font-weight: var(--weight-semibold); }
.model-logo { box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.25), 0 1px 2px var(--shadow-color); }
@keyframes nx-pop-in { from { opacity: 0; transform: translateY(4px) scale(0.96); } }

/* ---- Icons (m1-design-pass) --------------------------------------------
   QUOI : glyph characters replaced by .nx-icon masks (styles/icons.css). 
   COMMENT : chevron / check are mask icons in an inline-flex span, so the
   rotate-on-open of the chevron keeps its centre. */
.model-picker__chevron, .model-picker__check { display: inline-flex; align-items: center; }
