#icbot-root { position: fixed; bottom: max(22px, env(safe-area-inset-bottom)); right: max(22px, env(safe-area-inset-right)); z-index: 2147483000; font-family: 'Inter', system-ui, sans-serif; }

#icbot-root button { -webkit-appearance: none; appearance: none; }

#icbot-toggle {
  position: relative; width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, #FF6A3D, #D8381A);
  border: none; cursor: pointer;
  box-shadow: 0 10px 30px rgba(232,68,26,.45), 0 0 44px rgba(232,68,26,.22), inset 0 1px 0 rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s ease, box-shadow .25s ease;
}
#icbot-toggle:hover { transform: scale(1.07) translateY(-2px); box-shadow: 0 16px 40px rgba(232,68,26,.55), 0 0 60px rgba(232,68,26,.30), inset 0 1px 0 rgba(255,255,255,.25); }
#icbot-toggle .icbot-ic-open { width: 27px; height: 27px; }
#icbot-toggle .icbot-d { animation: icbotBlink 1.6s infinite; }
#icbot-toggle .icbot-d2 { animation-delay: .25s; }
#icbot-toggle .icbot-d3 { animation-delay: .5s; }
.icbot-pulse { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 0 rgba(232,68,26,.5); animation: icbotPulse 2.4s infinite; }
.icbot-halo { position: absolute; inset: -7px; border-radius: 50%; border: 1px solid rgba(232,68,26,.5); animation: icbotHalo 2.4s ease-out infinite; }
@keyframes icbotPulse { 0% { box-shadow: 0 0 0 0 rgba(232,68,26,.5);} 70% { box-shadow: 0 0 0 16px rgba(232,68,26,0);} 100% { box-shadow: 0 0 0 0 rgba(232,68,26,0);} }
@keyframes icbotHalo { 0% { transform: scale(.92); opacity: .9; } 100% { transform: scale(1.28); opacity: 0; } }
@keyframes icbotHaloSm { 0% { transform: scale(.92); opacity: .9; } 100% { transform: scale(1.24); opacity: 0; } }
@media (hover: none) { #icbot-toggle:hover { transform: none; } }
#icbot-badge {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: #fff; color: #D8381A; font-size: 11.5px; font-weight: 800;
  display: none; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,.35);
}
#icbot-root.has-unread #icbot-badge { display: flex; }
#icbot-root.open #icbot-toggle { display: none; }

#icbot-window {
  position: absolute; bottom: 0; right: 0; width: 380px; height: 560px; max-height: 80vh;
  background: linear-gradient(172deg, #FFFFFF, #F3F5FA);
  border-radius: 22px; border: 1px solid rgba(15,20,40,.10);
  box-shadow: 0 30px 80px rgba(20,25,50,.20), 0 0 70px rgba(232,68,26,.08);
  display: none; flex-direction: column; overflow: hidden;
}
#icbot-root.open #icbot-window { display: flex; animation: icbotUp .28s cubic-bezier(.16,1,.3,1); }
@keyframes icbotUp { from { opacity: 0; transform: translateY(18px) scale(.98);} to { opacity: 1; transform: translateY(0) scale(1);} }

