.td-chat, .td-chat * { box-sizing:border-box; }
.td-chat { position:fixed; right:24px; bottom:22px; z-index:1000; font-family:Involve,Arial,sans-serif; color:#10254a; font-size:14px; line-height:1.45; }
.td-chat button, .td-chat textarea { font:inherit; }
.td-chat__launcher { width:auto; min-width:204px; height:58px; padding:0 20px 0 15px; border:0; border-radius:18px; background:#1264e5; color:#fff; box-shadow:0 12px 36px rgba(2,31,78,.25); display:flex; align-items:center; gap:11px; cursor:pointer; transition:transform .2s,background .2s; position:relative; }
.td-chat__launcher:hover { background:#0b53c5; transform:translateY(-2px); }
.td-chat__launcher:focus-visible, .td-chat__icon:focus-visible, .td-chat__send:focus-visible, .td-chat__quick button:focus-visible { outline:3px solid rgba(18,100,229,.35); outline-offset:2px; }
.td-chat__launcher-icon { width:34px; height:34px; border-radius:11px; display:grid; place-items:center; background:rgba(255,255,255,.16); flex:none; }
.td-chat__launcher-icon svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8; }
.td-chat__launcher-text { text-align:left; font-weight:600; font-size:14px; line-height:1.25; }
.td-chat__launcher-text small { display:block; font-weight:400; opacity:.78; margin-top:3px; font-size:11px; }
.td-chat__badge { display:none; position:absolute; right:-4px; top:-5px; min-width:22px; height:22px; padding:0 6px; border-radius:99px; background:#ffb547; color:#10254a; border:3px solid #fff; place-items:center; font-size:11px; font-weight:700; }
.td-chat__badge.visible { display:grid; }
.td-chat__panel { position:fixed; inset:24px; width:auto; height:auto; min-height:0; background:#fff; border:1px solid #dce5f2; border-radius:22px; box-shadow:0 22px 70px rgba(2,31,78,.25); overflow:hidden; display:flex; flex-direction:column; opacity:0; visibility:hidden; transform:translateY(14px) scale(.99); transform-origin:center; transition:opacity .18s,transform .18s,visibility .18s; }
.td-chat.open .td-chat__panel { opacity:1; visibility:visible; transform:none; }
.td-chat.open .td-chat__launcher { opacity:0; visibility:hidden; pointer-events:none; }
.td-chat__header { background:linear-gradient(120deg,#052c64,#0758bf); color:#fff; padding:16px 15px; display:flex; gap:11px; align-items:center; flex:none; }
.td-chat__avatar { width:40px; height:40px; flex:none; border-radius:13px; background:rgba(255,255,255,.14); display:grid; place-items:center; font-size:17px; font-weight:700; }
.td-chat__title { min-width:0; flex:1; }
.td-chat__title b { display:block; font-size:14px; }
.td-chat__title span { display:flex; align-items:center; gap:6px; font-size:11px; opacity:.78; margin-top:3px; }
.td-chat__title span:before { content:""; width:6px; height:6px; border-radius:50%; background:#72e3b1; flex:none; }
.td-chat__icon { width:34px; height:34px; border:0; border-radius:10px; color:#fff; background:rgba(255,255,255,.1); display:grid; place-items:center; cursor:pointer; flex:none; }
.td-chat__icon:hover { background:rgba(255,255,255,.2); }
.td-chat__icon svg { width:18px; height:18px; stroke:currentColor; stroke-width:2; fill:none; }
.td-chat__messages { flex:1; overflow-y:auto; overscroll-behavior:contain; padding:18px 14px 10px; background:#f5f8fc; scroll-behavior:smooth; }
.td-chat__day { text-align:center; color:#8290a7; font-size:10px; margin:0 0 14px; }
.td-chat__msg { display:flex; margin:0 0 10px; animation:td-chat-in .18s ease-out; }
.td-chat__bubble { max-width:88%; padding:10px 12px; border-radius:6px 15px 15px 15px; background:#fff; box-shadow:0 1px 3px rgba(16,37,74,.07); white-space:pre-wrap; overflow-wrap:anywhere; font-size:13px; }
.td-chat__msg--visitor { justify-content:flex-end; }
.td-chat__msg--visitor .td-chat__bubble { color:#fff; background:#1264e5; border-radius:15px 6px 15px 15px; box-shadow:none; }
.td-chat__msg--operator .td-chat__bubble { background:#e9f8f0; border:1px solid #c6ead5; }
.td-chat__sender { display:block; color:#247248; font-size:10px; font-weight:600; margin-bottom:3px; }
.td-chat__time { display:block; text-align:right; font-size:9px; opacity:.5; margin-top:4px; }
.td-chat__quick { padding:0 14px 10px; display:flex; flex-wrap:wrap; gap:6px; background:#f5f8fc; }
.td-chat__quick:empty { display:none; }
.td-chat__quick button { border:1px solid #bdd2ed; border-radius:99px; color:#0a54ba; background:#fff; padding:7px 10px; cursor:pointer; font-size:11px; text-align:left; }
.td-chat__quick button:hover { background:#eaf2ff; border-color:#83abe0; }
.td-chat__composer { background:#fff; border-top:1px solid #e3eaf3; padding:11px 12px 8px; flex:none; }
.td-chat__input-row { display:flex; gap:8px; align-items:flex-end; }
.td-chat__input { width:100%; min-height:42px; max-height:100px; resize:none; border:1px solid #cfdae8; border-radius:13px; padding:10px 12px; color:#10254a; background:#fff; outline:none; line-height:1.4; }
.td-chat__input:focus { border-color:#5895e4; box-shadow:0 0 0 3px rgba(18,100,229,.08); }
.td-chat__input::placeholder { color:#8d9aaf; }
.td-chat__send { flex:none; width:42px; height:42px; border:0; border-radius:13px; background:#1264e5; color:#fff; display:grid; place-items:center; cursor:pointer; }
.td-chat__send:hover { background:#0b53c5; }
.td-chat__send:disabled { opacity:.5; cursor:wait; }
.td-chat__send svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.8; }
.td-chat__legal { display:block; text-align:center; color:#8a97a9; font-size:9px; margin-top:6px; text-decoration:none; }
.td-chat__legal:hover { color:#1264e5; }
.td-chat__typing { display:flex; gap:4px; padding:4px 2px; }
.td-chat__typing i { width:5px; height:5px; border-radius:50%; background:#8da0b9; animation:td-chat-dot 1s infinite alternate; }
.td-chat__typing i:nth-child(2) { animation-delay:.2s; }
.td-chat__typing i:nth-child(3) { animation-delay:.4s; }
.form__chat-link { display:block; margin:12px auto 0; border:0; background:none; color:#1264e5; font:inherit; font-size:14px; text-decoration:underline; text-underline-offset:3px; cursor:pointer; }
.apply__chat { margin-top:18px; }
@keyframes td-chat-in { from { opacity:0; transform:translateY(5px); } }
@keyframes td-chat-dot { to { opacity:.3; transform:translateY(-2px); } }
@media (max-width:600px) {
  .td-chat { right:14px; bottom:14px; }
  .td-chat__launcher { min-width:0; width:56px; height:56px; border-radius:18px; padding:0; justify-content:center; }
  .td-chat__launcher-icon { background:none; }
  .td-chat__launcher-text { display:none; }
  .td-chat__panel { position:fixed; inset:10px; width:auto; height:auto; min-height:0; border-radius:20px; transform:translateY(12px); }
  .td-chat__messages { padding-top:14px; }
  .td-chat__bubble { max-width:91%; font-size:13px; }
}
@media (prefers-reduced-motion:reduce) { .td-chat *, .td-chat__panel { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }
