/* TLM-Bot chat widget v2.2
 * Every rule is scoped to #tlmbot-root and starts from a reset, so theme / Elementor
 * button and input styles can't leak into the chat.
 */
#tlmbot-root { --tlmb-primary: #14254A; --tlmb-accent: #E8692C; --tlmb-text: #1D2433; --tlmb-muted: #6B7282; --tlmb-line: #E6E9F0; --tlmb-bg: #F6F7FA;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
  font-size: 14px; line-height: 1.5; color: var(--tlmb-text); -webkit-font-smoothing: antialiased; }

/* ── Reset (beats theme rules like `button {}` / `[type=button] {}` / `input {}`) ── */
#tlmbot-root *, #tlmbot-root *::before, #tlmbot-root *::after { box-sizing: border-box; }
#tlmbot-root button,
#tlmbot-root input:not([type=checkbox]),
#tlmbot-root a,
#tlmbot-root form { all: unset; box-sizing: border-box; font-family: inherit; }
#tlmbot-root button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
#tlmbot-root button:disabled { cursor: default; }
#tlmbot-root svg { display: block; flex-shrink: 0; }
#tlmbot-root img { max-width: 100%; height: auto; border: 0; box-shadow: none; border-radius: 0; }
#tlmbot-root p, #tlmbot-root div, #tlmbot-root span, #tlmbot-root label { font-family: inherit; letter-spacing: normal; text-transform: none; }
#tlmbot-root button:focus-visible, #tlmbot-root a:focus-visible { outline: 2px solid var(--tlmb-accent); outline-offset: 2px; }

/* ── Launcher ─────────────────────────────────────────────── */
#tlmbot-root #tlmb-fab { position: fixed; bottom: 24px; right: 24px; width: 60px; height: 60px; border-radius: 50%; background: var(--tlmb-accent); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 28px rgba(20,37,74,.30); z-index: 99998; transition: transform .2s ease, box-shadow .2s ease; overflow: hidden; }
#tlmbot-root #tlmb-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(20,37,74,.36); }
#tlmbot-root #tlmb-fab svg { width: 26px; height: 26px; }
#tlmbot-root #tlmb-fab .tlmb-ico-close { display: none; }
#tlmbot-root #tlmb-fab.tlmb-fab-open .tlmb-ico-chat { display: none; }
#tlmbot-root #tlmb-fab.tlmb-fab-open .tlmb-ico-close { display: block; }
#tlmbot-root #tlmb-fab.tlmb-fab-logo { background: #fff; border: 2px solid var(--tlmb-accent); }
#tlmbot-root #tlmb-fab.tlmb-fab-logo svg.tlmb-ico-chat { display: none; }
#tlmbot-root #tlmb-fab.tlmb-fab-logo img.tlmb-ico-chat { width: 70%; height: 70%; object-fit: contain; }
#tlmbot-root #tlmb-fab.tlmb-fab-logo.tlmb-fab-open { background: var(--tlmb-accent); }
#tlmbot-root #tlmb-fab.tlmb-fab-logo.tlmb-fab-open img { display: none; }
#tlmbot-root #tlmb-fab.tlmb-fab-logo .tlmb-ico-close { color: #fff; }

/* Pop-up message */
#tlmbot-root #tlmb-teaser { position: fixed; right: 24px; bottom: 96px; max-width: 260px; background: #fff; color: var(--tlmb-text); font-size: 14px; font-weight: 500; line-height: 1.45; padding: 12px 34px 12px 14px; border-radius: 14px 14px 4px 14px; box-shadow: 0 10px 30px rgba(20,37,74,.18); z-index: 99997; cursor: pointer; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .25s ease, transform .25s ease; }
#tlmbot-root #tlmb-teaser.tlmb-show { opacity: 1; transform: none; pointer-events: auto; }
#tlmbot-root #tlmb-teaser-x { position: absolute; top: 6px; right: 8px; width: 20px; height: 20px; line-height: 20px; text-align: center; font-size: 16px; color: #9AA1AF; border-radius: 50%; }
#tlmbot-root #tlmb-teaser-x:hover { background: #F0F2F6; color: var(--tlmb-text); }

/* ── Window ───────────────────────────────────────────────── */
#tlmbot-root #tlmb-window { position: fixed; bottom: 98px; right: 24px; width: 384px; height: min(640px, calc(100vh - 124px)); background: #fff; border-radius: 20px; display: flex; flex-direction: column; z-index: 99999; box-shadow: 0 24px 60px rgba(20,37,74,.25), 0 2px 8px rgba(20,37,74,.08); transform: translateY(14px) scale(.98); transform-origin: bottom right; opacity: 0; visibility: hidden; transition: transform .22s ease, opacity .22s ease, visibility 0s linear .22s; overflow: hidden; }
#tlmbot-root #tlmb-window.tlmb-open { transform: none; opacity: 1; visibility: visible; transition: transform .22s ease, opacity .22s ease; }

