/* ── L ASSISTANT FLOTTANT, 2026-09-27 ─────────────────────────────────────────
   Anthony : un rond en bas a droite avec SON icone (Assets/avyis-marque.svg ; c etait le H
   chrome de Hora, retire du front le 21/10), puis, le meme jour, « le mieux c est fond
   sombre sur sombre » : le rond est
   TON SUR TON (sombre sur le theme sombre, clair sur les clairs), une fenetre flottante
   « que je peux deplacer ou je veux », « du moderne et du wow ».

   ECRIT DU PLUS PETIT AU PLUS GRAND : la base est le telephone (une feuille qui
   monte du bas et prend l ecran), la fenetre flottante vient a partir de 601 px.

   LE CHROME N EST PAS DANS LE FICHIER, IL EST ICI. L icone sert de MASQUE (sa
   forme), et le degrade est peint par la page : argent sur un fond sombre,
   graphite sur un fond clair. Un chrome argent sur du blanc s eteint. */

:root {
  --ia-argent: linear-gradient(115deg, #C0C0C0 0%, #F4F4F4 18%, #A9A9A9 36%, #FFFFFF 54%, #8A8A8A 72%, #E8E8E8 88%, #C0C0C0 100%);
  --ia-graphite: linear-gradient(115deg, #2E2E2E 0%, #6A6A6A 18%, #141414 36%, #7C7C7C 54%, #0A0A0A 72%, #4A4A4A 88%, #2E2E2E 100%);
  /* LE DEFAUT EST LE THEME SOMBRE : rond sombre un cran plus clair que le sol (une surface se
     distingue par la luminosite), H argent, comme dans la fenetre. */
  --ia-rond: #262626;
  --ia-rond-bord: rgba(255,255,255,.13);
  --ia-rond-chrome: var(--ia-argent);
  --ia-anneau: rgba(255,255,255,.9);
  --ia-onde: rgba(255,255,255,.35);
  --ia-chrome: var(--ia-argent);
  --ia-ombre: 0 34px 90px -24px rgba(0,0,0,.75), 0 10px 28px -10px rgba(0,0,0,.55);
  --ia-ressort: cubic-bezier(.2, 1.18, .32, 1);
  --ia-doux: cubic-bezier(.2, .8, .2, 1);
}
/* LES THEMES CLAIRS : rond BLANC, H graphite, comme dans la fenetre claire. */
html[data-theme="relief"], html[data-theme="relief-rose"], html[data-theme="relief-verre"],
html[data-theme="relief-heure"], html[data-theme="clair"], html[data-theme="blanc"], html[data-theme="girly"] {
  --ia-rond: #FFFFFF;
  --ia-rond-bord: rgba(0,0,0,.07);
  --ia-rond-chrome: var(--ia-graphite);
  --ia-anneau: rgba(20,20,20,.75);
  --ia-onde: rgba(20,20,20,.22);
  --ia-chrome: var(--ia-graphite);
  --ia-ombre: 0 34px 90px -28px rgba(20,24,34,.45), 0 10px 28px -12px rgba(20,24,34,.30);
}

/* ── L ICONE, peinte ─────────────────────────────────────────────────────── */
.ia-h {
  display: block; flex: 0 0 auto; width: 18px; height: 18px;
  /* AVYIS, 2026-09-27 : la marque d Avyis (derivee de Assets/llm-icon.svg) remplace le H. Anthony :
     « on va habituer les gens a ce que l assistant soit Avyis ». */
  -webkit-mask: url(/Assets/avyis-marque.svg) center / contain no-repeat;
          mask: url(/Assets/avyis-marque.svg) center / contain no-repeat;
  background: var(--ia-chrome); background-size: 200% 100%; background-position: 0 0;
}
/* LE REFLET QUI TOURNE pendant que le modele travaille : le degrade commence et finit
   sur la meme teinte, donc le faire glisser d une largeur boucle sans couture. */
.ia-h.pense { animation: iaReflet 1.5s linear infinite; }
@keyframes iaReflet { to { background-position: -200% 0; } }

/* ── LE ROND ─────────────────────────────────────────────────────────────── */
/* IL ATTIRE L OEIL SANS CLIGNOTER (Anthony, 2026-09-27 : « le grossir un peu et qu il attire
   l attention ») : un anneau de metal liquide dont le reflet fait le tour, lentement ; un
   reflet qui passe sur le H toutes les 7 s ; a son arrivee, un rebond puis une onde, trois
   fois, et plus rien. Tout s arrete si le systeme demande moins de mouvement. */
@property --ia-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.ia-rond {
  position: fixed; z-index: 47;
  right: 16px; bottom: max(16px, calc(env(safe-area-inset-bottom) + 10px));
  width: 60px; height: 60px; padding: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--ia-rond); border: 1px solid var(--ia-rond-bord);
  box-shadow: 0 14px 34px -10px rgba(0,0,0,.45), 0 3px 8px rgba(0,0,0,.18);
  touch-action: none; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none;
  transition: transform .45s var(--ia-ressort), box-shadow .3s ease, opacity .25s ease;
  animation: iaArrive .8s var(--ia-ressort) .3s backwards;
}
/* L ANNEAU : un trait de 1,5 px dont un seul arc est eclaire, et cet arc tourne. */
.ia-rond::before {
  content: ""; position: absolute; inset: -1px; border-radius: 50%; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--ia-angle), transparent 0deg, var(--ia-anneau) 50deg, transparent 110deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: iaTour 6s linear infinite;
}
/* L ONDE, a l arrivee seulement : trois fois, puis elle se tait. */
.ia-rond::after {
  content: ""; position: absolute; inset: -1px; border-radius: 50%; pointer-events: none;
  border: 2px solid var(--ia-onde); opacity: 0;
  animation: iaOnde 2.2s var(--ia-doux) 1.1s 3;
}
@keyframes iaTour { to { --ia-angle: 360deg; } }
@keyframes iaOnde { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.55); } }
@keyframes iaArrive { from { opacity: 0; transform: scale(.3); } }
/* LE REFLET DU H : immobile 80 % du temps, puis il passe. Le degrade boucle sans couture. */
@keyframes iaLueur { 0%, 78% { background-position: 0 0; } 100% { background-position: -200% 0; } }
.ia-rond[hidden] { display: none; }
.ia-rond .ia-h { width: 30px; height: 30px; background: var(--ia-rond-chrome); background-size: 200% 100%;
  animation: iaLueur 7s var(--ia-doux) 2s infinite; }
