:root{
  --ic-primary:#e43f24;
  --ic-shadow:0 22px 60px rgba(0,0,0,.22);
}

/* Bubble */
#inovotec-chat-bubble{
  position:fixed;
  right:20px;
  bottom:20px;
  z-index:99999;
  width:58px;
  height:58px;
  border-radius:999px;
  border:0;
  cursor:pointer;
  box-shadow:0 14px 32px rgba(0,0,0,.18);
  background:var(--ic-primary);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:22px;
}
.ic-bubble-dot{
  position:absolute;
  top:10px;
  right:10px;
  width:10px;
  height:10px;
  border-radius:999px;
  background:#b8b8b8;
  border:2px solid rgba(255,255,255,.95);
}
.ic-bubble-dot.online{ background:#2ecc71; }

/* Panel */
#inovotec-chat-panel{
  position:fixed;
  right:20px;
  bottom:92px;
  z-index:99999;
  width:360px;
  max-width:92vw;
  height:520px;
  max-height:72vh;
  background:#fff;
  border-radius:18px;
  box-shadow:var(--ic-shadow);
  border:1px solid rgba(0,0,0,.06);

  /* IMPORTANT: JS atidarant pakeičia į display:flex */
  display:none;
  flex-direction:column;

  /* kad vidiniai scrollai veiktų stabiliai */
  overflow:hidden;
}

/* Header */
#inovotec-chat-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 12px;
  background:var(--ic-primary);
  color:#fff;
}
.ic-agent{ display:flex; align-items:center; gap:10px; min-width:0; }
.ic-avatar{
  width:36px; height:36px; border-radius:12px; overflow:hidden;
  background:rgba(255,255,255,.18); flex:0 0 auto;
}
.ic-avatar img{ width:100%; height:100%; object-fit:cover; display:block; }
.ic-agent-meta{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.ic-agent-name{
  font-weight:800; font-size:14px; line-height:1.1;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.ic-agent-status{ display:flex; align-items:center; gap:6px; font-size:12px; opacity:.92; }
.ic-dot{ width:8px; height:8px; border-radius:999px; background:#b8b8b8; }
.ic-dot.online{ background:#2ecc71; }

#inovotec-chat-close{
  background:rgba(255,255,255,.16);
  border:0; color:#fff;
  width:34px; height:34px;
  border-radius:12px;
  font-size:18px; cursor:pointer;
}

/* Messages (SCROLL CONTAINER) */
#inovotec-chat-messages{
  flex: 1 1 auto;
  min-height: 0;               /* SVARBIAUSIA flex scroll'ui */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;

  /* kad scrollas neperduotų puslapiui */
  overscroll-behavior: contain;
  touch-action: pan-y;

  padding:12px;
  background:linear-gradient(#fbfbfb,#f4f4f4);
}

/* Vien tik margin, be gap/flex ant scroll konteinerio */
.ic-msg{
  display:flex;
  margin:0 0 10px 0;
}
.ic-msg:last-child{ margin-bottom:0; }

.ic-msg.visitor{ justify-content:flex-end; }
.ic-wrap{ max-width:82%; }

.ic-bubble{
  padding:10px 12px;
  border-radius:14px;
  background:#fff;
  box-shadow:0 3px 14px rgba(0,0,0,.06);
  white-space:pre-wrap;
  word-break:break-word;
  border:1px solid rgba(0,0,0,.06);
  font-size:14px;
}
.ic-msg.visitor .ic-bubble{
  background:var(--ic-primary);
  color:#fff;
  border-color:rgba(255,255,255,.16);
}

.ic-img{
  width:100%;
  max-width:240px;
  height:auto;
  border-radius:12px;
  display:block;
}
.ic-caption{ margin-top:8px; font-size:13px; opacity:.95; }

.ic-ts{ font-size:11px; opacity:.65; margin-top:4px; padding:0 2px; }

/* Seen */
.ic-seen{
  font-size:12px;
  opacity:.75;
  margin-top:4px;
  padding:0 2px;
}

/* System line */
.ic-system{
  text-align:center;
  font-size:12px;
  opacity:.7;
  padding:8px 10px;
  margin:6px 0;
}

/* Typing row */
.ic-typing{
  padding:8px 12px;
  font-size:12px;
  opacity:.8;
  background:#fff;
  border-top:1px solid rgba(0,0,0,.06);
  display:flex;
  align-items:center;
  gap:6px;
}
.ic-dots span{
  display:inline-block;
  width:6px;
  animation: icBlink 1.2s infinite;
}
.ic-dots span:nth-child(2){ animation-delay:.15s; }
.ic-dots span:nth-child(3){ animation-delay:.3s; }
@keyframes icBlink{
  0%, 20% { opacity:.2; transform: translateY(0); }
  50% { opacity:1; transform: translateY(-1px); }
  100% { opacity:.2; transform: translateY(0); }
}

/* Composer */
#inovotec-chat-form{
  display:flex;
  gap:10px;
  padding:12px;
  background:#fff;
  border-top:1px solid rgba(0,0,0,.06);
  align-items:center;
}

.ic-attach{
  width:40px;
  height:40px;
  border-radius:14px;
  border:1px solid rgba(0,0,0,.14);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  user-select:none;
}
.ic-attach input{ display:none; }

#inovotec-chat-input{
  flex:1;
  border:1px solid rgba(0,0,0,.14);
  border-radius:14px;
  padding:11px 12px;
  outline:none;
  font-size:14px;
}
#inovotec-chat-send{
  border:0;
  border-radius:14px;
  padding:11px 14px;
  cursor:pointer;
  background:var(--ic-primary);
  color:#fff;
  font-weight:800;
}
#inovotec-chat-send:disabled{ opacity:.6; cursor:not-allowed; }

@media (max-width:420px){
  #inovotec-chat-panel{ width:92vw; right:4vw; }
}
