/* ============================================================
   nativeUI.css — Redesign premium Lovable3s (camada visual nova)
   Não altera lógica. Apenas estilos da raposa, menu, modais,
   borda do chat e anexo. Prefixo: qln-
   ============================================================ */

:root {
  --qln-bg: #09090b;
  --qln-card: #12121a;
  --qln-card-2: #16161f;
  --qln-purple: #7c3aed;
  --qln-hover: #8b5cf6;
  --qln-text: #f8fafc;
  --qln-text-2: #94a3b8;
  --qln-border: rgba(255, 255, 255, 0.08);
  --qln-border-strong: rgba(255, 255, 255, 0.14);
  --qln-shadow: 0 24px 70px -12px rgba(0, 0, 0, 0.7);
  --qln-glow: 0 0 22px rgba(124, 58, 237, 0.45);
  --qln-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===== Popup legado: oculto por padrão (zero flash no reload). =====
   Só reaparece como gate de ativação quando o nativeUI decide
   (body.qln-host-visible). Para licenciado vira host de lógica oculto. */
#ql-floating {
  display: none !important;
}
body.qln-host-visible #ql-floating {
  display: block !important;
  visibility: visible !important;
}

#qln-root,
#qln-root * {
  box-sizing: border-box;
  font-family: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont,
    system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ===== Borda premium ao redor do chat ===== */
.qln-chat-framed {
  position: relative;
  border-radius: 18px !important;
  box-shadow:
    0 0 0 1.5px rgba(124, 58, 237, 0.55),
    0 0 0 4px rgba(124, 58, 237, 0.08),
    0 0 28px rgba(124, 58, 237, 0.28),
    inset 0 0 18px rgba(124, 58, 237, 0.04);
  animation: qln-frame-breathe 4.5s var(--qln-ease) infinite;
  transition: box-shadow 0.25s var(--qln-ease);
}
@keyframes qln-frame-breathe {
  0%,
  100% {
    box-shadow:
      0 0 0 1.5px rgba(124, 58, 237, 0.5),
      0 0 0 4px rgba(124, 58, 237, 0.07),
      0 0 24px rgba(124, 58, 237, 0.22),
      inset 0 0 16px rgba(124, 58, 237, 0.03);
  }
  50% {
    box-shadow:
      0 0 0 1.5px rgba(139, 92, 246, 0.7),
      0 0 0 5px rgba(124, 58, 237, 0.12),
      0 0 34px rgba(124, 58, 237, 0.38),
      inset 0 0 20px rgba(124, 58, 237, 0.06);
  }
}

/* ===== Botão flutuante da raposa ===== */
#qln-fox {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 54px;
  border-radius: 16px;
  border: 1px solid var(--qln-border-strong);
  background: linear-gradient(155deg, rgba(30, 24, 50, 0.92), rgba(13, 11, 22, 0.92));
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow: var(--qln-shadow), var(--qln-glow);
  cursor: pointer;
  z-index: 2147483600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  animation: qln-fox-idle 3.4s ease-in-out infinite;
  transition: transform 0.2s var(--qln-ease), box-shadow 0.2s var(--qln-ease),
    border-color 0.2s var(--qln-ease);
}
#qln-fox svg {
  width: 30px;
  height: 30px;
  display: block;
  filter: drop-shadow(0 2px 5px rgba(124, 58, 237, 0.5));
}
#qln-fox:hover {
  transform: translateY(-50%) scale(1.08);
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: var(--qln-shadow), 0 0 30px rgba(139, 92, 246, 0.6);
  animation-play-state: paused;
}
#qln-fox:active {
  transform: translateY(-50%) scale(0.96);
}
#qln-fox.qln-open {
  border-color: rgba(139, 92, 246, 0.65);
  box-shadow: var(--qln-shadow), 0 0 32px rgba(139, 92, 246, 0.65);
  animation-play-state: paused;
}
@keyframes qln-fox-idle {
  0%,
  100% {
    transform: translateY(-50%);
  }
  50% {
    transform: translateY(calc(-50% - 5px));
  }
}

