/* ============================================================
   AgenticOS, Hub Arnaud.
   Structure UX : dashboard AgenticOS de reference (video Hermes).
   Matiere : DA NEMEE (bleus ink/cobalt/glacier, Bodoni display,
   or rare) + panneaux liquid glass (lib du skill liquid-glass).
   Conformite WCAG 2.1 AAA maintenue : contrastes >= 7:1 (texte),
   cibles >= 44px, focus renforce, reduced motion.
   Contrastes verifies : ACCESSIBILITE.md.
   ============================================================ */

:root {
  /* Palette NEMEE, source DESIGN_TOKENS.md du portfolio */
  --blue-ink: #0c1e54;
  --blue-night: #122e7e;
  --blue-royal: #1e47be;   /* CTA cobalt : blanc dessus = 7.8:1 AAA */
  --blue-300: #93aae0;     /* voix secondaire sur sombre : 7.4:1 sur ink */
  --bg-ink: #08164a;
  --glacier: #eaf0fb;
  --off-white: #f5f8ff;
  --paper: #fbfcff;
  --gold: #c99a2e;         /* micro-interactions uniquement, jamais du texte */
  --gold-soft: #e8d6a6;

  /* Identites d'agents, toutes >= 7:1 sur blanc (texte et fond d'initiale) */
  --id-terra: #92400e;
  --id-green: #065f46;
  --id-blue: #1e40af;
  --id-purple: #5b21b6;
  --id-red: #991b1b;
  --id-pink: #9d174d;

  --font-display: "Bodoni Moda", "Didot", Georgia, serif;
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --track-mono: 0.18em;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --dur: 0.3s;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --target: 44px;
}

/* ---------- Theme NUIT NEMEE (defaut) : ink, cobalt, blanc pur ---------- */
:root,
:root[data-theme="nuit"] {
  --t-bg: var(--bg-ink);
  --t-surface: #0c1e54;
  --t-sidebar: #0a1a50;
  --t-line: rgba(147, 170, 224, 0.30);
  --t-line-soft: rgba(147, 170, 224, 0.14);
  --t-fg: #ffffff;                 /* 19:1 sur ink, regle blanc pur */
  --t-fg-strong: #ffffff;
  --t-accent: var(--blue-300);     /* 7.4:1 sur ink */
  --t-accent-strong: #c9d6f2;      /* labels sidebar : 11.8:1 */
  --t-accent-fill: var(--blue-royal);   /* CTA cobalt */
  --t-accent-fill-fg: #ffffff;          /* 7.8:1 */
  --t-cta-hover: #3358d8;
  --t-bubble-user: var(--blue-royal);
  --t-bubble-user-fg: #ffffff;
  --t-ok: #ffffff;
  --t-pending: var(--gold-soft);   /* 11.9:1 */
  --t-error: #ffb4ab;              /* 10.1:1 */
  --t-focus: #ffffff;
  --t-chip-bg: rgba(147, 170, 224, 0.12);
  --t-glass-border: rgba(255, 255, 255, 0.22);
  --t-glass-tint-a: rgba(8, 22, 74, 0.30);
  --t-glass-tint-b: rgba(8, 22, 74, 0.55);
  --t-grain: 0.05;
}

/* ---------- Theme GLACIER : application litterale de la DA ---------- */
:root[data-theme="glacier"] {
  --t-bg: var(--glacier);
  --t-surface: var(--paper);
  --t-sidebar: #e2eaf9;
  --t-line: #c4d2ec;
  --t-line-soft: #dce6f7;
  --t-fg: var(--blue-ink);         /* 13.8:1 */
  --t-fg-strong: #08164a;
  --t-accent: var(--blue-night);   /* 10.7:1 */
  --t-accent-strong: var(--blue-ink);
  --t-accent-fill: var(--blue-royal);   /* CTA cobalt, blanc 7.8:1 */
  --t-accent-fill-fg: #ffffff;
  --t-cta-hover: var(--blue-night);
  --t-bubble-user: var(--blue-royal);
  --t-bubble-user-fg: #ffffff;
  --t-ok: var(--blue-ink);
  --t-pending: #5c4400;            /* 9.4:1 */
  --t-error: #8c1d18;              /* 8.0:1 */
  --t-focus: var(--blue-ink);
  --t-chip-bg: #dce6f7;
  --t-glass-border: rgba(255, 255, 255, 0.7);
  --t-glass-tint-a: rgba(245, 248, 255, 0.35);
  --t-glass-tint-b: rgba(234, 240, 251, 0.65);
  --t-grain: 0.03;
}

