/* Bulle d'assistant — sélecteurs préfixés .qantia-chat- uniquement. */

.qantia-chat-root {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 80;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--text, #e8eaef);
}

.qantia-chat-launcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--accent, #5b8cff);
  color: #fff;
  cursor: pointer;
}

.qantia-chat-launcher:focus-visible,
.qantia-chat-close:focus-visible,
.qantia-chat-send:focus-visible,
.qantia-chat-input:focus-visible {
  outline: 2px solid var(--accent, #5b8cff);
  outline-offset: 2px;
}

.qantia-chat-launcher-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.qantia-chat-glyph {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.qantia-chat-panel {
  display: flex;
  flex-direction: column;
  width: min(22rem, calc(100vw - 2rem));
  height: min(32rem, calc(100vh - 6.5rem));
  margin-bottom: 0.75rem;
  background: var(--bg-elevated, #12131a);
  color: var(--text, #e8eaef);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius, 14px);
  overflow: hidden;
}

.qantia-chat-panel[hidden] {
  display: none !important;
}

.qantia-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  background: var(--bg-card, #15171f);
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.qantia-chat-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.qantia-chat-close,
.qantia-chat-send {
  border: 0;
  border-radius: var(--radius-sm, 10px);
  cursor: pointer;
  font: inherit;
}

.qantia-chat-close {
  padding: 0.35rem 0.65rem;
  background: transparent;
  color: var(--text-muted, #8b92a3);
}

.qantia-chat-log {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.9rem;
}

.qantia-chat-msg {
  margin: 0;
  max-width: 90%;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  line-height: 1.45;
  font-size: 0.92rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.qantia-chat-msg-assistant {
  align-self: flex-start;
  background: var(--bg-card, #15171f);
}

.qantia-chat-msg-user {
  align-self: flex-end;
  background: var(--accent-dim, rgba(91, 140, 255, 0.15));
}

.qantia-chat-status {
  margin: 0;
  color: var(--text-muted, #8b92a3);
  font-size: 0.85rem;
}

.qantia-chat-status[hidden] {
  display: none !important;
}

.qantia-chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.qantia-chat-input {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border-strong, rgba(255, 255, 255, 0.12));
  border-radius: var(--radius-sm, 10px);
  background: var(--bg-page, #0a0b0f);
  color: inherit;
  font: inherit;
}

.qantia-chat-send {
  padding: 0.65rem 0.85rem;
  background: var(--accent, #5b8cff);
  color: #fff;
}

.qantia-chat-send:disabled {
  opacity: 0.55;
  cursor: default;
}