/* ===== Estado arrastável ===== */
#qln-fox.qln-dragged {
  top: auto;
  transform: none !important;
  animation: none !important;
  transition: left 0.26s var(--qln-ease), top 0.26s var(--qln-ease),
    box-shadow 0.2s var(--qln-ease), border-color 0.2s var(--qln-ease) !important;
}
#qln-fox.qln-dragged:hover {
  transform: scale(1.08) !important;
}
#qln-fox.qln-dragged:active {
  transform: scale(0.96) !important;
}
#qln-fox.qln-dragged.qln-open {
  transform: none !important;
}
#qln-fox.qln-dragging {
  transition: none !important;
  animation: none !important;
  cursor: grabbing !important;
  transform: scale(1.05) !important;
}
#qln-fox.qln-no-anim {
  transition: none !important;
}

/* Brilho suave quando há um plano aguardando aprovação (sem verde forte) */
#qln-fox.qln-plan-glow {
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.28), 0 8px 26px rgba(124, 58, 237, 0.32);
  animation: qln-plan-pulse 2.4s ease-in-out infinite;
}
@keyframes qln-plan-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.22), 0 8px 22px rgba(124, 58, 237, 0.26); }
  50% { box-shadow: 0 0 0 5px rgba(139, 92, 246, 0.30), 0 10px 30px rgba(139, 92, 246, 0.38); }
}

/* ===== Raposa EMBUTIDA na caixa de texto nativa (não flutuante) =====
   Neutraliza todo o estilo de widget flutuante (#qln-fox acima) e assume o
   visual de um botão nativo da barra do chat — o className copiado do
   botão "enviar" já dá a base; aqui só resetamos position/size/animação. */
#qln-fox.qln-fox-embedded {
  position: static !important;
  right: auto !important;
  top: auto !important;
  transform: none !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  border-radius: 8px !important;
  border: 0 !important;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  animation: none !important;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
#qln-fox.qln-fox-embedded svg {
  width: 18px;
  height: 18px;
  filter: none;
}
#qln-fox.qln-fox-embedded:hover {
  transform: none !important;
  box-shadow: none !important;
  background: rgba(139, 92, 246, 0.12) !important;
}
#qln-fox.qln-fox-embedded:active {
  transform: scale(0.94) !important;
}
#qln-fox.qln-fox-embedded.qln-open {
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.6) !important;
}
#qln-fox.qln-fox-embedded.qln-plan-glow {
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.5) !important;
  animation: qln-plan-pulse 2.4s ease-in-out infinite !important;
}

/* Pulinho + balanço contínuo no ícone da raposa (igual lovable-inspector).
   Usa `translate`/`rotate` (propriedades CSS separadas de `transform`) em
   vez de `transform: translateY()/rotate()` porque `.qln-fox-embedded` base
   tem `transform: none !important` — qualquer transform animado nunca vence
   isso (animação sempre perde de !important estático na mesma propriedade,
   `!important` dentro de @keyframes é instável entre browsers). Como
   `translate`/`rotate` são propriedades independentes que a regra base
   nunca toca, a animação não precisa brigar com nada. */
@keyframes qln-fox-mascot-bounce {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  25% { translate: 0 -3px; rotate: -8deg; }
  50% { translate: 0 0; rotate: 0deg; }
  75% { translate: 0 -1px; rotate: 8deg; }
}
#qln-fox.qln-fox-embedded.qln-fox-mascot {
  display: inline-flex !important;
  /* precisa de !important pra vencer o `animation: none !important` da regra
     base — sem isso a keyframe nunca chega a rodar (só o :active aparece,
     que é um transform de pseudo-classe comum, não a animação). */
  animation: qln-fox-mascot-bounce 1.4s ease-in-out infinite !important;
  transform-origin: 70% 90%;
}
/* `.qln-fox-embedded` força box-shadow:none!important com especificidade
   maior que `.qln-composer-btn-ring` sozinho — sem isso o contorno roxo
   nunca aparece na raposa (só nos outros botões da composer). */
#qln-fox.qln-fox-embedded.qln-composer-btn-ring {
  box-shadow: 0 0 0 1.5px var(--qln-purple) !important;
}

