/* Bulle de support flottante (assets/js/support-chat.js). Préfixe tlsup- : aucun conflit avec le Studio. */
.tlsup { --tlsup-teal: #2dd4bf; --tlsup-bg: #0f151c; --tlsup-line: rgba(255, 255, 255, .1); --tlsup-ink: #e6edf3; --tlsup-muted: #8b99aa;
  position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 480;
  font: 14px/1.45 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--tlsup-ink); }
.tlsup *, .tlsup *::before, .tlsup *::after { box-sizing: border-box; }
.tlsup [hidden] { display: none !important; }
.tlsup__bubble { position: relative; width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: linear-gradient(145deg, #2dd4bf, #14b8a6); color: #04201c; box-shadow: 0 10px 28px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .08) inset; transition: transform .15s; }
.tlsup__bubble:hover { transform: translateY(-2px) scale(1.03); }
.tlsup__bubble:focus-visible, .tlsup__tab:focus-visible, .tlsup__x:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.tlsup__badge { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #f43f5e; color: #fff;
  font-size: 11px; font-weight: 800; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px var(--tlsup-bg); }
.tlsup__hide { position: absolute; top: -8px; left: -8px; width: 20px; height: 20px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; display: none;
  background: #1e2833; color: #cbd5e1; font-size: 14px; line-height: 20px; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
.tlsup[data-mode="bubble"]:hover .tlsup__hide, .tlsup[data-mode="bubble"]:focus-within .tlsup__hide { display: block; }
.tlsup__tab { position: fixed; right: 0; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); width: 26px; height: 44px; border: 0; border-radius: 10px 0 0 10px; cursor: pointer;
  display: grid; place-items: center; background: rgba(20, 184, 166, .85); color: #04201c; box-shadow: 0 4px 14px rgba(0, 0, 0, .4); opacity: .75; }
.tlsup__tab:hover { opacity: 1; }
.tlsup__tab .tlsup__badge { top: -6px; right: auto; left: -8px; min-width: 16px; height: 16px; line-height: 16px; font-size: 10px; }
.tlsup[data-mode="bubble"] .tlsup__tab, .tlsup[data-mode="open"] .tlsup__tab { display: none; }
.tlsup[data-mode="tab"] .tlsup__bubble, .tlsup[data-mode="open"] .tlsup__bubble { display: none; }
.tlsup__panel { display: none; width: min(370px, calc(100vw - 32px)); height: min(540px, calc(100dvh - 110px)); flex-direction: column; overflow: hidden;
  border-radius: 18px; border: 1px solid var(--tlsup-line); background: var(--tlsup-bg); box-shadow: 0 24px 60px rgba(0, 0, 0, .55); }
.tlsup[data-mode="open"] .tlsup__panel { display: flex; }
.tlsup__head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 14px 12px 16px; border-bottom: 1px solid var(--tlsup-line);
  background: linear-gradient(180deg, rgba(45, 212, 191, .12), transparent); }
.tlsup__head > div { flex: 1; min-width: 0; }
.tlsup__head strong { display: block; font-size: 15.5px; }
.tlsup__head small { display: block; color: var(--tlsup-muted); font-size: 12.5px; }
.tlsup__x { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; background: rgba(255, 255, 255, .07); color: var(--tlsup-ink); }
.tlsup__x:hover { background: rgba(255, 255, 255, .14); }
.tlsup__list { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.tlsup__msg { max-width: 85%; padding: 8px 11px; border-radius: 14px; word-wrap: break-word; overflow-wrap: anywhere; }
.tlsup__msg a { color: inherit; text-decoration: underline; }
.tlsup__msg time { display: block; margin-top: 3px; font-size: 10.5px; opacity: .65; }
.tlsup__msg--me { align-self: flex-end; background: #134e4a; border-bottom-right-radius: 4px; }
.tlsup__msg--team { align-self: flex-start; background: #1e2833; border-bottom-left-radius: 4px; }
.tlsup__empty { margin: auto 0; text-align: center; color: var(--tlsup-muted); padding: 8px; }
.tlsup__empty p { margin: 0 0 10px; }
.tlsup__btn { display: inline-block; padding: 8px 16px; border-radius: 10px; background: var(--tlsup-teal); color: #04201c; font-weight: 700; text-decoration: none; }
.tlsup__form { display: flex; gap: 8px; align-items: flex-end; padding: 10px; border-top: 1px solid var(--tlsup-line); }
.tlsup__form textarea { flex: 1; min-height: 42px; max-height: 120px; resize: none; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--tlsup-line);
  background: #0a0f14; color: var(--tlsup-ink); font: inherit; font-size: 16px; }   /* 16 px : pas de zoom automatique sur iPhone */
.tlsup__form textarea:focus { outline: 2px solid rgba(45, 212, 191, .5); border-color: transparent; }
.tlsup__form button { flex: none; width: 42px; height: 42px; border-radius: 12px; border: 0; cursor: pointer; display: grid; place-items: center; background: var(--tlsup-teal); color: #04201c; }
.tlsup__form button:disabled { opacity: .5; }
/* Atelier plein écran : la barre d'outils occupe le bas, la bulle remonte et se fait discrète. */
html.atelier-open .tlsup { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
html.atelier-open .tlsup[data-mode="bubble"] .tlsup__bubble { width: 44px; height: 44px; opacity: .8; }
/* Fenêtres modales ouvertes (z-index 500) : la bulle passe dessous, la fenêtre de support reste au-dessus. */
.tlsup[data-mode="open"] { z-index: 520; }
@media (max-width: 699px) {
  .tlsup { right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .tlsup__bubble { width: 46px; height: 46px; }
  .tlsup[data-mode="open"] { left: 0; right: 0; bottom: 0; }
  .tlsup__panel { width: 100%; height: min(82dvh, 620px); border-radius: 18px 18px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
}
/* Mascotte Pixel */
.tlsup__bubble { background: radial-gradient(circle at 35% 30%, #5eead4, #14b8a6 70%); overflow: visible; }
.tlsup-bot { display: block; overflow: visible; filter: drop-shadow(0 2px 2px rgba(4, 32, 28, .25)); }
.tlsup-bot__eyes { transform-box: fill-box; transform-origin: center; animation: tlsupBlink 5s infinite; }
.tlsup-bot__bulb { animation: tlsupBulb 2.4s ease-in-out infinite; }
.tlsup__bubble:hover .tlsup-bot--bubble, .tlsup-bot--wave { animation: tlsupWave 1.2s ease-in-out 1; transform-origin: 50% 90%; }
.tlsup.has-unread .tlsup-bot--bubble { animation: tlsupHop 2.6s ease-in-out infinite; transform-origin: 50% 100%; }
.tlsup__avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(45, 212, 191, .16); }
.tlsup__msg--team { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 7px; }
.tlsup__msg--team time { grid-column: 2; }
.tlsup__mini { grid-row: span 2; align-self: start; }
.tlsup__empty .tlsup-bot { margin: 0 auto 10px; }
@keyframes tlsupBlink { 0%, 93%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.12); } }
@keyframes tlsupBulb { 0%, 100% { fill: #fbbf24; } 50% { fill: #fde68a; } }
@keyframes tlsupWave { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-10deg); } 60% { transform: rotate(8deg); } }
@keyframes tlsupHop { 0%, 80%, 100% { transform: translateY(0); } 86% { transform: translateY(-5px); } 92% { transform: translateY(0); } 96% { transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .tlsup-bot, .tlsup-bot * { animation: none !important; } }
@media (max-width: 699px) { .tlsup__bubble .tlsup-bot { width: 36px; height: 36px; } }
.tlsup__dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.tlsup__dots i { width: 6px; height: 6px; border-radius: 50%; background: #5eead4; animation: tlsupDot 1.2s infinite ease-in-out; }
.tlsup__dots i:nth-child(2) { animation-delay: .15s; } .tlsup__dots i:nth-child(3) { animation-delay: .3s; }
.tlsup__typing { color: var(--tlsup-muted); font-size: 13px; }
@keyframes tlsupDot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media print { .tlsup, .tlsup-imp, .tlsup-imp-frame { display: none !important; } }

/* Prise en main par un admin : bandeau très visible + liseré autour de l'écran. */
.tlsup-imp { position: fixed; left: 50%; top: 8px; transform: translateX(-50%); z-index: 2147483600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  max-width: calc(100vw - 16px); padding: 7px 8px 7px 14px; border-radius: 12px; background: #b91c1c; color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  font: 13.5px/1.35 'DM Sans', system-ui, sans-serif; }
.tlsup-imp svg { vertical-align: -3px; }
.tlsup-imp small { opacity: .85; }
.tlsup-imp button { border: 0; border-radius: 8px; padding: 6px 12px; background: #fff; color: #991b1b; font: inherit; font-weight: 800; cursor: pointer; }
.tlsup-imp-frame { position: fixed; inset: 0; z-index: 2147483599; pointer-events: none; box-shadow: inset 0 0 0 4px #dc2626; }
