#atc-chat-toggle {
  position: fixed;
  bottom: 90px;
  right: 25px;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: var(--color-primary, #d97706);
  color: #ffffff;
  border: none;
  font-size: 22px;
  cursor: pointer;
  z-index: 99999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

#atc-chat-box {
  position: fixed;
  bottom: 155px;
  right: 25px;
  width: 350px;
  height: 470px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  z-index: 99999;
  overflow: hidden;
  font-family: inherit;
}

#atc-chat-box.hidden { display: none; }

.atc-chat-header {
  background: #111827;
  color: #ffffff;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.atc-chat-header span { font-weight: 600; font-size: 14px; }

.atc-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Header Actions Alignment */
.atc-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.atc-chat-header-actions button {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.atc-chat-header-actions button:hover {
  color: #ffffff;
}

/* Ensure icons are crisp and correctly sized */
.atc-chat-header-actions i {
  font-size: 14px;
  line-height: 1;
}

.atc-chat-body {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
}

.atc-msg-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 85%;
}

.atc-msg-wrapper.atc-user-wrapper { align-self: flex-end; align-items: flex-end; }
.atc-msg-wrapper.atc-bot-wrapper { align-self: flex-start; align-items: flex-start; }

.atc-msg {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.atc-bot { background: #e2e8f0; color: #0f172a; }
.atc-user { background: var(--color-primary, #d97706); color: #ffffff; }

.atc-msg-time {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 3px;
  padding: 0 2px;
}

.atc-chat-footer {
  display: flex;
  padding: 10px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.atc-chat-footer input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
  font-size: 13px;
}

.atc-chat-footer button {
  background: var(--color-primary, #d97706);
  color: #ffffff;
  border: none;
  padding: 8px 14px;
  margin-left: 6px;
  border-radius: 6px;
  cursor: pointer;
}
/* Mobile View Adjustment */
@media (max-width: 480px) {
  #atc-chat-box {
    width: calc(100vw - 20px); /* Leaves a 10px margin on each side */
    right: 10px;
    left: 10px;
    bottom: 150px;
    max-height: 70vh; /* Prevents overflow on short screens */
  }

  #atc-chat-toggle {
    right: 15px;
  }
}