/* Copilote — interface
   Thème sombre par défaut, clair via le système ou le réglage (data-theme). */

@font-face {
  font-family: "Manrope";
  src: url("/polices/manrope.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --fond: #07080c;
  --fond-2: #0d0f16;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --surface-3: rgba(255, 255, 255, 0.12);
  --surface-opaque: #13151c;
  --bord: rgba(255, 255, 255, 0.08);
  --bord-fort: rgba(255, 255, 255, 0.16);
  --reflet-haut: rgba(255, 255, 255, 0.07);
  --ombre: 0 18px 50px rgba(0, 0, 0, 0.45);
  --texte: #f2f3f7;
  --texte-2: #a7abba;
  --texte-3: #8b91a3;
  --inverse: #07080c;
  /* Textes colorés (statuts, accents) : tels quels sur fond sombre, assombris sur fond clair pour rester lisibles. */
  --assombrir: 0%;
  --hausse: #2fbf88;
  --baisse: #f0795f;
  --grille: #23252e;
  --axe: #383a45;

  /* Une couleur par modèle — palette validée (daltonisme, contraste) pour les graphiques. */
  --m-haiku: #199e70;
  --m-sonnet: #9085e9;
  --m-opus: #d95926;
  --m-fable: #3987e5;
  --m-gemini: #d55181;

  /* États — jamais réutilisés pour autre chose, toujours avec icône et libellé. */
  --bon: #0ca30c;
  --bon-texte: #3ccf5a;
  --alerte: #fab219;
  --serieux: #ec835a;
  --critique: #d03b3b;
  --critique-texte: #ff7b7b;

  --accent: #8f7dff;
  --accent-2: #3ee0b0;
  --degrade-marque: linear-gradient(135deg, #8f7dff 0%, #5b8cff 45%, #3ee0b0 100%);

  --r-s: 10px;
  --r-m: 16px;
  --r-l: 24px;
  --r-xl: 32px;
  --flou: blur(22px) saturate(150%);
  --ressort: cubic-bezier(0.2, 0.9, 0.25, 1.15);
  --doux: cubic-bezier(0.2, 0.7, 0.2, 1);
  --haut-sur: env(safe-area-inset-top, 0px);
  --bas-sur: env(safe-area-inset-bottom, 0px);
  --largeur: 560px;

  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --fond: #f3f4f8;
    --fond-2: #e9ebf2;
    --surface: rgba(255, 255, 255, 0.62);
    --surface-2: rgba(255, 255, 255, 0.82);
    --surface-3: rgba(14, 16, 24, 0.06);
    --surface-opaque: #fbfbfd;
    --bord: rgba(14, 16, 24, 0.08);
    --bord-fort: rgba(14, 16, 24, 0.16);
    --reflet-haut: rgba(255, 255, 255, 0.9);
    --ombre: 0 18px 50px rgba(30, 34, 60, 0.1);
    --texte: #0e1018;
    --texte-2: #4a4f60;
    --texte-3: #5b6073;
    --inverse: #ffffff;
    --assombrir: 45%;
    --hausse: #0f7a52;
    --baisse: #c2452a;
    --grille: #e6e7ee;
    --axe: #c9cbd6;
    --m-haiku: #1baf7a;
    --m-sonnet: #6250d6;
    --m-opus: #eb6834;
    --m-fable: #2a78d6;
    --m-gemini: #e87ba4;
    --bon-texte: #0a7d0a;
    --critique-texte: #b42b2b;
    --accent: #6250d6;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --fond: #f3f4f8;
  --fond-2: #e9ebf2;
  --surface: rgba(255, 255, 255, 0.62);
  --surface-2: rgba(255, 255, 255, 0.82);
  --surface-3: rgba(14, 16, 24, 0.06);
  --surface-opaque: #fbfbfd;
  --bord: rgba(14, 16, 24, 0.08);
  --bord-fort: rgba(14, 16, 24, 0.16);
  --reflet-haut: rgba(255, 255, 255, 0.9);
  --ombre: 0 18px 50px rgba(30, 34, 60, 0.1);
  --texte: #0e1018;
  --texte-2: #4a4f60;
  --texte-3: #5b6073;
  --inverse: #ffffff;
  --assombrir: 45%;
  --hausse: #0f7a52;
  --baisse: #c2452a;
  --grille: #e6e7ee;
  --axe: #c9cbd6;
  --m-haiku: #1baf7a;
  --m-sonnet: #6250d6;
  --m-opus: #eb6834;
  --m-fable: #2a78d6;
  --m-gemini: #e87ba4;
  --bon-texte: #0a7d0a;
  --critique-texte: #b42b2b;
  --accent: #6250d6;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--fond);
  color: var(--texte);
}

body {
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

/* :where() = spécificité nulle : les variantes de bouton gardent leur couleur. */
:where(a.entete__lien, a.bouton, a.bouton-icone, a.anneau-budget, .nav a) {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

::selection {
  background: color-mix(in srgb, var(--accent) 40%, transparent);
}

.sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Fond : aurore + grain ---------- */

.aurore {
  position: fixed;
  inset: -20vmax;
  z-index: 0;
  pointer-events: none;
  /* Pas de filtre flou : recalculé à chaque image, il vidait la batterie du téléphone. Les dégradés sont déjà doux. */
  opacity: 0.6;
}
.aurore i {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  mix-blend-mode: screen;
  will-change: transform;
  animation: derive 28s ease-in-out infinite alternate;
}
.aurore i:nth-child(1) {
  left: 5%;
  top: 0;
  background: radial-gradient(circle, rgba(124, 104, 255, 0.5), rgba(124, 104, 255, 0.12) 38%, transparent 70%);
}
.aurore i:nth-child(2) {
  right: 0;
  top: 25%;
  background: radial-gradient(circle, rgba(46, 210, 170, 0.32), rgba(46, 210, 170, 0.08) 38%, transparent 70%);
  animation-duration: 34s;
  animation-delay: -8s;
}
.aurore i:nth-child(3) {
  left: 25%;
  bottom: 0;
  background: radial-gradient(circle, rgba(255, 120, 90, 0.2), rgba(255, 120, 90, 0.05) 38%, transparent 70%);
  animation-duration: 40s;
  animation-delay: -16s;
}
:root[data-theme="light"] .aurore {
  opacity: 0.5;
}
:root[data-theme="light"] .aurore i {
  mix-blend-mode: multiply;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .aurore {
    opacity: 0.5;
  }
  :root:not([data-theme="dark"]) .aurore i {
    mix-blend-mode: multiply;
  }
}

/* Teinte de l'aurore selon le modèle au travail */
body[data-teinte="haiku"] .aurore i:nth-child(1) {
  background: radial-gradient(circle, rgba(40, 210, 160, 0.5), transparent 70%);
}
body[data-teinte="sonnet"] .aurore i:nth-child(1) {
  background: radial-gradient(circle, rgba(140, 120, 255, 0.6), transparent 70%);
}
body[data-teinte="opus"] .aurore i:nth-child(1) {
  background: radial-gradient(circle, rgba(255, 128, 70, 0.45), transparent 70%);
}
body[data-teinte="gemini"] .aurore i:nth-child(1) {
  background: radial-gradient(circle, rgba(230, 90, 160, 0.45), transparent 70%);
}
body[data-teinte="fable"] .aurore i:nth-child(1) {
  background: radial-gradient(circle, rgba(70, 150, 255, 0.55), transparent 70%);
}

@keyframes derive {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(8vmax, 6vmax, 0) scale(1.12);
  }
  100% {
    transform: translate3d(-6vmax, 10vmax, 0) scale(0.95);
  }
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- Coquille ---------- */

.app {
  position: relative;
  z-index: 2;
  max-width: var(--largeur);
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.entete {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + var(--haut-sur)) 18px 10px;
  isolation: isolate;
}
/* Le fond verre de l'en-tête couvre toute la largeur, même sur grand écran. */
.entete::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 50%;
  z-index: -1;
  width: 100vw;
  transform: translateX(-50%);
  background: color-mix(in srgb, var(--fond) 72%, transparent);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid color-mix(in srgb, var(--bord) 60%, transparent);
}

.entete__marque {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.entete__lien {
  display: flex;
  align-items: center;
  min-height: 40px;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
/* Sur téléphone, le badge du relais prend la place du nom pour ne pas toucher la sphère centrale. */
@media (max-width: 460px) {
  .entete__marque:has(.pastille-relais:not([hidden])) .entete__mot,
  .entete__marque:has(.pastille-hors-ligne:not([hidden])) .entete__mot {
    display: none;
  }
  .pastille-hors-ligne__heure {
    display: none;
  }
}

.marque-orbe {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.75), transparent 32%),
    radial-gradient(circle at 70% 75%, #3ee0b0, transparent 60%),
    radial-gradient(circle at 75% 25%, #ff8a5c, transparent 55%),
    radial-gradient(circle at 35% 40%, #8f7dff, #2a1f6b 85%);
  box-shadow:
    0 0 18px rgba(143, 125, 255, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  animation: respire 5s ease-in-out infinite;
}

@keyframes respire {
  50% {
    transform: scale(1.08);
    box-shadow:
      0 0 26px rgba(143, 125, 255, 0.75),
      inset 0 0 0 1px rgba(255, 255, 255, 0.3);
  }
}

.entete__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pastille-relais {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 650;
  padding: 4px 9px;
  border-radius: 8px;
  color: var(--texte);
  background: color-mix(in srgb, var(--m-gemini) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--m-gemini) 40%, transparent);
}
.pastille-relais::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--m-gemini);
  box-shadow: 0 0 8px var(--m-gemini);
}
.pastille-demo {
  font-size: 12px;
  font-weight: 650;
  padding: 4px 9px;
  border-radius: 8px;
  color: var(--texte-2);
  background: var(--surface-2);
  border: 1px solid var(--bord);
}

.bouton-icone {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: var(--texte-2);
  transition:
    background 0.2s,
    color 0.2s,
    transform 0.25s var(--ressort);
}
.bouton-icone:hover {
  background: var(--surface-2);
  color: var(--texte);
}
.bouton-icone:active {
  transform: scale(0.92);
}
.bouton-icone svg {
  width: 22px;
  height: 22px;
}

.anneau-budget {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
}
.anneau-budget svg {
  width: 30px;
  height: 30px;
  transform: rotate(-90deg);
}
.anneau-budget .piste {
  stroke: var(--surface-3);
}
.anneau-budget .plein {
  stroke: var(--accent);
  stroke-linecap: round;
  transition:
    stroke-dashoffset 1s var(--doux),
    stroke 0.4s;
}
.anneau-budget[data-niveau="alerte"] .plein {
  stroke: var(--alerte);
}
.anneau-budget[data-niveau="critique"] .plein {
  stroke: var(--critique);
}

.contenu {
  flex: 1;
  padding: 4px 18px calc(200px + var(--bas-sur));
}

/* "backwards" et non "both" : une transformation qui persiste ferait des éléments fixes des enfants de la vue. */
.vue {
  animation: apparition 0.45s var(--doux) backwards;
}

/* Transitions entre vues (View Transitions API) */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.32s;
  animation-timing-function: var(--doux);
}
::view-transition-old(contenu) {
  animation: 0.22s var(--doux) both sortie;
}
::view-transition-new(contenu) {
  animation: 0.38s var(--doux) both apparition;
}
.contenu {
  view-transition-name: contenu;
}

@keyframes apparition {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
@keyframes sortie {
  to {
    opacity: 0;
    transform: translateY(-6px);
  }
}

/* ---------- Navigation ---------- */

.nav {
  position: fixed;
  left: 50%;
  bottom: calc(14px + var(--bas-sur));
  z-index: 30;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 6px;
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface-opaque) 72%, transparent);
  backdrop-filter: var(--flou);
  -webkit-backdrop-filter: var(--flou);
  border: 1px solid var(--bord);
  box-shadow:
    var(--ombre),
    inset 0 1px 0 var(--reflet-haut);
}

.nav__indicateur {
  position: absolute;
  top: 6px;
  left: 0;
  height: calc(100% - 12px);
  border-radius: 16px;
  background: var(--surface-3);
  box-shadow: inset 0 1px 0 var(--reflet-haut);
  transition:
    transform 0.5s var(--ressort),
    width 0.5s var(--ressort);
  pointer-events: none;
}

.nav__onglet {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 50px;
  border-radius: 16px;
  color: var(--texte-3);
  transition:
    color 0.25s,
    transform 0.3s var(--ressort);
}
.nav__onglet svg {
  width: 23px;
  height: 23px;
}
.nav__onglet:active {
  transform: scale(0.9);
}
.nav__onglet--actif {
  color: var(--texte);
}
.nav__onglet--actif svg {
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 70%, transparent));
}

