.tam-ai-widget *, .tam-ai-launcher { box-sizing: border-box; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }
.tam-ai-launcher { position: fixed; right: 22px; bottom: 22px; z-index: 999998; width: 64px; height: 64px; padding: 0; overflow: hidden; border: 2px solid rgba(255,255,255,.92); border-radius: 50%; cursor: pointer; background: linear-gradient(145deg,#fff,#eef2ff); box-shadow: 0 14px 35px rgba(37,99,235,.32), 0 0 0 5px rgba(124,58,237,.1); transition: transform .22s, box-shadow .22s; }
.tam-ai-launcher:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 18px 42px rgba(37,99,235,.4), 0 0 0 7px rgba(124,58,237,.12); }
.tam-ai-launcher img { width: 100%; height: 100%; padding: 3px; object-fit: contain; object-position: center; transform: scale(1.22); }
.tam-ai-widget[hidden], .tam-ai-launcher[hidden], .tam-ai-micro-permission[hidden] { display: none !important; }
.tam-ai-widget { position: fixed; right: 22px; bottom: 22px; z-index: 999999; display: flex; flex-direction: column; width: 296px; height: 210px; color: #151823; background: #fff; border: 1px solid #e4e7ec; border-radius: 10px; box-shadow: 0 18px 55px rgba(2,6,23,.24); overflow: visible; transition: width .25s cubic-bezier(.16,1,.3,1), height .25s cubic-bezier(.16,1,.3,1), border-radius .25s; }
.tam-ai-widget.conversation { width: 360px; max-width: calc(100vw - 28px); height: min(570px,calc(100vh - 42px)); border-radius: 14px; }
.tam-ai-widget.expanded { top: 0; right: 0; bottom: 0; width: 400px; max-width: 100vw; height: 100vh; border-radius: 12px 0 0 12px; }
.tam-ai-widget-header { display: flex; align-items: center; justify-content: space-between; flex: 0 0 35px; min-height: 35px; padding: 7px 9px 0 14px; }
.tam-ai-widget-header > div:first-child { display: none; min-width: 0; }
.tam-ai-widget.conversation .tam-ai-widget-header, .tam-ai-widget.expanded .tam-ai-widget-header { flex-basis: 58px; min-height: 58px; padding: 10px 12px 9px 20px; border-bottom: 1px solid #edf0f3; }
.tam-ai-widget.conversation .tam-ai-widget-header > div:first-child, .tam-ai-widget.expanded .tam-ai-widget-header > div:first-child { display: flex; flex-direction: row; align-items: baseline; gap: 8px; }
.tam-ai-widget-header strong { color: #121620; font-size: 14px; line-height: 1.3; }
.tam-ai-widget-header span { color: #6d7480; font-size: 12px; }
.tam-ai-window-actions { display: flex; gap: 2px; margin-left: auto; }
.tam-ai-widget-header button { display: grid; place-items: center; width: 27px; height: 27px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #6b7280; font-size: 17px; cursor: pointer; transition: background .15s,color .15s; }
.tam-ai-widget-header button:hover { color: #111827; background: #f1f3f5; }
#tam-ai-stop-audio { opacity: .3; pointer-events: none; font-size: 11px; }
#tam-ai-stop-audio.active { opacity: 1; pointer-events: auto; color: #fff; background: #e11d48; box-shadow: 0 4px 12px rgba(225,29,72,.25); }
.tam-ai-voice-hero { display: flex; justify-content: center; flex: 0 0 auto; padding: 2px 10px 8px; }
.tam-ai-widget.conversation .tam-ai-voice-hero, .tam-ai-widget.expanded .tam-ai-voice-hero { padding: 14px 14px 7px; }
.tam-ai-voice-hero button { display: inline-flex; align-items: center; gap: 8px; min-width: 154px; height: 48px; padding: 5px 20px 5px 7px; border: 1px solid #e0e3e8; border-radius: 999px; background: #fff; color: #111827; cursor: pointer; box-shadow: 0 3px 13px rgba(15,23,42,.06); font-size: 13px; transition: transform .18s,border-color .18s,box-shadow .18s; }
.tam-ai-voice-hero button:hover { transform: translateY(-1px); border-color: #c8ccd4; box-shadow: 0 7px 18px rgba(15,23,42,.09); }
.tam-ai-voice-hero i { position: relative; flex: 0 0 36px; width: 36px; height: 36px; overflow: hidden; border-radius: 50%; background: radial-gradient(circle at 34% 27%,#fff 0,#ede9fe 24%,#9b8cc5 58%,#3f3c52 100%); box-shadow: inset -3px -4px 8px rgba(15,23,42,.4), inset 3px 3px 5px #fff, 0 3px 9px rgba(76,65,110,.25); }
.tam-ai-voice-hero i::after { content: ""; position: absolute; inset: -40%; background: conic-gradient(transparent 0 22%,rgba(255,255,255,.86),transparent 45% 70%,rgba(167,139,250,.48),transparent); animation: tam-ai-orb 4.6s linear infinite; }
.tam-ai-voice-hero svg, .tam-ai-input-wrap svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tam-ai-voice-hero button.recording { color: #be123c; border-color: #fda4af; background: #fff1f2; }
.tam-ai-voice-hero button.recording i { background: radial-gradient(circle at 35% 30%,#fff,#fb7185 47%,#be123c); animation: tam-ai-pulse .75s ease-in-out infinite alternate; }
.tam-ai-widget.speaking .tam-ai-voice-hero i { animation: tam-ai-pulse .8s ease-in-out infinite alternate; }
@keyframes tam-ai-orb { to { transform: rotate(360deg); } }
@keyframes tam-ai-pulse { to { transform: scale(1.09); filter: saturate(1.15); } }
.tam-ai-micro-permission { position: absolute; right: 0; bottom: calc(100% + 9px); width: 296px; padding: 10px 11px; border: 1px solid #dbe2ea; border-radius: 10px; color: #394150; background: #fff; box-shadow: 0 12px 32px rgba(15,23,42,.16); font-size: 11px; line-height: 1.35; }
.tam-ai-micro-permission::after { content: ""; position: absolute; right: 76px; bottom: -6px; width: 11px; height: 11px; border-right: 1px solid #dbe2ea; border-bottom: 1px solid #dbe2ea; background: #fff; transform: rotate(45deg); }
.tam-ai-micro-permission span { display: block; margin-bottom: 7px; }
.tam-ai-micro-permission button { position: relative; z-index: 1; width: 100%; min-height: 30px; border: 0; border-radius: 6px; color: #fff; background: #111827; font-weight: 650; cursor: pointer; }
.tam-ai-micro-permission.denied { border-color: #fecaca; color: #991b1b; background: #fff7f7; }
.tam-ai-widget.conversation .tam-ai-micro-permission, .tam-ai-widget.expanded .tam-ai-micro-permission { position: static; width: auto; margin: 0 16px 7px; box-shadow: none; background: #f8fafc; }
.tam-ai-widget.conversation .tam-ai-micro-permission::after, .tam-ai-widget.expanded .tam-ai-micro-permission::after { display: none; }
.tam-ai-messages { display: none; min-height: 0; }
.tam-ai-widget.conversation .tam-ai-messages, .tam-ai-widget.expanded .tam-ai-messages { display: flex; flex: 1; padding: 11px 20px 14px; overflow-y: auto; overscroll-behavior: contain; flex-direction: column; gap: 11px; -webkit-overflow-scrolling: touch; }
.tam-ai-message { position: relative; max-width: 89%; padding: 8px 11px; border-radius: 13px; white-space: pre-wrap; overflow-wrap: anywhere; color: #181c27; font-size: 14px; line-height: 1.55; transform-origin: bottom var(--tam-ai-origin, left); animation: tam-ai-message-in .46s cubic-bezier(.2,.9,.25,1.05) both; will-change: transform, opacity; }
.tam-ai-message.no-anim { animation: none; }
.tam-ai-message.bot { align-self: flex-start; padding-left: 0; background: transparent; }
.tam-ai-message.user { --tam-ai-origin: right; align-self: flex-end; color: #0d1220; background: linear-gradient(135deg,#f4f6f8 0%,#e9edf4 100%); border-bottom-right-radius: 4px; box-shadow: 0 2px 10px rgba(15,23,42,.07), inset 0 1px 0 rgba(255,255,255,.9); }
.tam-ai-message.streaming::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 3px; vertical-align: -.12em; border-radius: 2px; background: linear-gradient(180deg,#8b5cf6,#2563eb); animation: tam-ai-caret .82s ease-in-out infinite; }
.tam-ai-message.typing { padding: 10px 13px; border-radius: 14px; background: #f4f6f9; }
.tam-ai-typing { display: inline-flex; align-items: center; gap: 5px; }
.tam-ai-typing i { width: 7px; height: 7px; border-radius: 50%; background: linear-gradient(140deg,#a78bfa,#3b82f6); opacity: .45; animation: tam-ai-typing-dot 1.15s cubic-bezier(.4,0,.2,1) infinite; }
.tam-ai-typing i:nth-child(2) { animation-delay: .16s; }
.tam-ai-typing i:nth-child(3) { animation-delay: .32s; }
@keyframes tam-ai-message-in { from { opacity: 0; transform: translate3d(0,16px,0) scale(.94); filter: blur(7px); } 60% { filter: blur(0); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes tam-ai-typing-dot { 0%,60%,100% { transform: translateY(0) scale(1); opacity: .4; } 30% { transform: translateY(-5px) scale(1.18); opacity: 1; } }
@keyframes tam-ai-caret { 0%,100% { opacity: 1; transform: scaleY(1); } 50% { opacity: .15; transform: scaleY(.75); } }
.tam-ai-widget.listening .tam-ai-voice-hero button { border-color: #fda4af; box-shadow: 0 0 0 4px rgba(244,63,94,.12), 0 7px 20px rgba(190,18,60,.18); }
.tam-ai-actions { display: grid; grid-template-columns: 1fr; gap: 6px; flex: 0 0 auto; padding: 0 11px 7px; }
.tam-ai-widget.conversation .tam-ai-actions, .tam-ai-widget.expanded .tam-ai-actions { padding: 3px 20px 8px; }
.tam-ai-action { min-height: 31px; padding: 5px 9px; border: 1px solid #242832; border-radius: 4px; color: #252832; background: #fff; font-size: 12px; font-weight: 500; cursor: pointer; transition: background .15s,transform .15s; }
.tam-ai-widget.conversation .tam-ai-action, .tam-ai-widget.expanded .tam-ai-action { min-height: 38px; border-radius: 7px; font-size: 13px; font-weight: 650; }
.tam-ai-action:hover { background: #f7f7f8; transform: translateY(-1px); }
.tam-ai-action.secondary { border-color: #cdd2d8; }
.tam-ai-input-wrap { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; min-height: 49px; margin: 0 11px; padding: 3px 5px 3px 12px; border: 1px solid #d4d8dd; border-radius: 5px; background: #fff; }
.tam-ai-widget.conversation .tam-ai-input-wrap, .tam-ai-widget.expanded .tam-ai-input-wrap { min-height: 55px; margin: 0 20px; padding-left: 15px; border-radius: 6px; }
.tam-ai-input-wrap:focus-within { border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139,92,246,.1); }
.tam-ai-input-wrap input { flex: 1; min-width: 0; height: 34px; padding: 0; border: 0 !important; outline: 0 !important; color: #111827; background: transparent; box-shadow: none !important; font-size: 13px; }
.tam-ai-input-wrap button { display: grid; place-items: center; flex: 0 0 auto; width: 31px; height: 31px; padding: 0; border: 0; border-radius: 6px; color: #27313d; background: transparent; cursor: pointer; }
.tam-ai-input-wrap button.recording { color: #fff; background: #e11d48; }
.tam-ai-input-wrap #tam-ai-send { color: #89919c; background: #e9edf0; font-size: 19px; transition: background .15s,color .15s; }
.tam-ai-input-wrap:focus-within #tam-ai-send { color: #fff; background: #111827; }
.tam-ai-input-wrap button:disabled { opacity: .45; cursor: wait; }
.tam-ai-widget footer { display: flex; justify-content: center; gap: 22px; flex: 0 0 27px; padding: 6px 12px 8px; }
.tam-ai-widget footer button, .tam-ai-widget footer a { padding: 0; border: 0; color: #7f8791; background: none; font-size: 9px; text-decoration: underline; cursor: pointer; }
.tam-ai-widget.compact footer button { display: none; }
.tam-ai-lead-card { align-self: stretch; padding: 13px; border: 1px solid #d6dbe1; border-radius: 12px; background: #f8fafc; animation: tam-ai-message-in .46s cubic-bezier(.2,.9,.25,1.05) both; }
.tam-ai-lead-card strong { display: block; font-size: 13px; }
.tam-ai-lead-card p { margin: 5px 0 9px; color: #667085; font-size: 12px; line-height: 1.4; }
.tam-ai-lead-card > div { display: flex; gap: 6px; }
.tam-ai-lead-card input { min-width: 0; flex: 1; height: 37px; padding: 0 9px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; }
.tam-ai-lead-card button { flex: 0 0 auto; padding: 0 11px; border: 0; border-radius: 6px; color: #fff; background: #111827; font-weight: 650; cursor: pointer; }
.tam-ai-lead-card small { display: none; margin-top: 5px; color: #dc2626; font-size: 11px; }
.tam-ai-lead-card.invalid small { display: block; }
.tam-ai-lead-card.invalid input { border-color: #dc2626; }
@media (max-width: 520px) {
  .tam-ai-widget, .tam-ai-widget.conversation { right: 10px; bottom: 10px; max-width: calc(100vw - 20px); }
  .tam-ai-widget.conversation { width: calc(100vw - 20px); height: min(650px,calc(100dvh - 20px)); }
  .tam-ai-widget.expanded { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100dvh; border-radius: 0; }
  .tam-ai-launcher { right: 16px; bottom: 16px; }
  .tam-ai-micro-permission { right: 0; width: min(296px,calc(100vw - 20px)); }
}
@media (prefers-reduced-motion: reduce) { .tam-ai-widget *, .tam-ai-launcher { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

