.chat-bouton { display: none; position: fixed; z-index: 12; top: calc(12px + env(safe-area-inset-top)); right: max(14px, calc((100vw - 480px) / 2 + 14px)); width: 50px; height: 50px; border-radius: 17px; background: var(--blanc); box-shadow: 0 5px 0 var(--ombre); font-size: 25px; }
.chat-bouton:active { translate: 0 4px; box-shadow: 0 1px 0 var(--ombre); }
.chat-bouton.neuf { animation: gigoter-chat 1.2s ease-in-out infinite; }
.chat-compteur { position: absolute; top: -7px; left: -7px; min-width: 22px; padding: 1px 5px; border-radius: 99px; background: var(--encre); color: var(--blanc); font-size: 12px; }
.chat-compteur:empty { display: none; }
@keyframes gigoter-chat { 0%, 60%, 100% { rotate: 0deg; } 70% { rotate: -14deg; } 80% { rotate: 12deg; } 90% { rotate: -6deg; } }
body.avec-chat .chat-bouton { display: block; }
body.avec-chat #ecran { padding-top: calc(70px + env(safe-area-inset-top)); }
.chat { position: fixed; z-index: 15; left: 50%; bottom: var(--clavier, 0px); translate: -50% 0; width: min(100%, 480px); height: min(70dvh, 520px); max-height: calc(100dvh - var(--clavier, 0px) - 12px); display: flex; flex-direction: column; gap: 10px; padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); background: var(--blanc); border-radius: 26px 26px 0 0; box-shadow: 0 -8px 30px rgba(35, 26, 46, .3); transition: transform .3s cubic-bezier(.2, .8, .2, 1), visibility .3s; }
.chat:not(.ouvert) { transform: translateY(110%); visibility: hidden; }
.chat header { display: flex; justify-content: space-between; align-items: center; }
.chat header h2 { color: var(--encre); text-shadow: none; font-size: 24px; }
.chat-fermer { width: 36px; height: 36px; border-radius: 12px; background: var(--pale); }
.chat-liste { flex: 1; min-height: 0; overflow-y: auto; list-style: none; display: flex; flex-direction: column; gap: 9px; overscroll-behavior: contain; }
.chat-liste li { display: flex; align-items: flex-end; gap: 8px; max-width: 85%; animation: pop .25s ease-out; }
.chat-liste li .qui { font-size: 26px; line-height: 1; }
.chat-liste li p { background: var(--pale); border-radius: 16px 16px 16px 4px; padding: 8px 12px; overflow-wrap: anywhere; min-width: 0; }
.chat-liste li small { display: block; font-size: 11px; opacity: .6; }
.chat-liste li.mien { align-self: flex-end; flex-direction: row-reverse; }
.chat-liste li.mien p { background: var(--soleil); border-radius: 16px 16px 4px 16px; }
.chat-liste li.rien { margin: auto; max-width: none; opacity: .55; }
.chat form { margin-bottom: 0; }
.chat form .bouton { margin-bottom: 4px; }