.badge {
  position: absolute;
  top: 7px;
  right: 13px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 750;
  line-height: 18px;
  text-align: center;
  color: #fff;
  background: var(--critique);
  box-shadow: 0 0 0 2px var(--surface-opaque);
  animation: rebond 0.5s var(--ressort);
}

@keyframes rebond {
  from {
    transform: scale(0.3);
  }
}

/* ---------- Éléments communs ---------- */

.carte {
  position: relative;
  border-radius: var(--r-l);
  /* Pas de flou d'arrière-plan sur les cartes : des dizaines de flous recalculés à chaque image coûtent cher
     au téléphone. Il reste sur les éléments flottants (en-tête, saisie, navigation, feuilles). */
  background: var(--surface);
  border: 1px solid var(--bord);
  box-shadow: inset 0 1px 0 var(--reflet-haut);
}

.titre-vue {
  margin: 12px 2px 4px;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.sous-titre {
  margin: 0 2px 22px;
  color: var(--texte-2);
  font-size: 15px;
}
.titre-section {
  margin: 28px 4px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--texte-3);
  letter-spacing: 0.01em;
}

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  font-weight: 650;
  font-size: 15px;
  background: var(--surface-2);
  border: 1px solid var(--bord);
  transition:
    transform 0.25s var(--ressort),
    background 0.2s,
    opacity 0.2s;
  user-select: none;
}
.bouton:hover {
  background: var(--surface-3);
}
.bouton:active {
  transform: scale(0.96);
}
.bouton:disabled {
  opacity: 0.45;
  pointer-events: none;
}
.bouton svg {
  width: 18px;
  height: 18px;
}
.bouton--principal {
  color: var(--inverse);
  background: var(--texte);
  border-color: transparent;
}
.bouton--principal:hover {
  background: color-mix(in srgb, var(--texte) 88%, var(--accent));
}
.bouton--fantome {
  background: transparent;
}
.bouton--plein {
  width: 100%;
}

