/* Telegram chat demo on the welcome #alerts section. No external libs. */
.alerts-sec .as-wrap{align-items:start}
.tg-demo{margin:0;min-width:0;width:100%}
.tg-demo .tg-phone{
  --tg-hdr:#17212b;
  --tg-chat:#0e1621;
  --tg-bubble:#182533;
  --tg-out:#2b5278;
  --tg-text:#e9eef4;
  --tg-dim:#7f8b99;
  --tg-link:#6ab3f3;
  --tg-line:#101821;
  --tg-btn:#17212b;
  --tg-btn-line:#3d4f61;
  width:100%;
  max-width:340px;
  margin:0 auto;
  padding:10px 8px 12px;
  background:linear-gradient(180deg,#1a1f26,#0a0c0f);
  border:1px solid #2a3340;
  border-radius:36px;
  box-shadow:0 24px 60px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.06);
}
.tg-bezel{
  display:flex;
  flex-direction:column;
  height:min(660px,82vh);
  min-height:480px;
  border-radius:26px;
  overflow:hidden;
  background:var(--tg-chat);
  border:1px solid #000;
}
.tg-hdr{
  display:flex;
  align-items:center;
  gap:8px;
  flex:0 0 auto;
  height:56px;
  padding:0 10px 0 4px;
  background:var(--tg-hdr);
  border-bottom:1px solid var(--tg-line);
}
.tg-back{color:#6ab3f3;font-size:32px;line-height:1;width:22px;text-align:center;font-weight:300}
.as-fig.tg-demo img.tg-ava,
.as-fig.tg-demo img.tg-ava-sm,
.tg-demo img.tg-ava,
.tg-demo img.tg-ava-sm{
  display:block;
  flex:0 0 auto;
  background:#000;
  border-radius:50%;
  object-fit:cover;
  box-shadow:none;
  margin:0;
}
.as-fig.tg-demo img.tg-ava,
.tg-demo img.tg-ava{width:40px;height:40px;max-width:40px;max-height:40px}
.as-fig.tg-demo img.tg-ava-sm,
.tg-demo img.tg-ava-sm{width:28px;height:28px;max-width:28px;max-height:28px;margin-top:18px;align-self:flex-end}
.tg-who{min-width:0;flex:1}
.tg-name{font:600 15px/1.2 Inter,"Segoe UI",system-ui,sans-serif;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tg-sub{font:400 12px/1.2 Inter,"Segoe UI",system-ui,sans-serif;color:var(--tg-dim);margin-top:1px}
.tg-chat{
  flex:1 1 auto;
  overflow:hidden; /* JS still sets scrollTop for the loop; not a user scroll container */
  overscroll-behavior:auto;
  padding:8px 8px 10px;
  background:var(--tg-chat);
  pointer-events:none; /* swipe/wheel over the chat continues page scroll */
  touch-action:auto;
}
/* Decorative phone mock: don't capture touch or wheel; figcaption stays normal. */
.tg-demo .tg-phone,
.tg-demo .tg-bezel{pointer-events:none}
.tg-demo figcaption{pointer-events:auto}
.tg-date{
  display:block;
  width:max-content;
  max-width:90%;
  margin:4px auto 8px;
  padding:3px 10px;
  border-radius:999px;
  background:#182533;
  color:var(--tg-dim);
  font:600 11px/1.4 Inter,"Segoe UI",system-ui,sans-serif;
  letter-spacing:.01em;
}
.tg-row{display:flex;align-items:flex-end;gap:6px;margin:0 0 6px;max-width:100%}
.tg-row.out{justify-content:flex-end}
.tg-col{min-width:0;max-width:86%}
.tg-row.out .tg-col{max-width:78%}
.tg-bubble{
  position:relative;
  padding:6px 9px 4px;
  border-radius:12px;
  background:var(--tg-bubble);
  color:var(--tg-text);
  font:400 13px/1.4 Inter,"Segoe UI",system-ui,sans-serif,"Noto Color Emoji","Apple Color Emoji","Segoe UI Emoji";
  word-wrap:break-word;
  overflow-wrap:anywhere;
}
.tg-row.out .tg-bubble{background:var(--tg-out);border-bottom-right-radius:4px}
.tg-row.in .tg-bubble{border-bottom-left-radius:4px}
.tg-bubble .tg-link{color:var(--tg-link);text-decoration:none;border-bottom:1px solid rgba(106,179,243,.35);pointer-events:none}
.tg-time{display:block;text-align:right;font:400 11px/1.4 Inter,"Segoe UI",system-ui,sans-serif;color:var(--tg-dim);margin-top:2px;letter-spacing:.01em}
.tg-row.out .tg-time{color:#9ec2e0}
.tg-kb{display:flex;flex-direction:column;gap:4px;margin:5px 0 0;width:100%}
.tg-kb-row{display:flex;gap:4px}
.tg-kbtn{
  flex:1 1 0;
  text-align:center;
  padding:7px 4px;
  border-radius:8px;
  background:var(--tg-btn);
  border:1px solid var(--tg-btn-line);
  color:#e9eef4;
  font:600 11.5px/1.2 Inter,"Segoe UI",system-ui,sans-serif,"Noto Color Emoji","Apple Color Emoji","Segoe UI Emoji";
  white-space:nowrap;
  pointer-events:none;
  user-select:none;
}
.tg-kbtn.on{border-color:#ff7a1a;background:#1b140e;color:#ffc48a}
.tg-comp{
  display:flex;align-items:center;gap:8px;
  flex:0 0 auto;
  min-height:48px;
  padding:6px 10px 8px;
  background:var(--tg-hdr);
  border-top:1px solid var(--tg-line);
}
.tg-menu{
  flex:0 0 auto;
  color:#ff7a1a;
  font:700 12px/1 Inter,"Segoe UI",system-ui,sans-serif;
  padding:6px 2px;
}
.tg-field{
  position:relative;
  flex:1 1 auto;
  min-height:32px;
  padding:7px 12px;
  border-radius:18px;
  background:#242f3d;
  color:var(--tg-text);
  font:400 14px/1.3 Inter,"Segoe UI",system-ui,sans-serif;
  display:flex;align-items:center;
  white-space:nowrap;
  overflow:hidden;
}
.tg-ph{color:var(--tg-dim)}
.tg-demo.is-typing .tg-ph{display:none}
.tg-caret{
  display:none;
  width:1.5px;height:15px;margin-left:1px;
  background:#6ab3f3;
  animation:tg-blink 1s steps(1) infinite;
}
.tg-demo.is-typing .tg-caret{display:inline-block}
@keyframes tg-blink{50%{opacity:0}}
.tg-dots{display:flex;align-items:center;gap:5px;padding:10px 14px;min-width:52px}
.tg-dots i{
  width:7px;height:7px;border-radius:50%;background:#7f8b99;
  animation:tg-dot 1.05s ease-in-out infinite;
}
.tg-dots i:nth-child(2){animation-delay:.15s}
.tg-dots i:nth-child(3){animation-delay:.3s}
@keyframes tg-dot{0%,80%,100%{opacity:.28;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}
.tg-row.tg-typing-row{display:none}
.tg-demo.is-bot-typing .tg-typing-row{display:flex}
.tg-date{display:none}
.tg-row[data-step]{display:none}
.tg-demo.is-static .tg-date,
.tg-demo .tg-date.is-on{display:block;opacity:1;transform:none}
.tg-demo.is-static .tg-row[data-step],
.tg-demo .tg-row[data-step].is-on{display:flex;opacity:1;transform:none}
.tg-demo:not(.is-static) .tg-row[data-step].is-on,
.tg-demo:not(.is-static) .tg-date.is-on{animation:tg-in .38s ease both}
@keyframes tg-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.tg-demo figcaption{
  margin:12px auto 0;
  max-width:340px;
  font-size:12px;
  line-height:1.45;
  color:var(--muted);
  text-align:center;
}
@media (max-width:900px){
  .tg-demo .tg-phone{max-width:360px}
}
@media (prefers-reduced-motion:reduce){
  .tg-caret,.tg-dots i{animation:none !important}
  .tg-demo .tg-row[data-step]{display:flex;opacity:1;transform:none;pointer-events:auto}
  .tg-demo .tg-date{display:block;opacity:1;transform:none;pointer-events:auto}
  .tg-demo.is-bot-typing .tg-typing-row{display:none}
  .tg-demo.is-typing .tg-caret{display:none}
  .tg-demo.is-typing .tg-ph{display:inline}
}