/* ---------- Logos de poles : marques clientes sur pastille claire ---------- */
.pole-logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.5rem; height: 1.5rem; flex: none;
  background: #ffffff;
  border: 1px solid var(--t-glass-border);
  border-radius: 6px;
  padding: 2px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.8);
  overflow: hidden;
}
.pole-logo img, .pole-logo svg {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.pole-logo-md { width: 1.875rem; height: 1.875rem; border-radius: 7px; padding: 3px; }
.pole-logo-lg { width: 2.5rem; height: 2.5rem; border-radius: 9px; padding: 4px; }
.pole-logo-xl { width: 4rem; height: 4rem; border-radius: 14px; padding: 8px; }
.avatar-row a:hover .pole-logo { box-shadow: 0 0 0 2px var(--blue-royal); }

/* ---------- Icones Lucide ---------- */
.ic { width: 1.125rem; height: 1.125rem; flex: none; display: block; }
.glyph { display: inline-flex; align-items: center; justify-content: center; }
.glyph .ic { width: 1.125rem; height: 1.125rem; }
.sub-link .ic { width: 1rem; height: 1rem; }
.btn .ic { width: 1.0625rem; height: 1.0625rem; }
.btn-primary .ic { width: 1.125rem; height: 1.125rem; }
.btn-icon .ic, .btn-media .ic { width: 1.25rem; height: 1.25rem; }
.status .ic { width: 0.875rem; height: 0.875rem; stroke-width: 2.25; }
.status-running .ic { animation: hub-spin 1.1s linear infinite; }
.channel-name .ic { width: 1.125rem; height: 1.125rem; color: var(--t-accent); }
.mention-pop .ic { width: 1rem; height: 1rem; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(52rem 36rem at 82% -8%, rgba(51, 88, 216, 0.22), transparent 60%),
    radial-gradient(40rem 30rem at -10% 108%, rgba(30, 71, 190, 0.16), transparent 55%),
    radial-gradient(24rem 18rem at 65% 85%, rgba(201, 154, 46, 0.05), transparent 60%),
    var(--t-bg);
  background-attachment: fixed;
  color: var(--t-fg);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
}

p, li { max-width: 76ch; }

a { color: var(--t-accent); text-decoration: underline; text-underline-offset: 0.2em; }
a:hover { color: var(--t-fg-strong); }

:focus-visible {
  outline: 3px solid var(--t-focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--t-accent-fill); color: var(--t-accent-fill-fg);
  padding: 0.75rem 1.25rem; border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: 0.8125rem;
  letter-spacing: var(--track-mono); text-transform: uppercase;
  text-decoration: none;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; border: 0; clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap;
}

/* ---------- Squelette : sidebar + contenu ---------- */
/* Grain NEMEE, purement decoratif */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: var(--t-grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
  z-index: 40;
}

.app {
  display: grid;
  grid-template-columns: 16.5rem 1fr;
  min-height: 100vh;
}
/* (la variante etroite est definie en fin de fichier, apres les regles de base) */

/* ---------- Sidebar ---------- */
.sidebar {
  background: linear-gradient(180deg, var(--t-glass-tint-a), var(--t-glass-tint-b));
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border-right: 1px solid var(--t-glass-border);
  padding: 1rem 0.875rem 2rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}

.workspace {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.375rem 0.5rem 1rem;
}
.workspace .logo {
  width: 2.25rem; height: 2.25rem; flex: none;
  display: grid; place-items: center;
  background: var(--blue-royal); color: #ffffff;
  transition: background var(--dur) var(--ease);
  border-radius: 8px;
  font-family: var(--font-mono); font-weight: 500; font-size: 0.9375rem;
  border-radius: var(--r-sm);
}
.workspace:hover .logo { background: var(--gold); } /* la micro-interaction doree, la seule */
.workspace .logo svg { width: 1.25rem; height: 1.25rem; }
.workspace .names strong {
  display: block;
  font-family: var(--font-display); font-weight: 400;
  text-transform: uppercase; letter-spacing: 0.09em;
  font-size: 1rem; line-height: 1.25;
}
.workspace .names span {
  font-family: var(--font-mono); font-size: 0.6875rem;
  letter-spacing: var(--track-mono); text-transform: uppercase; color: var(--t-accent);
}

.side-label {
  font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 500;
  letter-spacing: var(--track-mono); text-transform: uppercase;
  color: var(--t-accent-strong); margin: 1.25rem 0.5rem 0.375rem;
}

.side-nav { list-style: none; margin: 0; padding: 0; }
.side-nav a, .side-nav button {
  display: flex; align-items: center; gap: 0.625rem;
  width: 100%; min-height: var(--target);
  padding: 0.5rem 0.625rem;
  border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 0.9375rem; color: var(--t-fg);
  border-radius: var(--r-sm); text-decoration: none; text-align: left;
}
.side-nav a:hover, .side-nav button:hover { background: var(--t-line-soft); }
.side-nav a[aria-current="page"] {
  background: var(--t-chip-bg); color: var(--t-accent);
  font-weight: 600; text-decoration: underline; text-underline-offset: 0.25em;
}
.side-nav .glyph { width: 1.5rem; flex: none; color: var(--t-accent); }

.side-nav ul { list-style: none; margin: 0; padding: 0 0 0 1.5rem; }
.side-nav .sub-link { font-size: 0.875rem; min-height: 2.5rem; color: var(--t-accent); }

/* Rangee d'avatars des agents d'un pole */
.avatar-row { display: flex; flex-wrap: wrap; gap: 0.125rem; padding: 0.25rem 0.25rem 0.5rem; }
.avatar-row a {
  display: grid; place-items: center;
  min-width: var(--target); min-height: var(--target);
  border-radius: var(--r-sm);
}
.avatar-row a:hover { background: var(--t-line-soft); }
.avatar {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  width: 1.75rem; height: 1.75rem; flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  color: #ffffff; font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500;
}
.avatar-lg { width: 2.5rem; height: 2.5rem; font-size: 1rem; border-radius: var(--r-md); }

.topbar .nav-toggle { display: none; flex: none; }
.nav-scrim { display: none; }

/* ---------- Contenu ---------- */
.content { padding: 0; min-width: 0; }

.topbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem;
  min-height: 4.25rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--t-line);
  position: relative; z-index: 5;
}
.breadcrumb {
  min-width: 0; overflow-wrap: anywhere;
  font-family: var(--font-mono); font-size: 0.75rem;
  letter-spacing: var(--track-mono); text-transform: uppercase;
  color: var(--t-accent); margin: 0;
}
.topbar .actions { margin-left: auto; display: flex; gap: 0.5rem; }