.ia-rond:hover { transform: translateY(-3px) scale(1.06); box-shadow: 0 20px 44px -12px rgba(0,0,0,.5), 0 4px 10px rgba(0,0,0,.2); }
.ia-rond:hover .ia-h { animation: iaReflet 1.3s linear infinite; }
.ia-rond:hover::before { animation-duration: 2.2s; }
.ia-rond:active { transform: scale(.93); transition-duration: .12s; }
.ia-rond:focus-visible { outline: 2px solid var(--encre); outline-offset: 4px; }
.ia-rond.glisse { transition: none; cursor: grabbing; transform: scale(1.08); }
/* Il DEVIENT la fenetre : pendant qu elle est ouverte, il n est plus la. */
.ia-rond.cache { opacity: 0; transform: scale(.4); pointer-events: none; }

/* ── LA FENETRE : sur telephone, une feuille plein ecran ───────────────────── */
.ia {
  position: fixed; z-index: 48; left: 0; right: 0; bottom: 0; top: 0;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--fond-carte); color: var(--encre); font-family: var(--interface);
}
.ia[hidden] { display: none; }
.ia-contenu { display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0; }

.ia-poignee { display: block; position: relative; width: 40px; height: 5px; border-radius: 3px; margin: 8px auto 0;
  background: var(--barre); flex: 0 0 auto; touch-action: none; }
/* Une poignee de 5 px ne se saisit pas au doigt : sa zone de prise est bien plus grande qu elle. */
.ia-poignee::before { content: ""; position: absolute; inset: -12px -60px; }
.ia-tete {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 8px 10px 10px 16px; padding-top: max(8px, env(safe-area-inset-top));
  -webkit-user-select: none; user-select: none; touch-action: none;
}
.ia-nom { font-weight: 600; font-size: 15px; letter-spacing: .005em; white-space: nowrap; }
.ia-ici {
  display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 46%;
  padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--voile);
  font-size: 12px; color: var(--encre-3); animation: iaApparait .35s var(--ia-doux);
}
.ia-ici > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ia-ici button { flex: 0 0 auto; width: 24px; height: 24px; border: 0; border-radius: 50%; padding: 0;
  background: transparent; color: inherit; cursor: pointer; display: grid; place-items: center; }
