/* CHAT PAGE STYLES · MetaRun AI Coach */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

/* Entrada animada segura (ver js/gsap-entrance.js) — opacity:0 direto no
   CSS, carrega antes de qualquer coisa aparecer, sem risco de "flash" */
.gsap-hidden { opacity: 0; }

/* Remove as setinhas de incremento/decremento dos inputs numéricos */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

:root {
  --orange: #FF6B35;
  --orange-light: #FF8C5E;
  --orange-glow: rgba(255, 107, 53, 0.1);
  --black: #050505;
  --page-bg: #030303;
  --dark: #161616;
  --dark2: #1e1e1e;
  --dark3: #292929;
  --dark-border: #2a2a2a;
  --gray-700: #333;
  --gray-600: #444;
  --gray-500: #666;
  --gray-400: #888;
  --gray-300: #aaa;
  --gray-100: #f4f4f4;
  --white: #fff;
  --off-white: #fafafa;
  --topbar-bg: rgba(15, 15, 15, 0.85);
  --input-fade: rgba(15, 15, 15, 0);
  --font-display: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;
  --sidebar-width: 260px;
  --topbar-height: 68px;
  --input-area-height: 116px;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* LIGHT THEME VARIABLES */
[data-theme="light"] {
  --page-bg: #e7ebf3;
  --dark: #f8fafc;
  --dark2: #ffffff;
  --dark3: #f1f5f9;
  --dark-border: #e2e8f0;
  --white: #0f172a;
  --black: #ffffff;
  --gray-700: #334155;
  --gray-600: #475569;
  --gray-500: #64748b;
  --gray-400: #94a3b8;
  --gray-300: #cbd5e1;
  --gray-100: #1e293b;
  --topbar-bg: rgba(248, 250, 252, 0.95);
  --input-fade: rgba(248, 250, 252, 0);
}

html,
body {
  height: 100%;
  /* Em celular, "100%"/"100vh" é calculado a partir da tela toda,
     ignorando a barra de endereço do navegador — isso empurrava a barra
     de digitar mensagem pra fora da área visível. "dvh" (dynamic
     viewport height) acompanha o tamanho real visível, inclusive quando
     o teclado abre. Navegadores sem suporte simplesmente ignoram essa
     segunda linha e ficam com o "100%" de cima. */
  height: 100dvh;
  overflow: hidden
}

body {
  font-family: var(--font-body);
  background: var(--page-bg);
  color: var(--white);
  display: flex;
  -webkit-font-smoothing: antialiased;
  padding: 18px;
  gap: 16px
}

a {
  text-decoration: none;
  color: inherit
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit
}

textarea {
  font-family: var(--font-body);
  resize: none
}

/* ============= SIDEBAR (invisível — só os círculos dos ícones flutuam
   direto sobre o fundo da página, sem cartão por trás, igual referência) */
.chat-sidebar {
  width: 60px;
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 0;
  z-index: 100;
  flex-shrink: 0;
  box-shadow: none
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%
}

/* Cada ícone é seu próprio círculo flutuante — com fundo e sombra
   próprios, não uma barra contínua */
.sidebar-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--dark2);
  border: 1px solid var(--dark-border);
  color: var(--gray-400);
  font-size: 1.05rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  position: relative
}

.sidebar-icon-btn:hover {
  background: var(--dark3);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3)
}

.sidebar-icon-btn:active {
  transform: scale(0.94);
}

/* Botão "Nova conversa" com mais destaque — é a ação principal da barra */
.sidebar-icon-btn--accent {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
  box-shadow: 0 6px 18px rgba(255, 107, 53, 0.4)
}

.sidebar-icon-btn--accent:hover {
  background: var(--orange-light);
  border-color: var(--orange-light);
  color: var(--white)
}

.nav-btn.active {
  background: rgba(255, 107, 53, 0.15);
  border-color: rgba(255, 107, 53, 0.4);
  color: var(--orange)
}

.sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding-top: 14px
}

.user-dropdown-container {
  position: relative
}

.user-btn {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none
}

.sidebar-avatar-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--dark-border);
  transition: border-color 0.15s ease;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25)
}

.user-btn:hover .sidebar-avatar-icon {
  border-color: var(--orange)
}

.user-dropdown {
  position: fixed;
  width: 240px;
  background: var(--dark2);
  border: 1px solid var(--dark-border);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 100
}

