/* ── Conect7 Chatbot Widget ── assets/css/widget.css */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

/* ══════════════════════════════════════════
   VARIÁVEIS GLOBAIS
══════════════════════════════════════════ */
:root {
  --c7cb-primary:        #25d366;
  --c7cb-primary-hover:  #128c7e;
  --c7cb-shadow:         0 8px 40px rgba(0,0,0,.18);
  --c7cb-shadow-lg:      0 10px 25px rgba(0,0,0,.22);
  --c7cb-radius:         14px;
  --c7cb-radius-sm:      10px;
  --c7cb-font:           'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --c7cb-z:              999999;

  /* Paleta mensagens */
  --c7cb-msg-bot-bg:     #f3f4f6;
  --c7cb-msg-bot-color:  #1f2937;
  --c7cb-msg-user-bg:    #dcf8c6;
  --c7cb-msg-user-color: #1b5e20;

  /* Área de chat */
  --c7cb-chat-bg:        #d4edda;   /* verde-claro como na imagem */
  --c7cb-input-bg:       #fffff0;
  --c7cb-border:         #e2e5ea;
   
  --c7cb-secondary: #34495e;
  --c7cb-success: #27ae60;
  --c7cb-warning: #f39c12;
  --c7cb-error: #e74c3c;
  --c7cb-dark: #2c3e50;
  --c7cb-light: #ecf0f1;
  --c7cb-gray-100: #dcf8c6;
  --c7cb-gray-200: #e9ecef;
  --c7cb-gray-300: #dee2e6;
  --c7cb-gray-400: #ced4da;
  --c7cb-gray-500: #6c757d;
  --c7cb-gray-600: #495057;
  --c7cb-gray-700: #343a40;
  --c7cb-gray-800: #212529;
  --c7cb-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  --c7cb-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.2);
  --c7cb-border-radius: 12px;
  --c7cb-border-radius-sm: 8px;
  --c7cb-animation-duration: 0.3s;
  --c7cb-z-index: 999999;
}


/* ========== BOTÃO FLUTUANTE ========== */
.c7cb-toggle {
    position: fixed;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--c7cb-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: var(--c7cb-shadow);
    transition: all var(--c7cb-animation-duration) ease;
    z-index: var(--c7cb-z-index);
    outline: none;
}

.c7cb-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--c7cb-shadow-lg);
    background: var(--c7cb-primary-hover);
}

.c7cb-toggle:active {
    transform: scale(0.95);
}

/* ========================================
   AVATARES - GARANTIR TAMANHO FIXO
   ======================================== */

