/* ============================================================================
   PITI — assistant du site. Habillé dans la grammaire du site vitrine : filet
   de 1px, accent lagon unique, rayon 4px. Le panneau est en position fixe et
   ne dépend d'aucun conteneur : il doit survivre à n'importe quelle page.
   ============================================================================ */
.piti { position: relative; display: inline-block; flex: none; line-height: 0 }
.piti svg { display: block; border-radius: 999px }
.piti-dot { position: absolute; right: 1px; bottom: 1px; width: 10px; height: 10px;
  border-radius: 999px; background: var(--lagoon); border: 2px solid var(--deep) }

/* Mouvement : nage sur place. En CSS, donc la boucle est PARFAITE par
   construction — pas de couture à recoller comme sur une vidéo générée. */
.piti[data-anime="true"] .piti-corps { animation: piti-bob 4.2s ease-in-out infinite }
.piti[data-anime="true"] .piti-aile-g { animation: piti-aile 2.6s ease-in-out infinite;
  transform-origin: 50px 50px }
.piti[data-anime="true"] .piti-aile-d { animation: piti-aile 2.6s ease-in-out infinite;
  animation-delay: -1.3s; transform-origin: 50px 50px }
.piti[data-anime="true"] .piti-yeux { animation: piti-cligne 6.4s steps(1, end) infinite;
  transform-origin: 50px 45px }
@keyframes piti-bob   { 0%,100% { transform: translateY(0) }   50% { transform: translateY(-2.2px) } }
@keyframes piti-aile  { 0%,100% { transform: rotate(0deg) scaleY(1) } 50% { transform: rotate(-3.5deg) scaleY(.9) } }
@keyframes piti-cligne{ 0%,92%,100% { transform: scaleY(1) } 95% { transform: scaleY(.08) } }
@media (prefers-reduced-motion: reduce) { .piti * { animation: none !important } }

/* ── Lanceur ── */
.pc-launch { position: fixed; right: 18px; bottom: calc(var(--gangway-h) + 14px); z-index: 80;
  display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px;
  background: var(--hull); border: 1px solid var(--line-lit); border-radius: 999px;
  color: var(--ink); font-family: var(--sans); font-size: var(--t-small); cursor: pointer;
  box-shadow: 0 10px 30px -14px rgba(0,0,0,.75); transition: border-color .2s var(--ease) }
.pc-launch:hover { border-color: var(--lagoon) }
.pc-launch-t { white-space: nowrap; font-weight: 600 }
@media (min-width: 900px) { .pc-launch { bottom: 18px } }
@media (max-width: 420px) { .pc-launch-t { display: none } .pc-launch { padding: 8px } }
/* Sur petit écran, le lanceur se posait sur la hero et recouvrait tantôt le tarif, tantôt le
   second bouton — mesuré aux quatre tailles. Réserver de la place dans le contenu ne pouvait
   rien y faire : il est fixé au VIEWPORT, pas au flux. Il n'apparaît donc qu'une fois la
   première page franchie, ce qui laisse l'accroche et ses deux boutons intacts. */
@media (max-width: 900px) {
  .pc-launch { opacity: 0; transform: translateY(8px) scale(.96); pointer-events: none;
    transition: opacity .25s var(--ease), transform .25s var(--ease) }
  html[data-piti-visible="true"] .pc-launch { opacity: 1; transform: none; pointer-events: auto }
}

/* ── Panneau ── */
/* Le panneau est un <section>, donc `section { padding: var(--s-mid) 0 }` de style.css
   le frappait : 102,4 px de vide en haut ET en bas, et le fil de discussion écrasé de
   206 px — le premier message arrivait coupé en plein milieu de phrase. On qualifie par
   la balise (0,1,1) plutôt que par la seule classe : la règle tient encore si l'appli
   Next introduit un `.quelquechose section`. */
section.pc { padding: 0 }
.pc { position: fixed; right: 18px; bottom: 18px; z-index: 90;
  width: min(392px, calc(100vw - 24px)); max-height: min(640px, calc(100dvh - 36px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--deep); border: 1px solid var(--line-lit); border-radius: 14px;
  box-shadow: 0 30px 80px -28px rgba(0,0,0,.9);
  opacity: 0; transform: translateY(10px) scale(.98); pointer-events: none;
  transition: opacity .22s var(--ease), transform .22s var(--ease) }
.pc[data-ouvert="true"] { opacity: 1; transform: none; pointer-events: auto }
/* En-tête : le nom en display, le rôle en capitales fines. Un dégradé très court sous la
   ligne évite l'effet « barre d'outils » d'un aplat + filet. */
.pc-h { display: flex; align-items: center; gap: 12px; padding: 16px 18px 15px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.035), transparent) }
.pc-h b { display: block; font-family: var(--display); font-size: 16px; line-height: 1.2;
  font-weight: 500; letter-spacing: -.01em; color: var(--ink) }