.user-dropdown.show {
  display: flex;
  animation: fadeInUp 0.2s ease
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--gray-300);
  font-size: 0.82rem;
  transition: var(--transition);
  width: 100%;
  text-align: left
}

.dropdown-item i {
  font-size: 1rem;
  width: 18px;
  text-align: center
}

.dropdown-item:hover:not(.plan-info) {
  background: var(--dark3);
  color: var(--white)
}

.dropdown-item.plan-info {
  font-size: 0.75rem;
  color: var(--gray-400);
  cursor: default;
  background: var(--dark3)
}

.dropdown-item.upgrade {
  color: var(--white);
  font-weight: 600
}

.dropdown-divider {
  height: 1px;
  background: var(--dark-border);
  margin: 4px 0
}

.text-danger {
  color: #ef4444
}

.text-danger:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #ef4444 !important
}

/* ============= MAIN CHAT ============= */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--dark);
  position: relative;
  border-radius: 28px;
  border: 1px solid var(--dark-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.03)
}

/* TOPBAR — pill de status à esquerda, e nome + ações agrupados juntos
   no canto direito (não centralizado — o nome "gruda" na fileira de
   ações em vez de flutuar sozinho no meio de um vão vazio) */
.chat-topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid var(--dark-border);
  background: transparent;
  flex-shrink: 0
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0
}

.topbar-right-group {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0
}

.topbar-center {
  min-width: 0
}

/* Pill do lado esquerdo — mesmo espírito do seletor de modelo da
   referência, só que mostrando o status da IA MetaRun em vez de trocar
   de modelo (a MetaRun não tem múltiplos modelos pra escolher) */
.topbar-model-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px 0 6px;
  border-radius: 999px;
  background: var(--dark2);
  border: 1px solid var(--dark-border);
  color: var(--gray-300);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap
}

.topbar-menu {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--gray-400);
  transition: var(--transition)
}

.topbar-menu:hover {
  background: var(--dark3);
  color: var(--white)
}

.topbar-avatar {
  position: relative;
  width: 24px;
  height: 24px
}

.ai-avatar-inner {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--orange), #FF9A5E);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(255, 107, 53, 0.4);
  transition: box-shadow var(--dur) var(--ease)
}

.topbar-status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid var(--dark2);
  animation: statusPulse 2.5s ease-in-out infinite
}

@keyframes statusPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4)
  }

  50% {
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0)
  }
}

.topbar-ai-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.topbar-ai-status {
  font-size: 0.72rem;
  color: #4ade80;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px
}

.topbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--gray-400);
  transition: var(--transition)
}

.topbar-btn:hover {
  background: var(--dark3);
  color: var(--white)
}

.topbar-btn.active {
  background: var(--orange-glow);
  color: var(--orange);
}

.topbar-back {
  color: var(--gray-500)
}

/* Pill de CTA no topbar — "Meu plano" pra quem já assina, "Upgrade" pra
   quem ainda não tem plano ativo (texto/estilo trocado via JS) */
.topbar-upgrade-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--orange), #ff8c5a);
  color: var(--white);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(255, 107, 53, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease
}

.topbar-upgrade-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255, 107, 53, 0.45)
}

.topbar-upgrade-pill i {
  font-size: 0.85rem
}

/* Já existe um alternador de tema dentro de Configurações — deixa só lá,
   pra não duplicar controle no topo (mobile e desktop) */
#themeToggleBtn {
  display: none
}

/* ============ BOTÃO "OUVIR" (modo de fala) ============ */
.msg-action-btn.speaking {
  color: var(--orange);
}
.msg-action-btn.speaking i {
  animation: msgSpeakingPulse 1s ease-in-out infinite;
}
@keyframes msgSpeakingPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* CONVERSATIONS VIEW */
.conversations-view {
  flex: 1;
  overflow-y: auto;
  padding: 32px 0;
  max-width: 800px;
  margin: 0 auto;
  width: 100%
}

.conversations-view::-webkit-scrollbar {
  width: 5px
}

.conversations-view::-webkit-scrollbar-thumb {
  background: var(--dark3);
  border-radius: 3px
}

.conversations-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 0 24px
}

.conv-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--white);
  margin: 0
}

.conversations-actions {
  display: flex;
  gap: 8px
}

.conv-btn {
  padding: 8px 14px;
  border-radius: 18px;
  background: var(--dark2);
  border: 1px solid var(--dark-border);
  color: var(--gray-300);
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px
}

