/* ============================================
   Lovable3s — Floating Popup — Cyberpunk Neo-UI
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

#ql-floating, #ql-floating * {
  box-sizing: border-box;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

#ql-floating {
  --ql-bg: #14121f;
  --ql-bg-2: #0e0c17;
  --ql-surface: rgba(139,92,246,0.05);
  --ql-surface-2: rgba(139,92,246,0.09);
  --ql-border: rgba(255,255,255,0.07);
  --ql-border-2: rgba(139,92,246,0.18);
  --ql-text: #ede9fe;
  --ql-text-muted: rgba(237,233,254,0.50);
  --ql-text-dim: rgba(237,233,254,0.28);
  --ql-accent: #8b5cf6;
  --ql-accent-2: #7c3aed;
  --ql-success: #10b981;
  --ql-warn: #f59e0b;
  --ql-radius: 14px;

  position: fixed;
  z-index: 2147483647;
  width: clamp(280px, 30vw, 480px);
  container-type: inline-size;
  max-height: 86vh;
  background: var(--ql-bg);
  color: var(--ql-text);
  border: 1px solid var(--ql-border-2);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  animation: ql-pop 0.22s cubic-bezier(0.18,0.89,0.32,1.28);
}
@keyframes ql-pop { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }

#ql-floating.ql-minimized {
  width: auto !important; height: auto !important;
  min-width: 280px; min-height: 0;
  border-radius: 12px;
  overflow: hidden;
  cursor: default;
}
#ql-floating.ql-minimized > *:not(#ql-header) { display: none !important; }
#ql-floating.ql-minimized #ql-header {
  border-bottom: 0; padding: 8px 12px; background: rgba(255,255,255,0.02);
  display: flex; align-items: center; justify-content: space-between;
  cursor: grab; border-radius: 12px;
}
#ql-floating.ql-minimized .ql-header-left,
#ql-floating.ql-minimized .ql-header-center,
#ql-floating.ql-minimized .ql-header-right { display: flex; }

/* ===== HEADER ===== */
#ql-header {
  position: relative;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(139,92,246,0.10), rgba(255,255,255,0.01));
  border-bottom: 2px solid var(--ql-border-2);
  cursor: grab;
  user-select: none;
}
#ql-header:active { cursor: grabbing; }
.ql-header-left { display: flex; align-items: center; gap: 4px; justify-self: start; }
.ql-header-right { display: flex; align-items: center; gap: 4px; justify-self: end; }
.ql-header-center {
  display: flex; align-items: center; gap: 6px; justify-self: center;
  padding: 3px 12px; border-radius: 99px;
  background: rgba(139,92,246,0.08); border: 1px solid rgba(139,92,246,0.18);
}
.ql-brand { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; color: var(--ql-text); }
.ql-title { font-size: 12px; font-weight: 800; }
.ql-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--ql-accent); box-shadow: 0 0 8px var(--ql-accent); }
.ql-badge {
  font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 800;
  padding: 2px 6px; border-radius: 4px; letter-spacing: 0.1em;
  color: var(--ql-text-muted); background: rgba(255,255,255,0.05); border: 1px solid var(--ql-border);
}
.ql-badge-pro-header {
  font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 800;
  padding: 2px 6px; border-radius: 4px; letter-spacing: 0.1em;
  color: var(--ql-accent); background: rgba(139,92,246,0.10); border: 1px solid rgba(139,92,246,0.25);
}
.ql-icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border: 0; background: transparent;
  color: var(--ql-text-dim); border-radius: 7px; cursor: pointer;
  transition: all 0.18s ease;
}
.ql-icon-btn:hover { color: var(--ql-text); background: var(--ql-surface); }

/* ===== Seletor de idioma (i18n) — popup flutuante ===== */
.ql-lang-wrap { position: relative; display: inline-flex; }
.ql-lang-btn { position: relative; }
.ql-lang-btn svg { display: block; pointer-events: none; }
.ql-lang-btn .ql-lang-flag-badge {
  position: absolute; bottom: -1px; right: -2px;
  font-size: 9px; 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: 2147483647;
  min-width: 160px; padding: 6px;
  background: var(--ql-bg); border: 1px solid var(--ql-border-2);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.45);
}
.ql-lang-option {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; background: transparent; border: 0; border-radius: 8px;
  color: var(--ql-text); font-size: 12px; font-weight: 600; text-align: left; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.ql-lang-option:hover { background: rgba(139,92,246,0.14); }
.ql-lang-option-active { background: rgba(139,92,246,0.20); color: #fff; }
.ql-lang-opt-flag { font-size: 16px; line-height: 1; }
/* RTL dentro do popup (arabe) — escopo limitado ao #ql-floating */
#ql-floating[dir="rtl"] .ql-lang-menu { right: auto; left: 0; }
#ql-floating[dir="rtl"] .ql-lang-option { text-align: right; }
.ql-minimize-btn { background: transparent; border: 0; color: var(--ql-text-dim); cursor: pointer; font-size: 14px; padding: 4px 8px; }
.ql-minimize-btn:hover { color: var(--ql-text); }
.ql-notif-badge {
  position: absolute; top: 0; right: 0;
  background: var(--ql-accent); color: #fff; font-size: 8px; font-weight: 800;
  min-width: 14px; height: 14px; border-radius: 99px; display: inline-flex;
  align-items: center; justify-content: center; padding: 0 3px;
  box-shadow: 0 0 6px rgba(139,92,246,0.6);
}

/* ===== BODY ===== */
#ql-body {
  position: relative;
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
}
#ql-body::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle at 2px 2px, rgba(255,255,255,0.03) 1px, transparent 0);
  background-size: 18px 18px; z-index: 0;
}
#ql-body > * { position: relative; z-index: 1; }

/* ===== LICENSE GATE — Premium redesign (Raycast/Linear/Vercel vibe) ===== */
.ql-license-gate { padding: 20px 16px 6px; text-align: center; }

/* Mascote raposa no header (esquerda) */
.ql-gate-fox-sm { display: inline-flex; align-items: center; }
.ql-gate-fox-sm svg { display: block; }

/* Botoes de janela (minimizar / fechar) no header */
.ql-hdr-wc-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border: 0; border-radius: 7px;
  background: rgba(255,255,255,0.04); color: var(--ql-text-muted);
  cursor: pointer; transition: all 0.16s ease;
}
.ql-hdr-wc-btn:hover { background: var(--ql-surface-2); color: var(--ql-text); }
.ql-hdr-wc-btn svg { display: block; pointer-events: none; }
.ql-hdr-close:hover { background: rgba(239,68,68,0.18); color: #fca5a5; }

/* Hero: raposa centralizada com glow roxo */
.ql-gate-hero {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 100px; height: 100px; margin: 6px auto 16px;
}
.ql-gate-glow {
  position: absolute; inset: 4px; border-radius: 50%;
  background: radial-gradient(circle, rgba(139,92,246,0.50), rgba(139,92,246,0) 68%);
  filter: blur(10px); pointer-events: none;
  animation: ql-gate-glow-pulse 3.4s ease-in-out infinite;
}
@keyframes ql-gate-glow-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.9); }
  50% { opacity: 0.95; transform: scale(1.06); }
}
.ql-gate-hero .ql-lock-icon { position: relative; z-index: 1; margin: 0; min-height: 0; }
.ql-gate-fox-svg { width: 76px; height: 76px; display: block; filter: drop-shadow(0 6px 18px rgba(124,58,237,0.55)); }
.ql-gate-hero .ql-lock-icon img { width: 76px; height: 76px; object-fit: contain; display: block; filter: drop-shadow(0 6px 18px rgba(124,58,237,0.45)); }
.ql-gate-hero .ql-lock-default { font-size: 56px; line-height: 1; }