.icbot-header { position: relative; background: rgba(15,20,40,.025); padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; }
.icbot-header::after { content: ''; position: absolute; left: 6%; right: 6%; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(232,68,26,.55), rgba(255,255,255,.18), rgba(232,68,26,.55), transparent); }
.icbot-head-left { display: flex; align-items: center; gap: 11px; }
.icbot-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #FF6A3D, #D8381A);
  box-shadow: 0 0 18px rgba(232,68,26,.4);
  display: flex; align-items: center; justify-content: center;
}
.icbot-avatar svg { width: 20px; height: 20px; }
.icbot-title { color: #171A24; font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 7px; }
.icbot-online { width: 8px; height: 8px; border-radius: 50%; background: #2BD98A; box-shadow: 0 0 0 3px rgba(43,217,138,.2), 0 0 8px rgba(43,217,138,.6); }
.icbot-sub { color: #5B6273; font-size: 11px; margin-top: 1px; }
.icbot-head-actions { display: flex; align-items: center; gap: 2px; }
#icbot-close, #icbot-restart { background: transparent; border: none; cursor: pointer; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: background .2s ease; }
#icbot-close:hover, #icbot-restart:hover { background: rgba(15,20,40,.06); }
#icbot-close:focus-visible, #icbot-restart:focus-visible, .icbot-qr:focus-visible, #icbot-form button:focus-visible { outline: 2px solid #D8381A; outline-offset: 2px; }
#icbot-close svg { width: 18px; height: 18px; stroke: #171A24; }
#icbot-restart svg { width: 16px; height: 16px; stroke: #5B6273; }

#icbot-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: transparent; }
.icbot-msg { max-width: 82%; padding: 10px 14px; font-size: 13.5px; line-height: 1.55; white-space: pre-line; word-wrap: break-word; }
.icbot-bot  { background: #ECEEF5; border: 1px solid rgba(15,20,40,.06); color: #23262F; border-radius: 16px 16px 16px 5px; align-self: flex-start; }
.icbot-user { background: linear-gradient(135deg, #FF6A3D, #D8381A); color: #fff; border-radius: 16px 16px 5px 16px; align-self: flex-end; box-shadow: 0 6px 18px rgba(232,68,26,.25); }
.icbot-msg a { color: #C2410C; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }
.icbot-msg a:hover { color: #9A3412; }
.icbot-typing { display: inline-flex; gap: 4px; align-items: center; }
.icbot-typing span { width: 7px; height: 7px; border-radius: 50%; background: #FF8A5C; animation: icbotBlink 1.2s infinite; }
.icbot-typing span:nth-child(2){ animation-delay: .2s; } .icbot-typing span:nth-child(3){ animation-delay: .4s; }
@keyframes icbotBlink { 0%,60%,100%{ opacity:.25; } 30%{ opacity:1; } }

#icbot-quick { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 16px 10px; }
.icbot-qr {
  background: rgba(232,68,26,.08); border: 1px solid rgba(232,68,26,.4); color: #C2410C;
  border-radius: 999px; padding: 7px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: all .18s ease; font-family: inherit;
}
.icbot-qr:hover { background: linear-gradient(135deg, #FF6A3D, #D8381A); border-color: transparent; color: #fff; box-shadow: 0 6px 16px rgba(232,68,26,.35); transform: translateY(-1px); }

#icbot-form { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid rgba(15,20,40,.08); }
#icbot-text {
  flex: 1; min-width: 0; border-radius: 999px !important; padding: 10px 17px; font-size: 13.5px; outline: none; font-family: inherit;
  background: #fff; color: #171A24; border: 1px solid rgba(15,20,40,.14); transition: border-color .15s ease, box-shadow .15s ease;
}
#icbot-text:focus { border-color: rgba(232,68,26,.6); box-shadow: 0 0 0 3px rgba(232,68,26,.12); }
@media (max-width: 480px) { #icbot-text { font-size: 16px; } }
#icbot-form button {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: 50%;
  background: linear-gradient(135deg, #FF6A3D, #D8381A);
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(232,68,26,.35);
  transition: transform .15s ease, box-shadow .2s ease;
}
#icbot-form button:hover { transform: scale(1.08); box-shadow: 0 8px 24px rgba(232,68,26,.5); }
#icbot-form button:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }
#icbot-root.is-busy .icbot-qr { opacity: .5; pointer-events: none; }
#icbot-form button svg { width: 17px; height: 17px; }

@media (prefers-reduced-motion: reduce) {
  .icbot-pulse, .icbot-halo, #icbot-toggle .icbot-d, .icbot-typing span { animation: none !important; }
  #icbot-root.open #icbot-window { animation: none; }
}

@media (max-width: 480px) {
  #icbot-root { bottom: max(16px, env(safe-area-inset-bottom)); right: max(16px, env(safe-area-inset-right)); }
  .icbot-halo { animation-name: icbotHaloSm; }
  #icbot-window {
    position: fixed; inset: 0; width: 100%; border-radius: 0;
    height: 100vh; height: 100dvh;
    max-height: 100vh; max-height: 100dvh;
    padding-bottom: env(safe-area-inset-bottom);
  }
}