.conv-btn:hover {
  background: var(--dark3);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2)
}

.conv-btn.primary {
  background: var(--white);
  color: var(--black);
  border-color: transparent
}

.conv-btn.primary:hover {
  background: #e2e8f0;
  color: var(--black)
}

.conversations-search {
  margin: 0 24px 32px;
  position: relative
}

.conversations-search i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400)
}

.conversations-search input {
  width: 100%;
  background: var(--dark2);
  border: 1px solid var(--dark-border);
  border-radius: 12px;
  padding: 12px 16px 12px 42px;
  color: var(--white);
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none
}

.conversations-search input:focus {
  border-color: var(--orange)
}

.conversations-list {
  display: flex;
  flex-direction: column;
  padding: 0 24px
}

.conv-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px;
  border-bottom: 1px solid var(--dark-border);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: 10px;
  margin-bottom: 2px;
  position: relative;
}

.conv-item:hover {
  background: rgba(255, 107, 53, 0.06);
  border-bottom-color: transparent;
  transform: translateX(4px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.conv-item:active {
  transform: translateX(2px) scale(0.99);
}

.conv-item-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.conv-item-title {
  font-size: 0.92rem;
  color: var(--gray-300);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-item:hover .conv-item-title {
  color: var(--white)
}

.conv-item-date {
  font-size: 0.72rem;
  color: var(--gray-500);
  white-space: nowrap
}

.conv-item-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--gray-600);
  cursor: pointer;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  flex-shrink: 0;
  margin-left: 8px;
}

.conv-item:hover .conv-item-delete {
  opacity: 1;
  transform: scale(1);
}

/* Sem hover em tela de toque, esse botão ficava invisível (opacity:0) e
   sem jeito de saber que dava pra excluir a conversa por ali */
@media (hover: none) {
  .conv-item-delete {
    opacity: 1;
    transform: scale(1);
    width: 36px;
    height: 36px;
  }
}

.conv-item-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  transform: scale(1.1) !important;
}

.conv-item-delete:active {
  transform: scale(0.9) !important;
}

.conv-item-delete i {
  font-size: 0.85rem;
}

/* MESSAGES */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0 160px;
  scroll-behavior: smooth
}

.chat-messages::-webkit-scrollbar {
  width: 5px
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--dark3);
  border-radius: 3px
}

.chat-messages>* {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto
}

/* WELCOME SCREEN */
.chat-welcome {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 24px 8px;
  text-align: center
}

.welcome-title {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px
}

.welcome-title-muted {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gray-400)
}

.welcome-title-strong {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--white)
}

/* O container tem exatamente o tamanho do círculo da mascote — os balões
   se posicionam relativos a essa borda (100%), então ficam sempre grudados
   nela, com um respiro pequeno e fixo, nunca "perdidos" longe do ícone */
.welcome-mascot-row {
  position: relative;
  width: 92px;
  height: 92px;
  margin: 32px auto 30px
}

.welcome-avatar {
  width: 92px;
  height: 92px;
  background: linear-gradient(135deg, var(--orange), #FF9A5E);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 32px rgba(255, 107, 53, 0.4);
  flex-shrink: 0;
  z-index: 1
}

/* Balões grudados nas laterais da mascote — pertinho, quase encostando,
   em posições diagonais (um embaixo à esquerda, outro em cima à direita) */
.welcome-bubble {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--dark2);
  border: 1px solid var(--dark-border);
  border-radius: 14px;
  padding: 8px 14px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--gray-200);
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  animation: bubbleFloat 3.5s ease-in-out infinite
}

.welcome-bubble i {
  color: var(--orange);
  font-size: 0.72rem
}

.welcome-bubble--left {
  right: calc(100% + 10px);
  bottom: 2px;
  animation-delay: 0s
}

.welcome-bubble--right {
  left: calc(100% + 10px);
  top: 2px;
  animation-delay: 1.2s
}

@keyframes bubbleFloat {
  0%, 100% { transform: translateY(0) }
  50% { transform: translateY(-6px) }
}

@media (max-width: 520px) {
  .welcome-bubble { display: none }
}

.welcome-sub {
  font-size: 0.9rem;
  color: var(--gray-400);
  line-height: 1.6;
  margin-bottom: 32px
}

/* Sugestões em pílulas, centralizadas e quebrando linha — como a fileira
   de categorias (Coding/Cooking/Health...) da referência */
.welcome-suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px
}