.message-avatar {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Avatar do BOT - FORÇAR SVG */
.message-avatar.bot-avatar {
    background: transparent !important;
    padding: 0 !important;
    overflow: visible;
}

.message-avatar.bot-avatar svg {
    width: 32px !important;
    height: 32px !important;
    display: block;
}

/* Avatar do CLIENTE - GRADIENTE VERDE */
.message-avatar.client-avatar {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: white !important;
}

/* Avatar do ATENDENTE - GRADIENTE ROSA */
.message-avatar.attendant-avatar {
    background: linear-gradient(135deg, #f093fb, #f5576c) !important;
    color: white !important;
}

/* ========================================
   BUBBLES - CORES E ALINHAMENTO
   ======================================== */

.message-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 18px !important;
    word-wrap: break-word;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Bot/Sistema: Cinza à esquerda */
.message-bot .message-bubble,
.message-system .message-bubble {
    background: #f3f4f6 !important;
    color: #1f2937 !important;
    border-radius: 12px !important;
    margin: 0px auto 10px;
}

/* Atendente: Amarelo à esquerda */
.message-attendant .message-bubble {
    background: #fff3cd !important;
    color: #856404 !important;
    border-radius: 12px !important;
}

/* Cliente: Verde à direita */
.message-client .message-bubble {
    background: linear-gradient(135deg, #dcf8c6 0%, #c8e6c9 100%) !important;
    color: #5300d3 !important;
    border-radius: 12px !important;
    margin: 0 auto 10px;
}

/* verificar */
.message-content {
    line-height: 1.5;
    font-size: 14px;
    word-wrap: break-word;
}

.message-meta {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    font-size: 11px;
    color: #0000ff;
}

.message-time {
    font-size: 11px;
}

/* ========================================
   SELEÇÃO DE CANAL
   ======================================== */

.channel-selection {
    padding: 20px;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.selection-header h3 {
    font-size: 20px;
    margin: 0 0 8px 0;
    color: #1f2937;
}

.selection-header p {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 24px 0;
}

.channel-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.channel-option-btn {
    display: flex;
    align-items: center;
    padding: 7px 10px !important;
    background: white !important;
    border: 2px solid #0ea5e9;
    border-radius: 12px !important;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    flex-direction: column;
    margin-top: 10px;
    font-size: 13px !important;
    box-shadow: inset 0 0 10px #000000, 0 0 7px #000000 !important;
    color: #4d00ff;
}

.channel-option-btn:hover {
    border-color: var(--multichat-primary);
    background:  var(--multichat-success);
    color: #00e5ff;
    transform: translateY(-2px);
    box-shadow: inset 0 0 10px #000000, 0 0 7px #000000 !important;
}
.channel-option-btn:hover:not(:disabled) {
    border-color: var(--multichat-primary);
    background: #ff0000;
    transform: translateY(-2px);
    box-shadow: var(--multichat-shadow);;
}

.channel-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.channel-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.channel-desc {
    font-size: 13px;
    color: #6b7280;
}

.c7cb-btn-primary {
    background: #000;
    color: white !important;
    padding: 5px 10px;
    border: 1px solid green !important;
    border-radius: 10px;
    font-size: 13px;
}

.c7cb-btn-primary:hover {
    background: #0000ff;
    transform: translateY(-1px);
}

/* ========== BOTÕES ========== */
.menu-option-btn {
    display: flex;
    align-items: center;
    padding: 7px 10px !important;
    background: white !important;
    border: 2px solid #000000;
    border-radius: 12px !important;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    flex-direction: column;
    margin-top: 10px;
    font-size: 13px !important;
    box-shadow: inset 0 0 10px #000000, 0 0 7px #000000 !important;
    color: #4d00ff;
}


/* ========== CHATBOT E MENUS ========== */
.chatbot-menu {
    padding: 12px;
    background: #f9fafb;
    border-radius: 12px;
    margin: 8px 0;
}

.menu-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}


.menu-option-btn:hover:not(:disabled) {
    background: #0000ff !important;
    transform: translateY(-1px);
    border-color: var(--c7cb-primary);
    color: yellow;
}

.menu-option-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== PRODUTOS ========== */
.product-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 12px 0;
    padding: 12px;
}

.product-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    transition: all 0.3s;
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.product-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
}

.product-card h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.product-card .price {
    font-size: 16px;
    font-weight: 700;
    color: var(--multichat-primary);
    margin-bottom: 8px;
}

.product-link {
    display: inline-block;
    padding: 8px 16px;
    background: var(--multichat-primary);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    text-align: center;
    transition: all 0.2s;
}

.product-link:hover {
    background: var(--multichat-primary-hover);
    transform: scale(1.02);
}

/* ========== PEDIDOS ========== */
.order-details {
    padding: 16px;
    background: white;
    border-radius: 12px;
    margin: 8px 0;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.order-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1f2937;
}

.order-status {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: white;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}

.info-row strong {
    color: #6b7280;
    font-size: 14px;
}

.info-row span {
    color: #1f2937;
    font-size: 14px;
    font-weight: 600;
}

/* ========== ANIMAÇÕES ========== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes pulseButton {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes fadeInAvatar {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========================================
   RESPONSIVIDADE - MOBILE
   ======================================== */

@media (max-width: 480px) {
    .message-avatar {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
        font-size: 12px;
    }
    
    .message-avatar.bot-avatar svg {
        width: 28px !important;
        height: 28px !important;
    }
    
    .message-bubble {
        max-width: 85%;
        padding: 8px 12px;
    }
    
    .message-content {
        font-size: 13px;
    }
}

/* ========== JANELA DO CHAT ========== */
#c7cb-window {
    bottom: 20px !important;
    right: 20px !important;
    width: 380px !important;
    height: 540px !important;
    background: white !important;
    border: 1px solid #ccc !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
    border-radius: 12px !important;
    z-index: 999999 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#c7cb-window {
    display: none;
}