.puce {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--texte-2);
  background: var(--surface-2);
  border: 1px solid var(--bord);
  white-space: nowrap;
}
.puce svg {
  width: 14px;
  height: 14px;
}
.puce__point {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--couleur, var(--texte-3));
  box-shadow: 0 0 10px var(--couleur, transparent);
}

.statut {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 650;
}
.statut svg {
  width: 16px;
  height: 16px;
}
.statut--bon {
  color: var(--bon-texte);
}
.statut--alerte {
  color: var(--alerte);
}
.statut--critique {
  color: var(--critique-texte);
}

.vide {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 48px 24px;
  text-align: center;
  color: var(--texte-2);
}
.vide__icone {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 22px;
  background: var(--surface-2);
  border: 1px solid var(--bord);
  color: var(--bon-texte);
  animation: flotte 5s ease-in-out infinite;
}
.vide__icone svg {
  width: 28px;
  height: 28px;
}
.vide strong {
  color: var(--texte);
  font-size: 17px;
}
@keyframes flotte {
  50% {
    transform: translateY(-6px);
  }
}

.squelette {
  border-radius: var(--r-m);
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-3) 50%, var(--surface) 70%);
  background-size: 300% 100%;
  animation: miroiter 1.4s linear infinite;
}
@keyframes miroiter {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -200% 0;
  }
}

/* ---------- Accueil ---------- */