.suggestion-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  background: var(--dark2);
  border: 1px solid var(--dark-border);
  border-radius: 999px;
  color: var(--gray-300);
  font-size: 0.82rem;
  font-family: var(--font-body);
  white-space: nowrap;
  transition: var(--transition);
  cursor: pointer
}

.suggestion-btn:hover {
  background: var(--dark3);
  border-color: rgba(255, 107, 53, 0.35);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2)
}

/* MESSAGE BUBBLES */
.chat-message {
  display: flex;
  gap: 16px;
  padding: 24px;
  max-width: 100%;
  animation: msgIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  align-items: flex-start
}

@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(12px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.chat-message.user {
  flex-direction: row-reverse;
  justify-content: flex-start
}

.chat-message.user .msg-bubble {
  background: var(--dark2);
  color: var(--white);
  border: 1px solid var(--dark-border);
  border-radius: 20px;
  max-width: 600px
}

.chat-message.ai .msg-bubble {
  background: transparent;
  color: var(--white);
  border: none;
  border-radius: 0;
  padding: 0;
  max-width: 650px
}

.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0
}

.chat-message.ai .msg-avatar {
  background: transparent;
  border: 1px solid var(--dark-border);
  overflow: hidden;
}

.msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%
}

.chat-message.user .msg-avatar {
  display: none
}

/* Hide avatar for user in minimal style */
.msg-bubble {
  padding: 12px 18px;
  font-size: 0.95rem;
  line-height: 1.7
}

.msg-bubble p {
  margin-bottom: 12px
}

.msg-bubble p:last-child {
  margin-bottom: 0
}

.msg-bubble ul {
  padding-left: 18px;
  margin-bottom: 12px
}

.msg-bubble li {
  margin-bottom: 6px
}

.msg-bubble strong {
  font-weight: 700;
  color: inherit
}

.msg-heading {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--orange);
  margin: 18px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--dark-border)
}

.msg-list {
  list-style: none;
  padding: 0;
  margin: 4px 0 14px
}

.msg-list li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
  line-height: 1.6
}

.msg-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--orange)
}

.msg-table-wrap {
  margin: 10px 0 16px;
  overflow-x: auto;
  border: 1px solid var(--dark-border);
  border-radius: 12px
}

.msg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem
}

.msg-table th {
  background: rgba(255, 107, 53, 0.12);
  color: var(--orange);
  font-weight: 700;
  text-align: left;
  padding: 10px 14px;
  white-space: nowrap
}

.msg-table td {
  padding: 10px 14px;
  border-top: 1px solid var(--dark-border);
  color: var(--gray-300)
}

.msg-table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02)
}

/* ANEXOS */
.attachment-preview {
  display: flex;
  margin-bottom: 8px
}

.attachment-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--dark2);
  border: 1px solid var(--dark-border);
  border-radius: 12px;
  padding: 6px 10px 6px 6px;
  max-width: 260px
}

.attachment-chip-thumb {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0
}

.attachment-chip-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 107, 53, 0.12);
  color: var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem
}

.attachment-chip-name {
  font-size: 0.78rem;
  color: var(--gray-300);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1
}

.attachment-chip-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: var(--gray-400);
  flex-shrink: 0;
  transition: var(--transition)
}

.attachment-chip-remove:hover {
  background: var(--dark3);
  color: var(--white)
}

.msg-attachment {
  margin-bottom: 6px
}

.msg-attachment-img {
  max-width: 260px;
  max-height: 220px;
  border-radius: 14px;
  border: 1px solid var(--dark-border);
  object-fit: cover;
  display: block
}

.msg-attachment-file {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--dark2);
  border: 1px solid var(--dark-border);
  border-radius: 12px;
  padding: 10px 14px;
  max-width: 260px;
  font-size: 0.85rem;
  color: var(--gray-300)
}

.msg-attachment-file i {
  color: var(--orange);
  font-size: 1.1rem
}

.chat-message.user .msg-attachment {
  display: flex;
  justify-content: flex-end
}

/* AÇÕES NA MENSAGEM DO USUÁRIO (editar) */
.msg-actions-user {
  justify-content: flex-end
}

/* BOTÃO DE PARAR GERAÇÃO */
.send-btn.is-stop {
  background: var(--white)
}

.send-btn.is-stop i {
  font-size: 0.85rem
}

/* EDIÇÃO DE MENSAGEM */
.msg-edit-wrap {
  background: var(--dark2);
  border: 1px solid var(--orange);
  border-radius: 16px;
  padding: 10px 14px;
  max-width: 600px
}

