.pgra-root {
  position: fixed;
  bottom: 20px;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.pgra-right { right: 20px; }
.pgra-left { left: 20px; }

/* Botão flutuante */
.pgra-fab {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--pgra-color, #c6181a);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}
.pgra-fab:hover { transform: scale(1.06); }

/* Painel do chat */
.pgra-panel {
  position: absolute;
  bottom: 74px;
  width: 360px;
  max-width: calc(100vw - 40px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
}
.pgra-right .pgra-panel { right: 0; }
.pgra-left .pgra-panel { left: 0; }

.pgra-header {
  background: var(--pgra-color, #c6181a);
  color: #fff;
  padding: 14px 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pgra-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.pgra-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Formulário de contato */
.pgra-lead {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pgra-intro { margin: 0 0 4px; color: #525252; font-size: 14px; }
.pgra-privacy { margin: 4px 0 0; color: #8a8a8a; font-size: 11px; line-height: 1.4; }
.pgra-lead input {
  padding: 11px 12px;
  border: 1px solid #e6e2dc;
  border-radius: 10px;
  font-size: 14px;
}
.pgra-lead button,
.pgra-compose button {
  background: var(--pgra-color, #c6181a);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}
.pgra-lead button { padding: 12px; font-size: 14px; }

/* Mensagens */
.pgra-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pgra-msg {
  max-width: 80%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.pgra-msg-player {
  align-self: flex-end;
  background: var(--pgra-color, #c6181a);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.pgra-msg-ai {
  align-self: flex-start;
  background: #f2efe9;
  color: #1a1a1a;
  border-bottom-left-radius: 4px;
}

/* Markdown da resposta da IA (negrito, itálico, listas…). O balão da IA passa a
   ter blocos de verdade, então o `pre-wrap` sai daqui — a quebra de linha dentro
   do parágrafo vira <br>, e o espaço entre parágrafos é margem, não linha em
   branco. O balão do jogador continua com `pre-wrap` (é texto puro). */
.pgra-msg-ai {
  white-space: normal;
}
.pgra-msg-ai p {
  margin: 0 0 8px;
}
.pgra-msg-ai p:last-child,
.pgra-msg-ai ul:last-child,
.pgra-msg-ai ol:last-child {
  margin-bottom: 0;
}
.pgra-msg-ai ul,
.pgra-msg-ai ol {
  margin: 0 0 8px;
  padding-left: 20px;
}
.pgra-msg-ai li {
  margin: 2px 0;
}
.pgra-msg-ai code {
  background: #fff;
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 0.9em;
}
.pgra-msg-ai a {
  color: var(--pgra-color, #c6181a);
  font-weight: 700;
}

/* Caixa de envio */
.pgra-compose {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e6e2dc;
}
.pgra-compose input {
  flex: 1;
  padding: 11px 12px;
  border: 1px solid #e6e2dc;
  border-radius: 10px;
  font-size: 14px;
}
.pgra-compose button {
  width: 44px;
  font-size: 16px;
}

/* Cards de recomendação (RF-29b) */
.pgra-cards {
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 85%;
}
.pgra-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: #fff;
  border: 1px solid #e6e2dc;
  border-radius: 10px;
}
.pgra-card-img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.pgra-card-name {
  font-weight: 700;
  font-size: 13px;
  color: #1a1a1a;
}
.pgra-card-desc {
  font-size: 12px;
  color: #525252;
}
