.tmg-launch,.tmg-chat,.tmg-chat *{box-sizing:border-box}
.tmg-launch{position:fixed;right:max(18px,env(safe-area-inset-right,0px));bottom:max(18px,env(safe-area-inset-bottom,0px));z-index:9998;display:flex;align-items:center;gap:10px;height:56px;padding:0 22px 0 18px;border:0;border-radius:999px;background:linear-gradient(90deg,#e0103f,#7b3f98 58%,#0078b7);color:#fff;font:700 14px/1 "Manrope","Segoe UI",system-ui,sans-serif;cursor:pointer;box-shadow:0 12px 32px rgba(123,63,152,.45),0 2px 6px rgba(0,0,0,.4);transition:transform .2s ease,box-shadow .2s ease}
.tmg-launch:hover{transform:translateY(-2px);box-shadow:0 16px 38px rgba(123,63,152,.55),0 2px 6px rgba(0,0,0,.4)}
.tmg-launch svg{width:22px;height:22px;flex:none}
.tmg-launch .ic-x{display:none}
.tmg-launch.is-open{padding:0;width:56px;justify-content:center}
.tmg-launch.is-open .lbl,.tmg-launch.is-open .ic-chat{display:none}
.tmg-launch.is-open .ic-x{display:block}
.tmg-chat{padding:0;margin:0;position:fixed;right:max(18px,env(safe-area-inset-right,0px));bottom:calc(max(18px,env(safe-area-inset-bottom,0px)) + 68px);z-index:9999;width:min(400px,calc(100vw - 36px));height:min(640px,calc(100vh - 120px));height:min(640px,calc(100dvh - 120px));display:none;flex-direction:column;background:#110e29;color:#f6f4ff;border:1px solid rgba(255,255,255,.12);border-radius:22px;overflow:hidden;box-shadow:0 24px 70px rgba(0,0,0,.65),0 0 0 1px rgba(123,63,152,.25);font-family:"Manrope","Segoe UI",system-ui,sans-serif}
.tmg-chat.open{display:flex;animation:tmgIn .22s ease-out}
@keyframes tmgIn{from{opacity:0;transform:translateY(14px) scale(.98)}to{opacity:1;transform:none}}
.tmg-h{display:flex;align-items:center;gap:12px;padding:16px 12px 16px 16px;background:linear-gradient(135deg,#f8134b 0%,#7b3f98 52%,#0078b7 100%);flex:none}
.tmg-h .tmg-av{width:42px;height:42px;background:rgba(255,255,255,.2)}
.tmg-h .tmg-av img{width:22px}
.tmg-ht{flex:1;min-width:0}
.tmg-ht b{display:block;font:700 15px/1.2 "Montserrat","Segoe UI",system-ui,sans-serif}
.tmg-ht span{display:flex;align-items:center;gap:6px;margin-top:4px;font-size:12px;opacity:.92}
.tmg-ht span:before{content:"";width:8px;height:8px;border-radius:50%;background:#54e0a0;box-shadow:0 0 0 3px rgba(84,224,160,.25)}
.tmg-ib{display:flex;align-items:center;justify-content:center;width:34px;height:34px;border:0;border-radius:50%;background:rgba(255,255,255,.16);color:#fff;cursor:pointer;transition:background .15s}
.tmg-ib:hover{background:rgba(255,255,255,.28)}
.tmg-ib svg{width:18px;height:18px}
.tmg-log{flex:1;overflow-y:auto;padding:18px 14px 8px;display:flex;flex-direction:column;gap:12px;scroll-behavior:smooth;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.2) transparent;background:radial-gradient(120% 60% at 50% 0%,rgba(123,63,152,.14),transparent 70%)}
.tmg-row{display:flex;align-items:flex-end;gap:8px}
.tmg-row.me{justify-content:flex-end}
.tmg-av{width:28px;height:28px;flex:none;display:flex;align-items:center;justify-content:center;border-radius:50%;background:linear-gradient(135deg,#f8134b,#7b3f98 55%,#0078b7)}
.tmg-av img{width:15px;height:auto;display:block}
.tmg-b{max-width:82%;padding:11px 14px;font-size:14.5px;line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere}
.tmg-row.bot .tmg-b{background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.1);border-radius:18px 18px 18px 5px}
.tmg-row.me .tmg-b{background:linear-gradient(135deg,#8a45a8,#0078b7);color:#fff;border-radius:18px 18px 5px 18px}
.tmg-b.err{background:rgba(255,138,157,.14)!important;border-color:rgba(255,138,157,.35)!important;color:#ffb3c0}
.tmg-b a{color:#8fd0ff;text-decoration:underline;text-underline-offset:2px}
.tmg-row.me .tmg-b a{color:#fff}
.tmg-dots{display:inline-flex;gap:5px;padding:4px 2px}
.tmg-dots i{width:7px;height:7px;border-radius:50%;background:#b8b3d4;animation:tmgb 1.1s infinite}
.tmg-dots i:nth-child(2){animation-delay:.16s}.tmg-dots i:nth-child(3){animation-delay:.32s}
@keyframes tmgb{0%,80%,100%{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}
.tmg-chips{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 0 36px}
.tmg-chip{border:1px solid rgba(255,255,255,.22);border-radius:999px;background:rgba(255,255,255,.04);color:#f6f4ff;padding:9px 14px;font:600 13px/1.2 "Manrope","Segoe UI",system-ui,sans-serif;cursor:pointer;transition:background .15s,border-color .15s;text-align:left}
.tmg-chip:hover{background:rgba(248,19,75,.14);border-color:#f8134b}
.tmg-foot{flex:none;padding:10px 12px 6px;background:#0c0a22;border-top:1px solid rgba(255,255,255,.1)}
.tmg-field{display:flex;align-items:flex-end;gap:8px;padding:6px 6px 6px 16px;border:1px solid rgba(255,255,255,.16);border-radius:20px;background:rgba(255,255,255,.05);transition:border-color .15s,box-shadow .15s}
.tmg-field:focus-within{border-color:#7b3f98;box-shadow:0 0 0 3px rgba(123,63,152,.3)}
.tmg-chat .tmg-in{flex:1;width:auto;min-width:0;min-height:0;height:auto;max-height:110px;resize:none;border:0;border-radius:0;outline:0;box-shadow:none;background:transparent;color:#f6f4ff;padding:8px 0;margin:0;font:400 16px/1.4 "Manrope","Segoe UI",system-ui,sans-serif}
.tmg-chat .tmg-in:focus{outline:0;box-shadow:none}
.tmg-in::placeholder{color:#8f89b0}
.tmg-send{display:flex;align-items:center;justify-content:center;width:40px;height:40px;flex:none;border:0;border-radius:50%;background:linear-gradient(135deg,#e0103f,#7b3f98 58%,#0078b7);color:#fff;cursor:pointer;transition:transform .15s,opacity .15s}
.tmg-send:hover{transform:scale(1.06)}
.tmg-send:disabled{opacity:.45;cursor:default;transform:none}
.tmg-send svg{width:18px;height:18px}
.tmg-note{padding:6px 10px 8px;font-size:11px;line-height:1.35;color:#8f89b0;text-align:center}
.tmg-launch:focus-visible,.tmg-ib:focus-visible,.tmg-send:focus-visible,.tmg-chip:focus-visible{outline:2px solid #fff;outline-offset:2px}
@media (max-width:520px){
.tmg-launch.is-open{display:none}
.tmg-chat{top:0;left:0;right:0;bottom:0;width:auto;height:100%;border:0;border-radius:0}
.tmg-h{padding-top:calc(16px + env(safe-area-inset-top,0px))}
.tmg-foot{padding-bottom:calc(6px + env(safe-area-inset-bottom,0px))}
.tmg-b{max-width:86%}
}
@media (prefers-reduced-motion:reduce){.tmg-chat.open{animation:none}.tmg-launch,.tmg-send,.tmg-chip,.tmg-ib{transition:none}.tmg-dots i{animation:none}.tmg-log{scroll-behavior:auto}}