.scene {
  position: relative;
  display: grid;
  place-items: center;
  height: 290px;
  margin-top: 4px;
  transition:
    height 0.7s var(--ressort),
    margin 0.7s var(--ressort);
}
.scene canvas {
  width: 300px;
  height: 300px;
  transition: transform 0.7s var(--ressort);
  cursor: pointer;
}
.accueil--conversation .scene {
  display: none;
}
/* En conversation, la sphère se loge au centre de l'en-tête, comme une île. */
.orbe-haut {
  position: fixed;
  top: calc(var(--haut-sur) + 1px);
  left: 50%;
  z-index: 21;
  width: 62px;
  height: 62px;
  transform: translateX(-50%);
  animation: entree-orbe 0.6s var(--ressort) both;
}
.orbe-haut canvas {
  width: 62px;
  height: 62px;
  cursor: pointer;
}
.nouvelle-conversation {
  justify-self: center;
  margin-top: 4px;
  color: var(--texte-3);
}

.salutation {
  text-align: center;
  margin: -6px 0 26px;
  animation: apparition 0.7s var(--doux) 0.1s both;
}
.salutation h1 {
  margin: 0 0 6px;
  font-size: 32px;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.035em;
}
.salutation h1 span {
  background: var(--degrade-marque);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.salutation p {
  margin: 0;
  color: var(--texte-2);
}

.suggestions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.suggestion {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 112px;
  padding: 16px;
  text-align: left;
  border-radius: var(--r-l);
  background: var(--surface);
  border: 1px solid var(--bord);
  box-shadow: inset 0 1px 0 var(--reflet-haut);
  transition:
    transform 0.35s var(--ressort),
    background 0.25s,
    border-color 0.25s;
  animation: apparition 0.6s var(--doux) both;
}
.suggestion:nth-child(1) {
  animation-delay: 0.15s;
}
.suggestion:nth-child(2) {
  animation-delay: 0.21s;
}
.suggestion:nth-child(3) {
  animation-delay: 0.27s;
}
.suggestion:nth-child(4) {
  animation-delay: 0.33s;
}
.suggestion:hover {
  background: var(--surface-2);
  border-color: var(--bord-fort);
  transform: translateY(-2px);
}
.suggestion:active {
  transform: scale(0.97);
}
.suggestion__icone {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: var(--couleur);
  background: color-mix(in srgb, var(--couleur) 16%, transparent);
}
.suggestion__icone svg {
  width: 18px;
  height: 18px;
}
.suggestion strong {
  display: block;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.suggestion span {
  font-size: 13px;
  color: var(--texte-3);
}

/* Fil de conversation */
.fil {
  display: grid;
  gap: 18px;
  padding-top: 6px;
}

.bulle-moi {
  justify-self: end;
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 20px 20px 6px 20px;
  background: var(--surface-3);
  border: 1px solid var(--bord);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  animation: arrivee-droite 0.45s var(--ressort) both;
}
.bulle-moi__vocal {
  display: inline-flex;
  vertical-align: -3px;
  margin-right: 6px;
  color: var(--accent-2);
}
.bulle-moi__vocal svg {
  width: 16px;
  height: 16px;
}
@keyframes arrivee-droite {
  from {
    opacity: 0;
    transform: translate(16px, 8px) scale(0.96);
  }
}

.reponse {
  padding: 16px 16px 12px;
  border-radius: var(--r-l);
  animation: apparition 0.5s var(--doux) both;
  overflow: hidden;
}
.reponse::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--couleur, var(--accent)), transparent);
  opacity: 0;
  transition: opacity 0.4s;
}
.reponse--en-cours::before {
  opacity: 1;
  animation: balayage 1.6s linear infinite;
}
@keyframes balayage {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

.reponse__entete {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.avatar-agent {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 750;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.35), transparent 45%),
    color-mix(in srgb, var(--couleur, var(--accent)) 82%, #000);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--couleur, var(--accent)) 45%, transparent);
}
.reponse__agent {
  font-weight: 700;
  letter-spacing: -0.01em;
}
.reponse__entete .puce {
  margin-left: auto;
}

.etapes {
  display: grid;
  gap: 2px;
  margin: 12px 0 2px;
  padding: 0;
  list-style: none;
}
.etape {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  padding: 5px 0;
  font-size: 14px;
  color: var(--texte-2);
  animation: apparition 0.4s var(--doux) both;
}
.etape::before {
  content: "";
  position: absolute;
  left: 10.5px;
  top: 26px;
  bottom: -6px;
  width: 1px;
  background: var(--bord-fort);
}
.etape:last-child::before {
  display: none;
}
.etape__icone {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  color: var(--texte-3);
  background: var(--surface-2);
}
.etape__icone svg {
  width: 13px;
  height: 13px;
}
.etape--active .etape__icone {
  color: var(--couleur, var(--accent));
  background: color-mix(in srgb, var(--couleur, var(--accent)) 18%, transparent);
  animation: battement 1.2s ease-in-out infinite;
}
.etape--alerte .etape__icone {
  color: var(--alerte);
}
@keyframes battement {
  50% {
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--couleur, var(--accent)) 12%, transparent);
  }
}
.etape b {
  color: var(--texte);
  font-weight: 650;
}

