/* ============================================================
   Lead Rotator — Premium Widget UI (v3.2)
   Design system: layered surfaces, brand chips, refined motion.
   ============================================================ */

:root {
  --lr-main: #25D366;
  --lr-main-600: #1ebe5a;
  --lr-main-700: #128C7E;
  --lr-tg: #229ED9;
  --lr-bg: #ffffff;
  --lr-surface: #ffffff;
  --lr-surface-2: #f7f8fa;
  --lr-surface-3: #eef1f4;
  --lr-border: rgba(15, 23, 42, .08);
  --lr-border-strong: rgba(15, 23, 42, .12);
  --lr-text: #0f172a;
  --lr-text-2: #475569;
  --lr-text-3: #64748b;
  --lr-radius: 20px;
  --lr-radius-sm: 14px;
  --lr-shadow-lg: 0 24px 64px -16px rgba(15, 23, 42, .28), 0 8px 24px -8px rgba(15, 23, 42, .12);
  --lr-shadow-md: 0 8px 24px -6px rgba(15, 23, 42, .18);
  --lr-shadow-toggle: 0 14px 36px -8px rgba(37, 211, 102, .55), 0 4px 12px rgba(15, 23, 42, .14);
  --lr-offset-bottom: 24px;
  --lr-offset-side: 24px;
  --lr-font: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.lr { position: fixed; bottom: var(--lr-offset-bottom); z-index: 2147483600; font-family: var(--lr-font); -webkit-font-smoothing: antialiased; }
.lr-pos-right { right: var(--lr-offset-side); }
.lr-pos-left  { left:  var(--lr-offset-side); }
.lr *, .lr *::before, .lr *::after { box-sizing: border-box; }
.lr [hidden] { display: none !important; pointer-events: none !important; }

/* ---------- TOGGLE (botão flutuante) ---------- */
.lr-toggle {
  display: inline-flex; align-items: center; gap: 10px; position: relative;
  background: linear-gradient(135deg, var(--lr-main) 0%, var(--lr-main-600) 100%);
  color: #fff; border: 0; border-radius: 999px;
  padding: 14px 22px; font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  cursor: pointer; box-shadow: var(--lr-shadow-toggle);
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease;
  font-family: inherit;
}
.lr-toggle:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 18px 44px -8px rgba(37, 211, 102, .65), 0 6px 16px rgba(15, 23, 42, .18); }
.lr-toggle:active { transform: translateY(-1px) scale(1); }
.lr-style-bubble .lr-toggle { padding: 16px; }
.lr-style-avatar .lr-toggle {
  padding: 6px 20px 6px 6px; background: #fff; color: var(--lr-text);
  border: 1px solid var(--lr-border); box-shadow: var(--lr-shadow-md);
}
.lr-avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; display: block; box-shadow: 0 0 0 2px #fff inset; }
.lr-toggle-text { white-space: nowrap; }

.lr-pulse { position: absolute; inset: 0; border-radius: 999px; pointer-events: none; }
.lr-anim-pulse  .lr-pulse  { animation: lr-pulse 2.4s ease-out infinite; }
.lr-anim-bounce .lr-toggle { animation: lr-bounce 2.6s ease-in-out infinite; }
@keyframes lr-pulse  { 0%{box-shadow:0 0 0 0 rgba(37,211,102,.6);} 70%{box-shadow:0 0 0 22px rgba(37,211,102,0);} 100%{box-shadow:0 0 0 0 rgba(37,211,102,0);} }
@keyframes lr-bounce { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-6px);} }

