/* ---- Compaction du contexte (m2-compaction) -------------------------------
   QUOI : marqueur « Contexte compacté » du fil (compaction_marker.dart) et bouton « Compacter »
   de la topbar (compact_button.dart).
   POURQUOI ce dessin : une séparation pleine largeur, discrète (texte atténué, filets qui
   s'estompent), qui se lit comme une coupure du contexte et non comme un message. */

.compaction { margin: var(--space-4) 0; color: var(--color-text-muted); font-size: var(--text-sm); }
.compaction__toggle { list-style: none; display: flex; align-items: center; gap: var(--space-2); cursor: pointer; padding: var(--space-2) 0; border-radius: var(--radius-sm); }
.compaction__toggle::-webkit-details-marker { display: none; }
/* Filets de part et d'autre : la ligne de coupure, centrée sur le libellé. */
.compaction__toggle::before, .compaction__toggle::after { content: ""; flex: 1; height: 1px; background: var(--color-border-strong); }
.compaction__toggle:hover { color: var(--color-text); }
.compaction__label { font-weight: var(--weight-medium); }
.compaction__meta { color: var(--color-text-subtle); }
.compaction__meta::before { content: "·"; margin-right: var(--space-2); }
.compaction__body {
  white-space: pre-wrap; overflow-wrap: anywhere; line-height: var(--leading-relaxed);
  padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-surface); color: var(--color-text);
}
.compaction[open] .compaction__body { animation: nx-unfold var(--duration-enter) var(--ease-standard) both; }
.compaction--pending { display: flex; align-items: center; justify-content: center; gap: var(--space-2); }
.compaction--pending .nx-icon { animation: nx-compaction-pulse 1.2s var(--ease-standard) infinite; }
@keyframes nx-compaction-pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .compaction--pending .nx-icon { animation: none; } }

/* Bouton de la topbar : même gabarit pilule que .layout-toggle (compare.css). */
.compact-btn { 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); color: inherit; cursor: pointer; font-size: var(--text-sm); font-weight: var(--weight-medium); white-space: nowrap; transition: background-color var(--duration-fast) var(--ease-standard); }
.compact-btn:hover:not(:disabled) { background: var(--color-surface-2); }
.compact-btn:disabled { cursor: default; opacity: 0.5; }
.compact-btn__icon { color: var(--color-text-muted); }
@media (max-width: 720px) {
  .compact-btn { width: var(--hit-target); height: var(--hit-target); padding: 0; justify-content: center; }
  .compact-btn > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