/* Botão flutuante "Aceitar Plano" — aparece acima da raposa só quando há plano */
#qln-accept-float {
  position: fixed;
  z-index: 2147483601;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid rgba(139, 92, 246, 0.5);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.96), rgba(109, 40, 217, 0.96));
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow: 0 8px 26px rgba(124, 58, 237, 0.45), 0 0 0 3px rgba(124, 58, 237, 0.18);
  color: #fff;
  font: 700 13px/1 "Inter", system-ui, sans-serif;
  cursor: pointer;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px) scale(0.96);
  transition: opacity 0.2s var(--qln-ease), transform 0.2s var(--qln-ease),
    box-shadow 0.2s var(--qln-ease);
  animation: qln-af-pulse 2.4s ease-in-out infinite;
}
#qln-accept-float.qln-af-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}
#qln-accept-float svg {
  width: 16px;
  height: 16px;
  display: block;
}
#qln-accept-float:hover {
  border-color: rgba(167, 139, 250, 0.8);
  box-shadow: 0 10px 32px rgba(139, 92, 246, 0.6), 0 0 0 4px rgba(139, 92, 246, 0.24);
  animation-play-state: paused;
}
#qln-accept-float:active {
  transform: translateY(0) scale(0.96);
}
#qln-accept-float.qln-af-busy {
  pointer-events: none;
  opacity: 0.8;
  animation: none;
}
/* Erro: flash vermelho rápido, depois volta ao normal. */
#qln-accept-float.qln-af-err {
  animation: none;
  border-color: rgba(239, 68, 68, 0.85);
  box-shadow: 0 10px 32px rgba(239, 68, 68, 0.5), 0 0 0 4px rgba(239, 68, 68, 0.22);
}
@keyframes qln-af-pulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(124, 58, 237, 0.4), 0 0 0 3px rgba(124, 58, 237, 0.16); }
  50% { box-shadow: 0 10px 30px rgba(139, 92, 246, 0.55), 0 0 0 5px rgba(139, 92, 246, 0.26); }
}

/* Aviso no dashboard: chat bloqueado até abrir/criar um projeto */
#qln-dash-gate {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2147483646;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 440px;
  padding: 11px 16px;
  border-radius: 14px;
  border: 1px solid var(--qln-border-strong);
  background: linear-gradient(180deg, rgba(22, 22, 31, 0.96), rgba(9, 9, 11, 0.97));
  backdrop-filter: blur(22px) saturate(180%);
  box-shadow: var(--qln-shadow);
  color: var(--qln-text);
  font: 600 13px/1.4 "Inter", system-ui, sans-serif;
  animation: qln-dash-in 0.25s var(--qln-ease);
}
@keyframes qln-dash-in {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
#qln-dash-gate .qln-dash-ic {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--qln-purple);
}
#qln-dash-gate .qln-dash-ic svg {
  width: 18px;
  height: 18px;
}
#qln-dash-gate .qln-dash-msg {
  color: var(--qln-text-2);
}

/* ===== Menu da raposa (abre para cima) ===== */
#qln-menu {
  position: fixed;
  /* Rede de segurança: positionMenu() (JS) sempre sobrescreve com a posição
     real ancorada na raposa. Isso aqui só evita cair no canto (0,0) do
     viewport se, por algum motivo, JS abrir o menu antes de posicionar. */
  right: 22px;
  bottom: 90px;
  width: 286px;
  max-height: 78vh;
  overflow-y: auto;
  border-radius: 18px;
  border: 1px solid var(--qln-border);
  background: linear-gradient(180deg, rgba(22, 22, 31, 0.92), rgba(9, 9, 11, 0.94));
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  box-shadow: var(--qln-shadow);
  z-index: 2147483601;
  padding: 8px;
  transform-origin: bottom right;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.18s var(--qln-ease), transform 0.2s var(--qln-ease);
}
#qln-menu.qln-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
/* Acompanha a raposa sem lag durante o arrasto (posição muda direto, sem
   transição). A transição é reativada ao soltar para o snap suave. */
#qln-menu.qln-no-anim {
  transition: none !important;
}
/* cabeçalho: bolinha de conexão + label ("Conectado"/"Aguardando conexão") */
.qln-menu-cap {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--qln-text-2);
}
.qln-lang-wrap {
  margin-left: auto;
}
/* ===== Seletor de idioma (mesma classe/lógica do i18n.js do sidepanel —
   delegação global de clique já existe lá, só precisa do markup aqui) ===== */
