export const lang = {
    current: 'pt',
    languages: [
        { code: 'pt', label: '🇧🇷 PT' },
        { code: 'en-uk', label: '🇬🇧 EN' },
        { code: 'es', label: '🇪🇸 ES' },
        { code: 'fr', label: '🇫🇷 FR' }
    ],
    db: {
        pt: {
            lang_label: "PTBR",
            lang_title: "Idioma",
            manifesto_title: "MANIFESTO T∅T",
            manifesto_subtitle: "O editor portátil, transitório e resistente.",
            manifesto_body: "<div class=\"manifesto-grid\"><div class=\"manifesto-card\"><h3><span class=\"manifesto-badge\">01</span> DESKTOP FIRST</h3><p>Feito para escritores. Foco total. Saída limpa.</p></div><div class=\"manifesto-card\"><h3><span class=\"manifesto-badge\">02</span> MOBILE = SCANNER + MEMO</h3><p>Celular lê QR e guarda notas rápidas. Exporta JSON → desktop.</p></div><div class=\"manifesto-card\"><h3><span class=\"manifesto-badge\">03</span> ENTREGA</h3><p><span class=\"manifesto-key\">Cápsula local</span> + chave de extração (.tot/QR). Tudo offline.</p></div><div class=\"manifesto-card\"><h3><span class=\"manifesto-badge\">04</span> PROVA TÉCNICA</h3><p>Sem autoria oficial. Hash criptográfico + metadados de digitação.</p></div><div class=\"manifesto-card\"><h3><span class=\"manifesto-badge\">05</span> CERTIDÃO</h3><p>Hash, caracteres, keystrokes, primeiro/último toque, origem.</p></div><div class=\"manifesto-card\"><h3><span class=\"manifesto-badge\">06</span> NÃO PROMETE</h3><p>Sem nuvem, sem cartório, sem garantia legal absoluta.</p></div><div class=\"manifesto-card\"><h3><span class=\"manifesto-badge\">07</span> ÂNCORA OPCIONAL</h3><p>Publique o hash quando quiser. Você decide.</p></div></div><p class=\"manifesto-note\">Ao continuar, você entende os limites e aceita o manifesto.</p>",
            manifesto_accept: "LI E ENTENDI",
            welcome: "INICIALIZANDO SISTEMA",
            create_pass: "CRIE SUA SENHA DE ACESSO",
            repeat_pass: "CONFIRME A SENHA",
            start_btn: "CRIAR SESSÃO",
            locked: "SISTEMA BLOQUEADO",
            unlock_btn: "DESBLOQUEAR",
            wrong_pass: "SENHA INCORRETA",
            reset_warn: "PERIGO: ISSO APAGARÁ TUDO. CONTINUAR?",
            reset_invalid: "SENHAS INVÁLIDAS OU DIVERGENTES.",
            reset_cancel: "SENHA INCORRETA. OPERAÇÃO CANCELADA.",
            reset_prompt: "DIGITE A SENHA DE ACESSO PARA CONFIRMAR O EXTERMÍNIO:",
            modal_title: "CONFIRMAÇÃO",
            modal_ok: "OK",
            modal_cancel: "CANCELAR",
            project_delete_confirm: "Apagar arquivo",
            stats_chars: "CHARS",
            stats_words: "WORDS",
            stats_label: "CHARS: 0 | WORDS: 0",
            marquee_ready: "/// SISTEMA PRONTO /// PRESSIONE [F1] PARA AJUDA :: DIGITE --H NO EDITOR",
            font_title: "Mudar Fonte [Alt+F]",
            save_title: "Salvar [Ctrl+S]",
            export_btn: "EXPORTAR",
            search_ph: "Buscar... [Ctrl+F]",
            search_go: "IR",
            audio_title: "Música [Alt+M]",
            audio_btn: "SOM",
            reader_title: "Modo Leitor",
            reader_btn: "LEITOR",
            xray_title: "Modo Raio-X",
            xray_btn: "X-RAY",
            lock_title: "Bloquear Tela [Alt+L]",
            lock_btn: "LOCK",
            export_title: "PROTOCOLO DE EXTRAÇÃO",
            export_markdown: "EXPORTAR MARKDOWN",
            export_report_full: "IMPRESSÃO COMPLETA",
            export_qr_stream: "STREAM QR",
            export_social_title: "REDES FEDERADAS",
            export_social_bigtech: "REDES NAO FEDERADAS (ONDE VOCE NAO TEM CONTROLE SOBRE SEU CONTEUDO)",
            share_title: "DIVULGAR T∅T",
            share_copy: "COPIAR TEXTO",
            share_open: "ABRIR REDE",
            share_message: "Eu escrevo no 🔸 T∅T - Editor. Escreveu, exportou, apagou. Um bunker offline para escrever com privacidade. https://tot.undo.it/",
            fediverse_help: "NÃO SABE O QUE É O FEDIVERSO?",
            fediverse_title: "FEDIVERSO",
            fediverse_body: "<p>Pense em redes sociais como email: você pode usar qualquer provedor e falar com qualquer pessoa. O fediverso funciona assim.</p><p>Em vez de uma empresa mandar em tudo, várias comunidades se conectam. Você escolhe onde morar, leva seus dados e ainda conversa com todo mundo.</p><p>É menos vigilância, mais controle e mais liberdade.</p>",
            export_active: "ativo",
            export_all: "tudo",
            export_light: "luz",
            danger_zone: "ZONA DE PERIGO",
            reset_warn_body: "Isso apagará TODOS os arquivos e configurações.",
            reset_proof: "PROVA DE AUTORIA: DIGITE A PALAVRA",
            reset_keyword: "Palavra-chave",
            reset_validate: "VALIDAR PROVA",
            reset_confirm: "SIM, QUERO APAGAR",
            reset_password_prompt: "DIGITE SUA SENHA PARA AUTORIZAR A DESTRUIÇÃO:",
            reset_password_ph: "Senha de Acesso",
            reset_destroy: "DELETAR PARA SEMPRE",
            pomo_locked: "POMODORO BLOQUEADO",
            pomo_break: "PAUSA ATIVA",
            pomo_break_hint: "Desbloqueio exige a senha da sessão ao fim.",
            pomo_unlock_prompt: "DIGITE SUA SENHA PARA LIBERAR:",
            pomo_choice: "ESCOLHA O PRÓXIMO CICLO:",
            pomo_25: "25 MIN",
            pomo_55: "55 MIN",
            help_title: "MANUAL DE COMANDO",
            help_tab_general: "GERAL",
            help_tab_tools: "FERRAMENTAS",
            help_tab_nav: "NAVEGAÇÃO",
            help_tab_slash: "SLASH COMMANDS",
            help_help: "Ajuda",
            help_save: "Salvar / Exportar",
            help_open: "Abrir / Importar",
            help_fullscreen: "Tela Cheia (Zen)",
            help_search: "Buscar",
            help_close: "Fechar / Focar Editor",
            help_theme: "Trocar Tema",
            help_music: "Música (Play/Stop)",
            help_pomo: "Pomodoro (25m)",
            help_font: "Mudar Fonte",
            help_files: "Abrir Arquivos",
            help_nav: "Abrir Navegação",
            help_memo: "Abrir Memo",
            help_drawer_close: "Fechar Gaveta",
            help_slash_hint: "Digite no editor para ativar:",
            help_save_short: "Salvar",
            help_open_short: "Importar",
            help_theme_short: "Mudar Tema",
            help_fullscreen_short: "Tela Cheia",
            help_music_short: "Música",
            help_pomo_short: "Pomodoro",
            tab_files: "Arquivos [Alt+1]",
            tab_nav: "Navegação [Alt+2]",
            tab_memo: "Memo [Alt+3]",
            tab_theme: "Tema [Alt+T]",
            tab_books: "T∅TBooks [Alt+4]",
            hard_reset_title: "HARD RESET",
            fullscreen_title: "Tela Cheia [F11]",
            drawer_system: "SISTEMA",
            drawer_files: "ARQUIVOS",
            drawer_nav: "NAVEGAÇÃO",
            drawer_memo: "MEMO",
            btn_new_project: "+ NOVO",
            btn_import_title: "Importar JSON/TXT",
            btn_open: "ABRIR",
            btn_scan_qr: "Scan QR",
            btn_scan: "SCAN QR",
            nav_structure: "Estrutura do documento:",
            nav_insert: "INSERIR MARCADOR",
            nav_empty_hint: "Use \"Inserir Marcador\" para navegar.",
            nav_delete_confirm: "Apagar marcador",
            memo_ph: "Buffer de memória...",
            files_hint: "Gerencie seus arquivos e backups aqui.",
            nav_hint: "Veja a estrutura do documento e navegue pelos capítulos.",
            memo_hint: "Anote ideias rápidas sem afetar o texto principal.",
            mobile_theme: "TROCAR TEMA",
            mobile_full_enable: "ATIVAR MODO COMPLETO",
            mobile_full_disable: "VOLTAR PARA MEMO",
            mobile_memo_ph: "Nota rápida...",
            mobile_memo_tags: "Tags (separe por vírgula)",
            mobile_memo_add: "SALVAR NOTA",
            mobile_memo_delete: "APAGAR",
            mobile_export_memos: "EXPORTAR MEMOS",
            mobile_intro_title: "MODO MOBILE",
            mobile_intro_body: "<p>O mobile é reduzido ao essencial: scanner QR e notas rápidas.</p><p>Deslize para cima para esconder o scanner e escrever no memo.</p><p>Exporte JSON e importe no desktop para o projeto completo.</p>",
            mobile_intro_ok: "ENTENDI",
            offline_download: "BAIXAR APP OFFLINE",
            project_github: "GITHUB DO PROJETO",
            qr_stream_title: "STREAM QR",
            qr_stream_active: "STREAM ATIVO",
            qr_stream_pause: "PAUSAR",
            qr_stream_hint: "Feche para encerrar o envio.",
            qr_stream_instructions: "<p>1) No celular, abra o T∅T e vá em Arquivos → Scan QR.</p><p>2) Aponte para esta tela até completar.</p><p>3) Depois, apague tudo aqui.</p>",
            qr_scan_title: "SCAN QR",
            qr_scan_wait: "AGUARDANDO QR...",
            qr_scan_stop: "PARAR SCAN",
            qr_fallback_hint: "Sem câmera? Importe o arquivo .b64 ou cole a string.",
            qr_fallback_import: "IMPORTAR ARQUIVO",
            qr_fallback_paste: "Cole a string base64",
            qr_fallback_restore: "RESTAURAR",
            reader_glossary: "GLOSSÁRIO",
            lexicon_title: "DICIONARIO",
            lexicon_trans: "TRADUCOES",
            goal_label: "META",
            goal_done_title: "META CUMPRIDA",
            goal_done_body: "Parabéns, você atingiu sua meta de escrita.",
            goal_500_title: "500 PALAVRAS",
            goal_500_body: "Boa. Continue até 1000 palavras.",
            goal_1000_title: "1000 PALAVRAS",
            goal_1000_body: "Ótimo ritmo. Siga para 1500.",
            goal_1500_title: "1500 PALAVRAS",
            goal_1500_body: "Quase lá. Mire 2000.",
            goal_2000_title: "2000 PALAVRAS",
            goal_2000_body: "Excelente. Meta máxima atingida.",
            reader_glossary_title: "Glossário",
            reader_ruler_title: "Régua",
            reader_font_title: "Fonte",
            reader_theme_title: "Tema",
            reader_play_title: "Play",
            reader_close_title: "Fechar",
            default_project: "Rascunho Inicial",
            alert_backup_restored: "✅ BACKUP RESTAURADO COM SUCESSO!",
            alert_backup_invalid: "Erro: Backup inválido ou corrompido.",
            alert_capsule_restored: "✅ CÁPSULA T∅T RESTAURADA COM SUCESSO!",
            alert_capsule_invalid: "Erro: Cápsula inválida ou corrompida.",
            alert_backup_json_error: "Erro ao ler arquivo JSON.",
            prompt_file_name: "Nome do Arquivo:",
            reset_no_text: "SEM TEXTO PARA VALIDAR. CONTINUE COM A ETAPA 2.",
            reset_proof_ok: "PROVA ACEITA.",
            reset_proof_fail: "PALAVRA INCORRETA.",
            reset_executing: "EXECUTANDO PROTOCOLO...",
            reset_denied: "SENHA INCORRETA. ACESSO NEGADO.",
            pomo_unlocked: "ACESSO LIBERADO.",
            pomo_wrong_pass: "SENHA INCORRETA.",
            pomo_break_label: "PAUSA",
            qr_stream_paused: "STREAM PAUSADO",
            qr_stream_resume: "RETOMAR",
            qr_stream_empty: "SEM DADOS PARA STREAM.",
            qr_no_detector: "BarcodeDetector indisponível. Use importação por arquivo.",
            qr_using_fallback: "Decoder offline ativo. Aponte a câmera.",
            qr_camera_missing: "Elemento de câmera ausente.",
            qr_camera_blocked: "CÂMERA BLOQUEADA OU INDISPONÍVEL.",
            qr_receiving: "RECEBENDO",
            qr_restore_in_progress: "BACKUP COMPLETO. RESTAURANDO...",
            qr_decode_fail: "FALHA NA DECODIFICAÇÃO."
            ,
            qr_frame: "FRAME"
            ,
            confirm_exit: "Deseja encerrar o sistema?"
            ,
            chapter_title: "NOVO CAPÍTULO",
            chapter_placeholder: "..."
        },
        "en-uk": {
            lang_label: "ENG BRI",
            lang_title: "Language",
            manifesto_title: "T∅T MANIFESTO",
            manifesto_subtitle: "The portable, transient, resilient editor.",
            manifesto_body: "<div class=\"manifesto-grid\"><div class=\"manifesto-card\"><h3><span class=\"manifesto-badge\">01</span> DESKTOP FIRST</h3><p>Built for writers. Total focus. Clean exit.</p></div><div class=\"manifesto-card\"><h3><span class=\"manifesto-badge\">02</span> MOBILE = SCANNER + MEMO</h3><p>Phone reads QR and stores quick notes. Export JSON → desktop.</p></div><div class=\"manifesto-card\"><h3><span class=\"manifesto-badge\">03</span> DELIVERS</h3><p><span class=\"manifesto-key\">Local capsule</span> + extraction key (.tot/QR). Fully offline.</p></div><div class=\"manifesto-card\"><h3><span class=\"manifesto-badge\">04</span> TECHNICAL PROOF</h3><p>No official authorship. Cryptographic hash + typing metadata.</p></div><div class=\"manifesto-card\"><h3><span class=\"manifesto-badge\">05</span> BIRTH CERTIFICATE</h3><p>Hash, characters, keystrokes, first/last key, origin state.</p></div><div class=\"manifesto-card\"><h3><span class=\"manifesto-badge\">06</span> NOT PROMISED</h3><p>No cloud, no registry, no absolute legal guarantee.</p></div><div class=\"manifesto-card\"><h3><span class=\"manifesto-badge\">07</span> OPTIONAL ANCHOR</h3><p>Publish the hash when you want. Your call.</p></div></div><p class=\"manifesto-note\">By continuing, you understand the limits and accept the manifesto.</p>",
            manifesto_accept: "I READ AND UNDERSTAND",
            welcome: "SYSTEM BOOTING",
            create_pass: "CREATE ACCESS PASSWORD",
            repeat_pass: "CONFIRM PASSWORD",
            start_btn: "CREATE SESSION",
            locked: "SYSTEM LOCKED",
            unlock_btn: "UNLOCK",
            wrong_pass: "WRONG PASSWORD",
            reset_warn: "WARNING: THIS WILL WIPE EVERYTHING. PROCEED?",
            reset_invalid: "INVALID OR MISMATCHED PASSWORDS.",
            reset_cancel: "WRONG PASSWORD. OPERATION CANCELLED.",
            reset_prompt: "ENTER THE ACCESS PASSWORD TO CONFIRM ERASURE:",
            modal_title: "CONFIRMATION",
            modal_ok: "OK",
            modal_cancel: "CANCEL",
            project_delete_confirm: "Delete file",
            stats_chars: "CHARS",
            stats_words: "WORDS",
            stats_label: "CHARS: 0 | WORDS: 0",
            marquee_ready: "/// SYSTEM READY /// PRESS [F1] FOR HELP :: TYPE --H IN EDITOR",
            font_title: "Change Font [Alt+F]",
            save_title: "Save [Ctrl+S]",
            export_btn: "EXPORT",
            search_ph: "Search... [Ctrl+F]",
            search_go: "GO",
            audio_title: "Music [Alt+M]",
            audio_btn: "SOUND",
            reader_title: "Reader Mode",
            reader_btn: "READER",
            xray_title: "X-Ray Mode",
            xray_btn: "X-RAY",
            lock_title: "Lock Screen [Alt+L]",
            lock_btn: "LOCK",
            export_title: "EXPORT PROTOCOL",
            export_markdown: "EXPORT MARKDOWN",
            export_report_full: "FULL PRINT",
            export_qr_stream: "QR STREAM",
            export_social_title: "FEDERATED NETWORKS",
            export_social_bigtech: "NON-FEDERATED NETWORKS (NO REAL CONTROL OVER YOUR CONTENT)",
            share_title: "SHARE T∅T",
            share_copy: "COPY TEXT",
            share_open: "OPEN NETWORK",
            share_message: "I write on 🔸 T∅T - Editor. Wrote, exported, deleted. An offline bunker for private writing. https://tot.undo.it/",
            fediverse_help: "WHAT IS THE FEDIVERSE?",
            fediverse_title: "FEDIVERSE",
            fediverse_body: "<p>Think of social networks like email: you can pick any provider and still talk to everyone. The fediverse works the same way.</p><p>Instead of one company owning everything, many communities connect. You choose where to live, keep your data, and still reach everyone.</p><p>Less surveillance, more control, more freedom.</p>",
            export_active: "active",
            export_all: "all",
            export_light: "light",
            danger_zone: "DANGER ZONE",
            reset_warn_body: "This will delete ALL files and settings.",
            reset_proof: "PROOF OF AUTHORSHIP: TYPE THE WORD",
            reset_keyword: "Keyword",
            reset_validate: "VALIDATE PROOF",
            reset_confirm: "YES, DELETE",
            reset_password_prompt: "ENTER YOUR PASSWORD TO AUTHORISE DESTRUCTION:",
            reset_password_ph: "Access Password",
            reset_destroy: "DELETE FOREVER",
            pomo_locked: "POMODORO LOCKED",
            pomo_break: "BREAK ACTIVE",
            pomo_break_hint: "Unlock requires the session password at the end.",
            pomo_unlock_prompt: "ENTER YOUR PASSWORD TO UNLOCK:",
            pomo_choice: "CHOOSE NEXT CYCLE:",
            pomo_25: "25 MIN",
            pomo_55: "55 MIN",
            help_title: "COMMAND MANUAL",
            help_tab_general: "GENERAL",
            help_tab_tools: "TOOLS",
            help_tab_nav: "NAVIGATION",
            help_tab_slash: "SLASH COMMANDS",
            help_help: "Help",
            help_save: "Save / Export",
            help_open: "Open / Import",
            help_fullscreen: "Fullscreen (Zen)",
            help_search: "Search",
            help_close: "Close / Focus Editor",
            help_theme: "Switch Theme",
            help_music: "Music (Play/Stop)",
            help_pomo: "Pomodoro (25m)",
            help_font: "Change Font",
            help_files: "Open Files",
            help_nav: "Open Navigation",
            help_memo: "Open Memo",
            help_drawer_close: "Close Drawer",
            help_slash_hint: "Type in editor to trigger:",
            help_save_short: "Save",
            help_open_short: "Import",
            help_theme_short: "Switch Theme",
            help_fullscreen_short: "Fullscreen",
            help_music_short: "Music",
            help_pomo_short: "Pomodoro",
            tab_files: "Files [Alt+1]",
            tab_nav: "Navigation [Alt+2]",
            tab_memo: "Memo [Alt+3]",
            tab_theme: "Theme [Alt+T]",
            tab_books: "T∅TBooks [Alt+4]",
            hard_reset_title: "HARD RESET",
            fullscreen_title: "Fullscreen [F11]",
            drawer_system: "SYSTEM",
            drawer_files: "FILES",
            drawer_nav: "NAVIGATION",
            drawer_memo: "MEMO",
            btn_new_project: "+ NEW",
            btn_import_title: "Import JSON/TXT",
            btn_open: "OPEN",
            btn_scan_qr: "Scan QR",
            btn_scan: "SCAN QR",
            nav_structure: "Document structure:",
            nav_insert: "INSERT MARKER",
            nav_empty_hint: "Use \"Insert Marker\" to navigate.",
            nav_delete_confirm: "Delete marker",
            memo_ph: "Memory buffer...",
            files_hint: "Manage files and backups here.",
            nav_hint: "See the document structure and navigate chapters.",
            memo_hint: "Jot quick ideas without touching the main text.",
            mobile_theme: "CHANGE THEME",
            mobile_full_enable: "ENABLE FULL MODE",
            mobile_full_disable: "BACK TO MEMO",
            mobile_memo_ph: "Quick note...",
            mobile_memo_tags: "Tags (comma separated)",
            mobile_memo_add: "SAVE NOTE",
            mobile_memo_delete: "DELETE",
            mobile_export_memos: "EXPORT MEMOS",
            mobile_intro_title: "MOBILE MODE",
            mobile_intro_body: "<p>Mobile is reduced to essentials: QR scanner and quick notes.</p><p>Swipe up to hide the scanner and write in memo.</p><p>Export JSON and import on desktop for the full project.</p>",
            mobile_intro_ok: "GOT IT",
            offline_download: "DOWNLOAD OFFLINE APP",
            project_github: "PROJECT GITHUB",
            qr_stream_title: "QR STREAM",
            qr_stream_active: "STREAM ACTIVE",
            qr_stream_pause: "PAUSE",
            qr_stream_hint: "Close to end the stream.",
            qr_stream_instructions: "<p>1) On your phone, open T∅T and go to Files → Scan QR.</p><p>2) Point to this screen until it completes.</p><p>3) Then wipe everything here.</p>",
            qr_scan_title: "SCAN QR",
            qr_scan_wait: "WAITING FOR QR...",
            qr_scan_stop: "STOP SCAN",
            qr_fallback_hint: "No camera? Import the .b64 file or paste the string.",
            qr_fallback_import: "IMPORT FILE",
            qr_fallback_paste: "Paste the base64 string",
            qr_fallback_restore: "RESTORE",
            reader_glossary: "GLOSSARY",
            lexicon_title: "DICTIONARY",
            lexicon_trans: "TRANSLATIONS",
            goal_label: "GOAL",
            goal_done_title: "GOAL COMPLETE",
            goal_done_body: "Congrats, you reached your writing goal.",
            goal_500_title: "500 WORDS",
            goal_500_body: "Good. Keep going to 1000 words.",
            goal_1000_title: "1000 WORDS",
            goal_1000_body: "Great pace. Push for 1500.",
            goal_1500_title: "1500 WORDS",
            goal_1500_body: "Almost there. Aim for 2000.",
            goal_2000_title: "2000 WORDS",
            goal_2000_body: "Excellent. Max goal reached.",
            reader_glossary_title: "Glossary",
            reader_ruler_title: "Ruler",
            reader_font_title: "Font",
            reader_theme_title: "Theme",
            reader_play_title: "Play",
            reader_close_title: "Close",
            default_project: "Initial Draft",
            alert_backup_restored: "✅ BACKUP RESTORED SUCCESSFULLY!",
            alert_backup_invalid: "Error: Backup invalid or corrupted.",
            alert_capsule_restored: "✅ T∅T CAPSULE RESTORED SUCCESSFULLY!",
            alert_capsule_invalid: "Error: Capsule invalid or corrupted.",
            alert_backup_json_error: "Error reading JSON file.",
            prompt_file_name: "File Name:",
            reset_no_text: "NO TEXT TO VALIDATE. CONTINUE TO STEP 2.",
            reset_proof_ok: "PROOF ACCEPTED.",
            reset_proof_fail: "INCORRECT WORD.",
            reset_executing: "EXECUTING PROTOCOL...",
            reset_denied: "WRONG PASSWORD. ACCESS DENIED.",
            pomo_unlocked: "ACCESS GRANTED.",
            pomo_wrong_pass: "WRONG PASSWORD.",
            pomo_break_label: "BREAK",
            qr_stream_paused: "STREAM PAUSED",
            qr_stream_resume: "RESUME",
            qr_stream_empty: "NO DATA TO STREAM.",
            qr_no_detector: "BarcodeDetector unavailable. Use file import.",
            qr_using_fallback: "Offline decoder active. Point the camera.",
            qr_camera_missing: "Camera element missing.",
            qr_camera_blocked: "CAMERA BLOCKED OR UNAVAILABLE.",
            qr_receiving: "RECEIVING",
            qr_restore_in_progress: "BACKUP COMPLETE. RESTORING...",
            qr_decode_fail: "DECODE FAILED."
            ,
            qr_frame: "FRAME"
            ,
            confirm_exit: "Do you want to close the system?"
            ,
            chapter_title: "NEW CHAPTER",
            chapter_placeholder: "..."
        },
        es: {
            lang_label: "ESP",
            lang_title: "Idioma",
            manifesto_title: "MANIFIESTO T∅T",
            manifesto_subtitle: "El editor portátil, transitorio y resistente.",
            manifesto_body: "<div class=\"manifesto-grid\"><div class=\"manifesto-card\"><h3><span class=\"manifesto-badge\">01</span> DESKTOP FIRST</h3><p>Hecho para escritores. Foco total. Salida limpia.</p></div><div class=\"manifesto-card\"><h3><span class=\"manifesto-badge\">02</span> MÓVIL = SCANNER + MEMO</h3><p>El móvil lee QR y guarda notas rápidas. Exporta JSON → desktop.</p></div><div class=\"manifesto-card\"><h3><span class=\"manifesto-badge\">03</span> ENTREGA</h3><p><span class=\"manifesto-key\">Cápsula local</span> + clave de extracción (.tot/QR). Todo offline.</p></div><div class=\"manifesto-card\"><h3><span class=\"manifesto-badge\">04</span> PRUEBA TÉCNICA</h3><p>Sin autoría oficial. Hash criptográfico + metadatos de digitación.</p></div><div class=\"manifesto-card\"><h3><span class=\"manifesto-badge\">05</span> CERTIFICADO</h3><p>Hash, caracteres, pulsaciones, primera/última tecla, origen.</p></div><div class=\"manifesto-card\"><h3><span class=\"manifesto-badge\">06</span> NO PROMETE</h3><p>Sin nube, sin registro oficial, sin garantía legal absoluta.</p></div><div class=\"manifesto-card\"><h3><span class=\"manifesto-badge\">07</span> ANCLA OPCIONAL</h3><p>Publica el hash cuando quieras. Tu decides.</p></div></div><p class=\"manifesto-note\">Al continuar, entiendes los límites y aceptas el manifiesto.</p>",
            manifesto_accept: "LEÍ Y ENTENDÍ",
            welcome: "INICIANDO SISTEMA",
            create_pass: "CREAR CONTRASEÑA",
            repeat_pass: "CONFIRMAR CONTRASEÑA",
            start_btn: "CREAR SESIÓN",
            locked: "SISTEMA BLOQUEADO",
            unlock_btn: "DESBLOQUEAR",
            wrong_pass: "CONTRASEÑA INCORRECTA",
            reset_warn: "PELIGRO: ESTO BORRARÁ TODO. ¿SEGUIR?",
            reset_invalid: "CONTRASEÑAS INVÁLIDAS O DIFERENTES.",
            reset_cancel: "CONTRASEÑA INCORRECTA. OPERACIÓN CANCELADA.",
            reset_prompt: "INGRESE LA CONTRASEÑA PARA CONFIRMAR EL BORRADO:",
            modal_title: "CONFIRMACIÓN",
            modal_ok: "OK",
            modal_cancel: "CANCELAR",
            project_delete_confirm: "Borrar archivo",
            stats_chars: "CHARS",
            stats_words: "WORDS",
            stats_label: "CHARS: 0 | WORDS: 0",
            marquee_ready: "/// SISTEMA LISTO /// PRESIONE [F1] PARA AYUDA :: ESCRIBA --H EN EL EDITOR",
            font_title: "Cambiar Fuente [Alt+F]",
            save_title: "Guardar [Ctrl+S]",
            export_btn: "EXPORTAR",
            search_ph: "Buscar... [Ctrl+F]",
            search_go: "IR",
            audio_title: "Música [Alt+M]",
            audio_btn: "SONIDO",
            reader_title: "Modo Lector",
            reader_btn: "LECTOR",
            xray_title: "Modo Rayos-X",
            xray_btn: "X-RAY",
            lock_title: "Bloquear Pantalla [Alt+L]",
            lock_btn: "LOCK",
            export_title: "PROTOCOLO DE EXPORTACIÓN",
            export_markdown: "EXPORTAR MARKDOWN",
            export_report_full: "IMPRESIÓN COMPLETA",
            export_qr_stream: "STREAM QR",
            export_social_title: "REDES FEDERADAS",
            export_social_bigtech: "REDES NO FEDERADAS (SIN CONTROL REAL SOBRE TU CONTENIDO)",
            share_title: "COMPARTIR T∅T",
            share_copy: "COPIAR TEXTO",
            share_open: "ABRIR RED",
            share_message: "Yo escribo en 🔸 T∅T - Editor. Escribió, exportó, borró. Un bunker offline para escribir con privacidad. https://tot.undo.it/",
            fediverse_help: "NO SABES QUÉ ES EL FEDIVERSO?",
            fediverse_title: "FEDIVERSO",
            fediverse_body: "<p>Piensa en redes sociales como email: puedes elegir proveedor y hablar con cualquiera. El fediverso funciona igual.</p><p>En lugar de una empresa mandando todo, muchas comunidades se conectan. Tú eliges dónde estar, mantienes tus datos y sigues conectado.</p><p>Menos vigilancia, más control, más libertad.</p>",
            export_active: "activo",
            export_all: "todo",
            export_light: "luz",
            danger_zone: "ZONA DE PELIGRO",
            reset_warn_body: "Esto borrará TODOS los archivos y ajustes.",
            reset_proof: "PRUEBA DE AUTORÍA: ESCRIBA LA PALABRA",
            reset_keyword: "Palabra clave",
            reset_validate: "VALIDAR PRUEBA",
            reset_confirm: "SÍ, BORRAR",
            reset_password_prompt: "INGRESE SU CONTRASEÑA PARA AUTORIZAR LA DESTRUCCIÓN:",
            reset_password_ph: "Contraseña de acceso",
            reset_destroy: "BORRAR PARA SIEMPRE",
            pomo_locked: "POMODORO BLOQUEADO",
            pomo_break: "PAUSA ACTIVA",
            pomo_break_hint: "El desbloqueo requiere la contraseña de sesión al final.",
            pomo_unlock_prompt: "INGRESE SU CONTRASEÑA PARA LIBERAR:",
            pomo_choice: "ELIJA EL PRÓXIMO CICLO:",
            pomo_25: "25 MIN",
            pomo_55: "55 MIN",
            help_title: "MANUAL DE COMANDOS",
            help_tab_general: "GENERAL",
            help_tab_tools: "HERRAMIENTAS",
            help_tab_nav: "NAVEGACIÓN",
            help_tab_slash: "SLASH COMMANDS",
            help_help: "Ayuda",
            help_save: "Guardar / Exportar",
            help_open: "Abrir / Importar",
            help_fullscreen: "Pantalla Completa (Zen)",
            help_search: "Buscar",
            help_close: "Cerrar / Enfocar Editor",
            help_theme: "Cambiar Tema",
            help_music: "Música (Play/Stop)",
            help_pomo: "Pomodoro (25m)",
            help_font: "Cambiar Fuente",
            help_files: "Abrir Archivos",
            help_nav: "Abrir Navegación",
            help_memo: "Abrir Memo",
            help_drawer_close: "Cerrar Cajón",
            help_slash_hint: "Escriba en el editor para activar:",
            help_save_short: "Guardar",
            help_open_short: "Importar",
            help_theme_short: "Cambiar Tema",
            help_fullscreen_short: "Pantalla Completa",
            help_music_short: "Música",
            help_pomo_short: "Pomodoro",
            tab_files: "Archivos [Alt+1]",
            tab_nav: "Navegación [Alt+2]",
            tab_memo: "Memo [Alt+3]",
            tab_theme: "Tema [Alt+T]",
            tab_books: "T∅TBooks [Alt+4]",
            hard_reset_title: "HARD RESET",
            fullscreen_title: "Pantalla Completa [F11]",
            drawer_system: "SISTEMA",
            drawer_files: "ARCHIVOS",
            drawer_nav: "NAVEGACIÓN",
            drawer_memo: "MEMO",
            btn_new_project: "+ NUEVO",
            btn_import_title: "Importar JSON/TXT",
            btn_open: "ABRIR",
            btn_scan_qr: "Scan QR",
            btn_scan: "SCAN QR",
            nav_structure: "Estructura del documento:",
            nav_insert: "INSERTAR MARCADOR",
            nav_empty_hint: "Usa \"Insertar Marcador\" para navegar.",
            nav_delete_confirm: "Borrar marcador",
            memo_ph: "Buffer de memoria...",
            files_hint: "Gestiona archivos y copias aqui.",
            nav_hint: "Ve la estructura del documento y navega capítulos.",
            memo_hint: "Anota ideas rápidas sin tocar el texto principal.",
            mobile_theme: "CAMBIAR TEMA",
            mobile_full_enable: "ACTIVAR MODO COMPLETO",
            mobile_full_disable: "VOLVER A MEMO",
            mobile_memo_ph: "Nota rápida...",
            mobile_memo_tags: "Tags (separa por coma)",
            mobile_memo_add: "GUARDAR NOTA",
            mobile_memo_delete: "BORRAR",
            mobile_export_memos: "EXPORTAR MEMOS",
            mobile_intro_title: "MODO MÓVIL",
            mobile_intro_body: "<p>El móvil se reduce a lo esencial: scanner QR y notas rápidas.</p><p>Desliza hacia arriba para ocultar el scanner y escribir en memo.</p><p>Exporta JSON e importa en desktop para el proyecto completo.</p>",
            mobile_intro_ok: "ENTENDI",
            offline_download: "DESCARGAR APP OFFLINE",
            project_github: "GITHUB DEL PROYECTO",
            qr_stream_title: "STREAM QR",
            qr_stream_active: "STREAM ACTIVO",
            qr_stream_pause: "PAUSAR",
            qr_stream_hint: "Cierre para terminar el envío.",
            qr_stream_instructions: "<p>1) En el celular, abre T∅T y ve a Archivos → Scan QR.</p><p>2) Apunta a esta pantalla hasta completar.</p><p>3) Luego borra todo aquí.</p>",
            qr_scan_title: "SCAN QR",
            qr_scan_wait: "ESPERANDO QR...",
            qr_scan_stop: "DETENER SCAN",
            qr_fallback_hint: "Sin camara? Importa el archivo .b64 o pega la cadena.",
            qr_fallback_import: "IMPORTAR ARCHIVO",
            qr_fallback_paste: "Pega la cadena base64",
            qr_fallback_restore: "RESTAURAR",
            reader_glossary: "GLOSARIO",
            lexicon_title: "DICCIONARIO",
            lexicon_trans: "TRADUCCIONES",
            goal_label: "META",
            goal_done_title: "META CUMPLIDA",
            goal_done_body: "Felicidades, alcanzaste tu meta de escritura.",
            goal_500_title: "500 PALABRAS",
            goal_500_body: "Bien. Sigue hasta 1000 palabras.",
            goal_1000_title: "1000 PALABRAS",
            goal_1000_body: "Buen ritmo. Ve por 1500.",
            goal_1500_title: "1500 PALABRAS",
            goal_1500_body: "Casi listo. Apunta a 2000.",
            goal_2000_title: "2000 PALABRAS",
            goal_2000_body: "Excelente. Meta máxima lograda.",
            reader_glossary_title: "Glosario",
            reader_ruler_title: "Regla",
            reader_font_title: "Fuente",
            reader_theme_title: "Tema",
            reader_play_title: "Play",
            reader_close_title: "Cerrar",
            default_project: "Borrador Inicial",
            alert_backup_restored: "✅ BACKUP RESTAURADO CON ÉXITO!",
            alert_backup_invalid: "Error: Backup inválido o corrupto.",
            alert_capsule_restored: "✅ CÁPSULA T∅T RESTAURADA CON ÉXITO!",
            alert_capsule_invalid: "Error: Cápsula inválida o corrupta.",
            alert_backup_json_error: "Error al leer el archivo JSON.",
            prompt_file_name: "Nombre del Archivo:",
            reset_no_text: "SIN TEXTO PARA VALIDAR. CONTINÚE AL PASO 2.",
            reset_proof_ok: "PRUEBA ACEPTADA.",
            reset_proof_fail: "PALABRA INCORRECTA.",
            reset_executing: "EJECUTANDO PROTOCOLO...",
            reset_denied: "CONTRASEÑA INCORRECTA. ACCESO DENEGADO.",
            pomo_unlocked: "ACCESO LIBERADO.",
            pomo_wrong_pass: "CONTRASEÑA INCORRECTA.",
            pomo_break_label: "PAUSA",
            qr_stream_paused: "STREAM PAUSADO",
            qr_stream_resume: "REANUDAR",
            qr_stream_empty: "SIN DATOS PARA STREAM.",
            qr_no_detector: "BarcodeDetector no disponible. Use importación por archivo.",
            qr_using_fallback: "Decoder offline activo. Apunte la cámara.",
            qr_camera_missing: "Elemento de cámara ausente.",
            qr_camera_blocked: "CÁMARA BLOQUEADA O NO DISPONIBLE.",
            qr_receiving: "RECIBIENDO",
            qr_restore_in_progress: "BACKUP COMPLETO. RESTAURANDO...",
            qr_decode_fail: "FALLO EN LA DECODIFICACIÓN."
            ,
            qr_frame: "FRAME"
            ,
            confirm_exit: "¿Desea cerrar el sistema?"
            ,
            chapter_title: "NUEVO CAPÍTULO",
            chapter_placeholder: "..."
        },
        fr: {
            lang_label: "FRAN",
            lang_title: "Langue",
            manifesto_title: "MANIFESTE T∅T",
            manifesto_subtitle: "L'éditeur portable, transitoire et résistant.",
            manifesto_body: "<div class=\"manifesto-grid\"><div class=\"manifesto-card\"><h3><span class=\"manifesto-badge\">01</span> DESKTOP FIRST</h3><p>Conçu pour les écrivains. Focus total. Sortie propre.</p></div><div class=\"manifesto-card\"><h3><span class=\"manifesto-badge\">02</span> MOBILE = SCANNER + MÉMO</h3><p>Le mobile lit le QR et garde des notes rapides. Export JSON → desktop.</p></div><div class=\"manifesto-card\"><h3><span class=\"manifesto-badge\">03</span> OFFRE</h3><p><span class=\"manifesto-key\">Capsule locale</span> + clé d'extraction (.tot/QR). Tout hors ligne.</p></div><div class=\"manifesto-card\"><h3><span class=\"manifesto-badge\">04</span> PREUVE TECHNIQUE</h3><p>Pas d'auteur officiel. Hash cryptographique + métadonnées de saisie.</p></div><div class=\"manifesto-card\"><h3><span class=\"manifesto-badge\">05</span> CERTIFICAT</h3><p>Hash, caractères, frappes, première/dernière touche, origine.</p></div><div class=\"manifesto-card\"><h3><span class=\"manifesto-badge\">06</span> NE PROMET PAS</h3><p>Pas de cloud, pas de registre officiel, pas de garantie légale absolue.</p></div><div class=\"manifesto-card\"><h3><span class=\"manifesto-badge\">07</span> ANCRAGE OPTIONNEL</h3><p>Publiez le hash quand vous voulez. À vous de décider.</p></div></div><p class=\"manifesto-note\">En continuant, vous comprenez les limites et acceptez le manifeste.</p>",
            manifesto_accept: "J'AI LU ET COMPRIS",
            welcome: "DÉMARRAGE DU SYSTÈME",
            create_pass: "CRÉER UN MOT DE PASSE",
            repeat_pass: "CONFIRMER LE MOT DE PASSE",
            start_btn: "CRÉER LA SESSION",
            locked: "SYSTÈME VERROUILLÉ",
            unlock_btn: "DÉVERROUILLER",
            wrong_pass: "MOT DE PASSE INCORRECT",
            reset_warn: "DANGER : TOUT SERA EFFACÉ. CONTINUER ?",
            reset_invalid: "MOTS DE PASSE INVALIDES OU DIFFÉRENTS.",
            reset_cancel: "MOT DE PASSE INCORRECT. OPÉRATION ANNULÉE.",
            reset_prompt: "ENTREZ LE MOT DE PASSE POUR CONFIRMER L'EFFACEMENT :",
            modal_title: "CONFIRMATION",
            modal_ok: "OK",
            modal_cancel: "ANNULER",
            project_delete_confirm: "Supprimer le fichier",
            stats_chars: "CHARS",
            stats_words: "WORDS",
            stats_label: "CHARS: 0 | WORDS: 0",
            marquee_ready: "/// SYSTÈME PRÊT /// APPUYEZ SUR [F1] POUR L'AIDE :: TAPEZ --H DANS L'ÉDITEUR",
            font_title: "Changer la police [Alt+F]",
            save_title: "Enregistrer [Ctrl+S]",
            export_btn: "EXPORTER",
            search_ph: "Rechercher... [Ctrl+F]",
            search_go: "OK",
            audio_title: "Musique [Alt+M]",
            audio_btn: "SON",
            reader_title: "Mode Lecture",
            reader_btn: "LECTEUR",
            xray_title: "Mode Rayon-X",
            xray_btn: "X-RAY",
            lock_title: "Verrouiller l'écran [Alt+L]",
            lock_btn: "LOCK",
            export_title: "PROTOCOLE D'EXPORT",
            export_markdown: "EXPORTER MARKDOWN",
            export_report_full: "IMPRESSION COMPLETE",
            export_qr_stream: "STREAM QR",
            export_social_title: "RÉSEAUX FÉDÉRÉS",
            export_social_bigtech: "RÉSEAUX NON FÉDÉRÉS (SANS CONTRÔLE RÉEL DU CONTENU)",
            share_title: "PARTAGER T∅T",
            share_copy: "COPIER LE TEXTE",
            share_open: "OUVRIR LE RÉSEAU",
            share_message: "J'écris dans 🔸 T∅T - Editor. Écrit, exporté, effacé. Un bunker hors ligne pour écrire en privé. https://tot.undo.it/",
            fediverse_help: "VOUS NE SAVEZ PAS CE QU'EST LE FEDIVERSE?",
            fediverse_title: "FEDIVERSE",
            fediverse_body: "<p>Pensez aux réseaux sociaux comme aux emails : vous choisissez un fournisseur et vous parlez à tout le monde. Le fediverse fonctionne pareil.</p><p>Au lieu d'une entreprise qui contrôle tout, plusieurs communautés se connectent. Vous choisissez où être, gardez vos données et restez connecté.</p><p>Moins de surveillance, plus de contrôle, plus de liberté.</p>",
            export_active: "actif",
            export_all: "tout",
            export_light: "lumière",
            danger_zone: "ZONE DE DANGER",
            reset_warn_body: "Cela supprimera TOUS les fichiers et réglages.",
            reset_proof: "PREUVE D'AUTEUR : TAPEZ LE MOT",
            reset_keyword: "Mot-clé",
            reset_validate: "VALIDER LA PREUVE",
            reset_confirm: "OUI, SUPPRIMER",
            reset_password_prompt: "ENTREZ VOTRE MOT DE PASSE POUR AUTORISER LA DESTRUCTION :",
            reset_password_ph: "Mot de passe",
            reset_destroy: "SUPPRIMER POUR TOUJOURS",
            pomo_locked: "POMODORO VERROUILLÉ",
            pomo_break: "PAUSE ACTIVE",
            pomo_break_hint: "Le déverrouillage nécessite le mot de passe de session.",
            pomo_unlock_prompt: "ENTREZ VOTRE MOT DE PASSE POUR DÉVERROUILLER :",
            pomo_choice: "CHOISISSEZ LE PROCHAIN CYCLE :",
            pomo_25: "25 MIN",
            pomo_55: "55 MIN",
            help_title: "MANUEL DE COMMANDE",
            help_tab_general: "GÉNÉRAL",
            help_tab_tools: "OUTILS",
            help_tab_nav: "NAVIGATION",
            help_tab_slash: "SLASH COMMANDS",
            help_help: "Aide",
            help_save: "Enregistrer / Exporter",
            help_open: "Ouvrir / Importer",
            help_fullscreen: "Plein écran (Zen)",
            help_search: "Rechercher",
            help_close: "Fermer / Focus Éditeur",
            help_theme: "Changer Thème",
            help_music: "Musique (Play/Stop)",
            help_pomo: "Pomodoro (25m)",
            help_font: "Changer Police",
            help_files: "Ouvrir Fichiers",
            help_nav: "Ouvrir Navigation",
            help_memo: "Ouvrir Mémo",
            help_drawer_close: "Fermer le tiroir",
            help_slash_hint: "Tapez dans l'éditeur pour activer :",
            help_save_short: "Enregistrer",
            help_open_short: "Importer",
            help_theme_short: "Changer Thème",
            help_fullscreen_short: "Plein écran",
            help_music_short: "Musique",
            help_pomo_short: "Pomodoro",
            tab_files: "Fichiers [Alt+1]",
            tab_nav: "Navigation [Alt+2]",
            tab_memo: "Mémo [Alt+3]",
            tab_theme: "Thème [Alt+T]",
            tab_books: "T∅TBooks [Alt+4]",
            hard_reset_title: "HARD RESET",
            fullscreen_title: "Plein écran [F11]",
            drawer_system: "SYSTÈME",
            drawer_files: "FICHIERS",
            drawer_nav: "NAVIGATION",
            drawer_memo: "MÉMO",
            btn_new_project: "+ NOUVEAU",
            btn_import_title: "Importer JSON/TXT",
            btn_open: "OUVRIR",
            btn_scan_qr: "Scan QR",
            btn_scan: "SCAN QR",
            nav_structure: "Structure du document :",
            nav_insert: "INSÉRER MARQUEUR",
            nav_empty_hint: "Utilisez \"Insérer Marqueur\" pour naviguer.",
            nav_delete_confirm: "Supprimer le marqueur",
            memo_ph: "Buffer mémoire...",
            files_hint: "Gerez vos fichiers et sauvegardes ici.",
            nav_hint: "Voyez la structure et naviguez les chapitres.",
            memo_hint: "Notez des idees sans toucher au texte principal.",
            mobile_theme: "CHANGER THÈME",
            mobile_full_enable: "ACTIVER MODE COMPLET",
            mobile_full_disable: "RETOUR AU MÉMO",
            mobile_memo_ph: "Note rapide...",
            mobile_memo_tags: "Tags (séparés par virgule)",
            mobile_memo_add: "ENREGISTRER",
            mobile_memo_delete: "SUPPRIMER",
            mobile_export_memos: "EXPORTER MÉMOS",
            mobile_intro_title: "MODE MOBILE",
            mobile_intro_body: "<p>Le mobile est réduit à l'essentiel : scanner QR et notes rapides.</p><p>Glissez vers le haut pour masquer le scanner et écrire en mémo.</p><p>Exportez JSON et importez sur desktop pour le projet complet.</p>",
            mobile_intro_ok: "COMPRIS",
            offline_download: "TÉLÉCHARGER L'APP OFFLINE",
            project_github: "GITHUB DU PROJET",
            qr_stream_title: "STREAM QR",
            qr_stream_active: "STREAM ACTIF",
            qr_stream_pause: "PAUSE",
            qr_stream_hint: "Fermez pour terminer l'envoi.",
            qr_stream_instructions: "<p>1) Sur votre téléphone, ouvrez T∅T puis Fichiers → Scan QR.</p><p>2) Visez cet écran jusqu'à la fin.</p><p>3) Ensuite, effacez tout ici.</p>",
            qr_scan_title: "SCAN QR",
            qr_scan_wait: "EN ATTENTE DU QR...",
            qr_scan_stop: "ARRÊTER SCAN",
            qr_fallback_hint: "Sans caméra ? Importez le fichier .b64 ou collez la chaîne.",
            qr_fallback_import: "IMPORTER FICHIER",
            qr_fallback_paste: "Collez la chaîne base64",
            qr_fallback_restore: "RESTAURER",
            reader_glossary: "GLOSSAIRE",
            lexicon_title: "DICTIONNAIRE",
            lexicon_trans: "TRADUCTIONS",
            goal_label: "OBJECTIF",
            goal_done_title: "OBJECTIF ATTEINT",
            goal_done_body: "Bravo, vous avez atteint votre objectif d'écriture.",
            goal_500_title: "500 MOTS",
            goal_500_body: "Bien. Continuez jusqu'à 1000 mots.",
            goal_1000_title: "1000 MOTS",
            goal_1000_body: "Bon rythme. Visez 1500.",
            goal_1500_title: "1500 MOTS",
            goal_1500_body: "Presque. Atteignez 2000.",
            goal_2000_title: "2000 MOTS",
            goal_2000_body: "Excellent. Objectif maximal atteint.",
            reader_glossary_title: "Glossaire",
            reader_ruler_title: "Règle",
            reader_font_title: "Police",
            reader_theme_title: "Thème",
            reader_play_title: "Play",
            reader_close_title: "Fermer",
            default_project: "Brouillon Initial",
            alert_backup_restored: "✅ SAUVEGARDE RESTAURÉE AVEC SUCCÈS !",
            alert_backup_invalid: "Erreur : sauvegarde invalide ou corrompue.",
            alert_capsule_restored: "✅ CAPSULE T∅T RESTAURÉE AVEC SUCCÈS !",
            alert_capsule_invalid: "Erreur : capsule invalide ou corrompue.",
            alert_backup_json_error: "Erreur de lecture du fichier JSON.",
            prompt_file_name: "Nom du fichier :",
            reset_no_text: "AUCUN TEXTE À VALIDER. CONTINUEZ À L'ÉTAPE 2.",
            reset_proof_ok: "PREUVE ACCEPTÉE.",
            reset_proof_fail: "MOT INCORRECT.",
            reset_executing: "EXÉCUTION DU PROTOCOLE...",
            reset_denied: "MOT DE PASSE INCORRECT. ACCÈS REFUSÉ.",
            pomo_unlocked: "ACCÈS AUTORISÉ.",
            pomo_wrong_pass: "MOT DE PASSE INCORRECT.",
            pomo_break_label: "PAUSE",
            qr_stream_paused: "STREAM EN PAUSE",
            qr_stream_resume: "REPRENDRE",
            qr_stream_empty: "AUCUNE DONNÉE À STREAMER.",
            qr_no_detector: "BarcodeDetector indisponible. Utilisez l'import de fichier.",
            qr_using_fallback: "Décodage hors ligne actif. Pointez la caméra.",
            qr_camera_missing: "Élément caméra manquant.",
            qr_camera_blocked: "CAMÉRA BLOQUÉE OU INDISPONIBLE.",
            qr_receiving: "RÉCEPTION",
            qr_restore_in_progress: "SAUVEGARDE COMPLÈTE. RESTAURATION...",
            qr_decode_fail: "ÉCHEC DU DÉCODAGE."
            ,
            qr_frame: "FRAME"
            ,
            confirm_exit: "Voulez-vous fermer le système ?"
            ,
            chapter_title: "NOUVEAU CHAPITRE",
            chapter_placeholder: "..."
        }
    },
    init() {
        const saved = localStorage.getItem('lit_lang') || 'pt';
        this.setLang(saved);
    },
    t(key) {
        const t = this.db[this.current] || {};
        return t[key] || key;
    },
    setLang(l) {
        this.current = l;
        localStorage.setItem('lit_lang', l);
        this.apply();
    },
    cycleLang() {
        const index = this.languages.findIndex((l) => l.code === this.current);
        const next = this.languages[(index + 1 + this.languages.length) % this.languages.length];
        this.setLang(next.code);
    },
    apply() {
        const t = this.db[this.current];
        document.querySelectorAll('[data-i18n]').forEach(el => {
            const key = el.getAttribute('data-i18n');
            if (t[key]) el.innerText = t[key];
        });
        document.querySelectorAll('[data-i18n-html]').forEach(el => {
            const key = el.getAttribute('data-i18n-html');
            if (t[key]) el.innerHTML = t[key];
        });
        document.querySelectorAll('[data-i18n-title]').forEach(el => {
            const key = el.getAttribute('data-i18n-title');
            if (t[key]) el.title = t[key];
        });
        document.querySelectorAll('input[data-i18n-ph], textarea[data-i18n-ph]').forEach(el => {
            const key = el.getAttribute('data-i18n-ph');
            if (t[key]) el.placeholder = t[key];
        });
        document.querySelectorAll('[data-i18n-lang]').forEach(el => {
            if (t.lang_label) el.innerText = t.lang_label;
        });
        const langButtons = [document.getElementById("btnLangToggle"), document.getElementById("setupLangToggle")];
        langButtons.forEach((btn) => {
            if (btn && t.lang_label) btn.innerText = t.lang_label;
        });
        document.dispatchEvent(new CustomEvent("lang:changed", { detail: { code: this.current } }));
    }
};