#c7cb-window.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

#c7cb-window.minimized {
    display: none !important;
}

/* Posicionamento da janela */
.c7cb-window-bottom-right { bottom: 70px; right: 20px; }
.c7cb-window-bottom-left { bottom: 90px; left: 20px; }
.c7cb-window-top-right { top: 90px; right: 20px; }
.c7cb-window-top-left { top: 90px; left: 20px; }


/* ══════════════════════════════════════════
   ROOT / POSICIONAMENTO
══════════════════════════════════════════ */
#c7cb-root {
  position: fixed;
  z-index: var(--c7cb-z);
  font-family: var(--c7cb-font);
}

#c7cb-root.c7cb-pos-bottom-right  { bottom: 24px; right: 24px; }
#c7cb-root.c7cb-pos-bottom-left   { bottom: 24px; left:  24px; }
#c7cb-root.c7cb-pos-bottom-center { bottom: 24px; left: 50%; transform: translateX(-50%); }
#c7cb-root.c7cb-pos-middle-right  { bottom: 50%; right: 24px; transform: translateY(50%); }
#c7cb-root.c7cb-pos-middle-left   { bottom: 50%; left:  24px; transform: translateY(50%); }

/* ══════════════════════════════════════════
   FAB — BOTÃO FLUTUANTE
══════════════════════════════════════════ */
.c7cb-fab {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 22px !important;
    border: 5px solid #0000ff00;
    border-radius: 100% !important;
    color: #fff;
    font-family: var(--c7cb-font);
    font-size: 20px !important;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 30px rgb(0 0 0);
    transition: transform .2s, box-shadow .2s;
    white-space: nowrap;
    width: 38px;
    height: 38px;
    justify-content: center;
}
.c7cb-fab:hover  { transform: translateY(-2px); box-shadow: 0 10px 36px rgba(0,0,0,.3); }
.c7cb-fab:active { transform: scale(.97); }

/* Pulsing dot */
.c7cb-fab-pulse {
  position: absolute;
  top: -3px; right: -3px;
  width: 12px; height: 12px;
  background: #ff4757;
  border-radius: 50%;
  border: 2px solid #fff;
  animation: c7cb-pulse-dot 2s infinite;
}
@keyframes c7cb-pulse-dot {
  0%   { box-shadow: 0 0 0 0   rgba(255,71,87,.6); }
  70%  { box-shadow: 0 0 0 8px rgba(255,71,87,0);  }
  100% { box-shadow: 0 0 0 0   rgba(255,71,87,0);  }
}

/* ══════════════════════════════════════════
   WIDGET CONTAINER
══════════════════════════════════════════ */
/* ========== BASE ========== */
#c7cb-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--c7cb-gray-700);
    z-index: var(--c7cb-z-index);
    position: relative;
    box-sizing: border-box;
    margin: 0;
    padding: 2px;
}

/* Alinhamento para posições à esquerda */

