.chat-fab {
  position: fixed;
  bottom: 0;
  right: -22px;
  width: 190px;
  border: none;
  background: none;
  box-shadow: none;
  cursor: pointer;
  padding: 0;
  z-index: 998;
  line-height: 0;
  transition: transform .18s ease;
}

.chat-fab:hover {
  transform: translateY(-4px);
}

.chat-fab-avatar {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .22));
}

.chat-hint-bubble {
  position: fixed;
  right: 26px;
  bottom: 106px;
  max-width: 220px;
  background: #efe9db;
  color: #2b2a26;
  border: 1px solid rgba(143, 63, 69, .25);
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.6;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
  z-index: 998;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.chat-hint-bubble.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  cursor: pointer;
}

.chat-hint-bubble::after {
  content: "";
  position: absolute;
  bottom: -7px;
  right: 34px;
  width: 14px;
  height: 14px;
  background: #efe9db;
  border-right: 1px solid rgba(143, 63, 69, .25);
  border-bottom: 1px solid rgba(143, 63, 69, .25);
  transform: rotate(45deg);
}

@media (max-width: 480px) {
  .chat-fab {
    width: 130px;
    right: -14px;
  }

  .chat-hint-bubble {
    right: 14px;
    bottom: 76px;
    max-width: 160px;
    font-size: 12px;
  }
}

.chat-panel {
  position: fixed;
  bottom: 115px;
  right: 24px;
  width: min(340px, calc(100vw - 32px));
  max-height: min(480px, calc(100vh - 150px));
  background: #efe9db;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 999;
}

.chat-panel.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.chat-panel-header {
  background: #8f3f45;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
}

.chat-panel-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

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

.chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.chat-bubble-bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, .7);
  color: #2b2a26;
  border: 1px solid rgba(98, 83, 64, .16);
}

.chat-bubble-user {
  align-self: flex-end;
  background: #8f3f45;
  color: #fff;
}

.chat-bubble-typing {
  opacity: .6;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(98, 83, 64, .16);
  background: rgba(255, 255, 255, .4);
}

.chat-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid rgba(98, 83, 64, .24);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: #2b2a26;
}

.chat-input:focus {
  outline: 2px solid rgba(143, 63, 69, .35);
}

.chat-send {
  border: none;
  border-radius: 999px;
  padding: 9px 18px;
  background: #8f3f45;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.chat-send:hover {
  background: #7c3339;
}

@media (max-width: 480px) {
  .chat-panel {
    bottom: 82px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}
