.hobby-ai-chat {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 2147482800;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #15201b;
}

.hobby-ai-chat * {
  box-sizing: border-box;
}

.hobby-ai-launcher {
  width: min(290px, calc(100vw - 24px));
  min-height: 64px;
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(255, 211, 53, .72);
  border-radius: 999px;
  padding: 9px 12px 9px 10px;
  background: linear-gradient(135deg, #0d1712, #1b2a22);
  color: #fff;
  box-shadow: 0 20px 55px rgba(0, 0, 0, .28), 0 0 30px rgba(255, 211, 53, .24);
  cursor: pointer;
}

.hobby-ai-avatar,
.hobby-ai-send,
.hobby-ai-close {
  display: inline-grid;
  place-items: center;
  border: 0;
}

.hobby-ai-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #25d366;
  color: #06130d;
  box-shadow: 0 0 18px rgba(37, 211, 102, .36);
}

.hobby-ai-avatar svg {
  width: 25px;
  height: 25px;
}

.hobby-ai-launcher strong {
  display: block;
  font-size: 13px;
  line-height: 1.1;
}

.hobby-ai-launcher span {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, .72);
  font-size: 11px;
  line-height: 1.25;
}

.hobby-ai-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #25d366;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, .5);
  animation: hobbyAiPulse 1.8s infinite;
}

.hobby-ai-window {
  position: absolute;
  right: 0;
  bottom: 82px;
  width: min(390px, calc(100vw - 24px));
  max-height: min(690px, calc(100dvh - 112px));
  display: none;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border: 1px solid rgba(255, 211, 53, .62);
  border-radius: 18px;
  background: #efe7d4;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .34);
}

.hobby-ai-chat.is-open .hobby-ai-window {
  display: grid;
}

.hobby-ai-header {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  gap: 10px;
  align-items: center;
  padding: 14px;
  background: linear-gradient(135deg, #082015, #123a27);
  color: #fff;
}

.hobby-ai-header .hobby-ai-avatar {
  width: 42px;
  height: 42px;
}

.hobby-ai-title strong {
  display: block;
  font-size: 15px;
  line-height: 1.15;
}

.hobby-ai-title span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: rgba(255, 255, 255, .76);
  font-size: 12px;
}

.hobby-ai-title span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #25d366;
}

.hobby-ai-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

.hobby-ai-body {
  min-height: 310px;
  overflow-y: auto;
  padding: 16px 14px 12px;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 211, 53, .22), transparent 27%),
    linear-gradient(rgba(255, 255, 255, .50), rgba(255, 255, 255, .50)),
    #efe7d4;
}

.hobby-ai-messages {
  display: grid;
  gap: 10px;
}

.hobby-ai-message {
  width: fit-content;
  max-width: 88%;
  border-radius: 16px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.48;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .08);
  white-space: pre-line;
}

.hobby-ai-message.bot {
  justify-self: start;
  border-top-left-radius: 4px;
  background: #fff;
  color: #16201d;
}

.hobby-ai-message.user {
  justify-self: end;
  border-top-right-radius: 4px;
  background: #dcf8c6;
  color: #15201b;
}

.hobby-ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.hobby-ai-chip {
  border: 1px solid rgba(18, 58, 39, .12);
  border-radius: 999px;
  padding: 8px 10px;
  background: #fff;
  color: #16201d;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .06);
}

.hobby-ai-footer {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #f7f3e9;
}

.hobby-ai-form {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 8px;
  align-items: end;
}

.hobby-ai-input {
  width: 100%;
  min-height: 44px;
  max-height: 120px;
  resize: none;
  border: 1px solid rgba(22, 32, 29, .14);
  border-radius: 999px;
  padding: 12px 14px;
  background: #fff;
  color: #15201b;
  font: inherit;
  font-size: 14px;
  outline: none;
}

.hobby-ai-input:focus {
  border-color: #25d366;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, .16);
}

.hobby-ai-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #25d366;
  color: #06130d;
  cursor: pointer;
}

.hobby-ai-send svg {
  width: 20px;
  height: 20px;
}

.hobby-ai-whatsapp {
  width: 100%;
  min-height: 43px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #25d366, #52ee88);
  color: #06130d;
  font-size: 13px;
  font-weight: 950;
  text-decoration: none;
  box-shadow: 0 14px 30px rgba(37, 211, 102, .22);
}

.hobby-ai-note {
  color: rgba(22, 32, 29, .58);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}

@keyframes hobbyAiPulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .5); }
  70% { box-shadow: 0 0 0 10px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

@media (max-width: 520px) {
  .hobby-ai-chat {
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
  }

  .hobby-ai-launcher {
    width: 62px;
    height: 62px;
    min-height: 62px;
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .hobby-ai-launcher strong,
  .hobby-ai-launcher span,
  .hobby-ai-pulse {
    display: none;
  }

  .hobby-ai-avatar {
    width: 46px;
    height: 46px;
  }

  .hobby-ai-window {
    right: -2px;
    bottom: 74px;
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 92px);
    border-radius: 16px;
  }

  .hobby-ai-body {
    min-height: 280px;
    padding: 13px 10px 10px;
  }

  .hobby-ai-message {
    max-width: 92%;
    font-size: 12.5px;
  }

  .hobby-ai-chip {
    padding: 7px 9px;
    font-size: 11.5px;
  }
}