.view { padding: 1.5rem; }

h1.page-title {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: clamp(1.625rem, 3.2vw, 2.375rem);
  line-height: 1.15; margin: 0 0 0.375rem;
}
h1.page-title:focus { outline: none; }
.page-sub { margin: 0 0 1.5rem; }

h2.section-label {
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500;
  letter-spacing: var(--track-mono); text-transform: uppercase;
  color: var(--t-accent); margin: 1.75rem 0 0.75rem;
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: var(--target); min-width: var(--target);
  padding: 0.5rem 1.125rem;
  font: inherit; font-size: 0.9375rem; font-weight: 500;
  border-radius: 12px;
  border: 1px solid var(--t-glass-border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.12));
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  backdrop-filter: blur(10px) saturate(1.4);
  color: var(--t-fg);
  cursor: pointer;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.65),
    0 2px 8px rgba(12, 30, 84, 0.10);
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.24));
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.8),
    0 4px 14px rgba(12, 30, 84, 0.16);
}
:root[data-theme="nuit"] .btn {
  background: linear-gradient(180deg, rgba(147, 170, 224, 0.20), rgba(147, 170, 224, 0.06));
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.22),
    0 2px 10px rgba(4, 10, 35, 0.4);
}
:root[data-theme="nuit"] .btn:hover {
  background: linear-gradient(180deg, rgba(147, 170, 224, 0.30), rgba(147, 170, 224, 0.10));
}
.btn-primary {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 45%),
    rgba(30, 71, 190, 0.88);
  -webkit-backdrop-filter: blur(8px) saturate(1.4);
  backdrop-filter: blur(8px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.38);
  color: #ffffff;
  font-weight: 600;
  min-height: 3rem;
  padding: 0.625rem 1.5rem;
  letter-spacing: 0.02em;
  border-radius: 12px;
  box-shadow:
    0 6px 18px rgba(30, 71, 190, 0.4),
    inset 0 1px 1px rgba(255, 255, 255, 0.5),
    inset 0 -6px 14px rgba(255, 255, 255, 0.06);
}
.btn-primary:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 45%),
    rgba(51, 88, 216, 0.92);
  border-color: rgba(255, 255, 255, 0.5);
  color: #ffffff;
  box-shadow:
    0 8px 26px rgba(30, 71, 190, 0.55),
    inset 0 1px 1px rgba(255, 255, 255, 0.6);
}
:root[data-theme="glacier"] .btn-primary { background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0) 45%),
    #1e47be; }
:root[data-theme="glacier"] .btn-primary:hover { background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 45%),
    #122e7e; }
.btn[aria-pressed="true"] { background: var(--t-accent-fill); color: var(--t-accent-fill-fg); border-color: var(--t-accent-fill); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-sm { min-height: var(--target); padding: 0.375rem 0.875rem; font-size: 0.875rem; }

/* ---------- Cartes et stats ---------- */
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }

.card {
  background: linear-gradient(180deg, var(--t-glass-tint-a), var(--t-glass-tint-b));
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  backdrop-filter: blur(12px) saturate(1.4);
  border: 1px solid var(--t-glass-border);
  border-radius: var(--r-lg);
  padding: 1.125rem 1.25rem;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 8px 24px rgba(12, 30, 84, 0.10);
}
.card h3 { font-size: 1.0625rem; font-weight: 600; margin: 0 0 0.25rem; }

.stat-value { font-family: var(--font-display); font-size: 2.5rem; font-weight: 400; line-height: 1.1; }
.stat-label {
  font-family: var(--font-mono); font-size: 0.6875rem;
  letter-spacing: var(--track-mono); text-transform: uppercase; color: var(--t-accent);
}

.chips { display: flex; flex-wrap: wrap; gap: 0.375rem; margin: 0.5rem 0; padding: 0; list-style: none; }
.chip {
  font-family: var(--font-mono); font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  background: var(--t-chip-bg); color: var(--t-accent);
  border: 1px solid var(--t-line); border-radius: 999px;
}
.role-chip {
  display: inline-block;
  font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 500;
  letter-spacing: var(--track-mono); text-transform: uppercase;
  color: var(--t-accent);
}

/* ---------- Statuts : pastilles pleines tres visibles ----------
   Volontairement hors palette NEMEE (demande d'Arnaud) : la lisibilite
   d'etat prime sur la DA. Texte ink sur fonds vifs, 7.2:1 minimum. */
