/* ============================================================
   CHAT WIDGET — EMGRA GROUP
   ============================================================ */
.emgra-chat-launcher {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9998;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--gold, #C9A84C);
  color: var(--dark, #111111);
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.emgra-chat-launcher:hover {
  transform: scale(1.05);
  opacity: 0.92;
}

.emgra-chat-launcher svg {
  width: 26px;
  height: 26px;
}

.emgra-chat-panel {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  z-index: 9999;
  width: min(380px, calc(100vw - 2rem));
  max-height: min(520px, calc(100vh - 7rem));
  background: var(--white, #fff);
  border-radius: 12px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
  border: 1px solid #eee;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.emgra-chat-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.emgra-chat-header {
  background: var(--dark, #111);
  color: var(--white, #fff);
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.emgra-chat-header-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.emgra-chat-header-sub {
  font-size: 0.72rem;
  opacity: 0.75;
  margin-top: 0.15rem;
}

.emgra-chat-header-actions {
  display: flex;
  gap: 0.35rem;
}

.emgra-chat-icon-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--white, #fff);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s;
}

.emgra-chat-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.emgra-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 200px;
  max-height: 320px;
  background: #f9f9f9;
}

.emgra-chat-msg {
  max-width: 88%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.55;
  word-break: break-word;
}

.emgra-chat-msg--user {
  align-self: flex-end;
  background: var(--dark, #111);
  color: var(--white, #fff);
  border-bottom-right-radius: 3px;
}

.emgra-chat-msg--assistant {
  align-self: flex-start;
  background: var(--white, #fff);
  color: var(--dark, #111);
  border: 1px solid #eee;
  border-bottom-left-radius: 3px;
}

.emgra-chat-msg--typing {
  opacity: 0.7;
  font-style: italic;
}

.emgra-chat-footer {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid #eee;
  background: var(--white, #fff);
}

.emgra-chat-disclaimer {
  font-size: 0.68rem;
  color: #888;
  line-height: 1.4;
  margin-bottom: 0.6rem;
}

.emgra-chat-form {
  display: flex;
  gap: 0.5rem;
}

.emgra-chat-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font-family: 'Raleway', sans-serif;
  font-size: 0.88rem;
  resize: none;
  min-height: 42px;
  max-height: 100px;
  line-height: 1.4;
}

.emgra-chat-input:focus {
  outline: none;
  border-color: var(--gold, #C9A84C);
}

.emgra-chat-send {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 8px;
  background: var(--gold, #C9A84C);
  color: var(--dark, #111);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.emgra-chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.emgra-chat-welcome {
  font-size: 0.88rem;
  color: var(--grey-text, #555);
  text-align: center;
  padding: 1rem 0.5rem 0.5rem;
  line-height: 1.6;
}

.emgra-chat-quick-wrap {
  padding: 0 0 0.65rem;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 0.65rem;
}

.emgra-chat-quick-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 0.45rem;
}

.emgra-chat-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-height: 72px;
  overflow-y: auto;
}

.emgra-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  padding: 0.25rem 0 0.75rem;
}

.emgra-chat-chips--intro {
  margin-top: 0.25rem;
}

.emgra-chat-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.75rem;
  font-family: 'Raleway', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--dark, #111);
  background: var(--white, #fff);
  border: 1px solid var(--gold, #C9A84C);
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
  white-space: nowrap;
}

.emgra-chat-chip:hover:not(:disabled) {
  background: var(--gold, #C9A84C);
  color: var(--dark, #111);
}

.emgra-chat-chip:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.emgra-chat-chip:focus-visible {
  outline: 2px solid var(--gold, #C9A84C);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .emgra-chat-panel {
    right: 1rem;
    left: 1rem;
    width: auto;
    bottom: 5rem;
  }

  .emgra-chat-launcher {
    right: 1rem;
    bottom: 1rem;
  }
}
