.gsailm-ai-chat-root {
  position: fixed;
  inset-block-end: 1rem;
  inset-inline-end: 1rem;
  z-index: 1200;
  font-family: "Tajawal", "Cairo", system-ui, -apple-system, sans-serif;
}

.gsailm-ai-chat-root.is-en {
  font-family: "Inter", "Tajawal", system-ui, -apple-system, sans-serif;
}

.gsailm-ai-chat-fab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 0;
  border-radius: 999px;
  padding: 0.72rem 0.92rem;
  background: linear-gradient(135deg, #0f3f2c, #2b8a5e);
  color: #fff;
  box-shadow: 0 14px 36px rgba(43, 138, 94, 0.34);
  cursor: pointer;
}

.gsailm-ai-chat-fab-icon {
  width: 1.2rem;
  height: 1.2rem;
  display: inline-flex;
}

.gsailm-ai-chat-fab-icon svg,
.gsailm-ai-chat-close svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gsailm-ai-chat-fab-label {
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.gsailm-ai-chat-fab-pulse {
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  border: 1px solid rgba(107, 201, 153, 0.5);
  animation: gsailmAiPulse 2s infinite;
  pointer-events: none;
}

@keyframes gsailmAiPulse {
  0% { transform: scale(1); opacity: 0.8; }
  70% { transform: scale(1.08); opacity: 0; }
  100% { transform: scale(1.08); opacity: 0; }
}

.gsailm-ai-chat-panel {
  position: absolute;
  inset-inline-end: 0;
  inset-block-end: calc(100% + 0.72rem);
  width: min(92vw, 370px);
  max-height: min(70vh, 560px);
  display: none;
  flex-direction: column;
  border-radius: 1rem;
  border: 1px solid rgba(43, 138, 94, 0.2);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(15, 63, 44, 0.22);
  overflow: hidden;
}

.gsailm-ai-chat-root.is-open .gsailm-ai-chat-panel {
  display: flex;
  animation: gsailmAiPop .22s ease-out;
}

@keyframes gsailmAiPop {
  from { transform: translateY(8px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.gsailm-ai-chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.88rem 0.95rem 0.7rem;
  border-bottom: 1px solid rgba(43, 138, 94, 0.12);
  background: linear-gradient(135deg, rgba(43, 138, 94, 0.1), rgba(255, 255, 255, 0.5));
}

.gsailm-ai-chat-header h5 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #183c2b;
}

.gsailm-ai-chat-mode {
  display: inline-flex;
  margin-top: 0.3rem;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 700;
  color: #955a16;
  background: rgba(217, 74, 63, 0.12);
  border: 1px solid rgba(217, 74, 63, 0.2);
}

.gsailm-ai-chat-close {
  border: 0;
  background: rgba(15, 63, 44, 0.08);
  color: #1e6f4a;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 0.55rem;
  cursor: pointer;
}

.gsailm-ai-chat-body {
  padding: 0.82rem 0.92rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.gsailm-ai-chat-msg {
  max-width: 92%;
  padding: 0.58rem 0.72rem;
  border-radius: 0.72rem;
  font-size: 0.82rem;
  line-height: 1.6;
}

.gsailm-ai-chat-msg-user {
  align-self: flex-end;
  background: #123d2b;
  color: #fff;
  border-bottom-right-radius: 0.2rem;
}

.gsailm-ai-chat-msg-assistant {
  align-self: flex-start;
  background: #ecf8f2;
  color: #173c2b;
  border: 1px solid #d6ebdf;
  border-bottom-left-radius: 0.2rem;
}

.gsailm-ai-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.gsailm-ai-chat-chip {
  border: 1px solid rgba(43, 138, 94, 0.22);
  background: #fff;
  color: #1e6f4a;
  padding: 0.35rem 0.58rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.gsailm-ai-chat-chip:hover {
  background: rgba(43, 138, 94, 0.08);
}

.gsailm-ai-chat-input-wrap {
  display: flex;
  gap: 0.5rem;
  padding: 0.72rem 0.82rem 0.82rem;
  border-top: 1px solid rgba(43, 138, 94, 0.12);
  background: #fff;
}

.gsailm-ai-chat-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #cfe4da;
  border-radius: 999px;
  padding: 0.55rem 0.75rem;
  font-size: 0.82rem;
  outline: none;
}

.gsailm-ai-chat-input:focus {
  border-color: #2b8a5e;
  box-shadow: 0 0 0 3px rgba(43, 138, 94, 0.14);
}

.gsailm-ai-chat-send {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #2b8a5e, #4db878);
  color: #fff;
  padding: 0.55rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 767.98px) {
  .gsailm-ai-chat-root {
    inset-inline-end: 0.72rem;
    inset-block-end: 0.72rem;
  }

  .gsailm-ai-chat-fab-label {
    font-size: 0.76rem;
  }

  .gsailm-ai-chat-panel {
    width: min(95vw, 95vw);
    max-height: 72vh;
    inset-inline-end: 0;
  }
}