.status {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.04em; white-space: nowrap;
  padding: 0.22rem 0.7rem; border-radius: 999px;
  color: #08164a; border: 1.5px solid transparent;
}
.status-done, .status-on { background: #4ade80; border-color: #16a34a; }
.status-pending_validation, .status-queued { background: #ffc53d; border-color: #b45309; }
.status-running { background: #7dd3fc; border-color: #0369a1; }
.status-error { background: #ff9c9c; border-color: #991b1b; }
.status-off { background: transparent; color: var(--t-accent); border-color: var(--t-line); }
@keyframes hub-spin { to { transform: rotate(360deg); } }

/* ---------- Channel : 2 colonnes sessions + fil ---------- */
.channel {
  display: grid;
  grid-template-columns: 15rem 1fr;
  min-height: calc(100vh - 8.5rem);
  gap: 0;
}
@media (max-width: 66rem) { .channel { grid-template-columns: 1fr; } }

.sessions-col {
  border-right: 1px solid var(--t-glass-border);
  padding: 1rem 0.875rem;
  background: linear-gradient(180deg, var(--t-glass-tint-a), var(--t-glass-tint-b));
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  backdrop-filter: blur(12px) saturate(1.3);
}
.sessions-col .btn { width: 100%; margin-bottom: 0.75rem; }
.sessions-list { list-style: none; margin: 0; padding: 0; }
.sessions-list button {
  display: block; width: 100%; text-align: left;
  border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 0.875rem; color: var(--t-fg);
  min-height: var(--target); padding: 0.5rem 0.625rem;
  border-radius: var(--r-sm);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sessions-list button:hover { background: var(--t-line-soft); }
.sessions-list button[aria-current="true"] { background: var(--t-chip-bg); color: var(--t-accent); font-weight: 600; }

.thread-col { display: flex; flex-direction: column; min-width: 0; }
.thread {
  flex: 1; overflow-y: auto;
  padding: 1.5rem;
  display: flex; flex-direction: column; gap: 1.25rem;
}

.thread-empty {
  margin: auto; text-align: center; max-width: 34rem; padding: 2rem;
}
.thread-empty .empty-mark { display: flex; justify-content: center; margin: 0 0 1rem; }

/* Message utilisateur : bulle verte a droite */
.msg-user { align-self: flex-end; max-width: 46rem; }
.msg-user .bubble {
  background: var(--t-bubble-user); color: var(--t-bubble-user-fg);
  border-radius: var(--r-lg); border-end-end-radius: var(--r-sm);
  padding: 0.75rem 1.125rem;
}
.msg-user .meta { text-align: right; }

/* Tour d'agent : bloc a gauche */
.msg-agent { align-self: stretch; max-width: 52rem; }
.msg-agent .turn {
  background: var(--t-surface);
  border: 1px solid var(--t-line);
  border-radius: var(--r-lg);
  padding: 1rem 1.25rem;
}
.msg-head { display: flex; align-items: center; gap: 0.625rem; margin-bottom: 0.5rem; }
.msg-head .who { font-weight: 600; }
.meta {
  font-family: var(--font-mono); font-size: 0.75rem;
  color: var(--t-accent); margin: 0.25rem 0 0;
}

.narration { border: 1px solid var(--t-line-soft); border-radius: var(--r-md); margin: 0.625rem 0; }
.narration summary {
  cursor: pointer; min-height: var(--target);
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500;
  letter-spacing: var(--track-mono); text-transform: uppercase; color: var(--t-accent);
}
.narration ol { margin: 0; padding: 0 1.25rem 0.875rem 2.25rem; }
.narration li { font-size: 0.9375rem; margin-bottom: 0.375rem; }
.narration .ping { color: var(--t-accent); font-weight: 600; }

.msg-agent .answer { white-space: pre-wrap; word-break: break-word; margin: 0.5rem 0 0; }

/* Composer */
.composer {
  border-top: 1px solid var(--t-line);
  background: var(--t-surface);
  padding: 1rem 1.5rem;
  position: relative;
}
/* Une seule rangee, tous les controles centres sur la meme ligne.
   Le textarea grandit tout seul (JS), donc pas de poignee de resize. */
.composer form {
  display: flex;
  gap: 0.5rem;
  align-items: center;   /* et non flex-end : c'est ce qui desalignait tout */
}
.composer .composer-field { flex: 1 1 12rem; min-width: 0; display: flex; }
.composer textarea {
  flex: 1;
  min-height: var(--target);
  height: var(--target);
  max-height: 9rem;
  resize: none;          /* la poignee creait le decrochage en bas a droite */
  overflow-y: auto;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
  line-height: 1.45;
}
.composer .btn { flex: none; }

/* Popup de mention */
.mention-pop {
  position: absolute; bottom: calc(100% - 0.25rem); left: 1.5rem;
  background: var(--t-surface); border: 1px solid var(--t-line);
  border-radius: var(--r-md); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  min-width: 20rem; max-height: 18rem; overflow-y: auto; z-index: 20;
  padding: 0.375rem;
}
.mention-pop .pop-label {
  font-family: var(--font-mono); font-size: 0.6875rem;
  letter-spacing: var(--track-mono); text-transform: uppercase;
  color: var(--t-accent); padding: 0.375rem 0.625rem;
}
.mention-pop [role="option"] {
  display: flex; align-items: center; gap: 0.625rem;
  width: 100%; min-height: var(--target);
  padding: 0.375rem 0.625rem; border: 0; background: transparent;
  font: inherit; font-size: 0.875rem; color: var(--t-fg);
  border-radius: var(--r-sm); cursor: pointer; text-align: left;
}
.mention-pop [role="option"]:hover,
.mention-pop [role="option"][aria-selected="true"] { background: var(--t-chip-bg); }

/* ---------- Page agent : outil + onglets ---------- */
.agent-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }

.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--t-line); margin: 0 0 1.25rem; flex-wrap: wrap; }
.tabs [role="tab"] {
  border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 0.9375rem; color: var(--t-fg);
  min-height: var(--target); padding: 0.5rem 1rem;
  border-bottom: 3px solid transparent;
}
.tabs [role="tab"]:hover { background: var(--t-line-soft); }
.tabs [role="tab"][aria-selected="true"] {
  color: var(--t-accent); font-weight: 600;
  border-bottom-color: var(--t-accent-fill);
}

.tool-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); }
.tool-card {
  background: linear-gradient(180deg, var(--t-glass-tint-a), var(--t-glass-tint-b));
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  backdrop-filter: blur(12px) saturate(1.4);
  border: 1px solid var(--t-glass-border);
  border-radius: var(--r-lg); padding: 1rem 1.125rem;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5);
}
.tool-card .excerpt { font-size: 0.9375rem; margin: 0.375rem 0; }
.tool-card pre {
  white-space: pre-wrap; word-break: break-word;
  font-family: var(--font-mono); font-size: 0.8125rem;
  background: var(--t-bg); border-radius: var(--r-sm);
  padding: 0.625rem 0.75rem; margin: 0.5rem 0 0;
  max-height: 14rem; overflow-y: auto;
}