.pc-h i { display: block; font-style: normal; font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--faint); margin-top: 3px }
.pc-x { margin-left: auto; width: 32px; height: 32px; border: 0; background: transparent;
  color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; border-radius: var(--r) }
.pc-x:hover { color: var(--ink); background: var(--hull) }

.pc-fil { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px }
/* Le message d'accueil n'est PAS une bulle : une bulle grise en haut d'un panneau, c'est la
   signature visuelle de n'importe quel widget de chat. En display, sans fond, il se lit comme
   une phrase d'accueil du site — et l'avatar n'a plus à le répéter à côté. */
/* L'accueil est un MESSAGE, pas un chapô. Sorti de sa bulle et passé en display 17 px, le
   panneau se lisait comme une page éditoriale : on ne comprenait plus que c'était un chat.
   Il reprend la forme commune — avatar à gauche, bulle, même corps que la suite. */
.pc-b-accueil .pc-b-c > p { color: var(--ink) }
.pc-b { display: flex; gap: 9px; align-items: flex-start }
.pc-b p { font-size: var(--t-small); line-height: 1.6; padding: 11px 14px; border-radius: 12px;
  max-width: 86%; margin: 0 }
.pc-b-assistant p { border-top-left-radius: 4px }
.pc-b-user p { border-bottom-right-radius: 4px }
.pc-b-assistant p { background: var(--hull); color: var(--body) }
.pc-b-user { justify-content: flex-end }
.pc-b-user p { background: var(--lagoon); color: #04161E; font-weight: 500 }
.pc-b a { color: var(--lagoon-lit); text-decoration: underline; text-underline-offset: 2px;
  word-break: break-word }
.pc-b-user a { color: #04161E }
.pc-mini { margin-top: 2px }

.pc-tap { display: flex; gap: 4px; align-items: center }
.pc-tap i { width: 6px; height: 6px; border-radius: 999px; background: var(--muted);
  animation: pc-tap 1.2s ease-in-out infinite }
.pc-tap i:nth-child(2) { animation-delay: .18s }
.pc-tap i:nth-child(3) { animation-delay: .36s }
@keyframes pc-tap { 0%,60%,100% { opacity: .3 } 30% { opacity: 1 } }

/* Suggestions : des LIGNES séparées par un filet, pas des pastilles bordées. Quatre
   rectangles à bord visible empilés, c'est le « AI slop » que la maison proscrit ; la parade
   est typographique (cf. feedback_ai_slop_pills_to_typography). */
.pc-amorces { display: flex; flex-direction: column; gap: 0; padding: 2px 0 0; margin-left: 37px }
.pc-amorces::before { content: 'Suggestions'; font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--faint); padding-bottom: 3px }
.pc-amorces button { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; font-family: var(--sans); font-size: 12.5px; line-height: 1.4;
  color: var(--body); background: transparent; border: 0; border-top: 1px solid var(--line);
  border-radius: 0; padding: 9px 2px; cursor: pointer; text-align: left;
  transition: color .2s var(--ease), padding-left .2s var(--ease) }
.pc-amorces button::after { content: '→'; color: var(--faint); font-size: 13px;
  transition: color .2s var(--ease), transform .2s var(--ease) }
.pc-amorces button:hover:not(:disabled) { color: var(--ink); padding-left: 6px }
.pc-amorces button:hover:not(:disabled)::after { color: var(--lagoon-lit); transform: translateX(3px) }
.pc-amorces button:disabled { opacity: .45; cursor: not-allowed }

.pc-f { display: flex; gap: 8px; padding: 14px 18px 12px; border-top: 1px solid var(--line) }
/* `min-width:0` est OBLIGATOIRE : un élément flex ne rétrécit pas sous sa largeur intrinsèque
   tant que son `min-width` vaut `auto`. Mesuré à 320 px : le champ gardait 264 px et POUSSAIT le
   bouton d'envoi hors du panneau (bord droit à 328 pour un panneau qui s'arrête à 302). */
.pc-f input { flex: 1; min-width: 0; min-height: 44px; padding: 0 14px; font-family: var(--sans);
  font-size: 16px; color: var(--ink); background: rgba(255,255,255,.045);
  border: 1px solid var(--line); border-radius: 10px; outline: none;
  transition: border-color .2s var(--ease), background .2s var(--ease) }
.pc-f input::placeholder { color: var(--faint) }
/* 16 px est la borne SOUS laquelle Safari iOS zoome sur le champ au focus. Le DÉFAUT reste donc
   16 px — sûr partout — et on ne descend à 14 px que dans un contexte desktop POSITIVEMENT
   identifié. J'avais d'abord inversé (14 par défaut) parce que `(pointer:fine)` rendait `false`
   en headless : c'était changer le produit pour satisfaire le banc. Le banc s'émule
   (`emulateMediaFeatures`), le défaut de sécurité ne se négocie pas. */
@media (hover: hover) and (pointer: fine) { .pc-f input { font-size: 14px } }
.pc-f input:focus { border-color: var(--lagoon); background: rgba(255,255,255,.06) }
.pc-f button { width: 44px; min-height: 44px; border: 0; border-radius: 10px;
  background: var(--lagoon); color: #04161E; font-size: 19px; cursor: pointer;
  transition: background .2s var(--ease) }
.pc-f button:hover:not(:disabled) { background: var(--lagoon-lit) }
.pc-f button:disabled { opacity: .4; cursor: not-allowed }
.pc-note { margin: 0; padding: 0 18px 14px; font-size: 11px; line-height: 1.5;
  color: var(--faint) }
.pc-note strong { color: var(--body) }

/* Tailles portées par une classe : le widget autonome n'a pas de props React. */
.piti-28 { width: 28px; height: 28px } .piti-28 svg { width: 28px; height: 28px }
.piti-34 { width: 34px; height: 34px } .piti-34 svg { width: 34px; height: 34px }
.piti-46 { width: 46px; height: 46px } .piti-46 svg { width: 46px; height: 46px }
.piti-mini .piti-dot { display: none }
/* L'animation est armée sur <html> par le script, après le premier rendu. */
html[data-piti-anime="true"] .piti-corps { animation: piti-bob 4.2s ease-in-out infinite }
html[data-piti-anime="true"] .piti-g { animation: piti-aile 2.6s ease-in-out infinite; transform-origin: 50px 50px }
html[data-piti-anime="true"] .piti-d { animation: piti-aile 2.6s ease-in-out infinite; animation-delay: -1.3s; transform-origin: 50px 50px }
html[data-piti-anime="true"] .piti-yeux { animation: piti-cligne 6.4s steps(1,end) infinite; transform-origin: 50px 45px }

/* ── Cartes de faits ─────────────────────────────────────────────────────────
   Dates et montants sont rendus ICI, depuis les données du serveur — jamais
   depuis la prose du modèle. C'est ce qui rend la garantie structurelle. */
.pc-b-c { display: flex; flex-direction: column; gap: 8px; max-width: 86% }
.pc-b-c > p { max-width: 100% }
.pc-c { border: 1px solid var(--line-lit); border-radius: var(--r); padding: 10px 12px;
  background: rgba(255,255,255,.03) }
.pc-c-t { font-size: var(--t-micro); letter-spacing: .12em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 8px }
.pc-c-l { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px }
.pc-c-l li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: baseline;
  padding: 5px 0; border-top: 1px solid var(--line); font-size: var(--t-small) }