/* Header */
#tlmbot-root #tlmb-header { background: var(--tlmb-primary); padding: 16px 12px 16px 16px; display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
#tlmbot-root #tlmb-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--tlmb-accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
#tlmbot-root #tlmb-avatar svg { width: 21px; height: 21px; color: #fff; }
#tlmbot-root #tlmb-avatar.tlmb-has-logo { background: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
#tlmbot-root #tlmb-avatar img { width: 80%; height: 80%; object-fit: contain; }
#tlmbot-root #tlmb-header-info { flex: 1; min-width: 0; }
#tlmbot-root #tlmb-bot-name { font-size: 16px; font-weight: 700; color: #fff; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tlmbot-root #tlmb-bot-sub { font-size: 12.5px; color: rgba(255,255,255,.78); display: flex; align-items: center; gap: 6px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tlmbot-root .tlmb-online { width: 8px; height: 8px; border-radius: 50%; background: #3DDC84; box-shadow: 0 0 0 2px rgba(61,220,132,.25); flex-shrink: 0; }
#tlmbot-root #tlmb-close-btn, #tlmbot-root #tlmb-restart { width: 34px; height: 34px; border-radius: 10px; color: rgba(255,255,255,.8); display: flex; align-items: center; justify-content: center; transition: background .15s; }
#tlmbot-root #tlmb-close-btn:hover, #tlmbot-root #tlmb-restart:hover { color: #fff; background: rgba(255,255,255,.12); }
#tlmbot-root #tlmb-close-btn svg, #tlmbot-root #tlmb-restart svg { width: 18px; height: 18px; }

/* Body */
#tlmbot-root #tlmb-body { flex: 1; overflow-y: auto; padding: 18px 14px 12px; display: flex; flex-direction: column; gap: 10px; background: var(--tlmb-bg); overscroll-behavior: contain; scrollbar-width: thin; }
#tlmbot-root .tlmb-msg-wrap { display: flex; flex-direction: column; max-width: 100%; }
#tlmbot-root .tlmb-msg-wrap.tlmb-user { align-items: flex-end; }
#tlmbot-root .tlmb-bubble { padding: 11px 14px; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; max-width: 86%; margin: 0; }
#tlmbot-root .tlmb-bubble.tlmb-bot { background: #fff; color: var(--tlmb-text); border-radius: 4px 18px 18px 18px; border: 1px solid var(--tlmb-line); box-shadow: 0 1px 2px rgba(20,37,74,.04); }
#tlmbot-root .tlmb-bubble.tlmb-user { background: var(--tlmb-primary); color: #fff; border-radius: 18px 4px 18px 18px; }
#tlmbot-root .tlmb-bubble a { color: var(--tlmb-accent); text-decoration: underline; cursor: pointer; }
#tlmbot-root .tlmb-bubble strong { font-weight: 600; }
#tlmbot-root .tlmb-msg-time { font-size: 10.5px; color: #A3A9B6; margin-top: 4px; padding: 0 4px; }
#tlmbot-root .tlmb-src { font-size: 11.5px; margin-top: 8px; padding-top: 7px; border-top: 1px dashed var(--tlmb-line); }
#tlmbot-root .tlmb-src-kb { color: #1B8A4B; }
#tlmbot-root .tlmb-src-ai { color: #8A6A1B; }

/* Chips */
#tlmbot-root .tlmb-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 2px 0 4px; }
#tlmbot-root .tlmb-chips-stack { flex-direction: column; align-items: stretch; max-width: 92%; }
#tlmbot-root .tlmb-chips-title { width: 100%; font-size: 11px; font-weight: 600; color: #8A90A0; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 1px; }
#tlmbot-root .tlmb-chip { display: inline-block; background: #fff; border: 1.5px solid var(--tlmb-accent); color: var(--tlmb-primary); border-radius: 999px; padding: 7px 14px; font-size: 13.5px; font-weight: 500; line-height: 1.35; text-align: left; transition: background .15s, color .15s, opacity .15s; }
#tlmbot-root .tlmb-chips-stack .tlmb-chip { display: block; border-radius: 12px; padding: 10px 14px; }
#tlmbot-root .tlmb-chip:hover:not(:disabled) { background: var(--tlmb-accent); color: #fff; }
#tlmbot-root .tlmb-chip-picked { background: var(--tlmb-accent); color: #fff; }
#tlmbot-root .tlmb-chip-dim { opacity: .38; }
#tlmbot-root .tlmb-chip-cta { background: var(--tlmb-primary); border-color: var(--tlmb-primary); color: #fff; }
#tlmbot-root .tlmb-chip-ghost { border-color: #CDD2DC; color: var(--tlmb-muted); }