pre.file-view {
  white-space: pre-wrap; word-break: break-word;
  font-family: var(--font-mono); font-size: 0.8125rem;
  background: var(--t-surface); border: 1px solid var(--t-line);
  border-radius: var(--r-md); padding: 1rem;
}

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--t-line); border-radius: var(--r-lg); background: var(--t-surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; }
caption {
  text-align: left; padding: 0.75rem 1rem;
  font-family: var(--font-mono); font-size: 0.6875rem;
  letter-spacing: var(--track-mono); text-transform: uppercase; color: var(--t-accent);
}
th, td { text-align: left; padding: 0.7rem 1rem; border-top: 1px solid var(--t-line-soft); vertical-align: top; }
th {
  font-family: var(--font-mono); font-weight: 500; font-size: 0.6875rem;
  letter-spacing: var(--track-mono); text-transform: uppercase;
}
td code, .mono { font-family: var(--font-mono); font-size: 0.8125rem; }

/* ---------- Formulaires ---------- */
label {
  display: block;
  font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 500;
  letter-spacing: var(--track-mono); text-transform: uppercase;
  color: var(--t-accent); margin: 0 0 0.375rem;
}
input, select, textarea {
  width: 100%; min-height: var(--target);
  padding: 0.6rem 0.75rem; font: inherit;
  color: var(--t-fg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.08));
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--t-glass-border); border-radius: 12px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5);
}
:root[data-theme="nuit"] input,
:root[data-theme="nuit"] select,
:root[data-theme="nuit"] textarea {
  background: linear-gradient(180deg, rgba(147, 170, 224, 0.16), rgba(147, 170, 224, 0.05));
}
textarea { min-height: 6.5rem; }
input::placeholder, textarea::placeholder { color: var(--t-accent); opacity: 1; }
.field { margin: 0 0 1.125rem; }
.hint { font-size: 0.875rem; margin: 0.3rem 0 0; }
.checkbox-row { display: flex; align-items: center; gap: 0.75rem; }
.checkbox-row input[type="checkbox"] { width: 1.5rem; height: 1.5rem; min-height: 0; flex: none; accent-color: var(--t-accent-fill); }
.checkbox-row label { margin: 0; }

details.block {
  border: 1px solid var(--t-glass-border); border-radius: var(--r-lg); margin: 0 0 1.25rem;
  background: linear-gradient(180deg, var(--t-glass-tint-a), var(--t-glass-tint-b));
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  backdrop-filter: blur(10px) saturate(1.3);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5);
}
details.block > summary {
  cursor: pointer; min-height: var(--target);
  display: flex; align-items: center; padding: 0.5rem 1.125rem;
  font-weight: 600; font-size: 0.9375rem;
}
details.block > div { padding: 0.25rem 1.125rem 1.125rem; }

/* ---------- Dialog ---------- */
dialog {
  background: var(--t-surface); color: var(--t-fg);
  border: 1px solid var(--t-line); border-radius: var(--r-lg);
  padding: 1.75rem; max-width: 30rem; width: calc(100% - 2rem);
}
dialog::backdrop { background: rgba(10, 20, 15, 0.55); }
dialog h2 {
  margin: 0 0 0.375rem; font-size: 1.375rem;
  font-family: var(--font-display); font-weight: 400;
  text-transform: uppercase; letter-spacing: 0.05em;
}
dialog .dialog-sub { margin: 0 0 1.25rem; font-size: 0.9375rem; }

[role="status"] { min-height: 1.5rem; }
.error-text { color: var(--t-error); }
.error-text::before { content: "✕ "; }

/* ---------- Liquid glass (lib liquid-glass.js, skill maison) ----------
   .glass-panel : la lib pose le backdrop-filter (refraction Chromium,
   givre Safari/Firefox). Ici : la matiere qui fait lire "verre". */
.glass-panel {
  background: linear-gradient(180deg, var(--t-glass-tint-a), var(--t-glass-tint-b)) !important;
  border: 0 !important;
  border-radius: 16px;
}
/* Les headers restent a angles droits : pas de radius sur le fil d'Ariane
   ni sur le header de channel (demande d'Arnaud) */