.reflexion-texte {
  background: linear-gradient(90deg, var(--texte-3) 0%, var(--texte) 45%, var(--texte-3) 90%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: miroiter-texte 1.8s linear infinite;
}
@keyframes miroiter-texte {
  from {
    background-position: 150% 0;
  }
  to {
    background-position: -50% 0;
  }
}

.resume-etapes {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--texte-3);
}
.resume-etapes svg {
  width: 14px;
  height: 14px;
  transition: transform 0.3s var(--doux);
}
.resume-etapes[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.reponse__texte {
  margin-top: 12px;
  font-size: 15.5px;
  line-height: 1.62;
  overflow-wrap: anywhere;
  animation: net 0.7s var(--doux) both;
}
@keyframes net {
  from {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(6px);
  }
}
.reponse__texte > :first-child {
  margin-top: 0;
}
.reponse__texte > :last-child {
  margin-bottom: 0;
}
.reponse__texte p,
.reponse__texte ul,
.reponse__texte ol,
.reponse__texte blockquote,
.reponse__texte pre,
.reponse__texte table {
  margin: 0 0 12px;
}
.reponse__texte h3,
.reponse__texte h4 {
  margin: 18px 0 8px;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.reponse__texte ul,
.reponse__texte ol {
  padding-left: 22px;
}
.reponse__texte li {
  margin: 4px 0;
}
.reponse__texte li::marker {
  color: var(--texte-3);
}
.reponse__texte a {
  color: var(--texte);
  text-decoration-color: color-mix(in srgb, var(--accent) 70%, transparent);
  text-underline-offset: 3px;
}
.reponse__texte code {
  font-family: ui-monospace, "Cascadia Code", Menlo, monospace;
  font-size: 0.88em;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-3);
}
.reponse__texte pre {
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-opaque);
  border: 1px solid var(--bord);
  overflow-x: auto;
}
.reponse__texte pre code {
  padding: 0;
  background: none;
}
.reponse__texte blockquote {
  padding-left: 14px;
  border-left: 2px solid var(--bord-fort);
  color: var(--texte-2);
}
.reponse__texte table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  display: block;
  overflow-x: auto;
}
.reponse__texte th,
.reponse__texte td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--bord);
  text-align: left;
}

.reponse__pied {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--bord);
  font-size: 13px;
  color: var(--texte-3);
}
.reponse__pied .espace {
  flex: 1;
}
.reponse__pied .bouton-icone {
  width: 40px;
  height: 40px;
}
.reponse__pied .bouton-icone svg {
  width: 18px;
  height: 18px;
}
.reponse__pied .bouton-icone[aria-pressed="true"] {
  color: var(--accent-2);
}

.action-inline {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--r-m);
  background: color-mix(in srgb, var(--alerte) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--alerte) 30%, transparent);
  display: grid;
  gap: 10px;
  animation: apparition 0.4s var(--doux) both;
}
.action-inline__titre {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 650;
}
.action-inline__titre svg {
  width: 16px;
  height: 16px;
  color: var(--alerte);
}

/* Compositeur */
.compositeur {
  position: fixed;
  left: 50%;
  bottom: calc(84px + var(--bas-sur));
  z-index: 25;
  width: min(calc(100% - 28px), calc(var(--largeur) - 28px));
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 7px 7px 7px 16px;
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface-opaque) 78%, transparent);
  backdrop-filter: var(--flou);
  -webkit-backdrop-filter: var(--flou);
  border: 1px solid var(--bord);
  box-shadow:
    var(--ombre),
    inset 0 1px 0 var(--reflet-haut);
  transition:
    border-color 0.25s,
    box-shadow 0.25s;
}
.compositeur:focus-within {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--bord));
  box-shadow:
    var(--ombre),
    0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent),
    inset 0 1px 0 var(--reflet-haut);
}
.compositeur__champ {
  flex: 1;
  min-height: 42px;
  max-height: 140px;
  padding: 10px 0;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  font-size: 16px;
  line-height: 1.4;
}
.compositeur__champ::placeholder {
  color: var(--texte-3);
}
.bouton-envoyer {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 14px;
  color: var(--inverse);
  background: var(--texte);
  transition:
    transform 0.35s var(--ressort),
    opacity 0.2s;
}
.bouton-envoyer[hidden] {
  display: none;
}
.bouton-envoyer svg {
  width: 20px;
  height: 20px;
}
.bouton-envoyer:active {
  transform: scale(0.9);
}

