.ai-float {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #14532d;
  background: linear-gradient(135deg, #16a34a, #0ea5e9);
  color: #ffffff;
  font-weight: 700;
  border-radius: 999px;
  padding: 12px 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  cursor: pointer;
}

.ai-float svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.6;
}

.ai-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
}

.ai-modal.is-open {
  display: block;
}

.ai-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.75);
}

.ai-modal-panel {
  position: absolute;
  right: 18px;
  bottom: 74px;
  width: min(420px, calc(100vw - 24px));
  max-height: min(78vh, 640px);
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(8, 13, 28, 0.98);
  box-shadow: 0 24px 60px rgba(2, 8, 23, 0.6);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.ai-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.ai-modal-head strong {
  font-size: 14px;
}

.ai-modal-head button {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.88);
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  cursor: pointer;
}

.ai-chat-log {
  padding: 12px;
  overflow-y: auto;
  display: grid;
  gap: 8px;
}

.ai-msg {
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.ai-msg.user {
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.ai-msg.bot {
  background: rgba(15, 23, 42, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.ai-chat-form {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.ai-chat-form textarea {
  width: 100%;
  min-height: 70px;
  resize: vertical;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.86);
  color: #ffffff;
  padding: 10px 12px;
  font-family: inherit;
}

.ai-chat-form button {
  justify-self: end;
}

@media (max-width: 980px) {
  .ai-modal-panel {
    right: 12px;
    bottom: 66px;
    width: calc(100vw - 24px);
    max-height: 76vh;
  }
}

@media (max-width: 960px) {
  .ai-float {
    left: 12px;
    bottom: 12px;
    padding: 10px 14px;
    font-size: 13px;
  }
}