.topbar.glass-panel, .channel-head.glass-panel {
  border-radius: 0;
  box-shadow:
    0 12px 30px rgba(4, 10, 35, 0.35),
    inset 0 -1px 0 rgba(255, 255, 255, 0.14);
  box-shadow:
    0 20px 50px rgba(4, 10, 35, 0.45),
    inset 0 1px 1px rgba(255, 255, 255, 0.45),
    inset 0 -8px 20px rgba(255, 255, 255, 0.05),
    inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}
:root[data-theme="glacier"] .glass-panel {
  box-shadow:
    0 16px 40px rgba(12, 30, 84, 0.18),
    inset 0 1px 1px rgba(255, 255, 255, 0.85),
    inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}
.lg-fallback { background: linear-gradient(180deg, var(--t-glass-tint-a), var(--t-glass-tint-b)) !important; }

/* Verre leger sans SVG pour les elements re-rendus souvent (cartes stats) */
.glass-lite {
  background: linear-gradient(180deg, var(--t-glass-tint-a), var(--t-glass-tint-b));
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  backdrop-filter: blur(10px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
}
:root[data-theme="glacier"] .glass-lite { border-color: rgba(255, 255, 255, 0.6); }

/* ---------- Header de channel ---------- */
.channel-head {
  display: flex; align-items: center; gap: 0.75rem;
  min-height: 4rem;
  padding: 0.625rem 1.5rem;
  border-bottom: 1px solid var(--t-line);
  background: var(--t-surface);
}
.channel-name {
  margin: 0; font-family: var(--font-display); font-weight: 400;
  text-transform: uppercase; letter-spacing: 0.06em; font-size: 1.1875rem;
  display: flex; align-items: center; gap: 0.5rem;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.channel-actions { flex: none; }
.channel-name span { color: var(--t-accent); margin-right: 0.25rem; }
.channel-actions { margin-left: auto; display: flex; gap: 0.375rem; }
.btn-icon {
  width: var(--target); height: var(--target);
  min-width: var(--target); min-height: var(--target);
  padding: 0; font-size: 1rem;
}
.btn-danger { color: var(--t-error); border-color: var(--t-error); }
.btn-danger:hover { background: var(--t-error); color: #ffffff; }

/* ---------- Indicateur de travail ---------- */
.working-chip {
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.22rem 0.7rem;
  background: #7dd3fc; color: #08164a;
  border: 1.5px solid #0369a1; border-radius: 999px;
}
.working-chip .dots { display: inline-block; animation: hub-dots 1.2s steps(4, end) infinite; }
@keyframes hub-dots {
  0% { clip-path: inset(0 100% 0 0); }
  100% { clip-path: inset(0 -0.5ch 0 0); }
}

/* ---------- Detail du travail : liste cle valeur ---------- */
.kv { list-style: none; margin: 0; padding: 0 1.25rem 0.875rem; }
.kv li { font-size: 0.9375rem; margin-bottom: 0.25rem; }
.kv code {
  font-family: var(--font-mono); font-size: 0.8125rem;
  background: var(--t-chip-bg); border-radius: var(--r-sm);
  padding: 0.1rem 0.4rem;
}

/* ---------- Barre d outil de la page agent ---------- */
.tool-bar {
  display: flex; flex-wrap: wrap; gap: 0.625rem; align-items: center;
  margin: 0 0 1.25rem;
}
.tool-bar .field { flex: 1 1 10rem; min-width: 0; }
.tool-bar .btn { flex: none; }
.tool-tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.tool-tab {
  display: inline-flex; align-items: center; gap: 0.35rem;
  border: 1.5px solid var(--t-line); background: var(--t-surface);
  color: var(--t-fg); font: inherit; font-size: 0.875rem;
  height: var(--target); min-height: var(--target);
  padding: 0 0.875rem; white-space: nowrap;
  border-radius: 999px; cursor: pointer;
}
.tool-tab:hover { background: var(--t-line-soft); }
.tool-tab[aria-pressed="true"] {
  background: var(--t-accent-fill); border-color: var(--t-accent-fill);
  color: var(--t-accent-fill-fg); font-weight: 600;
}

/* ---------- Pied des popups ---------- */
.pop-footer { border-top: 1px solid var(--t-line-soft); margin-top: 0.25rem; }

/* ---------- Responsive ---------- */

/* Tablette et mobile : la sidebar devient un tiroir, le contenu reste visible */
@media (max-width: 60rem) {
  .app { grid-template-columns: 1fr; }
  .topbar .nav-toggle { display: inline-flex; }

  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(20rem, 86vw);
    height: 100vh;
    overflow-y: auto;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform var(--dur) var(--ease);
    border-right: 1px solid var(--t-glass-border);
    border-bottom: 0;
    box-shadow: 0 0 40px rgba(4, 10, 35, 0.35);
  }
  .sidebar[data-open="true"] { transform: none; }

  .nav-scrim {
    display: block;
    position: fixed; inset: 0;
    background: rgba(8, 22, 74, 0.55);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    z-index: 55;
  }
  .nav-scrim[hidden] { display: none; }

  .topbar { position: static; }
  .channel { grid-template-columns: 1fr; min-height: 0; }
  .sessions-col { border-right: 0; border-bottom: 1px solid var(--t-glass-border); }
  .sessions-list { display: flex; flex-wrap: wrap; gap: 0.25rem; }
  .sessions-list li { flex: 0 1 auto; }
  .sessions-list button { max-width: 13rem; }
  .thread { min-height: 40vh; }
}

/* Mobile : le composer passe en deux rangees, les libelles s'effacent */
@media (max-width: 48rem) {
  /* La topbar tient sur une seule ligne */
  .topbar { flex-wrap: nowrap; min-height: 3.75rem; }
  .breadcrumb {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    overflow-wrap: normal;
    direction: rtl; text-align: left;   /* on tronque le debut, pas la page courante */
  }
  .topbar .actions { flex: none; }
  .topbar .btn-primary { padding: 0.5rem 0.875rem; min-height: var(--target); }
  .view { padding: 1rem; }
  .topbar { padding: 0.75rem 1rem; }
  .channel-head { padding: 0.625rem 1rem; }
  .thread { padding: 1rem; }
  .composer { padding: 0.75rem 1rem; }

  .composer form { flex-wrap: wrap; }
  .composer .composer-field { flex: 1 1 100%; order: -1; }
  .composer .attach-bar { flex: 1 1 auto; }
  .composer .btn-primary { flex: 0 0 auto; margin-left: auto; }

  .msg-user, .msg-agent { max-width: 100%; }
  .tool-bar .field { flex: 1 1 100%; }
  .tool-bar .btn { flex: 1 1 auto; }
  .grid { grid-template-columns: 1fr; }
  .mention-pop { left: 1rem; right: 1rem; min-width: 0; }
}

/* Petit mobile : on gagne encore de la place */
@media (max-width: 30rem) {
  .workspace .names strong { font-size: 0.9375rem; }
  h1.page-title { font-size: 1.5rem; }
  .channel-name { font-size: 1rem; }
  .table-wrap { border-radius: var(--r-md); }
  .btn-primary { padding: 0.625rem 1rem; }
}

/* ---------- Pieces jointes et voix ---------- */
.attach-bar { display: flex; gap: 0.375rem; align-items: center; flex: none; }
/* Un <label> stylise en bouton heritait de la marge basse de la regle globale
   label, ce qui le decalait de 3px vers le haut dans un flex centre. */
label.btn { margin: 0; text-transform: none; letter-spacing: normal; font-size: inherit; color: inherit; }
.btn-media {
  width: var(--target); height: var(--target);
  min-width: var(--target); min-height: var(--target);
  padding: 0; font-size: 1.05rem;
}
.btn-media[aria-pressed="true"] { background: var(--t-error); border-color: var(--t-error); color: #ffffff; }

.pending-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 0.625rem; padding: 0; }
.pending-chips li {
  display: inline-flex; align-items: center; gap: 0.5rem;
  border: 1px solid var(--t-line); border-radius: var(--r-md);
  padding: 0.25rem 0.375rem 0.25rem 0.625rem;
  font-family: var(--font-mono); font-size: 0.75rem; background: var(--t-surface);
}
.pending-chips img { width: 2rem; height: 2rem; object-fit: cover; border-radius: var(--r-sm); }
.pending-chips button { min-width: var(--target); min-height: var(--target); border: 0; background: transparent; cursor: pointer; font-size: 1rem; color: var(--t-error); }

.msg-attachments { display: flex; flex-wrap: wrap; gap: 0.625rem; margin: 0.625rem 0 0; }
.msg-attachments img { max-width: 18rem; max-height: 14rem; border-radius: var(--r-md); border: 1px solid var(--t-line); display: block; }
.msg-attachments audio { display: block; min-width: 16rem; }

.rec-indicator { font-family: var(--font-mono); font-size: 0.75rem; color: var(--t-error); }

/* ---------- Vue Equipe : workflow et organigramme ---------- */
.workflow { counter-reset: step; list-style: none; margin: 0 0 1.5rem; padding: 0; max-width: 46rem; }
.workflow li {
  position: relative; padding: 0.625rem 1rem 0.625rem 3.25rem; margin: 0 0 0.5rem;
  background: var(--t-surface); border: 1px solid var(--t-line); border-radius: var(--r-md);
}
.workflow li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%);
  width: 1.75rem; height: 1.75rem; display: grid; place-items: center;
  background: var(--t-accent-fill); color: var(--t-accent-fill-fg);
  border-radius: 999px; font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 500;
}