.msg-edit-textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.6;
  min-height: 24px
}

.msg-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px
}

.msg-edit-btn {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 10px;
  transition: var(--transition)
}

.msg-edit-btn.cancel {
  color: var(--gray-400)
}

.msg-edit-btn.cancel:hover {
  color: var(--white)
}

.msg-edit-btn.save {
  background: var(--orange);
  color: var(--white)
}

.msg-edit-btn.save:hover {
  background: var(--orange-light)
}

/* BANNER DE LIMITE DE MENSAGENS */
.limit-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 14px;
  margin-bottom: 8px;
  font-size: 0.82rem
}

.limit-banner-text {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--white)
}

.limit-banner-btn {
  background: var(--white);
  color: var(--black);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 6px 14px;
  border-radius: 10px;
  white-space: nowrap;
  transition: var(--transition)
}

.limit-banner-btn:hover {
  background: #e2e8f0
}

.limit-banner-warning {
  background: rgba(255, 107, 53, 0.12);
  border: 1px solid rgba(255, 107, 53, 0.3)
}

.limit-banner-warning i {
  color: var(--orange)
}

.limit-banner-blocked {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3)
}

.limit-banner-blocked i {
  color: #ef4444
}

/* MODAL GENÉRICO (calculadora de pace) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto
}

.pace-modal {
  background: var(--dark2);
  border: 1px solid var(--dark-border);
  border-radius: 20px;
  width: 100%;
  max-width: 380px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: fadeInUp 0.2s ease
}

.pace-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px
}

.pace-modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  display: flex;
  align-items: center
}

.pace-modal-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  transition: var(--transition)
}

.pace-modal-close:hover {
  background: var(--dark3);
  color: var(--white)
}

@media (hover: none) {
  .pace-modal-close {
    width: 40px;
    height: 40px
  }
}

.pace-tabs {
  display: flex;
  background: var(--dark3);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 18px;
  gap: 4px
}

.pace-tab {
  flex: 1;
  padding: 8px;
  border-radius: 9px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-400);
  transition: var(--transition)
}

.pace-tab.active {
  background: var(--orange);
  color: var(--white)
}

.pace-label {
  display: block;
  font-size: 0.78rem;
  color: var(--gray-400);
  margin: 12px 0 6px
}

.pace-label:first-child {
  margin-top: 0
}

.pace-input {
  width: 100%;
  background: var(--dark3);
  border: 1px solid var(--dark-border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--white);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition)
}

.pace-input:focus {
  border-color: var(--orange)
}

.pace-calc-btn {
  width: 100%;
  background: var(--orange);
  color: var(--white);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 11px;
  border-radius: 10px;
  margin-top: 16px;
  transition: var(--transition)
}

.pace-calc-btn:hover {
  background: var(--orange-light)
}

.pace-result {
  margin-top: 16px;
  padding: 14px;
  background: var(--dark3);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px
}

.pace-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--gray-300)
}

.pace-result-item strong {
  color: var(--orange);
  font-size: 1rem
}

.pace-result-error {
  color: #ef4444;
  font-size: 0.82rem
}

.msg-bubble .msg-highlight {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 107, 53, 0.15);
  color: var(--orange);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 2px 0
}

.msg-time {
  font-size: 0.65rem;
  color: var(--gray-500);
  margin-top: 4px;
  text-align: right
}

.chat-message.user .msg-time {
  text-align: left
}

/* MSG ACTIONS (on hover) */
.msg-actions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  opacity: 0;
  transition: var(--transition)
}

.chat-message:hover .msg-actions {
  opacity: 1
}

/* Em telas de toque não existe ":hover" — sem isso, os botões de
   copiar/ouvir/regenerar de cada mensagem ficavam impossíveis de tocar
   no celular */
@media (hover: none) {
  .msg-actions {
    opacity: 1
  }
}

.msg-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  color: var(--gray-500);
  transition: var(--transition)
}

.msg-action-btn:hover {
  background: var(--dark3);
  color: var(--white)
}

/* DATE SEPARATOR */
.chat-date-sep {
  text-align: center;
  font-size: 0.7rem;
  color: var(--gray-500);
  margin: 12px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px
}

.chat-date-sep::before,
.chat-date-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--dark-border)
}

/* TYPING INDICATOR */
#chatTyping {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  width: 100%
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gray-400);
  animation: dotBounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0s;
}