/* ---------- PREVIEW BALLOON ---------- */
.lr-preview {
  position: absolute; bottom: 76px; max-width: 260px;
  background: #fff; color: var(--lr-text);
  padding: 14px 32px 14px 16px; border-radius: 16px; font-size: 14px; line-height: 1.4;
  box-shadow: var(--lr-shadow-md); cursor: pointer;
  opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s; pointer-events: none;
  border: 1px solid var(--lr-border);
}
.lr-pos-right .lr-preview { right: 0; }
.lr-pos-left  .lr-preview { left: 0; }
.lr-preview.lr-show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.lr-preview-close { position: absolute; top: 6px; right: 10px; font-size: 18px; color: #94a3b8; }

/* ---------- PANEL (caixa do chat) ---------- */
.lr-panel {
  position: absolute; bottom: 86px; width: 384px; max-width: calc(100vw - 32px);
  /* Altura total nunca passa de 85vh — header + scroll interno ficam contidos */
  max-height: min(620px, calc(100vh - 110px));
  display: flex; flex-direction: column;
  background: var(--lr-surface); border-radius: var(--lr-radius) !important;
  overflow: hidden;
  box-shadow: var(--lr-shadow-lg);
  border: 1px solid var(--lr-border);
  opacity: 0; transform: translateY(12px) scale(.97); pointer-events: none;
  transition: opacity .25s cubic-bezier(.16,1,.3,1), transform .25s cubic-bezier(.16,1,.3,1);
  backdrop-filter: saturate(180%);
}
.lr-pos-right .lr-panel { right: 0; transform-origin: bottom right; }
.lr-pos-left  .lr-panel { left:  0; transform-origin: bottom left; }
.lr[data-state="open"] .lr-panel { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.lr[data-state="open"] .lr-preview { display: none; }

/* ---------- HEADER ---------- */
.lr-header {
  position: relative;
  background:
    radial-gradient(140% 100% at 0% 0%, rgba(255,255,255,.18), transparent 60%),
    linear-gradient(135deg, var(--lr-main-700) 0%, var(--lr-main) 55%, var(--lr-main-600) 100%);
  color: #fff; padding: 22px 22px 22px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
}
.lr-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 24px;
  background: radial-gradient(120% 100% at 50% 0%, rgba(255,255,255,.08), transparent);
  pointer-events: none;
}
.lr-title {
  font-size: 18px; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em;
  color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.lr-subtitle {
  font-size: 14px; line-height: 1.4; margin-top: 6px;
  color: rgba(255,255,255,.96); font-weight: 500;
  /* Garante leitura sobre o gradiente verde, mesmo em telas claras */
  text-shadow: 0 1px 1px rgba(0,0,0,.12);
}
.lr-close {
  background: rgba(255,255,255,.18); border: 0; color: #fff;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 20px; line-height: 1; cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s ease, transform .15s ease;
  backdrop-filter: blur(8px);
}
.lr-close:hover { background: rgba(255,255,255,.28); transform: rotate(90deg); }

/* ---------- SOCIAL BAR ---------- */
.lr-social-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px 0; gap: 12px;
}
.lr-avatar-stack { display: flex; }
.lr-avatar-stack img, .lr-stack-letter {
  width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid #fff; object-fit: cover;
  margin-left: -10px; background: linear-gradient(135deg,#e2e8f0,#cbd5e1);
  display: inline-flex; align-items: center; justify-content: center;
  color: #94a3b8; font-weight: 700; font-size: 12px;
  box-shadow: 0 2px 4px rgba(15,23,42,.08);
}
.lr-avatar-stack img:first-child, .lr-avatar-stack .lr-stack-letter:first-child { margin-left: 0; }
.lr-online-tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: #15803d; font-weight: 600;
  background: #f0fdf4; padding: 5px 10px; border-radius: 999px;
  border: 1px solid #bbf7d0;
}
.lr-pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34,197,94,.7); animation: lrPulse 1.8s infinite;
}
@keyframes lrPulse { 0%{box-shadow:0 0 0 0 rgba(34,197,94,.7);} 70%{box-shadow:0 0 0 8px rgba(34,197,94,0);} 100%{box-shadow:0 0 0 0 rgba(34,197,94,0);} }