@keyframes c7cb-slide-up {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ══════════════════════════════════════════
   HEADER  (gradiente multicolor da imagem)
══════════════════════════════════════════ */
.c7cb-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 10px;
    color: #fff;
    border-radius: 10px;
    background: linear-gradient(60deg, #1b00ff 5%, #d8ff01 15%, #016712 40%, #0014ff 70%, #ffc800 90%, #fff900 100%);
    background-size: 200% 200%;
    box-shadow: inset 0 0 1em #000, 0 0 1em #000;
    text-shadow: 1px 1px 0 red;
    margin: auto;
}

.c7cb-header-info { display: flex; align-items: center; gap: 10px; }

/* Avatar circular com ícone de interrogação animado */
.c7cb-avatar {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.c7cb-avatar-icon { animation: c7cb-avatar-pulse 2s infinite; }
@keyframes c7cb-avatar-pulse {
  0%, 100% { transform: scale(1);   }
  50%       { transform: scale(1.1); }
}

.c7cb-widget-header strong {
    display: inline-flex;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
}

/* Badge online/offline */
.c7cb-online-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 20px;
  display: inline-block;
  margin-top: 2px;
}
.c7cb-online-badge.online  { background: rgba(255,255,255,.25); }
.c7cb-online-badge.offline { background: rgba(0,0,0,.2); }

/* Botões de controle (minimizar / fechar) */
.c7cb-header-actions { display: flex; gap: 6px; }
.c7cb-icon-btn {
  width: 28px; height: 28px;
  background: rgba(255,255,255,.2);
  border: none; border-radius: 50%;
  color: #fff;
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.c7cb-icon-btn:hover { background: rgba(255,255,255,.35); }

/* ══════════════════════════════════════════
   SCREENS
══════════════════════════════════════════ */
.c7cb-screen { display: none; flex-direction: column; flex: 1; overflow: hidden; }
.c7cb-screen.active { display: none; }

/* ══════════════════════════════════════════
   TELA WELCOME — escolha de canal
══════════════════════════════════════════ */
.c7cb-welcome-msg { padding: 18px 16px 8px; background: var(--c7cb-chat-bg); }

.c7cb-bot-bubble {
  background: #fff;
  border-radius: 14px 14px 14px 4px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  max-width: 90%;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

/* Grid de canais — fundo verde-claro igual à imagem */
.c7cb-channel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px 16px 16px;
  background: var(--c7cb-chat-bg);
  flex: 1;
}

.c7cb-channel-card {
  background: #fff;
  border: 2px solid #0ea5e9;          /* borda azul-ciano da imagem */
  border-radius: var(--c7cb-radius);
  padding: 18px 10px;
  cursor: pointer;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: border-color .2s, transform .15s, box-shadow .2s;
  box-shadow: inset 0 0 8px rgba(0,0,0,.1), 0 0 6px rgba(0,0,0,.12);
}
.c7cb-channel-card:hover {
  border-color: var(--c7cb-primary);
  transform: translateY(-2px);
  box-shadow: inset 0 0 10px rgba(0,0,0,.12), 0 6px 16px rgba(0,0,0,.12);
}
.c7cb-channel-card:active { transform: scale(.97); }

.c7cb-channel-icon { font-size: 36px; }
.c7cb-channel-card strong { font-size: 13px; font-weight: 800; color: #222; }
.c7cb-channel-card small  { font-size: 11px; color: #555; }

/* Timestamp / rodapé da tela welcome */
.c7cb-welcome-footer {
  background: var(--c7cb-chat-bg);
  padding: 4px 16px 8px;
  font-size: 11px;
  color: #0066cc;
}

/* ══════════════════════════════════════════
   TELA CHAT
══════════════════════════════════════════ */
#c7cb-screen-chat { background: var(--c7cb-chat-bg); }

/* Lista de mensagens */
.c7cb-messages::-webkit-scrollbar { width: 4px; }
.c7cb-messages::-webkit-scrollbar-thumb { background: #b2dfdb; border-radius: 4px; }

.c7cb-messages {
    flex: 1;
    overflow-y: scroll; /* ✅ Mude de auto para scroll */
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--c7cb-chat-bg);
    border: 3px solid #c8e6c9;
    border-radius: var(--c7cb-radius-sm);
    margin: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--c7cb-primary) #f0f0f0;
    max-height: 320px;
}

/* ✅ Estilização para browsers WebKit (Chrome, Safari, Edge) */
.c7cb-messages::-webkit-scrollbar {
    width: 6px;
}

.c7cb-messages::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.c7cb-messages::-webkit-scrollbar-thumb {
    background: var(--c7cb-primary);
    border-radius: 3px;
}

.c7cb-messages::-webkit-scrollbar-thumb:hover {
    background: var(--c7cb-primary-hover);
}

/* Mensagem base */
.c7cb-msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 82%;
  animation: c7cb-fade-in .2s ease;
}


@keyframes c7cb-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.c7cb-msg.bot  { align-self: flex-start; flex-direction: row; }
.c7cb-msg.user { align-self: flex-end;   flex-direction: row-reverse; }

/* Avatar da mensagem */
.c7cb-msg-avatar {
  width: 30px; height: 30px;
  min-width: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.c7cb-msg-avatar.bot  { background: #f3f4f6; }
.c7cb-msg-avatar.user { background: linear-gradient(135deg,#10b981,#059669); color: #fff; }

/* Balão */
.c7cb-bubble {
  padding: 9px 13px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
.c7cb-msg.bot  .c7cb-bubble {
  background: var(--c7cb-msg-bot-bg);
  color: var(--c7cb-msg-bot-color);
  border-radius: 14px 14px 14px 4px;
}
.c7cb-msg.user .c7cb-bubble {
  background: var(--c7cb-msg-user-bg);
  color: var(--c7cb-msg-user-color);
  border-radius: 14px 14px 4px 14px;
}

/* Meta (hora, status) */
.c7cb-msg-meta {
  display: flex; gap: 6px;
  font-size: 11px;
  color: #6b7280;
  margin-top: 3px;
  padding: 0 4px;
}
.c7cb-msg.user .c7cb-msg-meta { justify-content: flex-end; }

/* ══════════════════════════════════════════
   INDICADOR DE DIGITAÇÃO
══════════════════════════════════════════ */
.c7cb-typing {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: var(--c7cb-chat-bg);
}
.c7cb-typing-dots { display: flex; gap: 4px; }
.c7cb-typing-dots span {
  width: 7px; height: 7px;
  background: #aaa;
  border-radius: 50%;
  animation: c7cb-bounce .9s infinite;
}
.c7cb-typing-dots span:nth-child(2) { animation-delay: .15s; }
.c7cb-typing-dots span:nth-child(3) { animation-delay: .30s; }
@keyframes c7cb-bounce {
  0%,60%,100% { transform: translateY(0); }
  30%          { transform: translateY(-5px); }
}
.c7cb-typing-text { font-size: 12px; color: #6b7280; }

/* ══════════════════════════════════════════
   ÁREA DE INPUT
══════════════════════════════════════════ */
.c7cb-input-area {
  background: var(--c7cb-input-bg);
  border-top: 1px solid var(--c7cb-border);
  padding: 8px 10px 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Linha principal: botão voltar + input + emoji + enviar */
.c7cb-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

/* Botão voltar — dourado como na imagem */
.c7cb-back-btn {
  width: 36px; height: 36px;
  border: none; border-radius: 8px;
  background: #f5c518;              /* dourado */
  box-shadow: inset 0 0 8px rgba(0,0,0,.2), 0 0 6px rgba(0,0,0,.15);
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .15s;
  color: #fff;
}
.c7cb-back-btn:hover  { background: #d4a800; }
.c7cb-back-btn:active { transform: scale(.95); }

/* Botão upload de arquivo */
.c7cb-file-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px !important;
    background: #f5c518;
    box-shadow: inset 0 0 8px rgb(0 0 0 / .2), 0 0 6px rgb(0 0 0 / .15);
    font-size: 20px !important;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    margin: auto;
}
.c7cb-file-btn:hover { background: #d4a800; }

/* Wrapper do contenteditable + emoji-btn */
.c7cb-input-wrapper > div { flex: 1; position: relative; }

/* Input (contenteditable) */
.c7cb-input {
  width: 100%;
  min-height: 40px;
  max-height: 120px;
  overflow-y: auto;
  padding: 9px 40px 9px 12px;
  border: 1px solid var(--c7cb-border);
  border-radius: var(--c7cb-radius-sm);
  background: #fff;
  font-family: var(--c7cb-font);
  font-size: 13.5px;
  line-height: 1.45;
  color: #111;
  outline: none;
  box-sizing: border-box;
  white-space: pre-wrap;
  word-wrap: break-word;
  transition: border-color .2s, box-shadow .2s;
}
.c7cb-input:focus {
  border-color: var(--c7cb-primary);
  box-shadow: 0 0 0 3px rgba(37,211,102,.15);
}
/* Placeholder via data-attribute */
.c7cb-input:empty::before {
  content: attr(data-placeholder);
  color: #9ca3af;
  pointer-events: none;
  display: block;
  font-style: italic;
}
.c7cb-input:focus::before { content: ''; }

/* Feedback de coleta de nome */
.c7cb-input[data-collecting-name="true"] {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102,126,234,.15);
}

/* Drag-over para upload */
.c7cb-input.drag-over {
  border: 2px dashed var(--c7cb-primary) !important;
  background: #f0fdf4 !important;
  box-shadow: 0 0 16px rgba(37,211,102,.3) !important;
}

/* Botão emoji */
.c7cb-emoji-btn {
  position: absolute;
  right: 8px; bottom: 8px;
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 2px;
  line-height: 1;
  z-index: 2;
  transition: transform .15s;
}
.c7cb-emoji-btn:hover { transform: scale(1.15); }

/* Botão enviar — verde com sombra como na imagem */
.c7cb-send-btn {
  width: 36px; height: 36px;
  border: none; border-radius: 8px;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 8px rgba(0,0,0,.2), 0 0 6px rgba(0,0,0,.15);
  transition: opacity .2s, transform .15s;
  margin: auto;
}
.c7cb-send-btn:hover    { opacity: .88; transform: scale(1.06); }
.c7cb-send-btn:active   { transform: scale(.95); }
.c7cb-send-btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

/* Animação pulso no botão enviar quando nome válido */
.c7cb-send-btn:not([disabled]).pulse {
  animation: c7cb-pulse-btn 2s ease-in-out infinite;
}
@keyframes c7cb-pulse-btn {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.06); }
}

/* Rodapé do input: contador + privacidade */
.c7cb-input-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2px 2px;
}
.c7cb-char-count { font-size: 10px; color: #aaa; }

/* Barra de privacidade */
.c7cb-privacy-bar { background: var(--c7cb-input-bg); padding: 2px 10px 6px; }
.c7cb-privacy-link {
  font-size: 11px;
  color: #05c1a0;
  text-decoration: none;
  display: block;
  text-align: center;
}
.c7cb-privacy-link:hover { text-decoration: underline; }

/* ══════════════════════════════════════════
   TELA WHATSAPP — QR Code
══════════════════════════════════════════ */
.c7cb-qr-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px;
  overflow-y: auto;
  gap: 14px;
  background: var(--c7cb-chat-bg);
}
.c7cb-qr-header { text-align: center; }
.c7cb-qr-header h3 { margin: 0 0 4px; font-size: 16px; font-weight: 800; color: #222; }
.c7cb-qr-header p  { margin: 0; font-size: 12.5px; color: #555; }

.c7cb-qr-wrapper {
  width: 180px; height: 180px;
  background: #fff;
  border-radius: var(--c7cb-radius-sm);
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.c7cb-qr-wrapper img { width: 100%; height: 100%; }

.c7cb-wa-btn {
  display: inline-block;
  padding: 11px 24px;
  border-radius: 50px;
  color: #fff;
  font-weight: 800;
  font-size: 13.5px;
  text-decoration: none;
  background: #25d366;
  transition: opacity .2s;
}
.c7cb-wa-btn:hover { opacity: .88; color: #fff; }

.c7cb-wa-capture {
  width: 100%;
  background: #fff;
  border-radius: var(--c7cb-radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.c7cb-wa-capture p { margin: 0 0 4px; font-size: 12.5px; color: #555; font-weight: 700; }

.c7cb-input-field {
  width: 100%;
  border: 1px solid var(--c7cb-border);
  border-radius: var(--c7cb-radius-sm);
  padding: 9px 12px;
  font-family: var(--c7cb-font);
  font-size: 13.5px;
  outline: none;
  box-sizing: border-box;
  transition: border-color .2s;
}
.c7cb-input-field:focus { border-color: #25d366; }

.c7cb-wa-confirm-btn {
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: var(--c7cb-radius-sm);
  color: #fff;
  font-family: var(--c7cb-font);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: opacity .2s;
}
.c7cb-wa-confirm-btn:hover { opacity: .88; }

.c7cb-qr-back {
  border-radius: 20px;
  padding: 6px 20px;
  width: auto;
  font-size: 13px;
}

/* ══════════════════════════════════════════
   MENSAGENS — TIPOS (bot / atendente / cliente)
══════════════════════════════════════════ */
.c7cb-msg.c7cb-msg-attendant .c7cb-bubble {
  background: #fff3cd;
  color: #856404;
  border-radius: 14px 14px 14px 4px;
}
.c7cb-msg-avatar.attendant {
  background: linear-gradient(135deg,#f093fb,#f5576c);
  color: #fff;
}

/* ══════════════════════════════════════════
   MENU E SELEÇÃO DE CANAL
══════════════════════════════════════════ */
.c7cb-menu {
  padding: 12px;
  background: #f9fafb;
  border-radius: var(--c7cb-radius-sm);
  margin: 6px 0;
}
.c7cb-menu-options { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

.c7cb-menu-btn {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: #fff;
  border: 2px solid #000;
  border-radius: var(--c7cb-radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #4d00ff;
  box-shadow: inset 0 0 8px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.12);
  transition: all .25s;
}
.c7cb-menu-btn:hover:not(:disabled) {
  background: var(--c7cb-primary);
  border-color: var(--c7cb-primary);
  color: #fff;
  transform: translateX(4px);
}
.c7cb-menu-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ══════════════════════════════════════════
   AVALIAÇÃO (estrelas)
══════════════════════════════════════════ */
.c7cb-rating-widget {
  background: #f8f9ff;
  border: 2px solid #e0e7ff;
  border-radius: var(--c7cb-radius-sm);
  padding: 16px;
  margin: 10px 0;
  animation: c7cb-fade-in .4s ease;
}
.c7cb-stars-container {
  display: flex;
  justify-content: space-around;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.c7cb-star-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px;
  border-radius: var(--c7cb-radius-sm);
  background: #fff;
  border: 2px solid transparent;
  cursor: pointer;
  min-width: 52px;
  transition: all .25s;
}
.c7cb-star-wrapper:hover {
  transform: translateY(-4px) scale(1.04);
  border-color: #667eea;
  box-shadow: 0 6px 16px rgba(102,126,234,.25);
}
.c7cb-star-wrapper.selected {
  border-color: #667eea;
  background: linear-gradient(135deg,#667eea,#764ba2);
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 8px 20px rgba(102,126,234,.4);
}
.c7cb-star-wrapper[data-rating="5"]:hover   { background: linear-gradient(135deg,#ffd700,#ff8c00); border-color: #ffa500; }
.c7cb-star-wrapper[data-rating="5"].selected{ background: linear-gradient(135deg,#ffd700,#ff8c00); animation: c7cb-gold-glow 1.5s infinite; }
@keyframes c7cb-gold-glow {
  0%,100% { box-shadow: 0 8px 20px rgba(255,215,0,.5); }
  50%      { box-shadow: 0 8px 28px rgba(255,215,0,.8); }
}
.c7cb-star-label { font-size: 13px; font-weight: 700; color: #4a5568; transition: color .2s; }
.c7cb-star-wrapper.selected .c7cb-star-label { color: #fff; }
.c7cb-star-icon { font-size: 26px; transition: all .25s; }

.c7cb-rating-comment {
  width: 100%;
  padding: 10px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13.5px;
  font-family: var(--c7cb-font);
  resize: vertical;
  min-height: 72px;
  box-sizing: border-box;
  transition: border-color .2s;
}
.c7cb-rating-comment:focus { outline: none; border-color: #667eea; }

.c7cb-rating-submit {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  background: linear-gradient(135deg,#667eea,#764ba2);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px; font-weight: 800;
  cursor: pointer;
  transition: all .25s;
  box-shadow: 0 4px 12px rgba(102,126,234,.35);
}
.c7cb-rating-submit:hover:not(:disabled) { transform: translateY(-2px); opacity: .9; }
.c7cb-rating-submit:disabled { opacity: .55; cursor: not-allowed; background: #a0aec0; }

/* ══════════════════════════════════════════
   PROTOCOLO
══════════════════════════════════════════ */
.c7cb-protocol-display {
  background: #f0f9ff;
  border: 2px solid #0ea5e9;
  border-radius: var(--c7cb-radius-sm);
  padding: 14px;
  text-align: center;
  margin: 8px 0;
  animation: c7cb-protocol-reveal .5s ease;
}
@keyframes c7cb-protocol-reveal {
  0%   { opacity: 0; transform: scale(.9); }
  50%  { transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}
.c7cb-protocol-code {
  font-size: 26px;
  font-weight: 800;
  color: #0369a1;
  letter-spacing: 3px;
  font-family: 'Courier New', monospace;
  background: #fff;
  border-radius: 6px;
  display: inline-block;
  padding: 8px 14px;
  margin: 8px 0;
}
.c7cb-protocol-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  background: #e0f2fe; border: 1px solid #0ea5e9;
  border-radius: 10px;
  font-size: 11px; font-weight: 700;
  color: #0369a1;
  margin-left: 6px;
}

/* ══════════════════════════════════════════
   UPLOAD PROGRESS
══════════════════════════════════════════ */
.c7cb-upload-progress {
  animation: c7cb-fade-in .3s ease;
  padding: 6px 12px;
  background: #f0fdf4;
  border-radius: 6px;
  font-size: 12px;
  color: #166534;
}

/* ══════════════════════════════════════════
   NOTIFICAÇÃO / BADGE
══════════════════════════════════════════ */
.c7cb-notification-badge {
  position: absolute;
  top: -5px; right: -5px;
  background: #e74c3c;
  color: #fff;
  border-radius: 50%;
  width: 20px; height: 20px;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
  animation: c7cb-pulse-dot 2s infinite;
}

/* ══════════════════════════════════════════
   MODAL — POLÍTICA DE PRIVACIDADE
══════════════════════════════════════════ */
.c7cb-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: calc(var(--c7cb-z) + 10);
  align-items: center;
  justify-content: center;
}
.c7cb-modal.open { display: flex; }
.c7cb-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
}
.c7cb-modal-box {
  position: relative;
  background: #fff;
  border-radius: var(--c7cb-radius);
  padding: 24px;
  max-width: 380px;
  width: 90%;
  z-index: 1;
  box-shadow: var(--c7cb-shadow-lg);
  max-height: 80vh;
  overflow-y: auto;
}
.c7cb-modal-close {
  position: absolute;
  top: 12px; right: 12px;
  background: none; border: none;
  font-size: 20px; cursor: pointer;
  color: #666; line-height: 1;
}
.c7cb-modal-accept {
  display: block; width: 100%;
  margin-top: 16px;
  padding: 11px;
  border: none; border-radius: 8px;
  background: var(--c7cb-primary);
  color: #fff;
  font-size: 14px; font-weight: 800;
  cursor: pointer;
  transition: opacity .2s;
}
.c7cb-modal-accept:hover { opacity: .88; }

/* ══════════════════════════════════════════
   INATIVIDADE — AVISO PULSANTE
══════════════════════════════════════════ */
.c7cb-inactivity-warning {
  animation: c7cb-warning-pulse 1.5s infinite;
}
@keyframes c7cb-warning-pulse {
  0%,100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245,158,11,.7); }
  50%      { transform: scale(1.02); box-shadow: 0 0 18px 8px rgba(245,158,11,0); }
}

/* ══════════════════════════════════════════
   RESPONSIVO — MOBILE
══════════════════════════════════════════ */
@media (max-width: 420px) {
  .c7cb-widget {
    width: calc(100vw - 20px);
    right: 10px !important;
    left: auto !important;
    transform: none !important;
    max-height: calc(100vh - 110px);
  }
  .c7cb-pos-bottom-center .c7cb-widget {
    left: 10px !important;
    transform: none !important;
  }
  .c7cb-msg-avatar { width: 26px; height: 26px; min-width: 26px; font-size: 11px; }
  .c7cb-bubble { padding: 8px 11px; font-size: 13px; }
  .c7cb-star-wrapper { min-width: 44px; padding: 8px; }
  .c7cb-star-icon { font-size: 20px; }
}