.ql-lang-wrap { position: relative; display: inline-flex; }
.ql-lang-btn {
  position: relative;
  font-size: 13px;
  line-height: 1;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--qln-text-2);
  padding: 2px;
}
.ql-lang-btn .ql-lang-flag-badge {
  position: absolute;
  bottom: -3px;
  right: -4px;
  font-size: 8px;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.6));
}
.ql-lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  min-width: 150px;
  padding: 6px;
  background: var(--qln-card);
  border: 1px solid var(--qln-border-strong);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.ql-lang-option {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 9px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.ql-lang-option:hover {
  background: rgba(139, 92, 246, 0.14);
}
.ql-lang-option-active {
  background: rgba(139, 92, 246, 0.2);
}
.ql-lang-opt-flag {
  font-size: 15px;
  line-height: 1;
}
html[dir="rtl"] .ql-lang-menu {
  right: auto;
  left: 0;
}
html[dir="rtl"] .ql-lang-option {
  text-align: right;
}
.qln-conn-label {
  line-height: 1;
}
/* quando abre para baixo, a origem da animação vira topo-direita */
#qln-menu.qln-flip-down {
  transform-origin: top right;
}
#qln-menu.qln-flip-down:not(.qln-open) {
  transform: translateY(-12px) scale(0.96);
}
#qln-menu::-webkit-scrollbar {
  width: 6px;
}
#qln-menu::-webkit-scrollbar-thumb {
  background: rgba(124, 58, 237, 0.4);
  border-radius: 6px;
}

.qln-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  background: transparent;
  color: var(--qln-text);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.16s var(--qln-ease), transform 0.12s var(--qln-ease);
}
.qln-menu-item:hover {
  background: rgba(139, 92, 246, 0.12);
}
.qln-menu-item:active {
  transform: scale(0.985);
}
.qln-menu-item svg.qln-ic {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--qln-hover);
  stroke-width: 2;
}
.qln-menu-item .qln-label {
  flex: 1;
}
.qln-menu-item .qln-chev {
  width: 15px;
  height: 15px;
  color: var(--qln-text-2);
}
.qln-menu-sep {
  height: 1px;
  background: var(--qln-border);
  margin: 6px 8px;
}
.qln-menu-title {
  font-size: 10px;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--qln-text-2);
  text-transform: uppercase;
  padding: 8px 12px 4px;
}

/* ===== iOS switch ===== */
.qln-switch {
  position: relative;
  width: 40px;
  height: 23px;
  flex: 0 0 40px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  transition: background 0.22s var(--qln-ease);
}
.qln-switch::after {
  content: "";
  position: absolute;
  top: 2.5px;
  left: 2.5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.22s var(--qln-ease);
}
.qln-menu-item.qln-on .qln-switch {
  background: linear-gradient(135deg, var(--qln-purple), var(--qln-hover));
}
.qln-menu-item.qln-on .qln-switch::after {
  transform: translateX(17px);
}

/* ===== Info card dentro do menu ===== */
.qln-info {
  margin: 6px 4px 2px;
  padding: 12px;
  border-radius: 14px;
  background: var(--qln-card);
  border: 1px solid var(--qln-border);
}
.qln-info-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.qln-info-avatar {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--qln-purple), var(--qln-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex: 0 0 26px;
}
.qln-info-avatar svg {
  width: 13px;
  height: 13px;
}
/* ícone minimalista (Linear/Vercel) — apenas ilustrativo, não compete */
.qln-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 14px;
  color: var(--qln-text-2);
  opacity: 0.6;
}
.qln-ico svg {
  width: 14px;
  height: 14px;
}
.qln-info-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--qln-text);
  line-height: 1.1;
}
.qln-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 7px;
  border-radius: 6px;
  margin-left: auto;
  color: #fff;
  background: linear-gradient(135deg, var(--qln-purple), var(--qln-hover));
}
.qln-badge.qln-badge-trial {
  background: linear-gradient(135deg, #d97706, #f59e0b);
}

/* Key + Projeto capturado */
.qln-field {
  margin-top: 8px;
}
.qln-field-label {
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--qln-text-2);
  font-weight: 700;
  margin-bottom: 4px;
}
.qln-key {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--qln-card-2);
  border: 1px solid var(--qln-border);
}
.qln-key svg.qln-key-ic {
  width: 14px;
  height: 14px;
  color: var(--qln-hover);
  flex: 0 0 14px;
}
.qln-key-text {
  flex: 1;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11.5px;
  color: var(--qln-text);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qln-copy-btn {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--qln-border);
  background: transparent;
  color: var(--qln-text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.16s var(--qln-ease);
  flex: 0 0 26px;
}
.qln-copy-btn:hover {
  color: var(--qln-text);
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(139, 92, 246, 0.12);
}
.qln-copy-btn svg {
  width: 13px;
  height: 13px;
}
.qln-captured {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--qln-card-2);
  border: 1px solid var(--qln-border);
}
.qln-captured-name {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: var(--qln-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qln-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 8px;
}
.qln-dot.qln-ok {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
}
.qln-dot.qln-off {
  background: #64748b;
}
.qln-dot.qln-warn {
  background: #fbbf24;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
}
.qln-dot.qln-orange {
  background: #fb923c;
  box-shadow: 0 0 8px rgba(251, 146, 60, 0.6);
}
.qln-dot.qln-exp {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}
.qln-conn {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--qln-text-2);
  padding: 6px 4px 0;
}
.qln-conn.qln-exp-warn {
  color: #fbbf24;
}
.qln-conn.qln-exp-orange {
  color: #fb923c;
}
.qln-conn.qln-exp-exp {
  color: #ef4444;
}