@keyframes dotBounce {

  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  40% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

/* INPUT AREA */
.chat-input-area {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 24px calc(24px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, var(--dark) 60%, var(--input-fade));
  flex-shrink: 0;
  pointer-events: none
}

.chat-input-area>* {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  pointer-events: auto
}

/* Card do input — textarea em cima, fileira de pills embaixo (mesma
   estrutura do card de comando da referência) */
.chat-input-card {
  background: var(--dark2);
  border: 1px solid var(--dark-border);
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  padding: 14px 18px 10px;
  gap: 4px;
  transition: var(--transition);
  position: relative;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15)
}

.chat-input-card:focus-within {
  border-color: var(--orange);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(255, 107, 53, 0.1)
}

.chat-input-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px
}

.chat-input-toolbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0
}

.chat-input-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0
}

.input-pill-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--dark-border);
  background: var(--dark3);
  color: var(--gray-400);
  font-size: 0.76rem;
  font-weight: 500;
  white-space: nowrap;
  transition: var(--transition)
}

.input-pill-btn i {
  font-size: 0.82rem
}

.input-pill-btn:hover {
  background: var(--orange-glow, rgba(255, 107, 53, 0.1));
  border-color: rgba(255, 107, 53, 0.35);
  color: var(--orange)
}

.toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--gray-400);
  transition: var(--transition);
  flex-shrink: 0
}

.toolbar-btn:hover {
  background: var(--dark3);
  color: var(--white);
  transform: scale(1.1)
}

/* ============ BOTÃO DE MICROFONE (fala pra texto) ============ */
#micBtn.listening {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  animation: micPulse 1.4s ease-in-out infinite;
}
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

.chat-textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  font-size: 0.95rem;
  line-height: 1.5;
  padding: 4px 4px 10px;
  min-height: 28px;
  max-height: 160px;
  overflow-y: auto;
  width: 100%
}

.chat-textarea::placeholder {
  color: var(--gray-500)
}

.send-btn {
  width: 36px;
  height: 36px;
  background: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--black);
  transition: var(--transition);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.08)
}

.send-btn:hover:not(:disabled) {
  background: var(--gray-300);
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.12)
}

.send-btn:disabled {
  background: var(--dark3);
  color: var(--gray-600);
  cursor: not-allowed
}

.chat-disclaimer {
  text-align: center;
  font-size: 0.7rem;
  color: var(--gray-600);
  margin-top: 12px;
  line-height: 1.5
}

/* MOBILE OVERLAY */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 49;
  backdrop-filter: blur(4px)
}

/* RESPONSIVE */
@media(max-width:768px) {
  .chat-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1)
  }

  .chat-sidebar.open {
    transform: translateX(0)
  }

  .sidebar-overlay.show {
    display: block
  }

  .topbar-menu {
    display: flex
  }

  .topbar-back {
    display: none
  }

  .topbar-upgrade-pill span {
    display: none
  }

  .topbar-upgrade-pill {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center
  }

  .topbar-model-pill span {
    display: none
  }

  .topbar-model-pill {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center
  }

  /* No mobile os rótulos das pills não cabem — vira uma fileira de ícones
     com scroll horizontal, como a barra de anexos da referência encolhe
     em telas estreitas */
  .chat-input-toolbar-left {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none
  }

  .chat-input-toolbar-left::-webkit-scrollbar {
    display: none
  }

  .input-pill-btn span {
    display: none
  }

  .input-pill-btn {
    width: 32px;
    padding: 0;
    justify-content: center;
    flex-shrink: 0
  }

  .msg-bubble {
    max-width: 80vw
  }

  .chat-message {
    padding: 10px 14px
  }

  /* Balão do usuário ficava colado na borda direita — dá mais respiro */
  .chat-message.user {
    padding-right: 20px
  }

  /* Campos de texto com menos de 16px fazem o Safari do iPhone dar
     zoom automático ao tocar pra digitar — trava a experiência */
  .chat-textarea,
  .conversations-search input,
  .pace-input {
    font-size: 1rem
  }
}

/* Telas bem estreitas (celulares pequenos): a topbar do chat tem vários
   botões de ação e não cabe tudo em ~320-375px — recolhe o botão de
   compartilhar pra sobrar espaço */
@media(max-width:400px) {
  .chat-topbar {
    padding: 0 12px;
    gap: 8px
  }

  #shareBtn {
    display: none
  }
}