/* Compat: gate antigo sem hero */
.ql-lock-icon { margin-bottom: 10px; display: flex; align-items: center; justify-content: center; min-height: 36px; }
.ql-lock-icon .ql-lock-default { font-size: 36px; line-height: 1; }
.ql-lock-icon img { display: block; }

.ql-gate-title { font-size: 17px; font-weight: 800; margin: 0 0 5px; letter-spacing: -0.01em; }
.ql-gate-desc { font-size: 11.5px; color: var(--ql-text-muted); margin: 0 0 16px; line-height: 1.5; }

.ql-field { margin-bottom: 10px; }
.ql-field input {
  width: 100%; padding: 12px 12px; border-radius: 11px;
  background: rgba(0,0,0,0.4); border: 1px solid var(--ql-border-2); color: var(--ql-text);
  font-family: 'JetBrains Mono', monospace; font-size: 12px; outline: none;
  transition: all 0.18s ease;
}
.ql-field input:focus { border-color: rgba(139,92,246,0.5); box-shadow: 0 0 0 3px rgba(139,92,246,0.12); }
.ql-field input::placeholder { color: var(--ql-text-dim); }

/* Campo com icone de chave (esquerda) e botao colar (direita) */
.ql-field-icon { position: relative; display: flex; align-items: center; }
.ql-field-icon input { padding-left: 36px; padding-right: 42px; }
.ql-field-key-ic {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  display: inline-flex; color: var(--ql-text-dim); pointer-events: none;
  transition: color 0.18s ease;
}
.ql-field-icon:focus-within .ql-field-key-ic { color: var(--ql-accent); }
.ql-paste-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border: 0; border-radius: 8px;
  background: rgba(139,92,246,0.10); color: var(--ql-text-muted);
  cursor: pointer; transition: all 0.16s ease;
}
.ql-paste-btn:hover { background: rgba(139,92,246,0.22); color: var(--ql-text); }
.ql-paste-btn:active { transform: translateY(-50%) scale(0.9); }
.ql-paste-btn svg { display: block; pointer-events: none; }
.ql-paste-btn.ql-pasted { color: var(--ql-success); background: rgba(16,185,129,0.16); }

#ql-validate-btn {
  position: relative; width: 100%; padding: 12px 14px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: #fff; font-weight: 800; font-size: 12px;
  letter-spacing: 0.06em; text-transform: uppercase;
  border-radius: 11px; box-shadow: 0 10px 26px -10px rgba(124,58,237,0.8);
  transition: all 0.18s ease;
}
#ql-validate-btn:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 14px 32px -10px rgba(124,58,237,0.9); }
#ql-validate-btn:active { transform: translateY(0); }
#ql-validate-btn.ql-loading { pointer-events: none; color: transparent; }
#ql-validate-btn.ql-loading::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff;
  border-radius: 50%; animation: ql-spin 0.6s linear infinite;
}
@keyframes ql-spin { to { transform: rotate(360deg); } }

/* Selo "conexao segura" em verde */
.ql-gate-secure {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 12px; font-size: 10.5px; font-weight: 600; color: var(--ql-success);
}
.ql-secure-ic { display: inline-flex; }
.ql-gate-secure svg { display: block; }

#ql-license-log { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--ql-text-muted); margin-top: 8px; min-height: 12px; }

/* Suporte no gate: texto + botao WhatsApp premium */
.ql-gate-support {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  margin-top: 16px;
}
.ql-gate-support-text {
  margin: 0; text-align: center; font-size: 11.5px; font-weight: 500;
  color: var(--ql-text-muted); line-height: 1.4;
}
.ql-gate-support-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; width: 100%; padding: 11px 16px; cursor: pointer;
  border: 1px solid rgba(139,92,246,0.45); border-radius: 11px;
  background: linear-gradient(135deg, rgba(139,92,246,0.16), rgba(124,58,237,0.10));
  color: var(--ql-text); font-weight: 700; font-size: 12px; letter-spacing: 0.01em;
  box-shadow: 0 0 0 0 rgba(124,58,237,0);
  transition: transform 0.18s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}