.bouton-micro {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  color: #fff;
  background: var(--degrade-marque);
  box-shadow: 0 6px 22px rgba(120, 110, 255, 0.45);
  transition: transform 0.35s var(--ressort);
}
.bouton-micro::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid rgba(143, 125, 255, 0.5);
  animation: onde 2.4s ease-out infinite;
}
.bouton-micro svg {
  width: 20px;
  height: 20px;
  position: relative;
}
.bouton-micro:active {
  transform: scale(0.88);
}
.bouton-micro[disabled] {
  filter: grayscale(1);
  opacity: 0.4;
}
.bouton-micro[disabled]::after {
  display: none;
}
@keyframes onde {
  from {
    transform: scale(0.9);
    opacity: 0.9;
  }
  to {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* Écoute (plein écran) */
.ecoute {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  grid-template-rows: 1fr auto auto;
  justify-items: center;
  padding: calc(40px + var(--haut-sur)) 24px calc(40px + var(--bas-sur));
  background: color-mix(in srgb, var(--fond) 82%, transparent);
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  animation: fondu 0.35s var(--doux) both;
}
.ecoute--sortie {
  animation: fondu-sortie 0.3s var(--doux) both;
}
@keyframes fondu {
  from {
    opacity: 0;
  }
}
@keyframes fondu-sortie {
  to {
    opacity: 0;
  }
}
.ecoute__scene {
  align-self: center;
  display: grid;
  place-items: center;
}
.ecoute__scene canvas {
  width: min(78vw, 360px);
  height: min(78vw, 360px);
  animation: entree-orbe 0.6s var(--ressort) both;
}
@keyframes entree-orbe {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
}
.ecoute__transcription {
  min-height: 3.2em;
  max-width: 480px;
  margin: 0 0 28px;
  font-size: 24px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
}
.ecoute__transcription .provisoire {
  color: var(--texte-3);
}
.ecoute__indice {
  color: var(--texte-3);
  font-size: 15px;
  font-weight: 500;
}
.ecoute__actions {
  display: flex;
  gap: 18px;
}
.ecoute__actions .bouton-rond {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--bord);
  transition: transform 0.3s var(--ressort);
}
.ecoute__actions .bouton-rond:active {
  transform: scale(0.9);
}
.ecoute__actions .bouton-rond--valider {
  color: var(--inverse);
  background: var(--texte);
}
.ecoute__actions svg {
  width: 26px;
  height: 26px;
}

/* ---------- Validations ---------- */

.liste-validations {
  display: grid;
  gap: 14px;
}
.carte-validation {
  padding: 18px;
  display: grid;
  gap: 14px;
  animation: apparition 0.45s var(--doux) both;
  transition:
    transform 0.5s var(--ressort),
    opacity 0.4s,
    max-height 0.5s var(--doux),
    margin 0.5s var(--doux),
    padding 0.5s var(--doux);
}
.carte-validation--partie {
  transform: translateX(110%) rotate(4deg);
  opacity: 0;
}
.carte-validation--refusee {
  transform: translateX(-110%) rotate(-4deg);
  opacity: 0;
}
.carte-validation__haut {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--texte-3);
}
.carte-validation__titre {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.carte-validation__outil {
  font-size: 13px;
  color: var(--texte-3);
}
.params {
  display: grid;
  gap: 1px;
  margin: 0;
  border-radius: var(--r-m);
  overflow: hidden;
  border: 1px solid var(--bord);
}
.param {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  background: var(--surface);
}
.param dt {
  font-size: 12px;
  font-weight: 650;
  color: var(--texte-3);
}
.param dd {
  margin: 0;
  font-size: 14.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 16em;
  overflow: auto;
}
.carte-validation__actions {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 10px;
}

/* Maintenir pour approuver */
.bouton-maintenir {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.bouton-maintenir::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--degrade-marque);
  transform: scaleX(var(--progression, 0));
  transform-origin: left;
}
.bouton-maintenir--en-cours {
  transform: scale(0.98);
  color: #fff;
}
.bouton-maintenir--fait {
  color: #fff;
  background: var(--bon);
}

/* ---------- Activité ---------- */

.segments {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--bord);
}
.segment {
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 650;
  color: var(--texte-3);
  transition:
    background 0.25s,
    color 0.25s;
}
.segment[aria-pressed="true"] {
  color: var(--texte);
  background: var(--surface-3);
}

.hero {
  margin-top: 16px;
  padding: 22px 20px 20px;
}
.hero__libelle {
  font-size: 14px;
  color: var(--texte-2);
  font-weight: 600;
}
.hero__valeur {
  margin: 4px 0 14px;
  font-size: 54px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.045em;
}
.jauge {
  height: 8px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--jauge, var(--accent)) 18%, transparent);
  overflow: hidden;
}
.jauge__plein {
  height: 100%;
  border-radius: 4px;
  background: var(--jauge, var(--accent));
  transform-origin: left;
  animation: remplir 1.1s var(--doux) both;
}
@keyframes remplir {
  from {
    transform: scaleX(0);
  }
}
.jauge-legende {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 13px;
  color: var(--texte-3);
}

.tuiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.tuile {
  padding: 16px;
  border-radius: var(--r-l);
}
.tuile__libelle {
  font-size: 13px;
  color: var(--texte-2);
  font-weight: 600;
}
.tuile__valeur {
  margin-top: 4px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.graphique {
  margin-top: 10px;
  padding: 18px 16px 12px;
}
.graphique__titre {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
}
.legende {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 8px 0 12px;
  padding: 0;
  list-style: none;
  font-size: 12.5px;
  color: var(--texte-2);
}
.legende li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legende i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--couleur);
}
.graphique svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.graphique .ligne-grille {
  stroke: var(--grille);
  stroke-width: 1;
}
.graphique .ligne-base {
  stroke: var(--axe);
  stroke-width: 1;
}
.graphique .graduation {
  fill: var(--texte-3);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.graphique .segment-barre {
  transition: opacity 0.2s;
  animation: pousse 0.8s var(--doux) both;
  transform-box: fill-box;
  transform-origin: bottom;
}
.graphique .segment-barre:hover,
.graphique .segment-barre:focus {
  opacity: 0.8;
  outline: none;
}
@keyframes pousse {
  from {
    transform: scaleY(0);
  }
}
.graphique__zone {
  position: relative;
}
.infobulle {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  min-width: 120px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-opaque);
  border: 1px solid var(--bord-fort);
  box-shadow: var(--ombre);
  font-size: 12.5px;
  transform: translate(-50%, calc(-100% - 10px));
  white-space: nowrap;
}
.infobulle strong {
  display: block;
  font-size: 15px;
}
.infobulle span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--texte-2);
}
.infobulle span i {
  width: 12px;
  height: 2px;
  border-radius: 1px;
  background: var(--couleur);
}

.tableau {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  font-size: 14px;
}
.tableau th {
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 650;
  color: var(--texte-3);
  text-align: right;
}
.tableau th:first-child,
.tableau td:first-child {
  text-align: left;
}
.tableau td {
  padding: 10px 6px;
  border-top: 1px solid var(--bord);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.tableau td:first-child {
  font-weight: 650;
}
.cle-serie {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 3px;
  background: var(--couleur);
  vertical-align: -1px;
}

.liste-taches {
  display: grid;
  gap: 8px;
}
.ligne-tache {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--r-m);
  text-align: left;
  width: 100%;
}
.ligne-tache__demande {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: 14.5px;
}
.ligne-tache__meta {
  font-size: 12.5px;
  color: var(--texte-3);
}
.ligne-tache__cout {
  font-size: 13px;
  color: var(--texte-2);
  font-variant-numeric: tabular-nums;
}