/* Typing */
#tlmbot-root #tlmb-typing { display: inline-flex; align-items: center; gap: 5px; padding: 12px 15px; background: #fff; border: 1px solid var(--tlmb-line); border-radius: 4px 18px 18px 18px; width: max-content; }
#tlmbot-root .tlmb-dot { width: 7px; height: 7px; border-radius: 50%; background: #B6BCC8; animation: tlmb-bounce .9s ease-in-out infinite; }
#tlmbot-root .tlmb-dot:nth-child(2) { animation-delay: .15s; }
#tlmbot-root .tlmb-dot:nth-child(3) { animation-delay: .3s; }
@keyframes tlmb-bounce { 0%,80%,100% { transform: translateY(0); } 40% { transform: translateY(-5px); } }

/* Not answered */
#tlmbot-root .tlmb-fallback { background: #FFF6EF; border: 1px solid #F7D3B8; border-radius: 16px; padding: 14px; font-size: 13.5px; color: #5E3216; max-width: 90%; }
#tlmbot-root .tlmb-fallback-title { font-weight: 700; font-size: 14.5px; margin-bottom: 4px; color: #3F1F0B; }
#tlmbot-root .tlmb-fallback-btn, #tlmbot-root .tlmb-fallback-wa { display: block; width: 100%; margin-top: 10px; text-align: center; padding: 11px; border-radius: 12px; font-size: 14px; font-weight: 600; line-height: 1.2; text-decoration: none; }
#tlmbot-root .tlmb-fallback-btn { background: var(--tlmb-accent); color: #fff; }
#tlmbot-root .tlmb-fallback-btn:hover { filter: brightness(.95); }
#tlmbot-root .tlmb-fallback-wa { background: #fff; color: #128C4B; border: 1.5px solid #25D366; }
#tlmbot-root .tlmb-fallback-wa:hover { background: #F1FCF5; }

