.sgic-chat {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 120;
}

.sgic-chat-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0.95rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  color: #fff;
  font-weight: 700;
  font-size: 0.86rem;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.35);
  cursor: pointer;
}

.sgic-chat-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.65rem);
  width: min(360px, calc(100vw - 2rem));
  max-height: min(520px, calc(100vh - 6rem));
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  border: 1px solid #334155;
  border-radius: 16px;
  background: rgba(11, 18, 32, 0.98);
  box-shadow: 0 20px 48px rgba(2, 6, 23, 0.55);
  overflow: hidden;
}

.sgic-chat-panel[hidden] {
  display: none !important;
}

.sgic-chat-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #334155;
  background: rgba(30, 58, 138, 0.25);
}

.sgic-chat-header strong {
  display: block;
  font-size: 0.95rem;
}

.sgic-chat-header p {
  margin: 0.15rem 0 0;
  color: #94a3b8;
  font-size: 0.78rem;
}

.sgic-chat-close {
  border: none;
  background: transparent;
  color: #cbd5e1;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.sgic-chat-messages {
  padding: 0.85rem;
  overflow-y: auto;
  display: grid;
  gap: 0.55rem;
  align-content: start;
}

.sgic-chat-msg {
  max-width: 92%;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.sgic-chat-msg p {
  margin: 0;
}

.sgic-chat-msg--bot {
  justify-self: start;
  background: rgba(51, 65, 85, 0.45);
  border: 1px solid #334155;
  color: #e2e8f0;
}

.sgic-chat-msg--user {
  justify-self: end;
  background: rgba(37, 99, 235, 0.35);
  border: 1px solid rgba(96, 165, 250, 0.35);
  color: #f8fafc;
}

.sgic-chat-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.sgic-chat-links a {
  display: inline-flex;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid #475569;
  color: #bfdbfe;
  font-size: 0.76rem;
  text-decoration: none;
}

.sgic-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 0.85rem 0.55rem;
}

.sgic-chat-chip {
  border: 1px solid #334155;
  background: rgba(15, 23, 42, 0.85);
  color: #cbd5e1;
  border-radius: 999px;
  padding: 0.28rem 0.55rem;
  font-size: 0.74rem;
  cursor: pointer;
}

.sgic-chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
  padding: 0.75rem;
  border-top: 1px solid #334155;
}

.sgic-chat-form input {
  width: 100%;
  border: 1px solid #334155;
  background: rgba(15, 23, 42, 0.9);
  color: #e2e8f0;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font-size: 0.88rem;
}

.sgic-chat-send {
  border: none;
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

@media (max-width: 480px) {
  .sgic-chat {
    right: 0.65rem;
    bottom: 0.65rem;
  }

  .sgic-chat-toggle span {
    display: none;
  }
}