/* ---------- Arbre genealogique : racine en haut, branches en dessous ----------
   Pattern classique ul/li + pseudo-elements : chaque niveau est une rangee
   centree, les connecteurs en T se dessinent seuls. */
.org-scroll {
  overflow-x: auto;
  padding: 0.5rem 0 1.5rem;
}
.org-scroll:focus-visible { outline: 3px solid var(--t-focus); outline-offset: 2px; }

.gen-tree {
  width: max-content;   /* le centrage se fait par marges : l'overflow reste atteignable */
  margin: 0 auto;
  min-width: 100%;
  display: flex;
  justify-content: center;
}
.gen-tree ul {
  display: flex;
  align-items: flex-start;
  padding: 2.25rem 0 0;
  margin: 0;
  position: relative;
  list-style: none;
}
.gen-tree > ul { padding-top: 0; }
.gen-tree li {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding: 2.25rem 1rem 0;
}
.gen-tree > ul > li { padding-top: 0; }

/* Connecteurs : demi-traits horizontaux + descente verticale */
.gen-tree li::before,
.gen-tree li::after {
  content: "";
  position: absolute;
  top: 0;
  right: 50%;
  width: 50%;
  height: 2.25rem;
  border-top: 2px solid var(--t-line);
}
.gen-tree li::after {
  right: auto;
  left: 50%;
  border-left: 2px solid var(--t-line);
}
.gen-tree li:only-child::before, .gen-tree li:only-child::after { display: none; }
.gen-tree li:only-child { padding-top: 2.25rem; }
.gen-tree > ul > li:only-child { padding-top: 0; }
.gen-tree li:first-child::before { border-top: 0; }
.gen-tree li:last-child::after { border-top: 0; border-left: 2px solid var(--t-line); }
.gen-tree li:last-child::before { border-right: 2px solid var(--t-line); }
.gen-tree li:first-child::after { border-left: 2px solid var(--t-line); }
/* Descente depuis le parent vers la rangee des enfants */
.gen-tree ul ul::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  height: 2.25rem;
  border-left: 2px solid var(--t-line);
}