/* ── Lead card (inline in the conversation) ───────────────── */
#tlmbot-root .tlmb-lead { background: #fff; border: 1px solid var(--tlmb-line); border-radius: 18px; padding: 16px; box-shadow: 0 6px 20px rgba(20,37,74,.08); width: 100%; position: relative; overflow: hidden; }
#tlmbot-root .tlmb-lead::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--tlmb-accent); }
#tlmbot-root .tlmb-lead-head { margin: 2px 0 12px; }
#tlmbot-root .tlmb-lead-title { font-size: 16px; font-weight: 700; color: var(--tlmb-primary); line-height: 1.3; }
#tlmbot-root .tlmb-lead-sub { font-size: 13px; color: var(--tlmb-muted); margin-top: 4px; line-height: 1.5; }
#tlmbot-root .tlmb-field { position: relative; display: flex; align-items: center; margin-bottom: 9px; background: #F7F8FB; border: 1.5px solid #E1E5EC; border-radius: 12px; transition: border-color .15s, box-shadow .15s, background .15s; }
#tlmbot-root .tlmb-field:focus-within { border-color: var(--tlmb-accent); background: #fff; box-shadow: 0 0 0 4px rgba(232,105,44,.12); }
#tlmbot-root .tlmb-field.tlmb-field-err { border-color: #D64545; box-shadow: 0 0 0 4px rgba(214,69,69,.12); }
#tlmbot-root .tlmb-field-ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #9AA1AF; pointer-events: none; display: flex; }
#tlmbot-root .tlmb-field-ico svg { width: 17px; height: 17px; }
#tlmbot-root .tlmb-field:focus-within .tlmb-field-ico { color: var(--tlmb-accent); }
#tlmbot-root .tlmb-field input { display: block; width: 100%; padding: 12px 14px 12px 40px; font-size: 14px; line-height: 1.3; color: var(--tlmb-text); background: transparent; border: 0; min-height: 46px; }
#tlmbot-root .tlmb-field input::placeholder { color: #9AA1AF; opacity: 1; }
#tlmbot-root .tlmb-wa { display: flex; align-items: center; gap: 9px; margin: 0 2px 11px; font-size: 13px; color: var(--tlmb-muted); cursor: pointer; user-select: none; }
#tlmbot-root .tlmb-wa input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
#tlmbot-root .tlmb-wa-box { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid #C5CBD6; background: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .15s, border-color .15s; }
#tlmbot-root .tlmb-wa input:checked + .tlmb-wa-box { background: #25D366; border-color: #25D366; }
#tlmbot-root .tlmb-wa input:checked + .tlmb-wa-box::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
#tlmbot-root .tlmb-wa input:focus-visible + .tlmb-wa-box { outline: 2px solid var(--tlmb-accent); outline-offset: 2px; }
#tlmbot-root .tlmb-wa strong { color: #128C4B; font-weight: 600; }
#tlmbot-root .tlmb-lead-err { color: #C0392B; font-size: 12.5px; margin: -2px 2px 9px; }
#tlmbot-root .tlmb-lead-err:empty { display: none; }
#tlmbot-root .tlmb-lead-submit { display: block; width: 100%; padding: 13px; border-radius: 12px; background: var(--tlmb-accent); color: #fff; font-size: 15px; font-weight: 600; text-align: center; line-height: 1.2; box-shadow: 0 6px 16px rgba(232,105,44,.28); transition: filter .15s, transform .15s; }
#tlmbot-root .tlmb-lead-submit:hover:not(:disabled) { filter: brightness(.95); transform: translateY(-1px); }
#tlmbot-root .tlmb-lead-submit:disabled { opacity: .65; box-shadow: none; }
#tlmbot-root .tlmb-lead-skip { display: block; width: 100%; margin-top: 8px; padding: 8px; text-align: center; font-size: 13px; font-weight: 500; color: var(--tlmb-muted); border-radius: 10px; }
#tlmbot-root .tlmb-lead-skip:hover { color: var(--tlmb-text); background: #F3F4F7; }
#tlmbot-root .tlmb-lead-privacy { display: block; margin-top: 10px; font-size: 11.5px; line-height: 1.5; color: #9AA1AF; text-align: center; }
#tlmbot-root .tlmb-lead-privacy svg { display: inline-block; width: 11px; height: 11px; vertical-align: -1px; margin-right: 4px; }

/* ── Input bar ────────────────────────────────────────────── */
#tlmbot-root #tlmb-input-area { display: flex; gap: 8px; align-items: center; padding: 12px; border-top: 1px solid var(--tlmb-line); background: #fff; flex-shrink: 0; margin: 0; }
#tlmbot-root #tlmb-input { flex: 1; display: block; min-width: 0; padding: 11px 16px; border: 1.5px solid #E1E5EC; border-radius: 999px; font-size: 14px; line-height: 1.3; color: var(--tlmb-text); background: var(--tlmb-bg); min-height: 44px; transition: border-color .15s, background .15s; }
#tlmbot-root #tlmb-input::placeholder { color: #9AA1AF; opacity: 1; }
#tlmbot-root #tlmb-input:focus { border-color: var(--tlmb-accent); background: #fff; }
#tlmbot-root #tlmb-input:disabled { background: #F0F1F4; color: #9AA1AF; }
#tlmbot-root #tlmb-send { width: 44px; height: 44px; border-radius: 50%; background: var(--tlmb-accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: filter .15s; }
#tlmbot-root #tlmb-send:hover:not(:disabled) { filter: brightness(.95); }
#tlmbot-root #tlmb-send svg { width: 18px; height: 18px; color: #fff; margin-left: -2px; }
#tlmbot-root #tlmb-send:disabled { opacity: .45; }

/* ── Mobile: full screen ──────────────────────────────────── */
@media (max-width: 480px) {
  #tlmbot-root #tlmb-window { right: 0; left: 0; bottom: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; }
  #tlmbot-root #tlmb-fab { right: 16px; bottom: 16px; }
  #tlmbot-root #tlmb-fab.tlmb-fab-open { display: none; }
  #tlmbot-root #tlmb-teaser { right: 16px; bottom: 88px; max-width: calc(100vw - 32px); }
  #tlmbot-root #tlmb-input, #tlmbot-root .tlmb-field input { font-size: 16px; } /* stops iOS zoom */
}
@media (prefers-reduced-motion: reduce) {
  #tlmbot-root #tlmb-window, #tlmbot-root #tlmb-fab, #tlmbot-root .tlmb-dot, #tlmbot-root #tlmb-teaser { transition: none; animation: none; }
}

/* ══ v2.2: pulse, name pill, landing popup, left position ═════════════════ */