/* ---------- CHANNELS (lista de canais) ---------- */
.lr-channels {
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
  flex: 1 1 auto; min-height: 0;            /* permite o overflow funcionar dentro do flex parent */
  overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.lr-channels::-webkit-scrollbar { width: 6px; }
.lr-channels::-webkit-scrollbar-thumb { background: var(--lr-surface-3); border-radius: 3px; }

.lr-channel {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left; text-decoration: none;
  background: var(--lr-surface);
  border: 1px solid var(--lr-border);
  border-radius: var(--lr-radius-sm);
  padding: 14px 16px; cursor: pointer;
  font-size: 14px; color: var(--lr-text);
  position: relative; overflow: hidden;
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), border-color .18s, box-shadow .18s, background .18s;
}
.lr-channel::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--lr-main); transform: scaleY(0); transform-origin: center;
  transition: transform .2s ease;
}
.lr-channel:hover {
  transform: translateY(-1px);
  border-color: var(--lr-border-strong);
  box-shadow: 0 8px 20px -8px rgba(15,23,42,.16);
}
.lr-channel:hover::before { transform: scaleY(.7); }
.lr-channel:active { transform: translateY(0); }
.lr-channel:disabled { opacity: .55; cursor: wait; }

/* Chip do ícone — cor por canal */
.lr-channel > .lr-icon,
.lr-attendant > .lr-icon {
  width: 44px; height: 44px; padding: 11px;
  border-radius: 12px; flex-shrink: 0;
  background: var(--lr-main); background-size: 22px 22px;
  box-shadow: 0 4px 10px -2px rgba(37,211,102,.4), inset 0 1px 0 rgba(255,255,255,.18);
}
.lr-channel[data-type="telegram_group"] > .lr-icon {
  background: var(--lr-tg);
  box-shadow: 0 4px 10px -2px rgba(34,158,217,.4), inset 0 1px 0 rgba(255,255,255,.18);
}
.lr-channel[data-type="telegram_group"]::before { background: var(--lr-tg); }