.ia-ici button:hover { background: var(--filet); color: var(--encre); }
.ia-outils { margin-left: auto; display: flex; gap: 2px; flex: 0 0 auto; }
.ia-outil {
  width: 36px; height: 36px; border-radius: 11px; border: 0; padding: 0; cursor: pointer;
  background: transparent; color: var(--encre-3); display: grid; place-items: center;
  transition: background .2s ease, color .2s ease;
}
.ia-outil:hover, .ia-outil[aria-expanded="true"] { background: var(--voile); color: var(--encre); }
.ia-outil:focus-visible { outline: 2px solid var(--encre); outline-offset: 1px; }
.ia-outil svg { width: 18px; height: 18px; }
.ia-grandir { display: none; }

/* ── LE FIL ─────────────────────────────────────────────────────────────── */
.ia-fil { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 16px 8px; scroll-behavior: smooth; }
.ia-fil::-webkit-scrollbar { width: 8px; }
.ia-fil::-webkit-scrollbar-thumb { background: var(--barre); border-radius: 8px; border: 2px solid var(--fond-carte); }

.ia-accueil { min-height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 18px; padding: 8px 0 6px; }
.ia-accueil .ia-h { width: 40px; height: 40px; animation: iaReflet 2.4s var(--ia-doux) 1 both, iaApparait .6s var(--ia-doux) both; }
.ia-bonjour { margin: 0; font-family: var(--lecture); font-weight: 400; font-size: 27px; line-height: 1.18; letter-spacing: -.012em;
  animation: iaMonte .6s var(--ia-doux) .05s both; }
.ia-bonjour small { display: block; margin-top: 8px; font-family: var(--interface); font-size: 14.5px; line-height: 1.45;
  letter-spacing: 0; color: var(--encre-3); }
.ia-idees { display: flex; flex-direction: column; gap: 8px; }
.ia-idee {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  padding: 12px 14px; border-radius: 14px; border: 1px solid var(--filet); background: transparent;
  color: var(--encre-2); font: 400 14.5px/1.35 var(--interface);
  transition: background .2s ease, color .2s ease, transform .3s var(--ia-ressort), border-color .2s ease;
  animation: iaMonte .55s var(--ia-doux) both;
}
.ia-idee:nth-child(2) { animation-delay: .06s; } .ia-idee:nth-child(3) { animation-delay: .12s; } .ia-idee:nth-child(4) { animation-delay: .18s; }
.ia-idee svg { width: 16px; height: 16px; flex: 0 0 auto; opacity: .55; transition: transform .3s var(--ia-ressort), opacity .2s; }
.ia-idee:hover { background: var(--voile); color: var(--encre); border-color: var(--barre); }
.ia-idee:hover svg { transform: translateX(3px); opacity: 1; }
.ia-idee:focus-visible { outline: 2px solid var(--encre); outline-offset: 1px; }

/* LES TOURS. Les regles generales de `.tour` (index.html) valent pour la colonne ;
   ici, tout est borne a :is(#ia, #convPage) et passe donc devant. */
