.chatbot-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 60px;
  height: 60px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1038;
  border-radius: 50%;
  border:1px solid #dd2c00;
  background: linear-gradient(135deg, #dd2c00, #6f1600);
  background: #fff;
  color: #fff;
  box-shadow: 0 12px 28px rgba(221, 44, 0, 0.33);
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease;
  overflow: hidden;
}


.chatbot-fab:hover,
.chatbot-fab:focus {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(221, 44, 0, 0.42);
}

.chatbot-fab i {
  font-size: 27px;
  line-height: 1;
}

.chatbot-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 14, 27, 0.38);
  opacity: 0;
  visibility: hidden;
  transition: opacity 160ms ease;
  z-index: 1039;
}

.chatbot-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.chatbot-sidebar {
  position: fixed;
  right: 18px;
  bottom: 92px;
  width: min(420px, calc(100vw - 24px));
  height: min(78vh, 760px);
  border-radius: 18px;
  overflow: hidden;
  background: #f6f8fd;
  box-shadow: 0 24px 52px rgba(18, 23, 36, 0.27);
  transform: translateY(18px) scale(0.98);
  opacity: 0;
  visibility: hidden;
  transition: opacity 170ms ease, transform 170ms ease;
  z-index: 1040;
  display: flex;
  flex-direction: column;
}

.chatbot-sidebar.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  color: #fff;
  background: linear-gradient(130deg, #b42300, #dd2c00);
}

.chatbot-title-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chatbot-title-wrap strong {
  font-size: 15px;
  line-height: 1.15;
}

.chatbot-title-wrap small {
  font-size: 12px;
  opacity: 0.88;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chatbot-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chatbot-actions .btn {
  padding: 0.2rem 0.45rem;
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chatbot-message {
  display: flex;
}

.chatbot-message.is-user {
  justify-content: flex-end;
}

.chatbot-message.is-bot {
  justify-content: flex-start;
}

.chatbot-bubble {
  max-width: 84%;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.chatbot-message.is-user .chatbot-bubble {
  background: #dd2c00;
  color: #fff;
  border-bottom-right-radius: 6px;
}

.chatbot-message.is-bot .chatbot-bubble {
  background: #fff;
  color: #111828;
  border: 1px solid #dce3f2;
  border-bottom-left-radius: 6px;
}

.chatbot-message.is-error .chatbot-bubble {
  border-color: #f6b4b4;
  background: #fff6f6;
  color: #8f2323;
}

.chatbot-footer {
  border-top: 1px solid #dce3f2;
  background: #fff;
  padding: 8px 10px 10px;
}

.chatbot-waiting-text {
  font-size: 12px;
  color: #5a6478;
  margin-bottom: 6px;
  min-height: 18px;
}

.chatbot-form {
  display: flex;
  gap: 8px;
}

.chatbot-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid #ccd6ea;
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 14px;
  outline: none;
}

.chatbot-form input:focus {
  border-color: #dd2c00;
  box-shadow: 0 0 0 3px rgba(221, 44, 0, 0.16);
}

.chatbot-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  background: #6d7690;
  margin-right: 4px;
  animation: chatbot-dot-pulse 1s infinite ease-in-out;
}

.chatbot-dot:nth-child(2) {
  animation-delay: 0.16s;
}

.chatbot-dot:nth-child(3) {
  animation-delay: 0.32s;
  margin-right: 0;
}

@keyframes chatbot-dot-pulse {
  0%, 80%, 100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-1px);
  }
}

@media (max-width: 720px) {
  .chatbot-fab {
    right: 14px;
    bottom: 14px;
  }

  .chatbot-fab::after {
    left: 2px;
    bottom: -2px;
    width: 9px;
    height: 9px;
  }

  .chatbot-sidebar {
    right: 10px;
    bottom: 78px;
    width: calc(100vw - 20px);
    height: min(80vh, 760px);
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chatbot-fab,
  .chatbot-overlay,
  .chatbot-sidebar,
  .chatbot-dot {
    animation: none !important;
    transition: none !important;
  }
}

.chatbot-bubble p {
  margin: 0 0 0.55rem 0;
}

.chatbot-bubble p:last-child {
  margin-bottom: 0;
}

.chatbot-bubble ul {
  margin: 0.35rem 0 0.35rem 1.15rem;
  padding: 0;
}

.chatbot-bubble ol {
  margin: 0.35rem 0 0.35rem 1.2rem;
  padding: 0;
}

.chatbot-bubble li {
  margin: 0.2rem 0;
}

.chatbot-bubble h1,
.chatbot-bubble h2,
.chatbot-bubble h3,
.chatbot-bubble h4,
.chatbot-bubble h5,
.chatbot-bubble h6 {
  margin: 0.2rem 0 0.55rem 0;
  line-height: 1.28;
  color: #4a1200;
}

.chatbot-bubble h1 { font-size: 1.08rem; }
.chatbot-bubble h2 { font-size: 1.03rem; }
.chatbot-bubble h3 { font-size: 0.98rem; }
.chatbot-bubble h4,
.chatbot-bubble h5,
.chatbot-bubble h6 { font-size: 0.94rem; }

.chatbot-bubble blockquote {
  margin: 0.45rem 0;
  padding: 0.35rem 0.6rem;
  border-left: 3px solid #f0b7a8;
  background: #fffaf8;
  border-radius: 8px;
}

.chatbot-bubble pre.chatbot-pre {
  margin: 0.45rem 0;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: #f8f8fb;
  border: 1px solid #d7dce7;
  overflow-x: auto;
}

.chatbot-bubble code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
  background: #f4f4f6;
  border-radius: 5px;
  padding: 0.08rem 0.3rem;
}