/* CONTEXT MENU */
.context-menu {
  position: absolute;
  background: var(--dark2);
  border: 1px solid var(--dark-border);
  border-radius: 12px;
  padding: 6px;
  min-width: 180px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
  transform-origin: top left;
  transition: opacity 0.15s ease, transform 0.15s ease
}

.context-menu.show {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1)
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: var(--gray-300);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition)
}

.context-menu-item:hover {
  background: rgba(255, 107, 53, 0.1);
  color: var(--orange)
}

.context-menu-item.danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444
}
/* Animations for Conversations List */
.conversations-list .conv-item {
    animation: fadeInUp 0.35s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.conversations-list .conv-item:nth-child(1) { animation-delay: 0s; }
.conversations-list .conv-item:nth-child(2) { animation-delay: 0.04s; }
.conversations-list .conv-item:nth-child(3) { animation-delay: 0.08s; }
.conversations-list .conv-item:nth-child(4) { animation-delay: 0.12s; }
.conversations-list .conv-item:nth-child(5) { animation-delay: 0.16s; }
.conversations-list .conv-item:nth-child(6) { animation-delay: 0.2s; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.conv-empty {
    text-align: center;
    color: var(--gray-400);
    padding: 40px 20px;
}

/* ============ TOAST NOTIFICATIONS ============ */
.chat-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}
.chat-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.chat-toast-info {
    background: rgba(30, 30, 30, 0.92);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.chat-toast-success {
    background: rgba(22, 101, 52, 0.92);
    color: #bbf7d0;
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.chat-toast-error {
    background: rgba(127, 29, 29, 0.92);
    color: #fecaca;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.chat-toast-warning {
    background: rgba(120, 53, 15, 0.92);
    color: #fef3c7;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ============ LIKE BUTTON STATE ============ */
.msg-action-btn.like-btn.liked {
    color: var(--orange) !important;
    background: rgba(255, 107, 53, 0.12);
}

/* ============ ACTIVE CONVERSATION DOT ============ */
.conv-item {
    position: relative;
}
.conv-item-active-dot {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--orange);
    box-shadow: 0 0 8px rgba(255, 107, 53, 0.5);
}

/* ============ SELECT MODE ============ */
.conversations-list.select-mode .conv-item {
    padding-left: 44px;
    cursor: pointer;
}
.conversations-list.select-mode .conv-item::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid var(--dark-border);
    background: var(--dark2);
    transition: all 0.2s ease;
}
.conversations-list.select-mode .conv-item.selected::before {
    background: var(--orange);
    border-color: var(--orange);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

/* ============ MEDAL CELEBRATION MODAL ============
   Aparece quando o chat detecta um treino concluído e uma medalha nova é
   desbloqueada em tempo real (ver js/chat.js -> queueMedalCelebration).
   As classes de cor (.medal-gold/.medal-blue/etc) vêm de dashboard.css,
   carregado só por causa disso nesta página. */
.medal-celebration-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.medal-celebration-confetti {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.medal-celebration-confetti span {
    position: absolute;
    top: -12px;
    opacity: 0;
}

.medal-celebration-card {
    position: relative;
    z-index: 1;
    background: var(--dark2);
    border: 1px solid var(--dark-border);
    border-radius: 24px;
    padding: 40px 32px 32px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.medal-celebration-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.3rem;
    color: #fff;
}

.medal-celebration-icon.medal-gold { box-shadow: 0 0 34px rgba(245, 197, 66, 0.55); }
.medal-celebration-icon.medal-blue { box-shadow: 0 0 34px rgba(90, 169, 255, 0.55); }
.medal-celebration-icon.medal-teal { box-shadow: 0 0 34px rgba(56, 217, 169, 0.55); }
.medal-celebration-icon.medal-orange { box-shadow: 0 0 34px rgba(255, 107, 53, 0.55); }
.medal-celebration-icon.medal-purple { box-shadow: 0 0 34px rgba(139, 92, 246, 0.55); }

.medal-celebration-eyebrow {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--orange);
    margin-bottom: 6px;
}

.medal-celebration-title {
    font-family: var(--font-display, 'Sora', sans-serif);
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 26px;
    line-height: 1.25;
}

.medal-celebration-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--orange);
    color: #fff;
    border: none;
    padding: 12px 26px;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.86rem;
    cursor: pointer;
    font-family: var(--font-display, 'Sora', sans-serif);
    transition: filter 0.15s ease, transform 0.12s ease;
}

.medal-celebration-btn:hover { filter: brightness(1.08); }
.medal-celebration-btn:active { transform: scale(0.97);
}
.conversations-list.select-mode .conv-item.selected::after {
    content: '';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-60%) rotate(45deg);
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
}