/* ===== Submenu idioma ===== */
.qln-sub {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.24s var(--qln-ease);
}
.qln-sub.qln-open {
  max-height: 220px;
}
.qln-sub .qln-menu-item {
  padding-left: 42px;
  font-size: 13px;
}
.qln-flag {
  font-size: 15px;
}

/* ===== Modal (Painel Cliente / Notificações) ===== */
.qln-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 8, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2147483640;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s var(--qln-ease);
}
.qln-overlay.qln-open {
  opacity: 1;
}
.qln-modal {
  width: 420px;
  max-width: calc(100vw - 32px);
  max-height: 86vh;
  overflow-y: auto;
  border-radius: 20px;
  border: 1px solid var(--qln-border);
  background: linear-gradient(180deg, rgba(22, 22, 31, 0.96), rgba(9, 9, 11, 0.98));
  box-shadow: var(--qln-shadow);
  transform: translateY(14px) scale(0.97);
  transition: transform 0.22s var(--qln-ease);
}
.qln-overlay.qln-open .qln-modal {
  transform: translateY(0) scale(1);
}
.qln-modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px 11px;
  border-bottom: 1px solid var(--qln-border);
  position: sticky;
  top: 0;
  background: rgba(13, 11, 22, 0.85);
  backdrop-filter: blur(10px);
}
.qln-modal-head svg {
  width: 18px;
  height: 18px;
  color: var(--qln-hover);
}
.qln-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--qln-text);
  flex: 1;
}
.qln-modal-close {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid var(--qln-border);
  background: transparent;
  color: var(--qln-text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.16s var(--qln-ease);
}
.qln-modal-close:hover {
  color: var(--qln-text);
  background: rgba(255, 255, 255, 0.06);
}
.qln-modal-close svg {
  width: 15px;
  height: 15px;
  color: inherit;
}
.qln-modal-body {
  padding: 14px 18px 16px;
}
.qln-modal-sm {
  width: 380px;
}

/* grid de campos do painel cliente */
.qln-rows {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.qln-row {
  padding: 8px 11px;
  border-radius: 11px;
  background: var(--qln-card);
  border: 1px solid var(--qln-border);
}
.qln-row.qln-full {
  grid-column: 1 / -1;
}
.qln-row-label {
  font-size: 9px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--qln-text-2);
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.qln-row-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--qln-text);
  word-break: break-word;
  display: flex;
  align-items: center;
  gap: 8px;
}
.qln-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}
.qln-pill.qln-pill-ok {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.qln-pill.qln-pill-warn {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.qln-pill.qln-pill-off {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.qln-pill.qln-pill-orange {
  color: #fb923c;
  background: rgba(251, 146, 60, 0.12);
  border: 1px solid rgba(251, 146, 60, 0.32);
}
.qln-pill.qln-pill-exp {
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.32);
}
.qln-mono {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Resetar Dispositivo */
.qln-reset-btn {
  margin-top: 12px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 11px;
  border: 1px solid var(--qln-border);
  background: transparent;
  color: var(--qln-text-2);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s var(--qln-ease);
}
.qln-reset-btn svg {
  width: 15px;
  height: 15px;
}
.qln-reset-btn:hover {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
}

/* Modal de confirmação */
.qln-confirm-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--qln-text-2);
  margin: 0 0 16px;
}
.qln-confirm-actions {
  display: flex;
  gap: 10px;
}
.qln-btn-ghost,
.qln-btn-danger {
  flex: 1;
  padding: 10px 14px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s var(--qln-ease);
}
.qln-btn-ghost {
  border: 1px solid var(--qln-border);
  background: transparent;
  color: var(--qln-text);
}
.qln-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}
.qln-btn-danger {
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
}
.qln-btn-danger:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.4);
}