.pc-c-l li:first-child { border-top: 0 }
.pc-c-l b { color: var(--ink); font-weight: 500 }
.pc-c-l span { color: var(--body); font-variant-numeric: tabular-nums }
.pc-c-l i { font-style: normal; color: var(--faint); font-size: var(--t-micro); white-space: nowrap }
.pc-c-d { width: 100%; border-collapse: collapse; font-size: var(--t-small) }
.pc-c-d td { padding: 5px 0; border-top: 1px solid var(--line); color: var(--body) }
.pc-c-d tr:first-child td { border-top: 0 }
.pc-c-d .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink) }
.pc-c-d .tot td { border-top: 1px solid var(--line-lit); padding-top: 8px; color: var(--ink); font-weight: 500 }
.pc-c-b { display: inline-flex; align-items: center; justify-content: center; min-height: 40px;
  padding: 0 16px; border-radius: var(--r); background: var(--lagoon); color: #04161E;
  font-size: var(--t-small); font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  text-decoration: none }
.pc-c-b, .pc-c-b:hover { text-decoration: none }
.pc-c-b:hover { background: var(--lagoon-lit) }
.pc-c-s { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px }
.pc-c-s li { padding: 7px 0; border-top: 1px solid var(--line); font-size: var(--t-small) }
.pc-c-s li:first-child { border-top: 0 }
.pc-c-s b { display: block; color: var(--ink); font-weight: 500 }
.pc-c-s span { display: block; color: var(--faint); font-size: var(--t-micro); margin-top: 2px }
.pc-c-s i { display: block; font-style: normal; color: var(--lagoon-lit); font-size: var(--t-micro); margin-top: 3px }
.pc-c-i { font-size: var(--t-small); line-height: 1.6; color: var(--body) }

/* L'avatar est maintenant un PERSONNAGE animé : la vidéo remplit le disque et
   le cadrage vise le visage (le buste occupe le bas du plan). */
.piti video, .piti img { width: 100%; height: 100%; object-fit: cover;
  object-position: center 22%; border-radius: 999px; display: block }