.select-delete-bar {
    position: sticky;
    bottom: 0;
    background: var(--dark2);
    border: 1px solid var(--dark-border);
    border-radius: 12px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    animation: slideUp 0.25s ease;
}
.select-count {
    color: var(--gray-400);
    font-size: 0.85rem;
}
.select-delete-btn {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}
.select-delete-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    transform: translateY(-1px);
}
.select-delete-btn i { font-size: 0.85rem; }

/* ============ RENAME INPUT ============ */
.conv-rename-input {
    width: 100%;
    background: var(--dark3);
    border: 1px solid var(--orange);
    border-radius: 6px;
    padding: 4px 8px;
    color: var(--white);
    font-size: 0.88rem;
    font-weight: 600;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}
.conv-rename-input:focus {
    border-color: var(--orange);
}

/* ============ FILTER BUTTON ACTIVE STATE ============ */
.conv-btn.active {
    background: var(--orange);
    color: var(--white);
    border-color: transparent;
}

/* ============ ENTRANCE ANIMATIONS ============ */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.chat-message {
    animation: msgIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes msgIn {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-welcome {
    animation: fadeInScale 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.welcome-suggestions .suggestion-btn {
    animation: slideUp 0.4s ease backwards;
}
.welcome-suggestions .suggestion-btn:nth-child(1) { animation-delay: 0.1s; }
.welcome-suggestions .suggestion-btn:nth-child(2) { animation-delay: 0.15s; }
.welcome-suggestions .suggestion-btn:nth-child(3) { animation-delay: 0.2s; }
.welcome-suggestions .suggestion-btn:nth-child(4) { animation-delay: 0.25s; }
.welcome-suggestions .suggestion-btn:nth-child(5) { animation-delay: 0.3s; }
.welcome-suggestions .suggestion-btn:nth-child(6) { animation-delay: 0.35s; }

.settings-content {
    animation: fadeInScale 0.4s ease;
}

/* ============ STATUS DOT PULSE ============ */
.topbar-status-dot {
    animation: statusPulse 2.5s ease-in-out infinite;
}
@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0); }
}

/* ============ SEND BUTTON MICRO-ANIMATION ============ */
.send-btn {
    transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.send-btn:active:not(:disabled) {
    transform: scale(0.9);
}

/* ============ PACE MODAL ANIMATION ============ */
.pace-modal {
    animation: fadeInScale 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============ CONTEXT MENU ANIMATION ============ */
.context-menu.show {
    animation: fadeInScale 0.2s ease;
}

/* ============ SUGGESTION BTN CLICK FEEDBACK ============ */
.suggestion-btn:active {
    transform: scale(0.97);
    transition-duration: 0.08s;
}

/* ============ PAYWALL OVERLAY (chat exclusivo p/ assinantes) ============ */
body.chat-locked .chat-sidebar,
body.chat-locked .chat-main,
body.chat-locked .sidebar-overlay {
    display: none !important;
}

body.chat-locked .chat-paywall-overlay {
    display: flex !important;
}

.chat-paywall-overlay {
    position: fixed;
    inset: 0;
    background: var(--black);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.chat-paywall-card {
    max-width: 440px;
    width: 100%;
    text-align: center;
    background: var(--dark2);
    border: 1px solid var(--dark-border);
    border-radius: 20px;
    padding: 40px 32px;
    animation: fadeInScale 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-paywall-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px auto;
    border-radius: 50%;
    background: var(--orange-glow);
    color: var(--orange);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.chat-paywall-card h2 {
    color: var(--white);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.chat-paywall-card p {
    color: var(--gray-300);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 24px;
}

.chat-paywall-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: var(--orange);
    color: var(--white);
    font-weight: 700;
    padding: 13px 20px;
    border-radius: 12px;
    text-decoration: none;
    margin-bottom: 14px;
    transition: filter 0.2s ease;
}

.chat-paywall-btn:hover {
    filter: brightness(1.08);
}

.chat-paywall-back {
    display: inline-block;
    color: var(--gray-400);
    font-size: 0.85rem;
    text-decoration: none;
}

.chat-paywall-back:hover {
    color: var(--gray-300);
}
