/* ABSDETAL chat widget — embed on absdetal.ru */
#absdetal-bot-launcher,
#absdetal-bot-window,
#absdetal-bot-window * {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#absdetal-bot-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 64px;
  height: 64px;
  border-radius: 32px;
  background: #1f6feb;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  z-index: 2147483600;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  border: none;
}

#absdetal-bot-launcher:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
}

#absdetal-bot-launcher svg {
  width: 30px;
  height: 30px;
  fill: white;
}

#absdetal-bot-launcher .pulse {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: white;
  border-radius: 12px;
  font-size: 11px;
  padding: 2px 6px;
  font-weight: 600;
}

#absdetal-bot-tizer {
  position: fixed;
  bottom: 100px;
  right: 24px;
  max-width: 280px;
  background: #1f6feb;
  color: white;
  padding: 12px 36px 12px 16px;
  border-radius: 14px;
  border-bottom-right-radius: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  cursor: pointer;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
  z-index: 2147483599;
  animation: tizer-pop 0.35s cubic-bezier(0.5, 1.6, 0.4, 0.9);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#absdetal-bot-tizer:hover { background: #1a5dc4; }

#absdetal-bot-tizer .tizer-close {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 18px;
  opacity: 0.7;
  cursor: pointer;
  line-height: 1;
}
#absdetal-bot-tizer .tizer-close:hover { opacity: 1; }

#absdetal-bot-tizer::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 18px;
  width: 16px;
  height: 16px;
  background: #1f6feb;
  transform: rotate(45deg);
  z-index: -1;
}

@keyframes tizer-pop {
  from { opacity: 0; transform: translateY(20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

#absdetal-bot-window {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 24px);
  height: 600px;
  max-height: calc(100vh - 48px);
  background: white;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.22);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 2147483601;
  border: 1px solid #e5e7eb;
}

#absdetal-bot-window.open {
  display: flex;
}

.absdetal-bot-header {
  background: linear-gradient(135deg, #1f6feb 0%, #2563eb 100%);
  color: white;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.absdetal-bot-header .avatar {
  width: 38px;
  height: 38px;
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.absdetal-bot-header .title {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
}

.absdetal-bot-header .subtitle {
  font-size: 12px;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.absdetal-bot-header .subtitle::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  display: inline-block;
}

.absdetal-bot-header .close {
  margin-left: auto;
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px;
  opacity: 0.8;
  font-size: 22px;
  line-height: 1;
}

.absdetal-bot-header .close:hover { opacity: 1; }

.absdetal-bot-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f9fafb;
}

.absdetal-bot-msg {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.absdetal-bot-msg.assistant {
  background: white;
  border: 1px solid #e5e7eb;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  color: #111827;
}

.absdetal-bot-msg.user {
  background: #1f6feb;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.absdetal-bot-typing {
  align-self: flex-start;
  padding: 10px 14px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  display: flex;
  gap: 4px;
}

.absdetal-bot-typing span {
  width: 8px;
  height: 8px;
  background: #9ca3af;
  border-radius: 50%;
  animation: absdetal-blink 1.4s infinite both;
}

.absdetal-bot-typing span:nth-child(2) { animation-delay: 0.2s; }
.absdetal-bot-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes absdetal-blink {
  0%, 80%, 100% { opacity: 0.3; }
  40% { opacity: 1; }
}

.absdetal-bot-quickreplies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 8px;
  background: #f9fafb;
}

.absdetal-bot-quickreplies button {
  background: white;
  border: 1px solid #1f6feb;
  color: #1f6feb;
  padding: 6px 12px;
  border-radius: 14px;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.15s;
}

.absdetal-bot-quickreplies button:hover {
  background: #1f6feb;
  color: white;
}

.absdetal-bot-input-row {
  border-top: 1px solid #e5e7eb;
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  background: white;
  flex-shrink: 0;
}

.absdetal-bot-input-row textarea {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  resize: none;
  min-height: 40px;
  max-height: 120px;
  font-family: inherit;
  outline: none;
  line-height: 1.4;
}

.absdetal-bot-input-row textarea:focus {
  border-color: #1f6feb;
}

.absdetal-bot-input-row button.send {
  background: #1f6feb;
  color: white;
  border: none;
  border-radius: 12px;
  padding: 0 14px;
  height: 40px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.absdetal-bot-input-row button.send:disabled {
  opacity: 0.5;
  cursor: default;
}

.absdetal-bot-channels {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid #f1f5f9;
  background: white;
  flex-shrink: 0;
  font-size: 12px;
  color: #6b7280;
  align-items: center;
}

.absdetal-bot-channels .label {
  margin-right: 4px;
}

.absdetal-bot-channels a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  text-decoration: none;
  background: #f3f4f6;
  color: #374151;
  font-weight: 500;
  font-size: 12px;
  transition: background 0.15s;
}

.absdetal-bot-channels a:hover {
  background: #e5e7eb;
}

.absdetal-bot-channels a.tg {
  background: #229ED9;
  color: white;
}

.absdetal-bot-channels a.tg:hover {
  background: #1c8bbf;
}

.absdetal-bot-channels a.max {
  background: #6F43C7;
  color: white;
}

.absdetal-bot-leadform {
  background: white;
  border: 1px solid #1f6feb;
  border-radius: 14px;
  padding: 14px;
  margin-top: 6px;
  align-self: stretch;
}

.absdetal-bot-leadform h4 {
  margin: 0 0 10px;
  font-size: 14px;
  color: #1f2937;
  font-weight: 600;
}

.absdetal-bot-leadform input,
.absdetal-bot-leadform textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  margin-bottom: 8px;
  font-family: inherit;
  outline: none;
}

.absdetal-bot-leadform textarea {
  min-height: 60px;
  resize: vertical;
}

.absdetal-bot-leadform button {
  width: 100%;
  background: #1f6feb;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
}

.absdetal-bot-leadform button:disabled {
  opacity: 0.5;
}

.absdetal-bot-footer-note {
  font-size: 10.5px;
  color: #9ca3af;
  text-align: center;
  padding: 4px 0 6px;
  background: white;
}

@media (max-width: 480px) {
  #absdetal-bot-window {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }
  #absdetal-bot-launcher {
    bottom: 16px;
    right: 16px;
  }
}