.ql-gate-support-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(139,92,246,0.85);
  background: linear-gradient(135deg, rgba(139,92,246,0.28), rgba(124,58,237,0.18));
  box-shadow: 0 10px 28px -12px rgba(124,58,237,0.85), 0 0 18px -2px rgba(139,92,246,0.5);
}
.ql-gate-support-btn:active { transform: translateY(0); }
.ql-gate-support-ic { display: inline-flex; align-items: center; color: #25d366; }
.ql-gate-support-ic svg { display: block; pointer-events: none; }

/* Rodape do gate com seletor de idioma (canto inferior esquerdo) */
.ql-gate-footer {
  display: flex; align-items: center; padding: 8px 12px;
  border-top: 1px solid var(--ql-border); background: rgba(255,255,255,0.015);
}
.ql-gate-footer .ql-lang-wrap { margin-right: auto; }

/* ===== PLANS (license gate) ===== */
.ql-gate-divider { display: flex; align-items: center; margin: 14px 0 10px; color: var(--ql-text-dim); font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; font-family: 'JetBrains Mono', monospace; }
.ql-gate-divider::before, .ql-gate-divider::after { content: ''; flex: 1; height: 1px; background: var(--ql-border); margin: 0 8px; }
.ql-plans-section { width: 100%; }
.ql-plan-buy:hover { filter: brightness(1.1); }

/* ===== PROFILE / SYNC CARD ===== */
/* ===== PROFILE CARD (premium / cyber) ===== */
.ql-profile-card {
  /* #ql-body é flex-column: sem isto o card encolhe verticalmente (fica "achatado") */
  flex: 0 0 auto;
  position: relative; overflow: hidden;
  padding: 14px; border-radius: 16px;
  background: linear-gradient(160deg, rgba(139,92,246,0.10), rgba(20,18,31,0.45));
  border: 1px solid rgba(139,92,246,0.30);
  box-shadow: 0 0 0 1px rgba(139,92,246,0.05), 0 10px 30px -14px rgba(139,92,246,0.6);
}
.ql-profile-glow {
  position: absolute; top: -40%; right: -10%;
  width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(139,92,246,0.22), transparent 70%);
  pointer-events: none; filter: blur(6px);
}
/* flex-wrap: em telas largas fica em linha; em estreitas o badge desce p/ a 2ª linha sem espremer nome/sync */
.ql-profile-top { position: relative; z-index: 1; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; row-gap: 8px; }
.ql-avatar {
  flex: 0 0 auto;
  width: 44px; height: 44px; border-radius: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #c4b5fd;
  background: linear-gradient(135deg, rgba(139,92,246,0.26), rgba(124,58,237,0.10));
  border: 1px solid rgba(139,92,246,0.45);
  box-shadow: 0 0 22px -4px rgba(139,92,246,0.7), inset 0 0 14px -8px rgba(196,181,253,0.8);
}
.ql-avatar svg { width: 22px; height: 22px; }
.ql-profile-info { display: flex; flex-direction: column; gap: 4px; flex: 1 1 130px; min-width: 0; }
.ql-profile-name {
  font-size: 15px; font-weight: 800; letter-spacing: 0.02em; color: var(--ql-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ql-profile-badge { flex: 0 0 auto; align-self: flex-start; }
.ql-status-badge, .ql-badge-pro, .ql-badge-test {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: 'Poppins', sans-serif; font-size: 11px; font-weight: 800;
  padding: 5px 10px; border-radius: 9px; letter-spacing: 0.08em;
}
.ql-badge-crown { width: 12px; height: 12px; flex: 0 0 auto; }
.ql-badge-pro {
  color: #c4b5fd;
  background: linear-gradient(135deg, rgba(139,92,246,0.20), rgba(124,58,237,0.08));
  border: 1px solid rgba(139,92,246,0.50);
  box-shadow: 0 0 16px -4px rgba(139,92,246,0.65), inset 0 0 0 1px rgba(255,255,255,0.03);
}
.ql-badge-test {
  color: var(--ql-warn);
  background: rgba(245,158,11,0.10); border: 1px solid rgba(245,158,11,0.30);
}
.ql-sync-status {
  display: flex; align-items: center; gap: 6px; margin-top: 0;
  font-family: 'Poppins', sans-serif; font-size: 11px; color: var(--ql-text-muted);
  min-width: 0;
}
.ql-sync-text {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: inline-flex; align-items: center;
}
.ql-sync-text::before {
  content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 99px;
  background: var(--ql-warn); margin-right: 7px; flex: 0 0 auto;
  box-shadow: 0 0 8px currentColor;
}
.ql-sync-ok, .ql-sync-ok .ql-sync-text { color: var(--ql-success); }
.ql-sync-ok .ql-sync-text::before { background: var(--ql-success); animation: ql-pulse 1.6s ease-in-out infinite; }
.ql-sync-waiting .ql-sync-text::before { animation: ql-pulse 1.6s ease-in-out infinite; }
.ql-license-key {
  display: flex; align-items: center; gap: 5px; margin-top: 3px; min-width: 0;
  font-family: 'Poppins', sans-serif; font-size: 10.5px; color: var(--ql-text-muted);
}
.ql-license-icon { flex: 0 0 auto; opacity: 0.8; }
.ql-license-key-text {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: 0.3px; font-variant-numeric: tabular-nums;
}
.ql-license-copy {
  flex: 0 0 auto; margin-left: auto; padding: 1px 5px; cursor: pointer;
  background: rgba(124,90,255,0.08); border: 1px solid rgba(124,90,255,0.25);
  border-radius: 6px; color: var(--ql-accent,#7c5aff); font-size: 11px; line-height: 1.4;
  transition: background 0.18s, border-color 0.18s;
}
.ql-license-copy:hover { background: rgba(124,90,255,0.18); border-color: rgba(124,90,255,0.45); }
@keyframes ql-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.ql-profile-divider {
  position: relative; z-index: 1;
  height: 1px; margin: 13px 0 11px;
  background: linear-gradient(90deg, transparent, rgba(139,92,246,0.40), transparent);
}

/* ===== TABS ===== */
.ql-tabs { display: flex; gap: 4px; padding: 4px; background: rgba(0,0,0,0.3); border-radius: 10px; border: 1px solid var(--ql-border); }
.ql-tab {
  flex: 1; padding: 8px 10px; border: 0; cursor: pointer; background: transparent;
  color: var(--ql-text-dim); font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 0.18s ease;
}
.ql-tab:hover { color: var(--ql-text); }
.ql-tab-active { color: #fff; background: rgba(139,92,246,0.14); box-shadow: inset 0 0 0 1px rgba(139,92,246,0.3); }
.ql-tab-badge {
  background: var(--ql-accent); color: #fff; font-size: 9px; font-weight: 800;
  min-width: 16px; height: 16px; padding: 0 5px; border-radius: 99px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ===== COMPOSE CARD ===== */
.ql-compose {
  display: flex; flex-direction: column; gap: 8px; padding: 8px;
  background: var(--ql-surface); border: 1px solid var(--ql-border-2);
  border-radius: var(--ql-radius);
  box-shadow: 0 8px 24px -16px rgba(139,92,246,0.5);
}
.ql-compose-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-width: 0;
}
.ql-compose-field { position: relative; }

/* ===== TEXTAREA ===== */
#ql-msg {
  width: 100%; min-height: 120px; padding: 12px 14px;
  background: rgba(0,0,0,0.4); border: 1px solid var(--ql-border-2); border-radius: var(--ql-radius);
  color: var(--ql-text); font-family: inherit; font-size: 13px; resize: vertical; outline: none;
  transition: all 0.18s ease; box-sizing: border-box;
}
#ql-msg::placeholder { color: var(--ql-text-dim); }
#ql-msg:focus { border-color: rgba(139,92,246,0.5); box-shadow: 0 0 0 3px rgba(139,92,246,0.12); background: rgba(0,0,0,0.55); }

.ql-action-left { display: inline-flex; align-items: center; gap: 8px; flex: 0 1 auto; min-width: 0; }
.ql-action-left .ql-toggle-label-inline { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ql-toggle { position: relative; width: 30px; height: 16px; display: inline-block; cursor: pointer; }
.ql-toggle input { display: none; }
.ql-toggle-slider {
  position: absolute; inset: 0; background: rgba(255,255,255,0.10); border-radius: 99px;
  transition: background 0.2s ease;
}
.ql-toggle-slider::before {
  content: ''; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px;
  background: rgba(255,255,255,0.6); border-radius: 99px; transition: all 0.22s ease;
}
.ql-toggle input:checked + .ql-toggle-slider { background: rgba(139,92,246,0.5); }
.ql-toggle input:checked + .ql-toggle-slider::before { left: 16px; background: #fff; }
.ql-toggle-label-inline { font-size: 10px; font-weight: 700; color: var(--ql-text-muted); text-transform: uppercase; letter-spacing: 0.08em; }

.ql-tool-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; border: 0; cursor: pointer;
  background: transparent; color: var(--ql-text-muted);
  transition: all 0.18s ease;
}
.ql-tool-btn:hover { color: var(--ql-accent); background: rgba(139,92,246,0.08); }
/* Attach button — inline, agrupado com o toggle Plano abaixo da textarea */
.ql-attach-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--ql-border);
  cursor: pointer; background: var(--ql-surface); color: var(--ql-accent);
  transition: all 0.18s ease;
}
.ql-attach-btn:hover { color: #fff; background: var(--ql-accent); border-color: var(--ql-accent); transform: translateY(-1px); }
.ql-tool-loading { animation: ql-spin 1s linear infinite; }
@keyframes ql-spin { to { transform: rotate(360deg); } }
.ql-recording { color: var(--ql-accent) !important; animation: ql-pulse 1s ease-in-out infinite; }

.ql-send-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border: 0; cursor: pointer; white-space: nowrap;
  background: linear-gradient(135deg, var(--ql-accent), var(--ql-accent-2)); color: #fff;
  font-weight: 800; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.06em; border-radius: 99px;
  box-shadow: 0 6px 18px -6px rgba(139,92,246,0.6);
  transition: all 0.18s ease;
}
.ql-send-btn svg { width: 14px; height: 14px; }
.ql-send-btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.ql-send-btn:active { transform: scale(0.96); }
.ql-sending { opacity: 0.6; pointer-events: none; }

/* ===== LOG ===== */
#ql-log { font-family: 'JetBrains Mono', monospace; font-size: 10px; padding: 0 4px; }
.ql-log-info { color: var(--ql-text-muted); }
.ql-log-success { color: var(--ql-success); }
.ql-log-error { color: var(--ql-accent); }

/* ===== SECONDARY ACTION BUTTONS ===== */
.ql-watermark-btn, .ql-shield-btn, .ql-native-chat-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 11px 14px; border-radius: 11px; cursor: pointer;
  background: var(--ql-surface); border: 1px solid var(--ql-border);
  color: var(--ql-text-muted); font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  transition: all 0.18s ease;
  margin-top: 14px !important;
}
.ql-watermark-btn:hover, .ql-shield-btn:hover, .ql-native-chat-btn:hover {
  color: var(--ql-text); background: var(--ql-surface-2); border-color: rgba(139,92,246,0.25);
  transform: translateY(-1px);
}
.ql-shield-active { color: var(--ql-success) !important; border-color: rgba(16,185,129,0.35) !important; background: rgba(16,185,129,0.08) !important; }
.ql-native-send-active { color: var(--ql-accent) !important; border-color: rgba(139,92,246,0.35) !important; }

/* ===== NATIVE CHAT BADGE & CONTROLS ===== */
.ql-native-badge {
  position: absolute; top: 8px; right: 12px; z-index: 50;
  display: flex; align-items: center; gap: 10px;
  padding: 4px 12px; font-size: 11px; font-weight: 600;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff; border-radius: 99px;
  font-family: system-ui, -apple-system, sans-serif;
  box-shadow: 0 2px 10px rgba(139,92,246,0.4);
  pointer-events: auto;
}
.ql-native-badge-label {
  font-weight: 700; letter-spacing: 0.02em;
}
.ql-native-badge-divider {
  width: 1px; height: 14px;
  background: rgba(255,255,255,0.3);
}
.ql-native-plano-toggle {
  display: flex; align-items: center; gap: 5px;
  cursor: pointer; user-select: none;
  font-size: 10px; color: rgba(255,255,255,0.9);
}
.ql-native-plano-toggle input[type="checkbox"] {
  width: 12px; height: 12px;
  accent-color: #22c55e; cursor: pointer;
  margin: 0;
}
.ql-native-approve-btn {
  display: none;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white; border: none; border-radius: 6px;
  padding: 3px 8px; font-size: 10px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 1px 4px rgba(34, 197, 94, 0.3);
  white-space: nowrap;
}
.ql-native-approve-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.4);
}
.ql-native-approve-btn:disabled {
  opacity: 0.7; cursor: wait;
}
.ql-native-approve-btn.error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}
.ql-native-approve-btn.success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.ql-native-return-btn {
  display: inline-flex; align-items: center; justify-content: center;
  margin: 12px auto 0; padding: 8px 18px;
  background: rgba(139,92,246,0.12);
  border: 1px solid rgba(139,92,246,0.4);
  color: #c4b5fd; border-radius: 99px;
  font-size: 12px; font-weight: 700; cursor: pointer;
  font-family: inherit; letter-spacing: 0.02em;
  transition: all 0.18s ease;
  position: relative; left: 50%; transform: translateX(-50%);
}
.ql-native-return-btn:hover { background: rgba(139,92,246,0.22); color: #fff; }

/* ===== SHORTCUTS ===== */
.ql-shortcuts-section { padding: 4px 0; }
.ql-shortcuts-title {
  display: block; font-family: 'JetBrains Mono', monospace; font-size: 9px;
  letter-spacing: 0.2em; color: var(--ql-text-dim); margin: 4px 2px 8px;
}
.ql-shortcuts-grid {
  display: flex; flex-wrap: nowrap; gap: 6px;
  overflow-x: auto; overflow-y: hidden; padding-bottom: 4px;
  scrollbar-width: thin;
}
.ql-shortcuts-grid::-webkit-scrollbar { height: 4px; }
.ql-chip {
  display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: 5px;
  flex: 0 0 auto; white-space: nowrap;
  padding: 7px 12px; border-radius: 99px; cursor: pointer;
  background: var(--ql-surface); border: 1px solid var(--ql-border);
  color: var(--ql-text-muted); font-size: 10px; font-weight: 600;
  transition: all 0.18s ease;
}
.ql-chip:hover { color: var(--ql-text); background: var(--ql-surface-2); border-color: rgba(139,92,246,0.3); transform: translateY(-1px); }

/* ===== AUTO-APPROVE CARD ===== */
.ql-auto-approve-card {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px; overflow: hidden;
  background: linear-gradient(135deg, rgba(139,92,246,0.06), rgba(16,185,129,0.04));
  border: 1px solid var(--ql-border-2);
}
.ql-aa-glow { position: absolute; inset: -50%; background: radial-gradient(circle, rgba(139,92,246,0.15), transparent 60%); pointer-events: none; opacity: 0; transition: opacity 0.3s; }
.ql-aa-on .ql-aa-glow { opacity: 1; }
.ql-aa-icon-wrap {
  width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(139,92,246,0.12); color: var(--ql-accent); flex-shrink: 0;
}
.ql-aa-on .ql-aa-icon-wrap { background: rgba(16,185,129,0.15); color: var(--ql-success); }
.ql-aa-content { flex: 1; min-width: 0; }
.ql-aa-title-row { display: flex; align-items: center; gap: 6px; }
.ql-aa-title { font-size: 12px; font-weight: 800; }
.ql-aa-desc { display: block; font-size: 10px; color: var(--ql-text-muted); margin-top: 2px; }
.ql-aa-pill, .ql-aa-pill-mini {
  font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 800;
  padding: 2px 6px; border-radius: 4px; background: rgba(255,255,255,0.06); color: var(--ql-text-muted);
}
.ql-aa-pill-mini-on, .ql-aa-on .ql-aa-pill { background: rgba(16,185,129,0.18); color: var(--ql-success); }
.ql-aa-switch { position: relative; width: 36px; height: 20px; cursor: pointer; flex-shrink: 0; }
.ql-aa-switch input { display: none; }
.ql-aa-track { position: absolute; inset: 0; background: rgba(255,255,255,0.10); border-radius: 99px; transition: background 0.2s; }
.ql-aa-thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 99px; background: #fff; transition: all 0.22s; }
.ql-aa-switch input:checked + .ql-aa-track { background: var(--ql-success); }
.ql-aa-switch input:checked + .ql-aa-track .ql-aa-thumb { left: 18px; }

/* ===== ATTACHMENTS ===== */
.ql-attach-preview, .ql-attach-bar { display: flex; flex-direction: column; gap: 6px; padding: 8px; background: var(--ql-surface); border: 1px solid var(--ql-border); border-radius: 10px; }
.ql-attach-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; background: rgba(0,0,0,0.3); }
.ql-attach-thumb { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; }
.ql-attach-icon { width: 30px; height: 30px; border-radius: 6px; background: rgba(139,92,246,0.1); display: inline-flex; align-items: center; justify-content: center; }
.ql-attach-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ql-attach-name { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ql-attach-size { font-size: 9px; color: var(--ql-text-muted); font-family: 'JetBrains Mono', monospace; }
.ql-attach-count { font-size: 10px; color: var(--ql-text-muted); }
.ql-attach-remove { width: 22px; height: 22px; border: 0; background: transparent; color: var(--ql-text-dim); cursor: pointer; border-radius: 6px; }
.ql-attach-remove:hover { color: var(--ql-accent); background: rgba(139,92,246,0.08); }
.ql-attach-uploading { opacity: 0.5; }

/* ===== DRAG OVERLAY ===== */
.ql-drag-overlay { position: absolute; inset: 0; background: rgba(12,12,14,0.85); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 100; pointer-events: none; }
.ql-drag-overlay-inner { padding: 30px 40px; border: 2px dashed var(--ql-accent); border-radius: 16px; color: var(--ql-text); font-weight: 700; }

/* ===== NOTIFICATIONS PANEL ===== */
.ql-notif-panel {
  position: absolute; top: 50px; right: 8px; left: 8px; z-index: 60;
  background: rgba(12,12,14,0.97); backdrop-filter: blur(16px);
  border: 1px solid var(--ql-border-2); border-radius: 14px; overflow: hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,0.5);
  animation: ql-fade 0.2s ease;
}
@keyframes ql-fade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ql-notif-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--ql-border); font-weight: 700; font-size: 12px; }
.ql-notif-close-btn { background: transparent; border: 0; color: var(--ql-text-muted); cursor: pointer; font-size: 14px; }
.ql-notif-list { max-height: 350px; overflow-y: auto; padding: 8px; }
.ql-notif-item { padding: 10px 12px; border-radius: 10px; background: var(--ql-surface); margin-bottom: 6px; }
.ql-notif-item-title { font-size: 12px; font-weight: 700; }
.ql-notif-item-msg { font-size: 11px; color: var(--ql-text-muted); margin-top: 2px; }
.ql-notif-item-date { font-size: 9px; color: var(--ql-text-dim); margin-top: 4px; font-family: 'JetBrains Mono', monospace; }
.ql-notif-link { display: inline-block; font-size: 10px; color: var(--ql-accent); margin-top: 4px; text-decoration: none; }
.ql-notif-empty { text-align: center; color: var(--ql-text-muted); font-size: 11px; padding: 20px; }