.chatbot-bubble pre code {
  background: transparent;
  border-radius: 0;
  padding: 0;
  font-size: 0.88em;
}

.chatbot-bubble .chatbot-hr {
  border: 0;
  border-top: 1px solid #e5e8ef;
  margin: 0.6rem 0;
}

.chatbot-bubble a {
  color: #b32100;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}

.chatbot-bubble a:hover,
.chatbot-bubble a:focus {
  color: #8f1b00;
}

.chatbot-overlay {
  display: none !important;
  pointer-events: none !important;
}

.chatbot-sidebar {
  box-shadow: 0 42px 82px rgba(120, 24, 0, 0.34), 0 12px 24px rgba(140, 34, 0, 0.2);
}

.chatbot-teaser {
  position: fixed;
  right: 92px;
  bottom: 31px;
  z-index: 1041;
  border: 1px solid #ffd3c6;
  border-radius: 999px;
  background: #ffffff;
  color: #a92500;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  padding: 12px 18px;
  box-shadow: 0 18px 30px rgba(130, 31, 0, 0.24);
  transform-origin: right center;
  animation: chatbot-teaser-pop 2.4s ease-in-out infinite;
  white-space: nowrap;
}

.chatbot-teaser:hover,
.chatbot-teaser:focus {
  color: #8f2000;
  background: #fff4ef;
}

@media (max-width: 720px) {
  .chatbot-teaser {
    right: 82px;
    bottom: 22px;
    max-width: calc(100vw - 104px);
    font-size: 14px;
    padding: 11px 14px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@keyframes chatbot-teaser-pop {
  0%, 82%, 100% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
  86% {
    transform: translateY(-2px) scale(1.04) rotate(-1.2deg);
  }
  90% {
    transform: translateY(0) scale(1) rotate(1.1deg);
  }
  94% {
    transform: translateY(-1px) scale(1.02) rotate(-0.8deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chatbot-teaser {
    animation: none !important;
    transition: none !important;
  }
}

.chatbot-suggestions {
  align-self: stretch;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 0 2px;
  margin-top: -2px;
  background: transparent;
}

.chatbot-suggestion-btn {
  border: 1px solid #ffd3c6;
  background: #fff;
  color: #a92500;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  padding: 7px 11px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.chatbot-suggestion-btn:hover,
.chatbot-suggestion-btn:focus {
  background: #fff1eb;
  border-color: #ffbda7;
  outline: none;
  transform: translateY(-1px);
}

@media (max-width: 720px) {
  .chatbot-suggestions {
    padding: 1px 0 2px;
    gap: 6px;
  }

  .chatbot-suggestion-btn {
    font-size: 11px;
    padding: 6px 10px;
  }
}

.chatbot-header-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chatbot-header-avatar {
  width: 48px;
  height: 48px;
  object-fit: cover;
  flex: 0 0 auto;
  margin-bottom:-8px;
}

.chatbot-header-title-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chatbot-bot-avatar-wrap {
  width: 48px;
  flex: 0 0 48px;
  display: flex;
  align-items: flex-start;
}

.chatbot-bot-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #ffd3c6;
}

.chatbot-bot-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: calc(100% - 42px);
}

.chatbot-bot-name {
  font-size: 12px;
  font-weight: 700;
  color: #8f2000;
  margin-left: 2px;
}

.chatbot-message.is-bot {
  align-items: flex-start;
  gap: 8px;
}

.chatbot-message.is-bot .chatbot-bubble {
  max-width: 100%;
}

@media (max-width: 720px) {
  .chatbot-header-avatar,
  .chatbot-bot-avatar,
  .chatbot-bot-avatar-wrap {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .chatbot-bot-content {
    max-width: calc(100% - 38px);
  }
}
