/* Mode comparaison (multipane) — adapté de docs/design/mockups/css/panels.css (.nx-panes,
   .nx-pane*, .nx-pane-add, .nx-avatar-stack), shell.css (.nx-chip, .nx-btn--secondary) et
   thread.css (.nx-dots). Tokens uniquement, sauf valeurs de repli notées « repli ». */

/* ---- Topbar : bascule + pastille « N modèles » ---------------------------- */
.topbar__spacer { flex: 1; }
.topbar__chip { display: inline-flex; align-items: center; min-height: 28px; padding: 0 var(--space-2); border-radius: var(--radius-full); background: var(--color-surface-2); color: var(--color-text-muted); font-size: var(--text-xs); font-weight: var(--weight-medium); white-space: nowrap; }
.layout-toggle { display: inline-flex; align-items: center; gap: var(--space-2); flex: none; min-height: 32px; padding: 0 var(--space-3); border: 1px solid var(--color-border-strong); border-radius: var(--radius-full); background: var(--color-surface-raised); cursor: pointer; font-size: var(--text-sm); font-weight: var(--weight-medium); white-space: nowrap; transition: background-color var(--duration-fast) var(--ease-standard); }
.layout-toggle:hover { background: var(--color-surface-2); }
.layout-toggle__icon { color: var(--color-text-muted); }
/* Mobile : icône seule (le libellé reste lu via title + texte masqué visuellement). */
@media (max-width: 720px) {
  .topbar__chip { display: none; }
  .layout-toggle { width: var(--hit-target); height: var(--hit-target); padding: 0; justify-content: center; }
  .layout-toggle > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* ---- Rangée de panneaux --------------------------------------------------- */
/* Colonnes séparées par un filet de 1 px (le fond de la rangée transparaît dans le gap) ;
   au-delà de la largeur dispo, défilement horizontal avec accroche par panneau. */
.panes { flex: 1; min-height: 0; display: flex; gap: 1px; background: var(--color-border); overflow-x: auto; scroll-snap-type: x proximity; }
.pane { position: relative; flex: 1 1 0; min-width: var(--pane-min-width, 340px); display: flex; flex-direction: column; min-height: 0; background: var(--color-bg); scroll-snap-align: start; }
.pane[aria-busy="true"] .pane__header { box-shadow: inset 0 -2px 0 var(--color-focus-ring); }
.pane__header { display: flex; align-items: center; gap: var(--space-1); flex: none; height: 44px; padding: 0 var(--space-2); border-bottom: 1px solid var(--color-border); }
.pane__header .model-picker { min-width: 0; }
.pane__header .model-picker__trigger { min-height: 32px; background: none; }
.pane__header .model-picker__trigger:hover:not(:disabled) { background: var(--color-surface-2); border-color: transparent; }
.pane__spacer { flex: 1; }
.pane__btn { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 28px; height: 28px; border: 0; border-radius: var(--radius-md); background: none; color: var(--color-text-muted); cursor: pointer; font-size: var(--text-xs); }
.pane__btn:hover:not(:disabled) { background: var(--color-surface-2); color: var(--color-text); }
.pane__btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Menu du sélecteur ouvert vers le bas (en-tête de panneau). */
.model-picker--down .model-picker__menu { top: calc(100% + var(--space-2)); bottom: auto; }

/* ---- Statut ---------------------------------------------------------------- */
.pane-status { font-size: var(--text-xs); color: var(--color-text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pane-status--error { color: var(--color-danger); font-weight: var(--weight-medium); }
.pane-dots { display: inline-flex; gap: 3px; padding: 0 var(--space-1); }
.pane-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--color-accent); animation: pane-bounce 1.2s var(--ease-standard) infinite; }
.pane-dots i:nth-child(2) { animation-delay: 0.15s; }
.pane-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes pane-bounce { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* ---- Fil d'un panneau : colonne étroite, bulles pleine largeur ------------ */
.messages--pane { display: flex; flex-direction: column; padding: var(--space-4); }
.messages--pane .messages__col { width: 100%; }
.messages--pane .message__body { max-width: 100%; }
.messages__empty--pane { font-size: var(--text-sm); text-align: center; padding: 0 var(--space-4); }
.messages--pane .error-banner { width: 100%; margin: var(--space-4) 0 0; }

/* Ajouter un panneau : colonne de 56 px en bout de rangée. */
.pane-add { display: grid; place-items: center; flex: none; width: 56px; border: 0; background: var(--color-surface); color: var(--color-text-muted); cursor: pointer; font-size: var(--text-xl); transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard); }
.pane-add:hover { background: var(--color-surface-2); color: var(--color-text); }

/* ---- Composer commun : pile d'avatars des modèles destinataires ----------- */
.compare-chip { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 32px; padding: 0 var(--space-2) 0 var(--space-1); border-radius: var(--radius-full); background: var(--color-surface-2); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.compare-chip__stack { display: inline-flex; }
.compare-chip__stack .model-logo { margin-left: -6px; box-shadow: 0 0 0 2px var(--color-surface-raised); }
.compare-chip__stack .model-logo:first-child { margin-left: 0; }

/* Mobile : un panneau ≈ l'écran, on glisse de l'un à l'autre (maquette : défilement horizontal). */
@media (max-width: 720px) {
  .panes { scroll-snap-type: x mandatory; }
  .pane { min-width: min(var(--pane-min-width, 340px), 88vw); }
  .pane-add { width: 48px; }
}
@media (prefers-reduced-motion: reduce) { .pane-dots i { animation: none; opacity: 0.7; } }

/* Artefact ouvert dans un panneau : recouvre CE panneau seulement (scope par panneau). */
.pane > .nx-artifact { position: absolute; inset: 0; z-index: 2; inline-size: auto; block-size: auto; animation: none; }
