.ai-chat-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9998;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: #007972;
  box-shadow: 0 12px 35px rgba(0, 79, 74, .28);
  font: 800 15px/1.2 inherit;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.ai-chat-launcher:hover {
  color: #fff;
  background: #006861;
  transform: translateY(-2px);
  box-shadow: 0 15px 38px rgba(0, 79, 74, .34);
}

.ai-chat-launcher:focus-visible,
.ai-chat-close:focus-visible {
  outline: 3px solid #f2b134;
  outline-offset: 3px;
}

.ai-chat-overlay[hidden] { display: none; }

.ai-chat-overlay {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9999;
  display: block;
  pointer-events: none;
}

.ai-chat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100vw - 44px));
  max-height: min(680px, calc(100vh - 44px));
  overflow: hidden;
  border: 1px solid rgba(0, 121, 114, .14);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(8, 50, 47, .27);
  pointer-events: auto;
}

.ai-chat-card.ai-chat-started {
  height: min(620px, calc(100vh - 44px));
}

.ai-chat-card.ai-chat-started .ai-chat-intro {
  display: none;
}

.ai-chat-card.ai-chat-started #dograh-inline-container {
  flex: 1 1 auto;
  min-height: 0;
}

.ai-chat-card.ai-chat-started .dograh-chat-panel--inline {
  min-height: 0;
  border: 0;
  border-radius: 0;
}

.ai-chat-card.ai-chat-started .dograh-chat-header {
  min-height: 58px;
  padding-right: 58px;
}

.ai-chat-card.ai-chat-started .dograh-chat-messages {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 121, 114, .32) transparent;
}

.ai-chat-card.ai-chat-started .dograh-chat-messages::-webkit-scrollbar {
  width: 6px;
}

.ai-chat-card.ai-chat-started .dograh-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.ai-chat-card.ai-chat-started .dograh-chat-messages::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(0, 121, 114, .28);
}

.ai-chat-close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  color: #31504e;
  background: #edf8f7;
  font: 400 28px/36px Arial, sans-serif;
  cursor: pointer;
}

.ai-chat-card.ai-chat-started .ai-chat-close {
  top: 10px;
  right: 12px;
  color: #fff;
  background: rgba(0, 0, 0, .14);
}

.ai-chat-intro {
  padding: 28px 28px 12px;
}

.ai-chat-badge {
  display: inline-block;
  margin-bottom: 11px;
  padding: 5px 11px;
  border-radius: 999px;
  color: #007972;
  background: #e4f7f5;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
}

.ai-chat-intro h2 {
  margin: 0 44px 10px 0;
  color: #183d3a;
  font-size: clamp(23px, 5vw, 29px);
  line-height: 1.15;
}

.ai-chat-intro p {
  margin: 0 0 9px;
  color: #425e5c;
  font-size: 14px;
  line-height: 1.55;
}

.ai-chat-intro .ai-chat-privacy { font-size: 12.5px; }

.ai-chat-intro a {
  color: #007972;
  font-size: 12.5px;
  font-weight: 700;
}

#dograh-inline-container { min-height: 116px; }

.ai-chat-loading {
  padding: 32px 28px;
  color: #5f7472;
  text-align: center;
}

@media (max-width: 560px) {
  .ai-chat-launcher {
    right: 12px;
    bottom: 12px;
    min-height: 48px;
    padding: 0 16px;
    font-size: 14px;
  }

  .ai-chat-overlay {
    inset: 0;
    display: grid;
    place-items: end center;
    background: rgba(12, 41, 39, .48);
    backdrop-filter: blur(5px);
    pointer-events: auto;
  }

  .ai-chat-card {
    width: 100%;
    max-height: 92vh;
    border-radius: 22px 22px 0 0;
  }

  .ai-chat-card.ai-chat-started {
    height: 92dvh;
  }

  .ai-chat-intro { padding: 24px 20px 10px; }

  body.ai-chat-open { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-chat-launcher { transition: none; }
}
