
#ai-chat {
  position: fixed !important;
  right: 20px !important;
  bottom: 20px !important;
  z-index: 2147483640 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  font-family: Arial, sans-serif;
}

#ai-toggle {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 14px 19px;
  border: 0;
  border-radius: 999px;
  background: #075ea8;
  color: white;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 35px rgba(0,0,0,.25);
}

#ai-panel {
  position: absolute !important;
  right: 0 !important;
  bottom: 65px !important;
  width: 370px;
  max-width: calc(100vw - 30px);
  height: 520px;
  max-height: calc(100vh - 100px);
  display: none !important;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  background: white;
  color: #172033;
  box-shadow: 0 22px 65px rgba(0,0,0,.3);
}

#ai-panel.zoe-open {
  display: flex !important;
}

.ai-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px;
  background: linear-gradient(135deg,#075ea8,#063e77);
  color: white;
}

.ai-avatar {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  overflow: hidden;
  border: 2px solid white;
  border-radius: 50%;
  background: #d9efff;
  font-size: 27px;
}

.ai-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ai-header-text {
  flex: 1;
}

.ai-header-text h4,
.ai-header-text p {
  margin: 0;
  color: white;
}

.ai-header-text p {
  margin-top: 3px;
  font-size: 12px;
  opacity: .85;
}

.ai-close {
  border: 0;
  background: transparent;
  color: white;
  font-size: 20px;
  cursor: pointer;
}

.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 17px;
  background: #f3f7fb;
}

.ai-msg p {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: white;
  line-height: 1.5;
}

.ai-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.ai-quick-replies button {
  padding: 9px 12px;
  border: 1px solid #b9d2e8;
  border-radius: 999px;
  background: white;
  color: #075ea8;
  cursor: pointer;
}

.ai-input-wrap {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #dce5ed;
}

.ai-input {
  min-width: 0;
  flex: 1;
  padding: 11px;
  border: 1px solid #c4d3e0;
  border-radius: 9px;
}

.ai-send {
  padding: 0 15px;
  border: 0;
  border-radius: 9px;
  background: #075ea8;
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.ai-disclaimer {
  padding: 8px;
  font-size: 10px;
  text-align: center;
  color: #677386;
}

@media (max-width: 600px) {
  #ai-chat {
    right: 12px !important;
    bottom: 14px !important;
  }

  #ai-panel {
    position: fixed !important;
    right: 10px !important;
    left: 10px !important;
    bottom: 74px !important;
    width: auto;
    height: calc(100vh - 95px);
  }
}

/* CLOUDNORTH ZOE MOBILE FIT FIX START */
@media screen and (max-width: 600px) {
  #ai-chat {
    position: fixed !important;
    right: 10px !important;
    bottom: 10px !important;
    left: auto !important;
    width: auto !important;
    max-width: none !important;
    z-index: 2147483640 !important;
  }

  #ai-toggle {
    min-height: 44px !important;
    padding: 11px 15px !important;
    font-size: 14px !important;
  }

  #ai-panel {
    position: fixed !important;
    top: auto !important;
    right: 8px !important;
    bottom: 66px !important;
    left: 8px !important;

    width: auto !important;
    max-width: none !important;

    height: min(520px, calc(100dvh - 84px)) !important;
    max-height: calc(100dvh - 84px) !important;

    margin: 0 !important;
    border-radius: 14px !important;
    overflow: hidden !important;
  }

  #ai-panel.zoe-open {
    display: flex !important;
  }

  .ai-header {
    min-height: 58px !important;
    padding: 9px 11px !important;
    gap: 9px !important;
  }

  .ai-avatar {
    width: 40px !important;
    height: 40px !important;
    flex-basis: 40px !important;
    font-size: 23px !important;
  }

  .ai-header-text h4 {
    font-size: 15px !important;
  }

  .ai-header-text p {
    font-size: 11px !important;
  }

  .ai-close {
    width: 34px !important;
    height: 34px !important;
    font-size: 18px !important;
  }

  .ai-messages {
    min-height: 0 !important;
    padding: 12px !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .ai-msg {
    max-width: 94% !important;
  }

  .ai-msg p {
    padding: 10px 11px !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
  }

  .ai-quick-replies {
    gap: 6px !important;
    margin-top: 10px !important;
  }

  .ai-quick-replies button {
    padding: 8px 10px !important;
    font-size: 12px !important;
  }

  .ai-input-wrap {
    flex-shrink: 0 !important;
    gap: 6px !important;
    padding: 9px !important;
  }

  .ai-input {
    width: 100% !important;
    height: 40px !important;
    padding: 9px 10px !important;
    font-size: 16px !important;
  }

  .ai-send {
    min-width: 58px !important;
    height: 40px !important;
    padding: 0 11px !important;
    font-size: 13px !important;
  }

  .ai-disclaimer {
    flex-shrink: 0 !important;
    padding: 6px 8px !important;
    font-size: 9px !important;
    line-height: 1.3 !important;
  }
}

/* Fallback for browsers without dynamic viewport support */
@supports not (height: 100dvh) {
  @media screen and (max-width: 600px) {
    #ai-panel {
      height: min(520px, calc(100vh - 84px)) !important;
      max-height: calc(100vh - 84px) !important;
    }
  }
}
/* CLOUDNORTH ZOE MOBILE FIT FIX END */