/* Tooltip discreto nos botões copiar */
.qln-copy-btn[data-tip] {
  position: relative;
}
.qln-copy-btn[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  white-space: nowrap;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--qln-text);
  background: rgba(13, 11, 22, 0.96);
  border: 1px solid var(--qln-border);
  padding: 4px 8px;
  border-radius: 7px;
  opacity: 0;
  transform: translateY(3px);
  pointer-events: none;
  transition: opacity 0.15s var(--qln-ease), transform 0.15s var(--qln-ease);
}
.qln-copy-btn[data-tip]:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* notificações dentro do modal */
#qln-notif-host .ql-notif-panel,
#qln-notif-host #ql-notif-panel {
  position: static !important;
  display: block !important;
  width: 100% !important;
  box-shadow: none !important;
  border: 0 !important;
  background: transparent !important;
}
#qln-notif-host .ql-notif-header {
  display: none !important;
}

/* ===== Banner de notificação acima do chat nativo ===== */
#qln-notif-banner {
  position: fixed;
  z-index: 2147483000;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(165deg, var(--qln-card), var(--qln-card-2));
  border: 1px solid var(--qln-border-strong);
  box-shadow:
    0 0 0 1px rgba(124, 58, 237, 0.35),
    0 18px 46px -12px rgba(0, 0, 0, 0.65),
    0 0 24px rgba(124, 58, 237, 0.18);
  animation: qln-notif-banner-in 0.3s var(--qln-ease);
}
@keyframes qln-notif-banner-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.qln-notif-banner-ic {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(155deg, rgba(139, 92, 246, 0.22), rgba(124, 58, 237, 0.1));
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: var(--qln-hover);
}
.qln-notif-banner-ic svg {
  width: 16px;
  height: 16px;
}
.qln-notif-banner-body {
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 1px;
}
.qln-notif-banner-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--qln-text);
  margin-bottom: 3px;
}
.qln-notif-banner-msg {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--qln-text-2);
  word-break: break-word;
}
.qln-notif-banner-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--qln-hover);
  text-decoration: none;
  transition: gap 0.15s var(--qln-ease), color 0.15s var(--qln-ease);
}
.qln-notif-banner-link:hover {
  gap: 6px;
  color: #a78bfa;
  text-decoration: none;
}
.qln-notif-banner-close {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--qln-text-2);
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s var(--qln-ease), color 0.15s var(--qln-ease);
  margin: -2px -4px 0 0;
}
.qln-notif-banner-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--qln-text);
}
.qln-notif-banner-close svg {
  width: 14px;
  height: 14px;
}

/* ===== Contorno roxo estático na caixa de texto nativa + botões dela ===== */
.qln-composer-ring {
  position: relative !important;
  border-radius: 14px !important;
  box-shadow: 0 0 0 2px var(--qln-purple), 0 0 20px rgba(124, 58, 237, 0.28) !important;
}
.qln-composer-btn-ring {
  box-shadow: 0 0 0 1.5px var(--qln-purple) !important;
  border-radius: 8px !important;
}

/* ===== Faixa de aviso — extensão desativada (Desativar Extensão ligado) =====
   Fica DENTRO da coluna do chat (1º filho, ver updateDeactivatedBanner) —
   acima das mensagens, bem visível, sem cobrir o resto da página. */