/* ===== TRIAL COUNTDOWN ===== */
.ql-trial-countdown { margin-top: 8px; }
.ql-countdown-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 10px; color: var(--ql-text-muted); font-family: 'JetBrains Mono', monospace; }
.ql-countdown-icon { font-size: 12px; }
.ql-countdown-label { flex: 1; }
.ql-countdown-time { color: var(--ql-text); font-weight: 700; }
.ql-countdown-expired { color: var(--ql-accent); }
.ql-trial-bar { height: 4px; background: rgba(255,255,255,0.08); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.ql-trial-bar-fill { height: 100%; background: linear-gradient(90deg, var(--ql-success), #34d399); transition: width 0.4s ease; }
.ql-bar-urgent { background: linear-gradient(90deg, var(--ql-warn), var(--ql-accent)) !important; }
.ql-bar-expired { background: var(--ql-accent) !important; }

/* ===== FOOTER ===== */
.ql-footer {
  padding: 10px 14px; background: rgba(5,5,6,0.85); border-top: 1px solid var(--ql-border);
  display: flex; flex-direction: column; gap: 6px;
}
.ql-footer-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ql-group-link { color: #25d366; }
.ql-group-link:hover { color: #25d366; filter: brightness(1.2); }
.ql-support-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ql-text-dim); text-decoration: none;
  transition: color 0.18s ease;
}
.ql-support-link:hover { color: var(--ql-text); }
.ql-footer-version { font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--ql-text-dim); padding: 3px 7px; border: 1px solid var(--ql-border); border-radius: 4px; }
.ql-badge-mz { display: block; text-align: center; font-size: 9px; color: var(--ql-text-dim); font-family: 'JetBrains Mono', monospace; letter-spacing: 0.1em; }

/* ===== RESIZE HANDLE ===== */
.ql-resize-handle {
  position: absolute; right: 0; bottom: 0; width: 14px; height: 14px;
  cursor: nwse-resize; background:
    linear-gradient(135deg, transparent 50%, var(--ql-text-dim) 50%, var(--ql-text-dim) 60%, transparent 60%, transparent 70%, var(--ql-text-dim) 70%, var(--ql-text-dim) 80%, transparent 80%);
  opacity: 0.6;
}

/* ===== ALERTS (top toast inside the floating box) ===== */
.ql-custom-alert {
  position: absolute; top: 12px; left: 12px; right: 12px;
  background: linear-gradient(135deg, rgba(20,20,28,0.98), rgba(12,12,16,0.98));
  border: 1px solid rgba(139,92,246,0.45);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex; align-items: center; justify-content: flex-start;
  z-index: 2147483646;
  box-shadow: 0 12px 36px -8px rgba(0,0,0,0.7), 0 0 24px -6px rgba(139,92,246,0.4);
  animation: ql-alert-slide 0.25s ease-out;
  pointer-events: auto;
}
@keyframes ql-alert-slide { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.ql-alert-content { display: flex; align-items: center; gap: 10px; width: 100%; background: transparent; border: 0; padding: 0; max-width: none; text-align: left; }
.ql-alert-icon { font-size: 22px; margin: 0; line-height: 1; flex-shrink: 0; }
.ql-alert-title { font-size: 12px; font-weight: 800; color: var(--ql-text); margin: 0 0 2px; }
.ql-alert-message { font-size: 11px; color: var(--ql-text-muted); margin: 0; line-height: 1.35; }
.ql-alert-text-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ql-alert-ok-btn { display: none !important; }

/* ===== SHIELD OVERLAY ===== */
.ql-shield-overlay {
  position: absolute; inset: 0;
  background: rgba(10,10,15,0.94);
  backdrop-filter: blur(8px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 50; gap: 6px;
  border-radius: inherit;
  border: 1px solid rgba(139,92,246,0.35);
}
.ql-shield-overlay svg { width: 28px; height: 28px; color: #8b5cf6; }
.ql-shield-overlay-text { color: #fff; font-size: 13px; font-weight: 800; }
.ql-shield-overlay-sub { color: var(--ql-text-muted); font-size: 11px; }

/* ===== MODO PLANO MODAL ===== */
.ql-modo-plano-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 2147483645; padding: 16px; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.ql-modo-plano-visible { opacity: 1; pointer-events: auto; }
.ql-modo-plano-modal { background: var(--ql-bg); border: 1px solid var(--ql-border-2); border-radius: 16px; max-width: 360px; width: 100%; padding: 22px; color: var(--ql-text); }
.ql-modo-plano-icon { font-size: 32px; text-align: center; margin-bottom: 6px; }
.ql-modo-plano-title { font-size: 15px; font-weight: 800; text-align: center; }
.ql-modo-plano-body { font-size: 12px; color: var(--ql-text-muted); margin: 10px 0; }
.ql-modo-plano-body .ql-mp-credit { color: var(--ql-success); font-weight: 600; }
.ql-modo-plano-steps { margin: 10px 0; }
.ql-modo-plano-step { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--ql-border); }
.ql-modo-plano-step-num { width: 22px; height: 22px; border-radius: 50%; background: var(--ql-accent); color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ql-modo-plano-step-text { font-size: 11px; }
.ql-modo-plano-check { color: var(--ql-success); }
.ql-modo-plano-btn { width: 100%; padding: 10px; background: var(--ql-accent); color: #fff; border: 0; border-radius: 9px; font-weight: 700; cursor: pointer; margin-top: 10px; }

/* ===== NATIVE TOAST ===== */
.ql-native-toast { position: fixed; top: 24px; left: 50%; padding: 12px 22px; border-radius: 10px; font-size: 12px; font-weight: 700; z-index: 2147483647; opacity: 0; transform: translate(-50%, -10px); transition: all 0.25s; box-shadow: 0 10px 30px -10px rgba(0,0,0,0.6); text-align: center; }
.ql-native-toast-visible { opacity: 1; transform: translate(-50%, 0); }
.ql-native-toast-success { background: var(--ql-success); color: #fff; }
.ql-native-toast-error { background: var(--ql-accent); color: #fff; }

/* ===== TOAST: dica do painel lateral (canto inferior direito) ===== */
.ql-sidepanel-tip {
  position: fixed; right: 20px; bottom: 20px; z-index: 2147483647;
  width: 300px; max-width: calc(100vw - 40px);
  padding: 14px 14px 12px; border-radius: 14px;
  background: rgba(20,18,31,0.96); backdrop-filter: blur(14px);
  border: 1px solid rgba(139,92,246,0.30);
  box-shadow: 0 16px 40px -12px rgba(0,0,0,0.7), 0 0 0 1px rgba(0,0,0,0.4);
  color: #ede9fe; font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  opacity: 0; transform: translateY(14px); transition: opacity 0.28s ease, transform 0.28s ease;
}
.ql-sidepanel-tip-visible { opacity: 1; transform: translateY(0); }
.ql-sidepanel-tip .ql-tip-close {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 7px; cursor: pointer;
  background: transparent; color: rgba(237,233,254,0.45); font-size: 12px;
  transition: all 0.18s ease;
}
.ql-sidepanel-tip .ql-tip-close:hover { background: rgba(255,255,255,0.08); color: #fff; }
.ql-sidepanel-tip .ql-tip-body { display: flex; align-items: flex-start; gap: 10px; padding-right: 18px; }
.ql-sidepanel-tip .ql-tip-ico { font-size: 18px; line-height: 1.2; flex: 0 0 auto; }
.ql-sidepanel-tip .ql-tip-text { font-size: 12px; line-height: 1.45; color: rgba(237,233,254,0.85); }
.ql-sidepanel-tip .ql-tip-text strong {
  display: block; font-size: 12px; font-weight: 800; letter-spacing: 0.04em;
  color: #c4b5fd; margin-bottom: 2px;
}
.ql-sidepanel-tip .ql-tip-ok {
  display: block; margin: 12px 0 0 auto; padding: 7px 16px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--ql-accent), var(--ql-accent-2)); color: #fff;
  font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  border-radius: 99px; box-shadow: 0 6px 18px -6px rgba(139,92,246,0.6);
  transition: all 0.18s ease;
}
.ql-sidepanel-tip .ql-tip-ok:hover { filter: brightness(1.12); transform: translateY(-1px); }

/* ===== BALÃO "ABRA O MENU LATERAL" (ancorado ao #ql-sidepanel-btn) ===== */
.ql-sp-hint {
  position: absolute;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  max-width: calc(100% - 16px);
  padding: 7px 11px;
  background: linear-gradient(135deg, var(--ql-accent), var(--ql-accent-2));
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  border-radius: 10px;
  box-shadow: 0 10px 26px -6px rgba(139,92,246,0.75), 0 0 0 1px rgba(0,0,0,0.25);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.ql-sp-hint.ql-sp-hint-in { opacity: 1; transform: translateY(0); }
.ql-sp-hint.ql-sp-hint-out { opacity: 0; transform: translateY(-4px); }
.ql-sp-hint-arrow {
  position: absolute;
  top: -5px; left: 14px;
  width: 10px; height: 10px;
  background: var(--ql-accent);
  transform: rotate(45deg);
  border-radius: 2px;
}
.ql-sp-hint-text { position: relative; }

.ql-native-sending { opacity: 0.6; pointer-events: none; }
.ql-native-sending-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; }

/* ===== CHAT HISTORY ===== */
.ql-chat-empty { text-align: center; padding: 30px 20px; color: var(--ql-text-muted); font-size: 11px; }
.ql-chat-messages { display: flex; flex-direction: column; gap: 8px; }
.ql-chat-date-divider { display: flex; align-items: center; justify-content: center; margin: 6px 0; }
.ql-chat-date-label { font-size: 9px; font-family: 'JetBrains Mono', monospace; color: var(--ql-text-dim); padding: 3px 9px; background: var(--ql-surface); border-radius: 99px; }
.ql-chat-bubble {
  position: relative; padding: 10px 12px 10px 16px; margin-left: 6px;
  background: var(--ql-surface); border: 1px solid var(--ql-border);
  border-left: 0;
  border-radius: 4px 14px 14px 14px; font-size: 11px;
}
.ql-chat-bubble::before {
  content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  border-radius: 99px; background: linear-gradient(180deg, var(--ql-accent), var(--ql-accent-2));
}
.ql-chat-bubble:has(.ql-chat-status-err)::before { background: var(--ql-warn, #f59e0b); }
.ql-chat-meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 9px; color: var(--ql-text-dim); font-family: 'JetBrains Mono', monospace; }
.ql-chat-status-ok { color: var(--ql-success); }
.ql-chat-status-err { color: var(--ql-accent); }
.ql-chat-time { margin-left: auto; }
.ql-chat-actions { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--ql-border); margin-top: 6px; }
.ql-chat-count { font-size: 10px; color: var(--ql-text-muted); }
.ql-chat-clear { background: transparent; border: 1px solid var(--ql-border); color: var(--ql-text-muted); padding: 5px 10px; border-radius: 7px; font-size: 10px; cursor: pointer; }
.ql-chat-clear:hover { color: var(--ql-accent); border-color: rgba(139,92,246,0.3); }

/* ===== SPINNER ===== */
.ql-spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--ql-border-2); border-top-color: var(--ql-accent); border-radius: 50%; animation: ql-spin 0.8s linear infinite; }

/* ===== SCROLLBAR ===== */
#ql-floating ::-webkit-scrollbar { width: 6px; height: 6px; }
#ql-floating ::-webkit-scrollbar-track { background: transparent; }
#ql-floating ::-webkit-scrollbar-thumb { background: var(--ql-border-2); border-radius: 99px; }
#ql-floating ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* ===== LIGHT THEME ===== */
#ql-floating.ql-light {
  --ql-bg: #fafafa; --ql-bg-2: #fff;
  --ql-surface: rgba(0,0,0,0.03); --ql-surface-2: rgba(0,0,0,0.05);
  --ql-border: rgba(0,0,0,0.06); --ql-border-2: rgba(0,0,0,0.10);
  --ql-text: #1a1a1c; --ql-text-muted: rgba(0,0,0,0.55); --ql-text-dim: rgba(0,0,0,0.35);
}

/* ===== ONBOARDING TOOLTIP ===== */
.ql-onboarding-tooltip {
  width: 300px;
  background: linear-gradient(135deg, #1a1530 0%, #0f0a1f 100%);
  border: 1px solid rgba(139,92,246,0.55);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 20px 50px -10px rgba(0,0,0,0.75), 0 0 30px -4px rgba(139,92,246,0.55);
  color: #f5f3ff;
  font-family: 'Poppins', -apple-system, sans-serif;
  animation: ql-onb-pop 0.35s cubic-bezier(0.18,0.89,0.32,1.28);
}
@keyframes ql-onb-pop { from { opacity: 0; transform: translateY(-10px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
.ql-onb-arrow {
  position: absolute; top: -8px; width: 16px; height: 16px;
  background: linear-gradient(135deg, #1a1530, #1a1530);
  border-left: 1px solid rgba(139,92,246,0.55);
  border-top: 1px solid rgba(139,92,246,0.55);
  transform: rotate(45deg);
}
.ql-onb-title { font-size: 13px; font-weight: 800; color: #c4b5fd; margin-bottom: 6px; }
.ql-onb-msg { font-size: 12px; line-height: 1.45; color: rgba(245,243,255,0.85); margin-bottom: 12px; }
.ql-onb-actions { display: flex; gap: 8px; }
.ql-onb-btn-primary {
  flex: 1; padding: 8px 12px; border-radius: 8px;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  border: 0; color: #fff; font-size: 12px; font-weight: 700; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.ql-onb-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px -4px rgba(139,92,246,0.6); }
.ql-onb-btn-secondary {
  padding: 8px 12px; border-radius: 8px;
  background: transparent; border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7); font-size: 12px; font-weight: 600; cursor: pointer;
}
.ql-onb-btn-secondary:hover { background: rgba(255,255,255,0.05); color: #fff; }
.ql-onb-pulse { animation: ql-onb-pulse 1.6s ease-in-out infinite; border-radius: 8px; }
@keyframes ql-onb-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139,92,246,0.7); }
  50%      { box-shadow: 0 0 0 8px rgba(139,92,246,0); }
}

/* Enter-send collapsible */
.ql-enter-collapser { display:flex; flex-direction:column; align-items:center; margin-top:6px; }
.ql-enter-collapse-btn {
  width: 28px; height: 22px; border-radius: 8px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--ql-border);
  color: var(--ql-text-muted); cursor: pointer; display:flex; align-items:center; justify-content:center;
  transition: transform 0.25s ease, background 0.2s ease, color 0.2s ease;
}
.ql-enter-collapse-btn:hover { background: rgba(255,255,255,0.08); color: var(--ql-text); }
.ql-enter-collapse-btn.ql-open { transform: rotate(180deg); }
.ql-enter-panel {
  display:flex; align-items:center; justify-content:center; gap:8px;
  margin-top:8px; padding:8px 12px; border:1px solid var(--ql-border); border-radius:10px;
  background: rgba(255,255,255,0.03); width: fit-content;
}

/* ===== Update Blocker (popup) ===== */
.ql-update-blocker{position:absolute;inset:0;z-index:9999;background:rgba(8,10,18,0.92);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);display:flex;align-items:flex-start;justify-content:center;padding:16px;overflow-y:auto;border-radius:inherit}
/* Card de atualização — tema roxo da extensão (Lovable3s) */
.ql-upd-card{width:100%;max-width:340px;background:linear-gradient(160deg,rgba(139,92,246,0.12),rgba(14,14,24,0.96));border:1px solid rgba(139,92,246,0.45);border-radius:16px;padding:20px 18px;box-shadow:0 0 0 1px rgba(139,92,246,0.06),0 20px 60px -10px rgba(139,92,246,0.55);text-align:center;color:#ede9fe}
/* Logo da extensão (substitui o antigo ícone de brilho) */
.ql-upd-logo{display:flex;align-items:center;justify-content:center;margin:0 auto 10px;width:64px;height:64px;border-radius:16px;background:linear-gradient(135deg,rgba(139,92,246,0.26),rgba(124,58,237,0.10));border:1px solid rgba(139,92,246,0.45);box-shadow:0 0 24px -4px rgba(139,92,246,0.7),inset 0 0 16px -10px rgba(196,181,253,0.85)}
.ql-upd-logo img{width:42px;height:42px;object-fit:contain;display:block;filter:drop-shadow(0 0 8px rgba(139,92,246,0.55))}
.ql-upd-title{font-size:16px;font-weight:800;margin:0 0 6px;background:linear-gradient(135deg,#c4b5fd,#8b5cf6);-webkit-background-clip:text;background-clip:text;color:transparent}
.ql-upd-sub{font-size:12px;color:#a1a1aa;margin:0 0 12px;line-height:1.45}
.ql-upd-sub strong{color:#c4b5fd}
.ql-upd-changelog{font-size:11px;color:#cbd5e1;background:rgba(139,92,246,0.06);border:1px solid rgba(139,92,246,0.18);border-radius:8px;padding:8px 10px;margin-bottom:12px;text-align:left;white-space:pre-line;max-height:80px;overflow-y:auto}
.ql-upd-steps{display:flex;flex-direction:column;gap:8px;margin-bottom:14px;text-align:left}
.ql-upd-step{display:flex;align-items:flex-start;gap:8px;font-size:11px;color:#d4d4d8;line-height:1.4}
.ql-upd-step b{color:#fff}
.ql-upd-num{flex-shrink:0;width:20px;height:20px;border-radius:50%;background:linear-gradient(135deg,#7c3aed,#8b5cf6);color:#fff;display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:800}
.ql-upd-btn{display:block;width:100%;padding:11px 14px;background:linear-gradient(135deg,#7c3aed,#8b5cf6);color:#fff;border:none;border-radius:10px;font-size:13px;font-weight:700;text-decoration:none;cursor:pointer;transition:transform 0.15s,box-shadow 0.15s;box-shadow:0 8px 20px -6px rgba(139,92,246,0.6)}
.ql-upd-btn:hover{transform:translateY(-1px);box-shadow:0 12px 24px -6px rgba(139,92,246,0.8)}
.ql-upd-btn:disabled{opacity:0.5;cursor:not-allowed}
.ql-upd-dismiss{display:block;width:100%;padding:9px 14px;margin-top:8px;background:transparent;color:#a1a1aa;border:1px solid rgba(139,92,246,0.3);border-radius:10px;font-size:12px;font-weight:600;cursor:pointer;transition:background 0.15s,color 0.15s,border-color 0.15s}
.ql-upd-dismiss:hover{background:rgba(139,92,246,0.12);color:#fff;border-color:rgba(139,92,246,0.6)}
.ql-upd-foot{font-size:10px;color:#71717a;margin:10px 0 0}

/* ============ Auto-Aprovar — Modal de confirmação (preto/vermelho) ============ */
.ql-aa-confirm-overlay{
  position: fixed; inset: 0; z-index: 2147483647;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: qlAaFadeIn .18s ease-out;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.ql-aa-confirm-overlay.ql-aa-confirm-closing{ animation: qlAaFadeOut .18s ease-in forwards; }
@keyframes qlAaFadeIn{ from{opacity:0} to{opacity:1} }
@keyframes qlAaFadeOut{ from{opacity:1} to{opacity:0} }
@keyframes qlAaPopIn{
  from{ opacity:0; transform: scale(.9) translateY(8px); }
  to{ opacity:1; transform: scale(1) translateY(0); }
}
.ql-aa-confirm-modal{
  position: relative;
  width: 100%; max-width: 380px;
  background: linear-gradient(160deg, #15090b 0%, #0a0405 100%);
  border: 1px solid rgba(139,92,246, 0.35);
  border-radius: 18px;
  padding: 26px 22px 22px;
  box-shadow:
    0 25px 60px rgba(0,0,0,0.65),
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 0 40px rgba(139,92,246,0.18);
  color: #fff;
  text-align: center;
  animation: qlAaPopIn .22s cubic-bezier(.2,.9,.3,1.2);
  overflow: hidden;
}
.ql-aa-confirm-glow{
  position: absolute; top: -60px; left: 50%;
  width: 220px; height: 220px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(139,92,246,0.35) 0%, transparent 70%);
  pointer-events: none;
}
.ql-aa-confirm-icon{
  position: relative;
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #7f1d1d);
  color: #fff;
  box-shadow: 0 8px 24px rgba(124,58,237,0.5), inset 0 1px 0 rgba(255,255,255,0.2);
}
.ql-aa-confirm-title{
  position: relative;
  margin: 0 0 10px;
  font-size: 18px; font-weight: 700;
  color: #fff; letter-spacing: -.01em;
}
.ql-aa-confirm-text{
  position: relative;
  margin: 0 0 10px;
  font-size: 13px; line-height: 1.5;
  color: #d4d4d8;
}
.ql-aa-confirm-text strong{ color:#c4b5fd; font-weight:600; }
.ql-aa-confirm-sub{
  position: relative;
  margin: 0 0 18px;
  font-size: 13px; font-weight: 600;
  color: #fff;
}
.ql-aa-confirm-actions{
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ql-aa-btn{
  appearance: none; border: 0; cursor: pointer;
  padding: 11px 14px; border-radius: 11px;
  font-size: 13px; font-weight: 600;
  font-family: inherit;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.ql-aa-btn:active{ transform: translateY(1px); }
.ql-aa-btn-cancel{
  background: #1f1f23;
  color: #e4e4e7;
  border: 1px solid rgba(255,255,255,0.08);
}
.ql-aa-btn-cancel:hover{ background:#2a2a2f; }
.ql-aa-btn-confirm{
  background: linear-gradient(135deg, #8b5cf6 0%, #b91c1c 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(124,58,237,0.45);
}
.ql-aa-btn-confirm:hover{
  box-shadow: 0 8px 22px rgba(124,58,237,0.6);
  filter: brightness(1.05);
}

/* ===== RESPONSIVE (280px – 480px) ===== */
@container (max-width: 340px) {
  #ql-header { padding: 8px 8px; }
  .ql-header-center { padding: 3px 8px; }
  .ql-brand { font-size: 11px; letter-spacing: 0.03em; }
  .ql-badge-pro-header { display: none; }
  .ql-icon-btn { width: 26px; height: 26px; }
  .ql-compose-actions { flex-wrap: wrap; gap: 6px; }
  .ql-compose-actions .ql-action-left { flex: 1 1 auto; }
  .ql-send-btn { width: 100%; justify-content: center; }
  #ql-msg { min-height: 100px; }
  .ql-profile-card { padding: 12px; }
  .ql-profile-top { gap: 10px; row-gap: 8px; }
  /* avatar + nome/sync continuam na 1ª linha; só o badge desce p/ a 2ª, alinhado à esquerda */
  .ql-profile-info { flex: 1 1 auto; }
  .ql-profile-badge { flex: 1 1 100%; align-self: flex-start; }
  .ql-avatar { width: 38px; height: 38px; border-radius: 11px; }
  .ql-avatar svg { width: 19px; height: 19px; }
  .ql-profile-name { font-size: 13px; }
  .ql-status-badge, .ql-badge-pro, .ql-badge-test { padding: 4px 8px; font-size: 10px; }
}
@container (min-width: 440px) {
  #ql-msg { min-height: 140px; }
  .ql-chip { padding: 8px 14px; }
}