:is(#ia, #convPage) .tour { margin: 0 0 22px; }
:is(#ia, #convPage) .tour.neuf { animation: iaMonte .45s var(--ia-doux) both; }
:is(#ia, #convPage) .tour.moi { display: flex; flex-direction: column; align-items: flex-end; }
:is(#ia, #convPage) .tour.moi .dit {
  max-width: 86%; margin: 0; padding: 10px 14px; border-radius: 18px 18px 6px 18px;
  background: var(--encre); color: var(--fond-carte); box-shadow: none;
  font: 400 15px/1.5 var(--interface); font-style: normal; white-space: pre-wrap; overflow-wrap: anywhere;
}
/* LES PETITES LIGNES (qui parle, ce qui a ete lu) : la police de l interface, sans capitales.
   Le style de la colonne (capitales, chasse fixe) jurait a cote d une bulle. */
:is(#ia, #convPage) .tour .qui, :is(#ia, #convPage) .servis .qui {
  display: flex; align-items: center; gap: 7px; margin: 0 0 8px;
  font: 500 12.5px/1.4 var(--interface); letter-spacing: .005em; text-transform: none; color: var(--encre-3);
}
:is(#ia, #convPage) .servis .qui { margin: 0 2px 0 0; }
:is(#ia, #convPage) .tour .qui .ia-h { width: 15px; height: 15px; }
:is(#ia, #convPage) .tour .dit { font-size: 15.5px; line-height: 1.62; overflow-wrap: anywhere; }
:is(#ia, #convPage) .servis { gap: 6px; margin-top: 12px; }
:is(#ia, #convPage) .ia-attente .qui { color: var(--encre-3); font-size: 13px; letter-spacing: .01em; text-transform: none; }
:is(#ia, #convPage) .ia-attente .qui .ia-h { width: 20px; height: 20px; }
:is(#ia, #convPage) .ia-sec { font-family: var(--chiffre); font-size: 11.5px; opacity: .7; }

/* ── LA SAISIE ──────────────────────────────────────────────────────────── */
.ia-pied { padding: 8px 12px 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); flex: 0 0 auto; }
.ia-saisie {
  border: 1px solid var(--filet); border-radius: 20px; background: var(--fond);
  padding: 11px 10px 9px 14px; transition: border-color .2s ease, box-shadow .25s ease;
}
.ia-saisie:focus-within { border-color: var(--barre-vive); box-shadow: 0 0 0 4px var(--voile); }
:is(#ia, #convPage) #dire {
  display: block; width: 100%; min-height: 24px; max-height: 180px; margin: 0; padding: 0;
  border: 0; outline: 0; box-shadow: none; background: transparent; resize: none; overflow-y: hidden;
  color: var(--encre); font: 400 16px/1.45 var(--interface); font-style: normal;
}
:is(#ia, #convPage) #dire::placeholder { color: var(--encre-4); font-style: normal; }
/* Sans modele charge, la pastille serait un ovale vide. */
:is(#ia, #convPage) #voieConv:empty { display: none; }
.ia-rang { display: flex; align-items: center; gap: 8px; margin-top: 8px; min-width: 0; }
:is(#ia, #convPage) #voieConv {
  min-width: 0; max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 5px 11px; border-radius: 999px; font-size: 12px; background: var(--voile); border: 0; box-shadow: none;
}
.ia-envoyer {
  margin-left: auto; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; border: 0; padding: 0;
  display: grid; place-items: center; cursor: pointer; background: var(--encre); color: var(--fond-carte);
  transition: transform .3s var(--ia-ressort), opacity .2s ease;
}
.ia-envoyer svg { width: 18px; height: 18px; }
.ia-envoyer:disabled { opacity: .22; cursor: default; }
/* L ARRET (2026-09-27) : pendant qu Avyis travaille, la fleche devient un carre. */
.ia-envoyer.arret svg { width: 14px; height: 14px; }
.ia-envoyer:not(:disabled):hover { transform: scale(1.1); }
.ia-envoyer:focus-visible { outline: 2px solid var(--encre); outline-offset: 2px; }
.ia-aide { margin: 7px 4px 0; font-size: 11.5px; color: var(--encre-4); text-align: center; display: none; }

@keyframes iaMonte { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes iaApparait { from { opacity: 0; } to { opacity: 1; } }

/* ── A PARTIR DE 601 PX : la fenetre flotte, se deplace, s agrandit ───────── */
@media (min-width: 601px) {
  .ia-rond { right: 24px; bottom: 24px; width: 66px; height: 66px; }
  .ia-rond .ia-h { width: 32px; height: 32px; }
  .ia {
    right: auto; bottom: auto; top: 0; left: 0;
    /* 520 px depuis la carte unique (2026-09-27) : la fenetre a la largeur de la carte dont elle nait. */
    width: min(520px, calc(100vw - 24px)); height: min(640px, calc(100dvh - 24px));
    border: 1px solid var(--filet); border-radius: 22px; box-shadow: var(--ia-ombre);
    transition: width .45s var(--ia-ressort), height .45s var(--ia-ressort), left .45s var(--ia-ressort), top .45s var(--ia-ressort);
  }
  .ia.grande { width: min(760px, calc(100vw - 24px)); height: min(860px, calc(100dvh - 24px)); }
  .ia.glisse { transition: none; }
  .ia-poignee { display: none; }
  .ia-tete { padding: 12px 10px 10px 16px; cursor: grab; }
  .ia.glisse .ia-tete { cursor: grabbing; }
  .ia-grandir { display: grid; }
  .ia-fil { padding: 12px 20px 8px; }
  .ia-pied { padding: 8px 14px 14px; }
  :is(#ia, #convPage) #dire { font-size: 15px; }
  .ia-aide { display: block; }
  .ia.grande .ia-fil, .ia.grande .ia-pied { padding-left: max(20px, calc((100% - 640px) / 2)); padding-right: max(20px, calc((100% - 640px) / 2)); }
}

@media (prefers-reduced-motion: reduce) {
  .ia-rond, .ia, .ia-idee, .ia-envoyer { transition: none; }
  .ia-h.pense, .ia-accueil .ia-h, .ia-bonjour, .ia-idee, :is(#ia, #convPage) .tour.neuf, .ia-ici,
  .ia-rond, .ia-rond::before, .ia-rond::after, .ia-rond .ia-h, .ia-rond:hover .ia-h { animation: none; }
  .ia-rond::before { background: var(--ia-rond-bord); }
}

/* ── LA PAGE DES CONVERSATIONS, 2026-09-27 ──────────────────────────────────
   Anthony : « dans le meme style, une page vraiment dediee pour les conversations ».
   A gauche la liste (recentes, triees ; la corbeille par son icone), a droite la conversation, dans la
   grammaire de la fenetre flottante. TELEPHONE D ABORD : la liste, puis la conversation
   en plein ecran avec une fleche de retour ; les deux colonnes a partir de 900 px.
   La hauteur est posee par `caleConvPage()` : la liste et le fil defilent chacun chez eux. */
.ia-rond.sur-page { display: none; }
/* UN CHAT A PART ENTIERE (Anthony : « deux navigations a gauche, on s y perd ») : sur cette page,
   la navigation de Hora, la barre du haut et le plateau s effacent ; la page prend l ecran. */
html[data-conv] .colonne-rail, html[data-conv] .outils-haut, html[data-conv] .plateau,
html[data-conv] .deplie-rail { display: none !important; }
html[data-conv] #main { display: block; min-height: 0; }
html[data-conv] section.scene { padding: 0 !important; }
html[data-conv] #scene > .dedans { max-width: none; }
.conv-page { display: grid; grid-template-columns: minmax(0, 1fr); height: 100vh; height: 100dvh; min-height: 0;
  background: var(--fond-page); }
.conv-liste { display: flex; flex-direction: column; min-height: 0; min-width: 0;
  padding: max(12px, env(safe-area-inset-top)) 16px max(10px, env(safe-area-inset-bottom)); }
/* La rangee du logo reprend `.tete-rail` de Hora : ici, seulement l air sous elle. */
.conv-marque { margin-bottom: 8px; }
.conv-deplier { display: none; }
.conv-fil { display: none; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; background: var(--fond); }
.conv-page.voir-fil .conv-liste { display: none; }
.conv-page.voir-fil .conv-fil { display: flex; animation: iaApparait .3s var(--ia-doux); }

.conv-liste-tete { display: flex; flex-direction: column; gap: 10px; padding-bottom: 10px; }
.conv-nouvelle {
  display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 14px; cursor: pointer;
  border-radius: 14px; border: 1px solid var(--filet); background: var(--fond-carte); color: var(--encre);
  font: 500 14.5px var(--interface); transition: border-color .2s ease, transform .3s var(--ia-ressort);
}
.conv-nouvelle .ia-h { width: 18px; height: 18px; }
.conv-nouvelle:hover { border-color: var(--barre-vive); }
.conv-nouvelle:hover .ia-h { animation: iaReflet 1.3s linear infinite; }
.conv-nouvelle:active { transform: scale(.98); }
.conv-nouvelle:focus-visible { outline: 2px solid var(--encre); outline-offset: 2px; }
.conv-chercher { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 12px;
  border-radius: 12px; background: var(--voile); color: var(--encre-3); }
.conv-chercher svg { width: 15px; height: 15px; flex: 0 0 auto; }
.conv-chercher input { flex: 1; min-width: 0; padding: 0; border: 0; outline: 0; box-shadow: none;
  background: transparent; color: var(--encre); font: 400 16px var(--interface); }
.conv-chercher:focus-within { box-shadow: 0 0 0 2px var(--barre-vive); }
/* LE TRI ET LA CORBEILLE (2026-09-27) : ils remplacent les onglets Recentes / Archives / Corbeille. */
.conv-outils { display: flex; align-items: center; gap: 4px; min-width: 0; }
.conv-tri { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 2px; padding-left: 8px; color: var(--encre-3); }
.conv-tri > svg { width: 15px; height: 15px; flex: 0 0 auto; }
.conv-tri > button { min-width: 0; min-height: 38px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 500 13px var(--interface); color: var(--encre-2); }
.conv-outil { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 38px; min-height: 38px; padding: 0 8px; border: 0; border-radius: 10px; background: transparent;
  color: var(--encre-3); cursor: pointer; font: 500 13px var(--interface); transition: background .2s ease, color .2s ease; }
.conv-outil svg { width: 17px; height: 17px; flex: 0 0 auto; }
.conv-outil:hover { background: var(--voile); color: var(--encre); }
.conv-outil:focus-visible { outline: 2px solid var(--encre); outline-offset: 1px; }

/* LA REPONSE EN FLUX (2026-09-28) : le texte s ecrit dans la bulle d attente, un curseur au bout. */
:is(#ia, #convPage) .ia-attente.ecrit .ia-lecture { display: none; }
:is(#ia, #convPage) .ia-flux { margin-top: 2px; }
:is(#ia, #convPage) .ia-flux > :last-child::after { content: ''; display: inline-block; width: .5em; height: 1.05em; margin-left: 2px;
  vertical-align: -.15em; background: currentColor; opacity: .55; animation: iaCurseur 1s steps(2, start) infinite; }
@keyframes iaCurseur { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { :is(#ia, #convPage) .ia-flux > :last-child::after { animation: none; } }
/* LES GESTES SOUS UN MESSAGE (2026-09-27) : copier ; sur SES bulles, le crayon ; sous SON dernier message, le reprendre. */
:is(#ia, #convPage) .tour.moi.edition { align-items: stretch; }
.ia-edition { display: block; width: 100%; min-height: 48px; max-height: 240px; margin: 0; padding: 10px 14px;
  border: 1px solid var(--barre-vive); border-radius: 16px; background: var(--fond); color: var(--encre);
  font: 400 15px/1.5 var(--interface); resize: none; outline: 0; box-shadow: 0 0 0 4px var(--voile); overflow-y: auto; }
.tour.moi.edition .tour-gestes { justify-content: flex-end; gap: 8px; margin-top: 8px; }
.tour-gestes { display: flex; align-items: center; gap: 2px; margin-top: 4px; min-width: 0; }
.tour-gestes .ia-copier { margin-top: 0; }
/* COPIER UN MESSAGE (2026-09-27). */
.ia-copier { display: grid; place-items: center; width: 30px; height: 30px; margin-top: 4px; padding: 0; border: 0;
  border-radius: 8px; background: transparent; color: var(--encre-4); cursor: pointer; transition: opacity .15s ease, color .15s ease, background .15s ease; }
.ia-copier svg { width: 15px; height: 15px; }
.ia-copier:hover { background: var(--voile); color: var(--encre); }
.ia-copier.fait { color: var(--encre); }
.ia-copier:focus-visible { outline: 2px solid var(--encre); outline-offset: 1px; }
@media (hover: hover) and (pointer: fine) {
  .ia-copier { opacity: 0; }
  .tour:hover .ia-copier, .ia-copier:focus-visible, .ia-copier.fait { opacity: 1; }
}

.conv-items { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 -6px; padding: 0 6px 8px; }
.conv-groupe { margin: 14px 8px 6px; font: 600 11.5px var(--interface); letter-spacing: .05em; text-transform: uppercase; color: var(--encre-4); }
.conv-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "t p" "m p"; column-gap: 6px;
  padding: 10px 4px 10px 12px; border-radius: 12px; cursor: pointer; transition: background .15s ease;
  animation: iaMonte .4s var(--ia-doux) both;
}
.conv-item:hover { background: var(--voile); }
.conv-item.actif { background: var(--voile); box-shadow: inset 2px 0 0 var(--encre); }
.conv-item:focus-visible { outline: 2px solid var(--encre); outline-offset: -2px; }
.conv-item-titre { grid-area: t; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 500 14.5px/1.35 var(--interface); color: var(--encre); }
.conv-item-meta { grid-area: m; margin-top: 2px; font: 400 12.5px/1.4 var(--interface); color: var(--encre-4); }
.conv-points { grid-area: p; align-self: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 10px;
  display: grid; place-items: center; background: transparent; color: var(--encre-3); cursor: pointer; }
.conv-points svg { width: 17px; height: 17px; }
.conv-points:hover { background: var(--filet); color: var(--encre); }
@media (hover: hover) and (pointer: fine) {
  .conv-points { opacity: 0; transition: opacity .15s ease; }
  .conv-item:hover .conv-points, .conv-item.actif .conv-points, .conv-points:focus-visible { opacity: 1; }
}
.conv-epingle { font-size: 8px; margin-right: 7px; vertical-align: 2px; color: var(--encre-3); }
.conv-vide { margin: 18px 8px; font-size: 14px; color: var(--encre-3); }
.conv-vider { display: block; margin: 16px 8px; padding: 0; border: 0; background: none; cursor: pointer;
  min-height: 36px; font: 500 13px var(--interface); color: var(--encre-2); text-decoration: underline; text-underline-offset: 3px; }
.conv-liste-pied { padding-top: 8px; border-top: 1px solid var(--filet); }
.conv-recuperer { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 42px; padding: 0 10px;
  border: 0; border-radius: 10px; background: transparent; color: var(--encre-3); cursor: pointer; text-align: left;
  font: 500 13px var(--interface); }
.conv-recuperer svg { width: 16px; height: 16px; flex: 0 0 auto; }
.conv-recuperer:hover { background: var(--voile); color: var(--encre); }

.conv-tete { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 8px 8px 8px 6px;
  padding-top: max(8px, env(safe-area-inset-top)); border-bottom: 1px solid var(--filet); }
.conv-titre { flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 600 15px/1.3 var(--interface); color: var(--encre); }
.conv-note { flex-basis: 100%; margin: 2px 8px 2px; font-size: 13px; color: var(--encre-3); }
.conv-fil .ia-fil { padding: 18px 16px 8px; }
.conv-fil .ia-pied { padding: 8px 12px 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }

/* LES ICONES DE LA RANGEE DU LOGO (#bCal, #bConvs). Au telephone elles ont la forme du bouton
   menu qu elles cotoient ; au bureau, la discretion de « replier », et chacune s allume sur sa page. */
.outil-rail.actif { color: var(--encre); box-shadow: var(--creux); }
@media (min-width: 1080px) {
  .tete-rail { gap: 4px; }
  .outil-rail { background: transparent; border-color: transparent; box-shadow: none; color: var(--encre-3); }
  .cal-rail { margin-left: auto; }
  .outil-rail:hover { color: var(--encre); background: var(--voile); }
  .outil-rail.actif { color: var(--encre); background: var(--voile); box-shadow: none; }
  .outil-rail + .replie-rail { margin-left: 0; }
}

@media (min-width: 601px) { .conv-chercher input { font-size: 14px; } }
@media (min-width: 900px) {
  /* La barre des conversations a la largeur et le sol de la navigation de Hora ; le chat est
     le plateau, pose a cote, comme la fenetre principale. */
  .conv-page { grid-template-columns: var(--rail, 286px) minmax(0, 1fr); gap: 0; }
  .conv-liste { padding: 20px 16px 12px 20px; }
  .conv-page .conv-fil { margin: 8px 8px 8px 0; border-radius: 12px; border: 1px solid var(--fenetre-filet);
    box-shadow: var(--fenetre-ombre); }
  .conv-page .conv-liste, .conv-page.voir-fil .conv-liste { display: flex; }
  .conv-page .conv-fil { display: flex; animation: none; }
  .conv-retour { display: none; }
  .conv-tete { padding: 12px 14px 12px 20px; }
  .conv-fil .ia-fil, .conv-fil .ia-pied { padding-left: max(24px, calc((100% - 720px) / 2)); padding-right: max(24px, calc((100% - 720px) / 2)); }
  .conv-fil .ia-bonjour { font-size: 36px; }
  .conv-fil .ia-accueil .ia-h { width: 48px; height: 48px; }
}
/* « REPLIER » DANS LE CHAT : meme etat que la navigation de Hora (`html[data-rail]`), meme palier. */
@media (min-width: 1080px) {
  html[data-rail="replie"] .conv-page { grid-template-columns: minmax(0, 1fr); }
  html[data-rail="replie"] .conv-page .conv-liste { display: none; }
  html[data-rail="replie"] .conv-page .conv-fil { margin-left: 8px; }
  html[data-rail="replie"] .conv-deplier { display: grid; }
}
@media (prefers-reduced-motion: reduce) {
  .conv-item, .conv-page.voir-fil .conv-fil, .conv-nouvelle:hover .ia-h { animation: none; }
}
