.aisa-agent-wrap {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999999;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.aisa-launcher {
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: #111;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(0,0,0,.25);
  font-size: 27px;
  transition: transform .2s ease;
}

.aisa-launcher:hover {
  transform: scale(1.06);
}

.aisa-launcher-icon {
  line-height: 1;
}

.aisa-agent {
  width: 370px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 40px);
  border: 1px solid #ddd;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 35px rgba(0,0,0,.2);
  display: flex;
  flex-direction: column;
}

.aisa-header {
  padding: 15px 16px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.aisa-header strong,
.aisa-header span {
  display: block;
}

.aisa-header span {
  margin-top: 4px;
  font-size: 12px;
  opacity: .65;
}

.aisa-close {
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}

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

.aisa-msg {
  padding: 10px 13px;
  border-radius: 12px;
  max-width: 85%;
  white-space: pre-wrap;
  line-height: 1.45;
  font-size: 14px;
}

.aisa-user {
  align-self: flex-end;
  background: #eee;
}

.aisa-assistant {
  align-self: flex-start;
  background: #f5f7fa;
}

.aisa-error {
  align-self: flex-start;
  background: #fff0f0;
}

.aisa-input-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #eee;
}

.aisa-input-row input {
  min-width: 0;
  flex: 1;
  padding: 11px;
  border: 1px solid #ccc;
  border-radius: 9px;
  outline: none;
}

.aisa-input-row button {
  padding: 11px 15px;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}

.aisa-status {
  padding: 0 14px 10px;
  font-size: 12px;
  opacity: .65;
}

@media (max-width: 600px) {
  .aisa-agent-wrap {
    right: 12px;
    bottom: 12px;
  }

  .aisa-agent {
    width: calc(100vw - 24px);
    height: min(600px, calc(100vh - 90px));
  }
}