/* ---------- Agents ---------- */

.liste-agents {
  display: grid;
  gap: 14px;
}
.carte-agent {
  padding: 18px;
  display: grid;
  gap: 16px;
  animation: apparition 0.5s var(--doux) both;
}
.carte-agent__haut {
  display: flex;
  gap: 14px;
  align-items: center;
}
.carte-agent__haut .avatar-agent {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  font-size: 18px;
}
.carte-agent h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.02em;
}
.carte-agent p {
  margin: 2px 0 0;
  font-size: 14px;
  color: var(--texte-2);
}
.carte-agent__ligne {
  display: grid;
  gap: 8px;
}
.carte-agent__ligne > span {
  font-size: 12px;
  font-weight: 650;
  color: var(--texte-3);
}
.echelle {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.echelle--5 {
  grid-template-columns: repeat(5, 1fr);
}
.echelon {
  display: grid;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--texte-3);
  text-align: center;
}
.echelon i {
  height: 6px;
  border-radius: 3px;
  background: var(--surface-3);
}
.echelon--actif {
  color: var(--texte);
}
.echelon--actif i {
  background: var(--couleur, var(--accent));
  box-shadow: 0 0 12px color-mix(in srgb, var(--couleur, var(--accent)) 50%, transparent);
}
.echelon--atteint i {
  background: color-mix(in srgb, var(--couleur, var(--accent)) 45%, transparent);
}
.carte-agent__puces {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ---------- Réglages ---------- */

.groupe {
  padding: 4px 16px;
  margin-bottom: 14px;
}
.groupe__titre {
  margin: 22px 4px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--texte-3);
}
.reglage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 10px 0;
}
.reglage + .reglage {
  border-top: 1px solid var(--bord);
}
.reglage--colonne {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.reglage__texte {
  display: grid;
  gap: 1px;
}
.reglage__texte strong {
  font-size: 15px;
  font-weight: 650;
}
.reglage__texte span {
  font-size: 13px;
  color: var(--texte-3);
}

.champ {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--bord);
  background: var(--surface-2);
  outline: 0;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.champ:focus {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--bord));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}
select.champ {
  appearance: none;
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--texte-3) 50%), linear-gradient(135deg, var(--texte-3) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) 21px,
    calc(100% - 15px) 21px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.interrupteur {
  position: relative;
  flex: none;
  width: 52px;
  height: 32px;
  border-radius: 16px;
  background: var(--surface-3);
  border: 1px solid var(--bord);
  transition: background 0.3s;
}
.interrupteur::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.4s var(--ressort);
}
.interrupteur[aria-checked="true"] {
  background: var(--accent);
}
/* Zone tactile élargie autour de l'interrupteur, sans changer son dessin. */
.interrupteur::before {
  content: "";
  position: absolute;
  inset: -6px -4px;
}
.interrupteur[aria-checked="true"]::after {
  transform: translateX(20px);
}

input[type="range"] {
  width: 100%;
  height: 40px;
  accent-color: var(--accent);
}

.ligne-boutons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- Notifications ---------- */

.toasts {
  position: fixed;
  top: calc(12px + var(--haut-sur));
  left: 50%;
  z-index: 80;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  width: min(calc(100% - 28px), 420px);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface-opaque);
  border: 1px solid var(--bord-fort);
  box-shadow: var(--ombre);
  font-size: 14.5px;
  font-weight: 550;
  animation: toast-entree 0.45s var(--ressort) both;
  pointer-events: auto;
}
.toast svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.toast--bon svg {
  color: var(--bon-texte);
}
.toast--critique svg {
  color: var(--critique-texte);
}
.toast--sortie {
  animation: toast-sortie 0.3s var(--doux) both;
}
@keyframes toast-entree {
  from {
    opacity: 0;
    transform: translateY(-14px) scale(0.96);
  }
}
@keyframes toast-sortie {
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* ---------- Écrans larges ---------- */

@media (min-width: 900px) {
  :root {
    --largeur: 680px;
  }
  .suggestions {
    grid-template-columns: repeat(4, 1fr);
  }
  .titre-vue {
    font-size: 36px;
  }
}

/* ---------- Mouvement réduit ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .aurore i {
    animation: none;
  }
}
:root[data-mouvement="reduit"] *,
:root[data-mouvement="reduit"] *::before,
:root[data-mouvement="reduit"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

/* ---------- Compléments ---------- */

.echange {
  display: grid;
  gap: 12px;
}


.graphique svg .colonne {
  transition: opacity 0.2s;
}
.graphique svg.graphique--survol .colonne:not(.colonne--active) {
  opacity: 0.4;
}
.graphique svg rect[tabindex]:focus-visible {
  outline: none;
  stroke: var(--bord-fort);
  stroke-width: 1;
}

.bouton-maintenir:not(.bouton-maintenir--en-cours)::before {
  transition: transform 0.35s var(--doux);
}

.echelon small {
  display: block;
  margin-top: -3px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--texte-3);
}

.ligne-tache .statut svg {
  width: 20px;
  height: 20px;
}

[hidden] {
  display: none !important;
}

/* ---------- Modules ---------- */