/* Spinning ring around the button */
#tlmbot-root #tlmb-ring { position: fixed; bottom: 18px; right: 18px; width: 72px; height: 72px; border-radius: 50%; pointer-events: none; z-index: 99997;
  background: conic-gradient(from 0deg, var(--tlmb-accent), transparent 40%, var(--tlmb-accent));
  -webkit-mask: radial-gradient(circle, transparent 32px, #000 33px); mask: radial-gradient(circle, transparent 32px, #000 33px);
  animation: tlmb-spin 2.5s linear infinite; }
@keyframes tlmb-spin { to { transform: rotate(360deg); } }

/* Radar ripples: two rings, 1s apart, so one is always expanding */
#tlmbot-root .tlmb-ripple { position: fixed; bottom: 24px; right: 24px; width: 60px; height: 60px; border-radius: 50%; border: 2px solid var(--tlmb-accent); opacity: 0; pointer-events: none; z-index: 99996; animation: tlmb-ripple 2s ease-out infinite; }
#tlmbot-root .tlmb-ripple-2 { animation-delay: 1s; }
@keyframes tlmb-ripple { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(2.1); opacity: 0; } }

/* Glow on the button while the landing popup is showing */
#tlmbot-root #tlmb-fab.tlmb-glow { animation: tlmb-glow 1.8s ease-in-out infinite; }
@keyframes tlmb-glow {
  0%, 100% { box-shadow: 0 10px 28px rgba(20,37,74,.30); }
  50%      { box-shadow: 0 10px 28px rgba(20,37,74,.30), 0 0 0 9px color-mix(in srgb, var(--tlmb-accent) 22%, transparent); }
}

/* Name pill ("Ask The Language Mentors") */
#tlmbot-root #tlmb-pill { position: fixed; bottom: 35px; right: 102px; display: inline-flex; align-items: center; height: 38px; padding: 0 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap; max-width: calc(100vw - 130px); overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 6px 18px rgba(20,37,74,.22); z-index: 99997; transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease; }
#tlmbot-root #tlmb-pill:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(20,37,74,.28); }

/* Landing popup sits above the ring */
#tlmbot-root #tlmb-teaser { bottom: 104px; }
#tlmbot-root #tlmb-teaser-text { display: block; }

/* While the chat is open: hide ring, ripples, pill and popup */
#tlmbot-root.tlmb-is-open #tlmb-ring,
#tlmbot-root.tlmb-is-open .tlmb-ripple,
#tlmbot-root.tlmb-is-open #tlmb-pill { display: none; }
#tlmbot-root.tlmb-is-open #tlmb-teaser { opacity: 0; pointer-events: none; }

/* ── Left-side position ── */
#tlmbot-root.tlmb-pos-left #tlmb-fab,
#tlmbot-root.tlmb-pos-left .tlmb-ripple { right: auto; left: 24px; }
#tlmbot-root.tlmb-pos-left #tlmb-ring   { right: auto; left: 18px; }
#tlmbot-root.tlmb-pos-left #tlmb-pill   { right: auto; left: 102px; }
#tlmbot-root.tlmb-pos-left #tlmb-teaser { right: auto; left: 24px; border-radius: 14px 14px 14px 4px; }
#tlmbot-root.tlmb-pos-left #tlmb-window { right: auto; left: 24px; transform-origin: bottom left; }

@media (max-width: 480px) {
  #tlmbot-root #tlmb-ring    { bottom: 10px; right: 10px; }
  #tlmbot-root .tlmb-ripple  { bottom: 16px; right: 16px; }
  #tlmbot-root #tlmb-pill    { bottom: 29px; right: 90px; height: 34px; padding: 0 14px; font-size: 13px; max-width: calc(100vw - 110px); }
  #tlmbot-root #tlmb-teaser  { bottom: 94px; }
  #tlmbot-root.tlmb-pos-left #tlmb-fab,
  #tlmbot-root.tlmb-pos-left .tlmb-ripple { left: 16px; }
  #tlmbot-root.tlmb-pos-left #tlmb-ring   { left: 10px; }
  #tlmbot-root.tlmb-pos-left #tlmb-pill   { left: 90px; }
  #tlmbot-root.tlmb-pos-left #tlmb-teaser { left: 16px; }
  #tlmbot-root.tlmb-pos-left #tlmb-window { left: 0; right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  #tlmbot-root .tlmb-ripple { display: none; }
  #tlmbot-root #tlmb-ring, #tlmbot-root #tlmb-fab.tlmb-glow, #tlmbot-root #tlmb-pill { animation: none; transition: none; }
}