.lr-channel-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.lr-channel-label {
  font-weight: 600; font-size: 15px; letter-spacing: -0.01em; color: var(--lr-text);
  line-height: 1.3;
}
.lr-channel-sub {
  font-size: 13px; color: var(--lr-text-3); margin-top: 3px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lr-channel-count {
  display: inline-flex; align-items: center; font-size: 11px; color: #16a34a;
  margin-top: 6px; font-weight: 600;
}
.lr-arrow {
  color: #cbd5e1; font-size: 22px; font-weight: 400;
  transition: transform .2s ease, color .2s ease;
}
.lr-channel:hover .lr-arrow { transform: translateX(4px); color: var(--lr-text-2); }

/* Override de ícone monocromático — força branco dentro do chip */
.lr-channel > .lr-icon-whatsapp,
.lr-attendant > .lr-icon-whatsapp { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='white'><path d='M16 .4C7.4.4.4 7.4.4 16c0 2.8.7 5.6 2.1 8L0 32l8.3-2.2c2.3 1.3 4.9 2 7.6 2h.1c8.6 0 15.6-7 15.6-15.6S24.6.4 16 .4zm7.4 18.8c-.4-.2-2.4-1.2-2.8-1.3-.4-.1-.6-.2-.9.2-.3.4-1 1.3-1.2 1.5-.2.2-.4.3-.8.1-.4-.2-1.7-.6-3.2-2-1.2-1.1-2-2.4-2.2-2.8-.2-.4 0-.6.2-.8.2-.2.4-.4.5-.7.2-.2.2-.4.3-.6.1-.2 0-.4 0-.6-.1-.2-.9-2.2-1.2-3-.3-.8-.6-.7-.9-.7h-.7c-.2 0-.6.1-.9.4-.3.4-1.2 1.2-1.2 2.9 0 1.7 1.2 3.4 1.4 3.6.2.2 2.4 3.7 5.9 5.2.8.4 1.5.6 2 .7.8.3 1.6.2 2.2.1.7-.1 2.1-.9 2.4-1.7.3-.8.3-1.5.2-1.6-.1-.1-.4-.2-.7-.4z'/></svg>"); background-size: 22px 22px; background-repeat: no-repeat; background-position: center; }
.lr-channel > .lr-icon-telegram { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M9.78 18.65l.28-4.23 7.68-6.92c.34-.31-.07-.46-.52-.19L7.74 13.3 3.64 12c-.88-.25-.89-.86.2-1.3l15.97-6.16c.73-.33 1.43.18 1.15 1.3l-2.72 12.81c-.19.91-.74 1.13-1.5.71L12.6 16.3l-1.99 1.93c-.23.23-.42.42-.83.42z'/></svg>"); background-size: 22px 22px; background-repeat: no-repeat; background-position: center; }

/* Ícone padrão (não dentro de chip) — usado em outros lugares */
.lr-icon { width: 24px; height: 24px; display: inline-block; background-repeat: no-repeat; background-position: center; background-size: contain; flex-shrink: 0; }
.lr-icon-chat { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M20 2H4a2 2 0 0 0-2 2v18l4-4h14a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2z'/></svg>"); }
.lr-icon-whatsapp { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='%2325D366'><path d='M16 .4C7.4.4.4 7.4.4 16c0 2.8.7 5.6 2.1 8L0 32l8.3-2.2c2.3 1.3 4.9 2 7.6 2h.1c8.6 0 15.6-7 15.6-15.6S24.6.4 16 .4zm7.4 18.8c-.4-.2-2.4-1.2-2.8-1.3-.4-.1-.6-.2-.9.2-.3.4-1 1.3-1.2 1.5-.2.2-.4.3-.8.1-.4-.2-1.7-.6-3.2-2-1.2-1.1-2-2.4-2.2-2.8-.2-.4 0-.6.2-.8.2-.2.4-.4.5-.7.2-.2.2-.4.3-.6.1-.2 0-.4 0-.6-.1-.2-.9-2.2-1.2-3-.3-.8-.6-.7-.9-.7h-.7c-.2 0-.6.1-.9.4-.3.4-1.2 1.2-1.2 2.9 0 1.7 1.2 3.4 1.4 3.6.2.2 2.4 3.7 5.9 5.2.8.4 1.5.6 2 .7.8.3 1.6.2 2.2.1.7-.1 2.1-.9 2.4-1.7.3-.8.3-1.5.2-1.6-.1-.1-.4-.2-.7-.4z'/></svg>"); }
.lr-icon-telegram { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23229ED9'><path d='M9.78 18.65l.28-4.23 7.68-6.92c.34-.31-.07-.46-.52-.19L7.74 13.3 3.64 12c-.88-.25-.89-.86.2-1.3l15.97-6.16c.73-.33 1.43.18 1.15 1.3l-2.72 12.81c-.19.91-.74 1.13-1.5.71L12.6 16.3l-1.99 1.93c-.23.23-.42.42-.83.42z'/></svg>"); }

/* ---------- TEAM MODE (atendentes em grid compacto) ----------
   Cards menores, 2 colunas no painel padrão, 1 só em telas muito estreitas.
   Mantém info essencial (avatar + nome + status) e libera espaço pros canais. */
.lr-team-title {
  font-size: 11px; font-weight: 700; color: var(--lr-text-3);
  text-transform: uppercase; letter-spacing: .08em;
  padding: 14px 4px 8px;
  display: flex; align-items: center; gap: 8px;
}
.lr-team-title::after {
  content: ""; flex: 1; height: 1px; background: var(--lr-border);
}
.lr-team-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.lr-attendant {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 8px; padding: 12px 10px 14px;
  text-decoration: none; cursor: pointer;
  background: var(--lr-surface);
  border: 1px solid var(--lr-border);
  border-radius: var(--lr-radius-sm);
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), border-color .18s, box-shadow .18s, background .18s;
  position: relative; min-width: 0;
}
.lr-attendant:hover {
  transform: translateY(-2px); border-color: var(--lr-main);
  box-shadow: 0 8px 20px -8px rgba(37,211,102,.3);
}
.lr-attendant:active { transform: translateY(0); }
.lr-att-avatar {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  position: relative; overflow: visible;
  background: linear-gradient(135deg, var(--lr-main) 0%, var(--lr-main-700) 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px #fff, 0 4px 10px -2px rgba(37,211,102,.4);
}
.lr-att-photo, .lr-att-initial { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.lr-att-initial { background: transparent; color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 20px; text-transform: uppercase; }
.lr-att-text { width: 100%; display: flex; flex-direction: column; align-items: center; min-width: 0; gap: 2px; }
.lr-att-name {
  font-size: 13.5px; font-weight: 600; color: var(--lr-text);
  letter-spacing: -0.01em; line-height: 1.25;
  width: 100%; max-width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lr-att-role {
  font-size: 11.5px; color: var(--lr-text-3); line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
/* Indicador online flutuante no canto do avatar */
.lr-att-avatar::after {
  content: ""; position: absolute; right: -1px; bottom: -1px;
  width: 13px; height: 13px; border-radius: 50%; background: #22c55e;
  border: 2px solid #fff;
}
/* Status separado: desativa o "lr-online" inline pra não duplicar */
.lr-online { display: none; }
/* Esconde o chip de ícone whatsapp dentro do card de atendente (visual mais limpo) */
.lr-attendant > .lr-icon { display: none; }

/* ---------- LEAD FORM (escondido por padrão) ---------- */
.lr-leadform { display: none !important; }
.lr-leadform[hidden] { display: none !important; }
.lr-hp { position: absolute !important; left: -9999px !important; opacity: 0 !important; }

.lr-inline-btn {
  background: linear-gradient(135deg, var(--lr-main) 0%, var(--lr-main-600) 100%);
  color: #fff; border: 0; border-radius: 12px;
  padding: 13px 22px; font-weight: 600; cursor: pointer; font-size: 14.5px;
  letter-spacing: -0.01em; box-shadow: var(--lr-shadow-toggle);
  transition: transform .15s ease, box-shadow .15s ease;
}
.lr-inline-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -8px rgba(37,211,102,.6); }

.lr-offline {
  padding: 14px 20px; font-size: 13px; color: var(--lr-text-3);
  background: var(--lr-surface-2); border-top: 1px solid var(--lr-border); text-align: center;
}

/* ---------- CONNECTING OVERLAY ---------- */
.lr-connecting[hidden] { display: none !important; pointer-events: none !important; }
.lr-connecting {
  position: fixed; inset: 0; background: rgba(15,23,42,.55); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
  z-index: 2147483647; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.lr-connecting.is-show { display: flex; pointer-events: auto; opacity: 1; }
.lr-conn-card {
  background: #fff; border-radius: var(--lr-radius); padding: 22px 24px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 30px 80px rgba(0,0,0,.3); min-width: 300px;
  border: 1px solid var(--lr-border);
}
.lr-conn-avatar {
  width: 52px; height: 52px; border-radius: 50%; overflow: hidden;
  background: linear-gradient(135deg, var(--lr-main), var(--lr-main-700));
  flex-shrink: 0; position: relative; box-shadow: 0 0 0 3px rgba(37,211,102,.18);
}
.lr-conn-avatar img { width: 100%; height: 100%; object-fit: cover; }
.lr-conn-initial { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 20px; }
.lr-conn-title { font-size: 12px; color: var(--lr-text-3); }
.lr-conn-name { font-weight: 700; color: var(--lr-text); font-size: 15.5px; letter-spacing: -0.01em; }
.lr-conn-role { font-size: 12.5px; color: var(--lr-text-3); }
.lr-conn-dots { display: flex; gap: 4px; margin-left: auto; }
.lr-conn-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--lr-main); animation: lrTyp 1s infinite; }
.lr-conn-dots i:nth-child(2) { animation-delay: .15s; }
.lr-conn-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes lrTyp { 0%,80%,100%{ transform:scale(.6); opacity:.5; } 40%{ transform:scale(1); opacity:1; } }

/* ---------- DARK MODE ---------- */
.lr.lr-theme-dark {
  --lr-bg: #0f172a;
  --lr-surface: #1e293b;
  --lr-surface-2: #0f172a;
  --lr-surface-3: #334155;
  --lr-border: rgba(255,255,255,.08);
  --lr-border-strong: rgba(255,255,255,.14);
  --lr-text: #f8fafc;
  --lr-text-2: #cbd5e1;
  --lr-text-3: #94a3b8;
}
.lr.lr-theme-dark .lr-panel { background: var(--lr-surface); border-color: var(--lr-border); }
.lr.lr-theme-dark .lr-channel { background: rgba(255,255,255,.04); border-color: var(--lr-border); color: var(--lr-text); }
.lr.lr-theme-dark .lr-channel:hover { background: rgba(255,255,255,.06); }
.lr.lr-theme-dark .lr-channel-label { color: var(--lr-text); }
.lr.lr-theme-dark .lr-channel-sub { color: var(--lr-text-3); }
.lr.lr-theme-dark .lr-attendant { background: rgba(255,255,255,.04); border-color: var(--lr-border); }
.lr.lr-theme-dark .lr-att-name { color: var(--lr-text); }
.lr.lr-theme-dark .lr-att-role { color: var(--lr-text-3); }
.lr.lr-theme-dark .lr-online-tag { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.3); color: #4ade80; }
.lr.lr-theme-dark .lr-conn-card { background: var(--lr-surface); border-color: var(--lr-border); }
.lr.lr-theme-dark .lr-conn-name { color: var(--lr-text); }
.lr.lr-theme-dark .lr-offline { background: var(--lr-surface-2); color: var(--lr-text-3); border-color: var(--lr-border); }

/* ---------- BOTTOM BAR (mobile alternative) ---------- */
@media (max-width: 640px) {
  .lr.lr-disp-bottombar .lr-toggle { width: 100%; border-radius: 0; bottom: 0; left: 0; right: 0; padding: 16px; justify-content: center; }
  .lr.lr-disp-bottombar .lr-panel { width: 100vw; max-width: 100vw; max-height: 92vh; border-radius: var(--lr-radius) var(--lr-radius) 0 0; bottom: 0; left: 0; right: 0; }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 600px) {
  /* No mobile, painel vira bottom sheet em position:fixed pra escapar do
     wrapper .lr (que fica preso ao canto direito sem largura definida).
     Assim ocupa 100% da viewport e nada fica cortado. */
  .lr-panel {
    position: fixed !important;
    left: 0 !important; right: 0 !important; bottom: 0 !important; top: auto !important;
    width: 100vw !important; max-width: 100vw !important;
    max-height: 88vh;
    border-radius: 18px 18px 0 0;
    transform-origin: bottom center !important;
  }
  .lr-pos-right .lr-panel,
  .lr-pos-left  .lr-panel { right: 0; left: 0; transform-origin: bottom center; }
  .lr-title { font-size: 17px; }
  .lr-subtitle { font-size: 13.5px; }
  .lr-header { padding: 18px 18px 16px; }
  .lr-channels { padding: 12px; gap: 8px; }
  .lr-channel { padding: 12px 14px; }
  .lr-channel > .lr-icon { width: 40px; height: 40px; }
  .lr-channel-label { font-size: 14.5px; }
  .lr-channel-sub { font-size: 12.5px; }
  .lr-team-grid { gap: 8px; }
  .lr-attendant { padding: 10px 8px 12px; }
  .lr-att-avatar { width: 48px; height: 48px; }
  .lr-att-name { font-size: 13px; }
  .lr-att-role { font-size: 11px; }

  /* Overlay escuro por trás do bottom-sheet pra dar foco */
  .lr[data-state="open"]::before {
    content: ""; position: fixed; inset: 0;
    background: rgba(15, 23, 42, .35);
    z-index: -1; pointer-events: none;
    animation: lrFadeIn .2s ease both;
  }
}
@keyframes lrFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Em telas muito estreitas (< 340px), atendentes em 1 coluna pra não quebrar nome */
@media (max-width: 340px) {
  .lr-team-grid { grid-template-columns: 1fr; }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  .lr-anim-pulse .lr-pulse, .lr-anim-bounce .lr-toggle,
  .lr-pulse-dot, .lr-conn-dots i,
  .lr-channel, .lr-attendant, .lr-toggle, .lr-arrow, .lr-close { animation: none !important; transition: none !important; }
}