.tuile-icone {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  color: var(--couleur);
  background: color-mix(in srgb, var(--couleur) 17%, transparent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--couleur) 30%, transparent),
    0 8px 24px color-mix(in srgb, var(--couleur) 18%, transparent);
}
.tuile-icone svg {
  width: 24px;
  height: 24px;
}
.tuile-icone--grande {
  width: 64px;
  height: 64px;
  border-radius: 20px;
}
.tuile-icone--grande svg {
  width: 32px;
  height: 32px;
}

.grille-modules {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
@media (min-width: 900px) {
  .grille-modules {
    grid-template-columns: 1fr 1fr;
  }
}

.carte-module,
.carte-idee {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  color: inherit;
  text-decoration: none;
  transition:
    transform 0.35s var(--ressort),
    border-color 0.25s,
    background 0.25s;
  animation: apparition 0.5s var(--doux) backwards;
}
.carte-module:hover,
.carte-idee:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--couleur, var(--accent)) 40%, var(--bord));
}
.carte-module:active,
.carte-idee:active {
  transform: scale(0.98);
}
.carte-module__corps {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.carte-module__corps strong {
  font-size: 17px;
  letter-spacing: -0.015em;
}
.carte-module__desc {
  font-size: 14px;
  color: var(--texte-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.carte-module__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.carte-idee {
  align-items: center;
  border-color: color-mix(in srgb, #8f7dff 35%, var(--bord));
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, #8f7dff 16%, transparent), transparent 60%),
    var(--surface);
}
.carte-idee > span:nth-child(2) {
  display: grid;
  gap: 2px;
  flex: 1;
}
.carte-idee strong {
  font-size: 16px;
}
.carte-idee span span {
  font-size: 13.5px;
  color: var(--texte-2);
}
.carte-idee > svg {
  width: 20px;
  height: 20px;
  color: var(--texte-3);
  transform: rotate(-90deg);
}

.lien-retour {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 6px 0 4px -4px;
  padding: 6px 8px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--texte-2);
  text-decoration: none;
}
.lien-retour svg {
  width: 18px;
  height: 18px;
}
.lien-retour:hover {
  color: var(--texte);
  background: var(--surface-2);
}

.entete-module {
  display: flex;
  gap: 16px;
  align-items: center;
  margin: 8px 0 6px;
}
.entete-module .titre-vue {
  margin: 0;
}
.entete-module p {
  margin: 4px 0 0;
  color: var(--texte-2);
  font-size: 15px;
}

.objectif {
  display: grid;
  gap: 10px;
  padding: 16px;
  margin-top: 14px;
}

.bouton--petit {
  height: 40px;
  padding: 0 12px;
  border-radius: 11px;
  font-size: 14px;
}
.bouton--petit svg {
  width: 16px;
  height: 16px;
}

.liste-productions {
  display: grid;
  gap: 10px;
}
.production {
  padding: 14px 16px 12px;
  display: grid;
  gap: 8px;
  animation: apparition 0.45s var(--doux) backwards;
}
.production__haut {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.production__haut strong {
  font-size: 15px;
}
.production__haut .ligne-tache__meta {
  margin-left: auto;
}
.production__texte {
  margin-top: 0;
  max-height: 7.5em;
  overflow: hidden;
  cursor: pointer;
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  animation: none;
}
.production--ouverte .production__texte {
  max-height: none;
  mask-image: none;
  -webkit-mask-image: none;
}

.reglage--bouton {
  width: 100%;
  text-align: left;
}
.elements-donnees {
  display: grid;
  gap: 8px;
  padding: 0 0 12px;
}
.element-donnee {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--bord);
}
.element-donnee dl {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 4px 0 0;
}
.element-donnee dl div {
  display: flex;
  gap: 6px;
  font-size: 13.5px;
  min-width: 0;
}
.element-donnee dt {
  color: var(--texte-3);
  font-weight: 600;
}
.element-donnee dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.configuration {
  margin-top: 22px;
  padding: 4px 16px;
}
.configuration summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  cursor: pointer;
  font-weight: 650;
  list-style: none;
}
.configuration summary::-webkit-details-marker {
  display: none;
}
.configuration summary svg {
  width: 18px;
  height: 18px;
  color: var(--texte-3);
}
.configuration[open] {
  padding-bottom: 16px;
}
.configuration .carte-agent__ligne {
  margin-top: 14px;
}
.instructions {
  margin: 0;
  font-size: 14px;
  color: var(--texte-2);
  white-space: pre-wrap;
  max-height: 16em;
  overflow: auto;
}

/* Puce « Avec <module> » au-dessus du compositeur */
.puce-module {
  position: fixed;
  left: 50%;
  bottom: calc(150px + var(--bas-sur));
  z-index: 26;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 6px 0 12px;
  border-radius: 12px;
  font-size: 13.5px;
  color: var(--texte-2);
  background: color-mix(in srgb, var(--surface-opaque) 85%, transparent);
  backdrop-filter: var(--flou);
  -webkit-backdrop-filter: var(--flou);
  border: 1px solid var(--bord-fort);
  box-shadow: var(--ombre);
  animation: rebond 0.45s var(--ressort);
}
.puce-module > svg {
  width: 15px;
  height: 15px;
  color: var(--accent);
}
.puce-module b {
  color: var(--texte);
}
.puce-module__fermer {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  color: var(--texte-3);
}
.puce-module__fermer:hover {
  background: var(--surface-3);
  color: var(--texte);
}
.puce-module__fermer svg {
  width: 14px;
  height: 14px;
}
