<style>
    * { box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
    body { margin: 0; display: flex; height: 100vh; overflow: hidden; background: #f4f7f6; }

    /* --- LADO ESQUERDO: LIVE PREVIEW --- */
    .preview-pane { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 2rem; position: relative; background: #000; overflow: hidden; }
    .admin-bg-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; transition: opacity 1.5s ease-in-out; background-size: cover; background-position: center; opacity: 0; }
    .admin-bg-layer.active { opacity: 1; }
    .preview-pane::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.4); z-index: 1; }
    
    .preview-content { position: relative; z-index: 2; width: 100%; transition: transform 0.1s ease-out; transform-style: preserve-3d; }
    .hero-logo { max-width: 140px; max-height: 140px; object-fit: contain; margin: 0 auto 1.5rem auto; display: block; filter: drop-shadow(0 5px 15px rgba(0,0,0,0.4)); border-radius: 12px; }
    .preview-pane h1 { font-size: 3.5rem; margin-top: 0; margin-bottom: 1rem; text-shadow: 0 10px 20px rgba(0,0,0,0.5); }
    .preview-pane p { font-size: 1.2rem; max-width: 600px; text-shadow: 0 2px 5px rgba(0,0,0,0.5); margin: 0 auto 2rem auto; line-height: 1.5; white-space: pre-wrap; }

    /* WHATSAPP PREVIEW STYLE */
    .wa-fab-container { position: absolute; bottom: 30px; right: 30px; z-index: 1000; display: flex; align-items: flex-end; transition: transform 0.2s ease-out; }
    @keyframes pulse-live {
      0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); transform: scale(1); }
      70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); transform: scale(1.05); }
      100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); transform: scale(1); }
    }
    .wa-fab { width: 65px; height: 65px; background: #25D366; border-radius: 50%; display: flex; justify-content: center; align-items: center; cursor: pointer; border: none; outline: none; box-shadow: 0 10px 20px rgba(37, 211, 102, 0.4); animation: pulse-live 2s infinite; position: relative; }
    .wa-fab svg { width: 35px; height: 35px; fill: white; }
    .wa-fab-badge { position: absolute; top: -5px; right: -5px; width: 22px; height: 22px; background: #ff3b30; color: white; border-radius: 50%; font-size: 14px; font-weight: bold; display: flex; justify-content: center; align-items: center; visibility: hidden; z-index: 1001; }
    
    .wa-chat-box { position: absolute; bottom: 85px; right: 0; width: 340px; background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(15px); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 20px; overflow: hidden; opacity: 0; visibility: hidden; transform: translateY(20px) scale(0.8); transition: all 0.4s; text-align: left; }
    .wa-chat-box.active { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
    .chat-header { background: #128C7E; padding: 15px 20px; display: flex; align-items: center; gap: 15px; }
    .avatar { width: 45px; height: 45px; background: white; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-weight: bold; color: #128C7E; font-size: 1.2rem; overflow: hidden; }
    .chat-header-info h3 { font-size: 1.1rem; margin: 0; color: white; text-shadow: none; }
    .chat-header-info p { font-size: 0.8rem; color: #dcf8c6; margin: 0; text-shadow: none; }
    .chat-body { padding: 20px; min-height: 100px; background: rgba(0, 0, 0, 0.2); }
    
    .typing-dots { display: none; text-align: center; padding: 10px; }
    .typing-dots .dot { display: inline-block; width: 8px; height: 8px; margin: 0 2px; background: #9cabb3; border-radius: 50%; opacity: 0; animation: typing-dots-anim 1.5s infinite; }
    .typing-dots .dot:nth-child(2) { animation-delay: 0.2s; }
    .typing-dots .dot:nth-child(3) { animation-delay: 0.4s; }
    @keyframes typing-dots-anim { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
    
    .message-content { display: none; background: white; color: #333; padding: 12px 15px; border-radius: 0 15px 15px 15px; font-size: 0.95rem; text-shadow: none; }
    .chat-footer { display: none; padding: 15px; text-align: center; background: rgba(255, 255, 255, 0.05); }
    .start-chat-btn { display: inline-block; width: 100%; padding: 12px; background: #25D366; color: white; text-decoration: none; font-weight: bold; border-radius: 25px; }

    /* Controladores de Estado da Animação */
    .typing-active .typing-dots { display: block !important; }
    .message-active .message-content, .message-active .chat-footer { display: block !important; }

    /* --- LADO DIREITO: PAINEL DE CONTROLE --- */
    .admin-pane { width: 420px; height: 100vh; padding: 10px; display: flex; flex-direction: column; background: #f9fbfb; border-left: 1px solid #e0e0e0; overflow-y: auto;}
    .admin-container { background: white; padding: 15px; border-radius: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); display: flex; flex-direction: column; gap: 8px;}
    .admin-container h2 { margin: 0 0 5px 0; color: #128C7E; border-bottom: 2px solid #eee; padding-bottom: 5px; font-size: 1.2rem; display: flex; justify-content: space-between; align-items: center;}
    .badge-pro { background: #111; color: #fff; font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; margin-left: 5px; }

    .form-group { margin-bottom: 5px; }
    .form-row { display: flex; gap: 10px; }
    .form-row .form-group { flex: 1; }
    label { display: block; font-weight: bold; margin-bottom: 2px; color: #555; font-size: 0.75rem; }
    input[type="text"], textarea, select { width: 100%; padding: 6px 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 0.85rem; }
    input[type="color"] { width: 100%; height: 32px; border: 1px solid #ccc; border-radius: 4px; cursor: pointer; padding: 1px; }
    textarea { resize: none; height: 50px; } 

    .btn-export { background: #111; color: white; border: none; padding: 12px 15px; font-size: 0.95rem; border-radius: 6px; cursor: pointer; font-weight: bold; width: 100%; margin-top: 10px; display: flex; justify-content: center; align-items: center; gap: 8px; transition: 0.2s;}
    .btn-export:hover { background: #333; transform: translateY(-2px); }
    .btn-replay { background: #e9ecef; border: 1px solid #ced4da; padding: 4px 8px; font-size: 0.75rem; border-radius: 4px; cursor: pointer; font-weight: bold; }

    .file-input-row { display: flex; gap: 8px; align-items: center; margin-top: 2px;}
    .btn-secondary { background: #6c757d; color: white; border: none; padding: 6px 10px; font-size: 0.75rem; border-radius: 4px; cursor: pointer; height: 30px; white-space: nowrap; transition: 0.2s;}
    .btn-secondary:hover { background: #5a6268; }
    
    .preset-grid { display: flex; gap: 6px; flex-wrap: wrap; background: #f4f7f6; padding: 6px; border-radius: 6px; border: 1px solid #eee; margin-top: 5px;}
    .preset-btn { width: 26px; height: 26px; border-radius: 50%; border: 2px solid white; box-shadow: 0 1px 3px rgba(0,0,0,0.2); cursor: pointer; transition: transform 0.2s; position: relative; }
    .preset-btn:hover { transform: scale(1.2); border-color: #25D366; }
    .preset-btn::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 10px; height: 10px; border-radius: 50%; background-color: var(--txt-color); }

    .thumbnails { display: flex; gap: 5px; margin-top: 5px; flex-wrap: wrap; min-height: 35px; align-items: center;}
    .thumb { width: 45px; height: 30px; border-radius: 3px; object-fit: cover; border: 1px solid #ccc; }
    .success-msg { display: none; background: #d4edda; color: #155724; padding: 12px; border-radius: 6px; margin-top: 8px; text-align: center; font-size: 0.95rem; border: 1px solid #c3e6cb;}

    .footer-area { display: flex; flex-direction: column; align-items: center; margin-top: auto; padding: 15px 0; gap: 10px;}
    #qrcode { padding: 10px; background: white; border-radius: 8px; border: 1px solid #eee;}
    .links a { color: #128C7E; text-decoration: none; font-weight: bold; font-size: 0.9rem; }
    
    /* Novo estilo para a caixa de embed */
    .embed-box { width: 90%; text-align: center; margin-top: 5px; }
    .embed-box p { font-size: 0.75rem; color: #555; margin: 0 0 5px 0; font-weight: bold; }
    .embed-box textarea { width: 100%; height: 50px; font-family: monospace; font-size: 0.7rem; background: #eee; border: 1px solid #ccc; border-radius: 4px; padding: 5px; cursor: text; resize: none; color: #333; }

    @media (max-width: 800px) { .preview-pane { display: none; } .admin-pane { width: 100%; } }
  </style>