#qln-deactivated-banner {
  position: sticky;
  top: 0;
  z-index: 2147483000;
  overflow: hidden;
  padding: 7px 0;
  background: linear-gradient(90deg, #7a1f1f, #a33a1a);
  border-bottom: 1px solid rgba(255, 200, 120, 0.4);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  flex-shrink: 0;
}
.qln-deactivated-track {
  display: flex;
  width: max-content;
  white-space: nowrap;
  animation: qln-deactivated-scroll 16s linear infinite;
  color: #ffe4b8;
  font: 700 12px/1.4 Inter, system-ui, -apple-system, sans-serif;
  letter-spacing: 0.2px;
}
.qln-deactivated-track span {
  padding-right: 60px;
}
@keyframes qln-deactivated-scroll {
  from { translate: 0 0; }
  to { translate: -50% 0; }
}

/* ===== Tour de primeiro uso — spotlight + tooltip ===== */
#qln-tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  background: transparent;
}
#qln-tour-spotlight {
  position: fixed;
  z-index: 2147483647;
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(8, 6, 14, 0.88);
  border: 2px solid var(--qln-purple);
  pointer-events: none;
  transition: left 0.25s ease, top 0.25s ease, width 0.25s ease, height 0.25s ease;
}
#qln-tour-tooltip {
  position: fixed;
  z-index: 2147483647;
  width: 280px;
  max-width: calc(100vw - 24px);
  background: linear-gradient(165deg, var(--qln-card), var(--qln-card-2));
  border: 1px solid var(--qln-border-strong);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 18px 46px -12px rgba(0, 0, 0, 0.65), 0 0 24px rgba(124, 58, 237, 0.22);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  transition: left 0.25s ease, top 0.25s ease, bottom 0.25s ease;
}
.qln-tour-step {
  font-size: 10px;
  font-weight: 700;
  color: var(--qln-purple);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.qln-tour-title {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}
.qln-tour-text {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--qln-text-2);
  margin-bottom: 12px;
}
.qln-tour-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.qln-tour-skip {
  background: transparent;
  border: none;
  color: var(--qln-text-2);
  font-size: 12px;
  cursor: pointer;
  padding: 6px 4px;
}
.qln-tour-next {
  background: linear-gradient(135deg, var(--qln-purple), var(--qln-hover));
  border: none;
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
}

/* ===== Anexo premium (chat nativo) ===== */
#ql-native-attach-bar.qln-attach {
  display: block !important;
  padding: 12px !important;
  margin: 8px 0 !important;
  border-radius: 14px !important;
  border: 1px dashed rgba(124, 58, 237, 0.45) !important;
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.08), rgba(124, 58, 237, 0.03)) !important;
  box-shadow: inset 0 0 18px rgba(124, 58, 237, 0.05);
}
.qln-attach-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: #c4b5fd;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}
.qln-attach-head svg {
  width: 15px;
  height: 15px;
}
.qln-attach-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.qln-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 11px;
  background: var(--qln-card);
  border: 1px solid var(--qln-border);
  max-width: 220px;
  position: relative;
  overflow: hidden;
}
.qln-chip-thumb {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 34px;
  border: 1px solid var(--qln-border);
  background: #0d0d14;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--qln-hover);
}
.qln-chip-thumb svg {
  width: 16px;
  height: 16px;
}
.qln-chip-meta {
  min-width: 0;
  flex: 1;
}
.qln-chip-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--qln-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qln-chip-sub {
  font-size: 10.5px;
  color: var(--qln-text-2);
  margin-top: 1px;
}
.qln-chip-rm {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #fca5a5;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  flex: 0 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s var(--qln-ease);
}
.qln-chip-rm:hover {
  background: rgba(248, 113, 113, 0.2);
}
.qln-chip-prog {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, var(--qln-purple), var(--qln-hover));
  animation: qln-prog 1.1s ease-in-out infinite;
  transform-origin: left;
}
@keyframes qln-prog {
  0% {
    transform: scaleX(0.1);
    opacity: 0.6;
  }
  50% {
    transform: scaleX(0.8);
    opacity: 1;
  }
  100% {
    transform: scaleX(0.1);
    opacity: 0.6;
  }
}

/* toast simples (caso usado) */
.qln-toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--qln-card);
  border: 1px solid var(--qln-border);
  color: var(--qln-text);
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  z-index: 2147483646;
  box-shadow: var(--qln-shadow);
  opacity: 0;
  transition: all 0.22s var(--qln-ease);
  pointer-events: none;
}
.qln-toast.qln-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
