.bh-chat-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9998;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #09b3f0, #35c9f5);
  color: #ffffff;
  box-shadow: 0 20px 42px rgba(9, 179, 240, 0.32);
  font: 900 0.95rem/1 "Inter", Arial, sans-serif;
  cursor: pointer;
}

.bh-chat-launcher span:first-child {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  font-size: 1.1rem;
}

.bh-chat-launcher.is-hidden-by-modal,
.bh-chat-panel.is-hidden-by-modal {
  display: none !important;
}

.bh-chat-panel {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 9999;
  width: min(390px, calc(100vw - 28px));
  max-height: min(680px, calc(100vh - 120px));
  display: none;
  overflow: hidden;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(20, 32, 51, 0.1);
  box-shadow: 0 28px 80px rgba(11, 27, 44, 0.22);
  font-family: "Inter", Arial, sans-serif;
}

.bh-chat-panel.is-open {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.bh-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 16px;
  color: #ffffff;
  background: linear-gradient(135deg, #102139, #0787b8);
}

.bh-chat-title {
  display: grid;
  gap: 3px;
}

.bh-chat-title strong {
  font-size: 1rem;
}

.bh-chat-title span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  font-weight: 700;
}

.bh-chat-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 1.25rem;
  cursor: pointer;
}

.bh-chat-messages {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-anchor: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(237, 248, 254, 0.78)),
    #f6faff;
}

.bh-chat-message {
  max-width: 88%;
  padding: 11px 13px;
  border-radius: 16px;
  color: #24344a;
  background: #ffffff;
  border: 1px solid rgba(20, 32, 51, 0.08);
  box-shadow: 0 8px 18px rgba(11, 27, 44, 0.06);
  font-size: 0.92rem;
  line-height: 1.45;
}

.bh-chat-message.user {
  justify-self: end;
  color: #ffffff;
  background: linear-gradient(135deg, #09b3f0, #0787b8);
}

.bh-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bh-chat-project-list {
  display: grid;
  gap: 12px;
}

.bh-chat-project-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(20, 32, 51, 0.08);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(11, 27, 44, 0.06);
}

.bh-chat-project-card strong {
  color: #102139;
  font-size: 0.95rem;
  line-height: 1.25;
}

.bh-chat-project-meta {
  color: #65758a;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
}

.bh-chat-project-card p {
  margin: 0;
  color: #24344a;
  font-size: 0.84rem;
  line-height: 1.42;
}

.bh-chat-project-images {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.bh-chat-project-image {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(9, 179, 240, 0.16);
  border-radius: 10px;
  background: #eef7fb;
  cursor: pointer;
}

.bh-chat-project-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.bh-chat-project-image-badge {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: rgba(16, 33, 57, 0.68);
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1;
}

.bh-chat-project-image:hover img,
.bh-chat-project-image:focus-visible img {
  transform: scale(1.06);
}

.bh-chat-project-empty {
  grid-column: 1 / -1;
  color: #65758a;
  font-size: 0.82rem;
  font-weight: 700;
}

.bh-chat-preview {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  place-items: center;
  padding: 18px;
}

.bh-chat-preview.is-open {
  display: grid;
}

.bh-chat-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 15, 28, 0.76);
}

.bh-chat-preview-dialog {
  position: relative;
  display: grid;
  place-items: center;
  width: min(920px, 100%);
  max-height: calc(100vh - 36px);
  gap: 10px;
  z-index: 1;
}

.bh-chat-preview-image {
  max-width: 100%;
  max-height: calc(100vh - 112px);
  border-radius: 12px;
  object-fit: contain;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.bh-chat-preview-close,
.bh-chat-preview-nav {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  background: rgba(9, 179, 240, 0.9);
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.25);
}

.bh-chat-preview-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  font-size: 1.35rem;
  z-index: 2;
}

.bh-chat-preview-nav {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.9rem;
  transform: translateY(-50%);
  z-index: 2;
}

.bh-chat-preview-nav.prev {
  left: 10px;
}

.bh-chat-preview-nav.next {
  right: 10px;
}

.bh-chat-preview-nav:disabled {
  opacity: 0.38;
  cursor: default;
}

.bh-chat-preview-caption {
  max-width: min(720px, 100%);
  padding: 8px 12px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(16, 33, 57, 0.78);
  font: 800 0.86rem/1.35 "Inter", Arial, sans-serif;
  text-align: center;
}

.bh-chat-choice,
.bh-chat-submit,
.bh-chat-link {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(9, 179, 240, 0.18);
  background: #ffffff;
  color: #102139;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
}

.bh-chat-choice:hover,
.bh-chat-link:hover {
  border-color: rgba(9, 179, 240, 0.42);
  color: #0787b8;
}

.bh-chat-form {
  display: grid;
  gap: 10px;
  padding: 14px 16px 16px;
  background: #ffffff;
  border-top: 1px solid rgba(20, 32, 51, 0.08);
}

.bh-chat-input {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid rgba(20, 32, 51, 0.12);
  border-radius: 14px;
  background: #f8fbfd;
  color: #102139;
  font: inherit;
  outline: none;
}

.bh-chat-input:focus {
  border-color: rgba(9, 179, 240, 0.42);
  box-shadow: 0 0 0 4px rgba(9, 179, 240, 0.08);
  background: #ffffff;
}

.bh-chat-submit {
  color: #ffffff;
  border: 0;
  background: linear-gradient(135deg, #09b3f0, #35c9f5);
}

@media (max-width: 540px) {
  .bh-chat-launcher {
    right: 14px;
    bottom: 14px;
  }

  .bh-chat-panel {
    right: 14px;
    bottom: 82px;
  }

  .bh-chat-project-images {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bh-chat-preview {
    padding: 10px;
  }

  .bh-chat-preview-image {
    max-height: calc(100vh - 92px);
  }

  .bh-chat-preview-close {
    top: 8px;
    right: 8px;
  }

  .bh-chat-preview-nav {
    width: 38px;
    height: 38px;
    font-size: 1.6rem;
  }
}