/* Noeud : carte compacte verticale, avatar en tete */
.gen-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  text-align: center;
  background: linear-gradient(180deg, var(--t-glass-tint-a), var(--t-glass-tint-b));
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  backdrop-filter: blur(12px) saturate(1.4);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.55), 0 6px 18px rgba(12, 30, 84, 0.10);
  border: 1px solid var(--t-glass-border);
  border-radius: var(--r-md);
  padding: 0.875rem 1rem;
  min-width: 10.5rem;
  max-width: 12.5rem;
}
.gen-node.is-root { border: 2px solid var(--blue-royal); }
.gen-node.is-manager { border-top: 4px solid var(--blue-royal); }
.gen-node .who-role { font-weight: 600; line-height: 1.3; }
.gen-node .who-name { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--t-accent); }
.org-pole-label {
  font-family: var(--font-mono); font-size: 0.625rem; font-weight: 600;
  letter-spacing: var(--track-mono); text-transform: uppercase;
  color: var(--t-accent-strong);
  padding: 0.12rem 0.5rem;
  border: 1px solid var(--t-line); border-radius: 999px;
}

.org-pole { margin: 0 0 1.5rem; }
.org-manager { border-inline-start: 4px solid var(--blue-royal); }
.org-workers { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); margin-top: 0.75rem; padding-left: 1.5rem; border-left: 2px solid var(--t-line); }
.org-card {
  background: var(--t-surface); border: 1px solid var(--t-line);
  border-radius: var(--r-md); padding: 0.875rem 1rem;
}
.org-card .who-role { font-weight: 600; }
.org-card .who-name { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--t-accent); }
.badge {
  font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.18rem 0.6rem; border-radius: 999px;
}
.badge-created { background: #4ade80; border: 1.5px solid #16a34a; color: #08164a; }
.badge-created::before { content: "✓ "; }
.badge-todo { background: #ffc53d; border: 1.5px solid #b45309; color: #08164a; }
.badge-todo::before { content: "○ "; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Serveur Minecraft ---------- */
.mc-grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
}
.mc-carte { margin: 0; }
.mc-valeur {
  font-family: var(--font-display, Georgia, serif);
  font-size: 2rem;
  line-height: 1.1;
  margin: 0.25rem 0 0.5rem;
}
.empty-team { margin-bottom: 1.5rem; }

/* ---------- Agent en train de réfléchir puis de parler ---------- */
.etat-agent {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.5rem;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cobalt, #1e47be);
}
.etat-agent .pulse {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--cobalt, #1e47be);
  animation: hub-pulse 1.4s ease-in-out infinite;
}
@keyframes hub-pulse {
  0%, 100% { transform: scale(0.7); opacity: 0.45; }
  50%      { transform: scale(1.15); opacity: 1; }
}

/* Le curseur qui suit le texte pendant que l'agent rédige. */
.en-cours .bubble::after {
  content: "";
  display: inline-block;
  width: 0.55ch;
  height: 1em;
  margin-left: 0.15em;
  vertical-align: text-bottom;
  background: currentColor;
  animation: hub-curseur 1s steps(2, end) infinite;
}
@keyframes hub-curseur { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.reflexion { margin: 0.4rem 0 0.6rem; }
.reflexion summary {
  cursor: pointer;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.75;
}
.reflexion-texte {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  line-height: 1.5;
  opacity: 0.8;
  white-space: pre-wrap;
}

/* Une animation ne doit jamais s'imposer : on la coupe si le systeme le
   demande, la lisibilite de l'etat reste assuree par le mot lui-meme. */
@media (prefers-reduced-motion: reduce) {
  .etat-agent .pulse,
  .en-cours .bubble::after { animation: none; }
  .en-cours .bubble::after { opacity: 1; }
}

/* Portrait d'agent : l'image couvre la pastille, la lettre disparait. */
.avatar-photo {
  background-size: cover;
  background-position: center top;
  color: transparent;
}

/* Bouton « Retenir » dans le pied d'un message d'Arnaud.
   Il vit dans la ligne de metadonnees, discret par defaut : ce n'est pas une
   action qu'on veut voir a chaque message, c'est une action qu'on veut
   trouver quand on la cherche. */
.lien-retenir {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  opacity: .55;
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}
.lien-retenir:hover:not(:disabled) { opacity: 1; }
.lien-retenir:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.lien-retenir:disabled { cursor: default; opacity: .85; text-decoration: none; }
