#!/usr/bin/env python3
import sys
import os
import shutil
import platform
import subprocess
import webbrowser
import locale
import fcntl
from PyQt6.QtWidgets import (
    QApplication, QWidget, QVBoxLayout, QHBoxLayout, QGridLayout,
    QLabel, QPushButton, QFrame, QStackedWidget, QGraphicsDropShadowEffect,
    QScrollArea, QMenu, QProgressBar, QDialog, QComboBox, QCheckBox, QSizePolicy
)
from PyQt6.QtGui import QPixmap, QIcon, QColor, QAction, QPainter, QPen, QBrush, QFont, QFontMetrics, QPalette
from PyQt6.QtCore import Qt, QTimer, QThread, pyqtSignal, QFileSystemWatcher, QProcess, QSize

INSTALLED_PKGS_CACHE = set()

def reload_installed_pkgs_cache():
    global INSTALLED_PKGS_CACHE
    pkgs = set()
    local_db = "/var/lib/pacman/local"
    try:
        for entry in os.listdir(local_db):
            parts = entry.rsplit("-", 2)
            if len(parts) == 3:
                pkgs.add(parts[0])
    except Exception:
        pass
    INSTALLED_PKGS_CACHE = pkgs

reload_installed_pkgs_cache()


import shlex
import unicodedata

def _term_cell_width(text):
    return sum(2 if unicodedata.east_asian_width(ch) in ("W", "F") else 1 for ch in text)


def build_x64_term_cmd(title, banner_title, shell_body):
    prefix_plain = "  ⚡ X64 LIOS COMMAND CENTER  •  "
    vis_len = _term_cell_width(prefix_plain) + _term_cell_width(banner_title)
    inner_width = max(76, vis_len + 3)
    horiz = "═" * inner_width
    pad = " " * (inner_width - vis_len)
    script = (
        f"printf '\\033[1;31m╔{horiz}╗\\033[0m\\n'; "
        f"printf '\\033[1;31m║\\033[0m  \\033[1;37m⚡ X64 LIOS COMMAND CENTER\\033[0m  \\033[1;31m•\\033[0m  \\033[1;33m{banner_title}\\033[0m{pad}\\033[1;31m║\\033[0m\\n'; "
        f"printf '\\033[1;31m╚{horiz}╝\\033[0m\\n\\n'; "
        f"( {shell_body} ); "
        f"status=$?; "
        f"echo ''; "
        f"if [ $status -eq 0 ]; then "
        f"  printf '\\033[1;32m✓ Operación completada con éxito.\\033[0m '; "
        f"else "
        f"  printf '\\033[1;31m✕ La operación no se pudo completar (código: %d).\\033[0m ' $status; "
        f"fi; "
        f"read -p 'Presiona Enter para cerrar esta ventana...'"
    )
    return (
        f"kitty -o remember_window_size=no -o background_opacity=1.0 -o initial_window_width=108c -o initial_window_height=30c "
        f"--title {shlex.quote(title)} bash -c {shlex.quote(script)}"
    )


def get_system_update_cmd():
    return "x64-update"


def get_static_hw_info():
    cpu_model = "Generic x86_64 Processor"
    cpu_cores = os.cpu_count() or 1
    try:
        with open("/proc/cpuinfo", "r") as f:
            for line in f:
                if line.startswith("model name"):
                    raw = line.split(":", 1)[1].strip()
                    for token in ["(R)", "(TM)", "(tm)", "CPU", "Processor"]:
                        raw = raw.replace(token, "")
                    cpu_model = " ".join(raw.split())
                    break
    except Exception:
        pass

    gpu_model = "VGA / DRM Graphics"
    try:
        import re
        res = subprocess.run(
            ["lspci"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, timeout=2.0
        )
        detected_gpus = []
        for line in res.stdout.splitlines():
            if any(k in line for k in ["VGA compatible controller:", "3D controller:", "Display controller:"]):
                raw = re.split(r"(?:VGA compatible controller|3D controller|Display controller):\s*", line)[-1].strip()
                raw = raw.split("(rev")[0].strip()
                for token in ["Corporation", "Incorporated", "Ltd.", "Co.", ", Inc.", "[AMD/ATI]"]:
                    raw = raw.replace(token, "")
                brand = ""
                if "nvidia" in raw.lower():
                    brand = "NVIDIA"
                elif "amd" in raw.lower() or "radeon" in raw.lower():
                    brand = "AMD"
                elif "intel" in raw.lower():
                    brand = "Intel"

                bracket_match = re.search(r"\[(.*?)\]", raw)
                if bracket_match:
                    friendly = bracket_match.group(1).strip()
                    if brand and not friendly.lower().startswith(brand.lower()):
                        clean = f"{brand} {friendly}"
                    else:
                        clean = friendly
                else:
                    clean = " ".join(raw.split())
                detected_gpus.append(clean)

        if detected_gpus:
            if len(detected_gpus) == 2 and detected_gpus[0] == detected_gpus[1]:
                gpu_model = f"{detected_gpus[0]} (x2 SLI)"
            elif len(detected_gpus) > 1 and "Intel" in detected_gpus[0] and "NVIDIA" in detected_gpus[1]:
                gpu_model = f"{detected_gpus[1]} + {detected_gpus[0]}"
            else:
                gpu_model = detected_gpus[0]
            if len(gpu_model) > 42:
                gpu_model = gpu_model[:39] + "..."
    except Exception:
        pass

    root_fs = "Linux FS"
    try:
        with open("/proc/mounts", "r") as f:
            for line in f:
                parts = line.split()
                if len(parts) >= 3 and parts[1] == "/":
                    root_fs = parts[2].upper()
                    break
    except Exception:
        pass

    zram_active = False
    try:
        with open("/proc/swaps", "r") as f:
            zram_active = ("zram" in f.read())
    except Exception:
        pass

    return {
        "cpu_model": cpu_model,
        "cpu_cores": cpu_cores,
        "gpu_model": gpu_model,
        "root_fs": root_fs,
        "zram_active": zram_active
    }

STATIC_HW = get_static_hw_info()


class ServiceStatusWorker(QThread):
    status_ready = pyqtSignal(dict)

    def __init__(self, sys_units, user_units=None, parent=None):
        super().__init__(parent)
        self.sys_units = sys_units or []
        self.user_units = user_units or []

    def _check_group(self, units, is_user=False):
        out = {}
        if not units:
            return out
        base_cmd = ["systemctl", "--user"] if is_user else ["systemctl"]
        try:
            res_act = subprocess.run(
                [*base_cmd, "is-active", *units],
                stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, timeout=3
            )
            act_lines = res_act.stdout.splitlines()
            res_en = subprocess.run(
                [*base_cmd, "is-enabled", *units],
                stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, timeout=3
            )
            en_lines = res_en.stdout.splitlines()
            for i, u in enumerate(units):
                is_act = (i < len(act_lines) and act_lines[i].strip() == "active")
                is_en = (i < len(en_lines) and en_lines[i].strip() == "enabled")
                active_val = (is_act or is_en)
                if u == "ufw.service" and active_val and os.path.exists("/etc/ufw/ufw.conf"):
                    try:
                        with open("/etc/ufw/ufw.conf", "r") as uf:
                            active_val = any(line.strip().startswith("ENABLED=yes") for line in uf)
                    except Exception:
                        pass
                out[u] = active_val
        except Exception:
            for u in units:
                out[u] = False
        return out

    def run(self):
        result = {}
        result.update(self._check_group(self.sys_units, is_user=False))
        result.update(self._check_group(self.user_units, is_user=True))
        self.status_ready.emit(result)


TRANSLATIONS = {'es': {'Home': 'Inicio',
        'Tweaks & System': 'Ajustes y Sistema',
        'Gaming Center': 'Centro Gaming',
        'Philosophy': 'Filosofía',
        'Welcome to X64 LIOS': 'Bienvenido a X64 LIOS',
        'Update System': 'Actualizar Sistema',
        'Synchronize repositories and upgrade all system packages (pacman -Syu).': 'Sincroniza y actualiza todo el sistema (pacman -Syu).',
        'Discord Community': 'Comunidad Discord',
        'System Services & Tweaks': 'Servicios y Ajustes del Sistema',
        'Control real-time daemons, configure low-latency DNS, and execute system rescue routines with a single click.': 'Controla '
                                                                                                                         'demonios en '
                                                                                                                         'tiempo real, '
                                                                                                                         'configura DNS de '
                                                                                                                         'baja latencia y '
                                                                                                                         'ejecuta rutinas '
                                                                                                                         'de rescate con '
                                                                                                                         'un solo clic.',
        'Real-Time Daemons & Services': 'Demonios y Servicios en Tiempo Real',
        'System Maintenance & Utilities': 'Utilidades y Optimización del Sistema',
        'Troubleshooting & System Rescue': 'Solución de Problemas y Rescate (Troubleshooting)',
        'FalconD Gaming Daemon': 'FalconD Gaming',
        'Dynamic CPU affinity and automatic performance profiles for games.': 'Afinidad dinámica de CPU para juegos.',
        'Ananicy-cpp Priority': 'Ananicy-cpp',
        'Automatic process nice/ionice latency tuning in the background.': 'Prioridad y latencia de procesos en vivo.',
        'Bpftune Kernel Auto-Tuning': 'Bpftune Kernel',
        'Dynamic eBPF network buffer and sysctl optimization in real time.': 'Auto-tuning eBPF de red y kernel.',
        'Systemd-OOMD Anti-Freeze': 'Systemd-OOMD',
        'Prevents hard system freezes under extreme 100% RAM/ZRAM exhaustion.': 'Protección anti-bloqueo de memoria RAM.',
        'Profile-sync-daemon (RAM Browser)': 'Navegador RAM',
        'Moves browser profiles to tmpfs RAM for instant speed and less SSD wear.': 'Perfiles web (PSD) en RAM.',
        'LIOS Update Notifier': 'LIOS Update',
        'System tray timer that checks and alerts when new updates are ready.': 'Aviso automático de actualizaciones.',
        'UFW Security Firewall': 'Cortafuegos UFW',
        'Active network protection against unauthorized incoming connections.': 'Blindaje activo de puertos y red.',
        'Bluetooth Service': 'Bluetooth',
        'Support for wireless controllers, headsets, and Bluetooth peripherals.': 'Soporte de mandos y audio inalámbrico.',
        'NVMe / SSD Trim Timer': 'Trim NVMe / SSD',
        'Weekly scheduled block maintenance to preserve SSD lifespan and speed.': 'Mantenimiento semanal de bloques SSD.',
        'ACTIVE': 'ACTIVO',
        'INACTIVE': 'INACTIVO',
        'Rank Fastest Mirrors': 'Clasificar Espejos',
        'Test and select the fastest download servers.': 'Selecciona los servidores más veloces.',
        'Clean Package Cache': 'Limpiar Caché Pacman',
        'Free up disk space by removing old cached packages (pacman -Sc).': 'Libera espacio de paquetes antiguos.',
        'Remove Orphan Packages': 'Purgar Huérfanos',
        'Purge unused dependency packages left behind on your system.': 'Limpia dependencias sin uso (pacman -Qtdq).',
        'Change DNS Server': 'Cambiar Servidor DNS',
        'Measure ping latency and switch to Cloudflare, AdGuard, Quad9, or DoT.': 'Mide el ping en ms y activa DNS rápidos.',
        'Install Winboat (Windows Apps)': 'Instalar Winboat',
        'Run Windows productivity apps seamlessly via container integration.': 'Apps de Windows vía contenedor ligero.',
        'Unlock Pacman Database': 'Desbloquear Base de Datos (db.lck)',
        'Remove /var/lib/pacman/db.lck if a previous update was interrupted.': 'Elimina /var/lib/pacman/db.lck tras un corte previo.',
        'Reset Pacman Keyrings': 'Restablecer Depósitos de Llaves (Keyrings)',
        'Reinitialize and populate GPG cryptographic keys if package signatures fail.': 'Regenera las firmas GPG si pacman arroja error de '
                                                                                        'llaves.',
        'Reinstall All Native Packages': 'Reinstalar Todos los Paquetes Nativos',
        'Force reinstall of all native system packages to repair damaged files.': 'Reinstala todos los paquetes nativos para reparar el '
                                                                                  'sistema.',
        'KWin (Wayland) Debug Console': 'Consola de Depuración KWin (Wayland)',
        'Open the native KWin Wayland diagnostic inspector for windows and VRR.': 'Abre el inspector de KWin para diagnosticar Wayland y '
                                                                                  'VRR.',
        'X64 Gaming Center': 'Centro Gaming X64',
        'Modular 1-click installation of gaming launchers, compatibility layers, and FPS overlays.': 'Instalación modular en 1 clic de '
                                                                                                     'lanzadores de juegos, motores '
                                                                                                     'Proton/UMU, librerías 32-bits y '
                                                                                                     'overlays.',
        'MODULAR COMPONENT INSTALLATION': 'INSTALACIÓN MODULAR POR COMPONENTES',
        'Full X64 Gaming Suite (All-in-One)': 'Suite Gaming X64 Completa (Todo en Uno)',
        'Complete arsenal: Steam, Lutris, Heroic, Faugus, Gamescope, Proton-SLR, UMU, Wine, MangoHud, ProtonUp-Qt & 32-bit libs.': 'Arsenal '
                                                                                                                                   'completo: '
                                                                                                                                   'Steam, '
                                                                                                                                   'Lutris, '
                                                                                                                                   'Heroic, '
                                                                                                                                   'Faugus, '
                                                                                                                                   'Gamescope, '
                                                                                                                                   'Proton-SLR, '
                                                                                                                                   'UMU, '
                                                                                                                                   'Wine, '
                                                                                                                                   'MangoHud, '
                                                                                                                                   'ProtonUp-Qt '
                                                                                                                                   'y '
                                                                                                                                   'librerías '
                                                                                                                                   '32-bits.',
        'X64 Gaming Core, Proton-SLR & Wine X64': 'Motor Gaming y Wine X64',
        'Essential 32-bit Vulkan/Audio libs, Proton-SLR, UMU, Wine X64, Winetricks & Protontricks.': 'Librerías 32-bits Vulkan/Audio, '
                                                                                                     'Proton-SLR, UMU, Wine X64, '
                                                                                                     'Winetricks y Protontricks.',
        'Steam': 'Steam',
        'Official Valve gaming platform with native Proton integration.': 'Plataforma oficial de Valve con integración nativa de Proton.',
        'Lutris': 'Lutris',
        'Unified open gaming manager for Epic, GOG, Battle.net, EA, and Wine.': 'Gestor abierto unificado para Epic, GOG, Battle.net, EA y '
                                                                                'Wine.',
        'Heroic Games Launcher': 'Heroic Games Launcher',
        'Native graphical launcher for Epic Games, GOG, and Amazon Games.': 'Lanzador gráfico nativo para Epic Games, GOG y Amazon Games.',
        'Faugus Launcher': 'Faugus Launcher',
        'Ultra-lightweight modern launcher for Battle.net, EA App, Ubisoft, and standalone Windows games via UMU/Proton.': 'Lanzador '
                                                                                                                           'ultraligero '
                                                                                                                           'para '
                                                                                                                           'Battle.net, EA '
                                                                                                                           'App, Ubisoft y '
                                                                                                                           'juegos '
                                                                                                                           'Windows.',
        'MangoHud & GOverlay': 'MangoHud y GOverlay',
        'In-game FPS, frametime, CPU/GPU temperature HUD and graphical configurator.': 'HUD en vivo de FPS, frametime, temperaturas y '
                                                                                       'configurador GOverlay.',
        'Gamescope (Valve Micro-Compositor)': 'Gamescope (Compositor Valve)',
        'Valve Wayland micro-compositor for FSR upscaling, frame limiting, and resolution isolation.': 'Micro-compositor Wayland de Valve '
                                                                                                       'para escalado FSR, límite de FPS y '
                                                                                                       'resoluciones aisladas.',
        'ProtonUp-Qt': 'ProtonUp-Qt',
        'Graphical manager to install and update GE-Proton and Wine-GE versions.': 'Gestor gráfico para instalar y actualizar GE-Proton y '
                                                                                   'Wine-GE.',
        'INSTALLED ✓': 'INSTALADO ✓',
        'INSTALL': 'INSTALAR',
        'INSTALL SUITE': 'INSTALAR SUITE',
        'Launch at startup': 'Abrir al iniciar',
        'Architecture:': 'Arquitectura:',
        'Session:': 'Sesión:',
        'Installed': 'Instalado',
        'X64 Architectural Manifesto': 'Manifiesto Arquitectónico X64',
        'X64 LIOS was born as the ultimate answer to Linux fragmentation. We extract the raw power of high-performance kernels, the precision of the gaming ecosystem, and the purity of Arch to forge the definitive operating system.': 'X64 '
                                                                                                                                                                                                                                          'LIOS '
                                                                                                                                                                                                                                          'nace '
                                                                                                                                                                                                                                          'como '
                                                                                                                                                                                                                                          'la '
                                                                                                                                                                                                                                          'respuesta '
                                                                                                                                                                                                                                          'definitiva '
                                                                                                                                                                                                                                          'a '
                                                                                                                                                                                                                                          'la '
                                                                                                                                                                                                                                          'fragmentación '
                                                                                                                                                                                                                                          'de '
                                                                                                                                                                                                                                          'Linux. '
                                                                                                                                                                                                                                          'Extraemos '
                                                                                                                                                                                                                                          'la '
                                                                                                                                                                                                                                          'fuerza '
                                                                                                                                                                                                                                          'bruta '
                                                                                                                                                                                                                                          'de '
                                                                                                                                                                                                                                          'los '
                                                                                                                                                                                                                                          'kernels '
                                                                                                                                                                                                                                          'de '
                                                                                                                                                                                                                                          'alto '
                                                                                                                                                                                                                                          'rendimiento, '
                                                                                                                                                                                                                                          'la '
                                                                                                                                                                                                                                          'precisión '
                                                                                                                                                                                                                                          'del '
                                                                                                                                                                                                                                          'ecosistema '
                                                                                                                                                                                                                                          'gaming '
                                                                                                                                                                                                                                          'y '
                                                                                                                                                                                                                                          'la '
                                                                                                                                                                                                                                          'pureza '
                                                                                                                                                                                                                                          'de '
                                                                                                                                                                                                                                          'Arch '
                                                                                                                                                                                                                                          'para '
                                                                                                                                                                                                                                          'forjar '
                                                                                                                                                                                                                                          'el '
                                                                                                                                                                                                                                          'sistema '
                                                                                                                                                                                                                                          'operativo '
                                                                                                                                                                                                                                          'definitivo.',
        'I. Absolute Freedom': 'I. La Libertad Absoluta',
        'Upstream purity of Arch Linux with zero PPAs, zero corporate ties, and 99% of system packages intact. Combined with the AUR and modern GUI tools for complete freedom.': 'Pureza '
                                                                                                                                                                                  'Upstream '
                                                                                                                                                                                  'de '
                                                                                                                                                                                  'Arch '
                                                                                                                                                                                  'Linux '
                                                                                                                                                                                  'con '
                                                                                                                                                                                  'cero '
                                                                                                                                                                                  'PPAs, '
                                                                                                                                                                                  'cero '
                                                                                                                                                                                  'ataduras '
                                                                                                                                                                                  'corporativas '
                                                                                                                                                                                  'y '
                                                                                                                                                                                  'el '
                                                                                                                                                                                  '99% '
                                                                                                                                                                                  'de '
                                                                                                                                                                                  'los '
                                                                                                                                                                                  'paquetes '
                                                                                                                                                                                  'del '
                                                                                                                                                                                  'sistema '
                                                                                                                                                                                  'intactos. '
                                                                                                                                                                                  'Combinado '
                                                                                                                                                                                  'con '
                                                                                                                                                                                  'el '
                                                                                                                                                                                  'AUR '
                                                                                                                                                                                  'y '
                                                                                                                                                                                  'herramientas '
                                                                                                                                                                                  'gráficas '
                                                                                                                                                                                  'modernas '
                                                                                                                                                                                  'para '
                                                                                                                                                                                  'una '
                                                                                                                                                                                  'libertad '
                                                                                                                                                                                  'total.',
        'II. Surgical Optimization': 'II. Optimización Quirúrgica',
        'X64 low-latency kernel with scx dynamic schedulers, FalconD gaming CPU affinity, ananicy-cpp priority tuning, and pure ZRAM in RAM for zero disk swap latency.': 'Kernel '
                                                                                                                                                                          'X64 '
                                                                                                                                                                          'de '
                                                                                                                                                                          'baja '
                                                                                                                                                                          'latencia '
                                                                                                                                                                          'con '
                                                                                                                                                                          'schedulers '
                                                                                                                                                                          'dinámicos '
                                                                                                                                                                          'scx, '
                                                                                                                                                                          'afinidad '
                                                                                                                                                                          'de '
                                                                                                                                                                          'CPU '
                                                                                                                                                                          'gaming '
                                                                                                                                                                          'con '
                                                                                                                                                                          'FalconD, '
                                                                                                                                                                          'optimización '
                                                                                                                                                                          'ananicy-cpp '
                                                                                                                                                                          'y '
                                                                                                                                                                          'ZRAM '
                                                                                                                                                                          'puro '
                                                                                                                                                                          'en '
                                                                                                                                                                          'RAM '
                                                                                                                                                                          'sin '
                                                                                                                                                                          'latencia '
                                                                                                                                                                          'de '
                                                                                                                                                                          'swap '
                                                                                                                                                                          'en '
                                                                                                                                                                          'disco.',
        'III. Multi-Environment Ecosystem': 'III. Ecosistema Multi-Entorno',
        'Live environment in KDE Plasma 6 Wayland, plus 8 official installation options (KDE, GNOME, COSMIC, Niri, Cinnamon, Xfce, Hyprland, and Server) with 16:9 previews.': 'Entorno '
                                                                                                                                                                               'Live '
                                                                                                                                                                               'en '
                                                                                                                                                                               'KDE '
                                                                                                                                                                               'Plasma '
                                                                                                                                                                               '6 '
                                                                                                                                                                               'Wayland, '
                                                                                                                                                                               'más '
                                                                                                                                                                               '8 '
                                                                                                                                                                               'opciones '
                                                                                                                                                                               'oficiales '
                                                                                                                                                                               'de '
                                                                                                                                                                               'instalación '
                                                                                                                                                                               '(KDE, '
                                                                                                                                                                               'GNOME, '
                                                                                                                                                                               'COSMIC, '
                                                                                                                                                                               'Niri, '
                                                                                                                                                                               'Cinnamon, '
                                                                                                                                                                               'Xfce, '
                                                                                                                                                                               'Hyprland '
                                                                                                                                                                               'y '
                                                                                                                                                                               'Servidor) '
                                                                                                                                                                               'con '
                                                                                                                                                                               'capturas '
                                                                                                                                                                               '16:9.',
        'IV. Infrastructure Independence': 'IV. Independencia de Infraestructura',
        'Cascading repository hierarchy. [x64-lios] holds priority #1 at the top of the system, served with SSL from our high-speed CDN infrastructure.': 'Jerarquía '
                                                                                                                                                          'propia '
                                                                                                                                                          'de '
                                                                                                                                                          'repositorios '
                                                                                                                                                          'en '
                                                                                                                                                          'cascada. '
                                                                                                                                                          '[x64-lios] '
                                                                                                                                                          'tiene '
                                                                                                                                                          'prioridad '
                                                                                                                                                          '#1 '
                                                                                                                                                          'absoluta '
                                                                                                                                                          'en '
                                                                                                                                                          'la '
                                                                                                                                                          'cima '
                                                                                                                                                          'del '
                                                                                                                                                          'sistema, '
                                                                                                                                                          'servido '
                                                                                                                                                          'con '
                                                                                                                                                          'SSL '
                                                                                                                                                          'desde '
                                                                                                                                                          'nuestra '
                                                                                                                                                          'infraestructura '
                                                                                                                                                          'CDN '
                                                                                                                                                          'de '
                                                                                                                                                          'alta '
                                                                                                                                                          'velocidad.',
        'V. Hardware Mutation': 'V. Mutación de Hardware',
        'During installation, the system audits your CPU: modern processors get AVX2/AVX512 (v3/v4) repositories injected below [x64-lios]. chwd autodetects NVIDIA, AMD, and Intel GPUs.': 'Durante '
                                                                                                                                                                                            'la '
                                                                                                                                                                                            'instalación '
                                                                                                                                                                                            'el '
                                                                                                                                                                                            'sistema '
                                                                                                                                                                                            'audita '
                                                                                                                                                                                            'tu '
                                                                                                                                                                                            'CPU: '
                                                                                                                                                                                            'procesadores '
                                                                                                                                                                                            'modernos '
                                                                                                                                                                                            'reciben '
                                                                                                                                                                                            'repositorios '
                                                                                                                                                                                            'AVX2/AVX512 '
                                                                                                                                                                                            '(v3/v4) '
                                                                                                                                                                                            'bajo '
                                                                                                                                                                                            '[x64-lios]. '
                                                                                                                                                                                            'chwd '
                                                                                                                                                                                            'autodetecta '
                                                                                                                                                                                            'GPUs '
                                                                                                                                                                                            'NVIDIA, '
                                                                                                                                                                                            'AMD '
                                                                                                                                                                                            'e '
                                                                                                                                                                                            'Intel.',
        'VI. Modular Architecture': 'VI. Arquitectura Modular',
        'Lightweight installer with zero bloat. Heavy gaming platforms and emulators are cleanly delegated to post-installation setup in X64 Hello after first boot.': 'Instalador '
                                                                                                                                                                       'ligero '
                                                                                                                                                                       'sin '
                                                                                                                                                                       'bloatware. '
                                                                                                                                                                       'Las '
                                                                                                                                                                       'plataformas '
                                                                                                                                                                       'pesadas '
                                                                                                                                                                       'de '
                                                                                                                                                                       'juegos '
                                                                                                                                                                       'y '
                                                                                                                                                                       'emuladores '
                                                                                                                                                                       'se '
                                                                                                                                                                       'delegan '
                                                                                                                                                                       'limpiamente '
                                                                                                                                                                       'al '
                                                                                                                                                                       'asistente '
                                                                                                                                                                       'post-instalación '
                                                                                                                                                                       'en '
                                                                                                                                                                       'X64 '
                                                                                                                                                                       'Hello '
                                                                                                                                                                       'tras '
                                                                                                                                                                       'el '
                                                                                                                                                                       'primer '
                                                                                                                                                                       'arranque.',
        'VII. Shield of Resilience': 'VII. Escudo de Resiliencia',
        'Temporal immutability with Btrfs & automated Snapper snapshots. Multi-bootloader support choosing Limine, GRUB, systemd-boot, or rEFInd for effortless rollback.': 'Inmutabilidad '
                                                                                                                                                                            'temporal '
                                                                                                                                                                            'con '
                                                                                                                                                                            'Btrfs '
                                                                                                                                                                            'y '
                                                                                                                                                                            'snapshots '
                                                                                                                                                                            'automáticos '
                                                                                                                                                                            'de '
                                                                                                                                                                            'Snapper. '
                                                                                                                                                                            'Soporte '
                                                                                                                                                                            'multi-bootloader '
                                                                                                                                                                            'eligiendo '
                                                                                                                                                                            'Limine, '
                                                                                                                                                                            'GRUB, '
                                                                                                                                                                            'systemd-boot '
                                                                                                                                                                            'o '
                                                                                                                                                                            'rEFInd '
                                                                                                                                                                            'para '
                                                                                                                                                                            'rollback '
                                                                                                                                                                            'sin '
                                                                                                                                                                            'esfuerzo.',
        'VIII. The Death of the Terminal': 'VIII. La Muerte de la Terminal',
        'GUI-First philosophy for effortless everyday use, paired with an elite hacker terminal experience in Kitty, Fish shell, and Starship pills for power users.': 'Filosofía '
                                                                                                                                                                       'GUI-First '
                                                                                                                                                                       'para '
                                                                                                                                                                       'uso '
                                                                                                                                                                       'diario '
                                                                                                                                                                       'intuitivo, '
                                                                                                                                                                       'unida '
                                                                                                                                                                       'a '
                                                                                                                                                                       'una '
                                                                                                                                                                       'experiencia '
                                                                                                                                                                       'de '
                                                                                                                                                                       'terminal '
                                                                                                                                                                       'hacker '
                                                                                                                                                                       'de '
                                                                                                                                                                       'élite '
                                                                                                                                                                       'en '
                                                                                                                                                                       'Kitty, '
                                                                                                                                                                       'Fish '
                                                                                                                                                                       'shell '
                                                                                                                                                                       'y '
                                                                                                                                                                       'Starship '
                                                                                                                                                                       'pills '
                                                                                                                                                                       'para '
                                                                                                                                                                       'usuarios '
                                                                                                                                                                       'avanzados.',
        'IX. Hybrid Rolling Release': 'IX. Rolling Release Híbrido',
        'The core flies at pure Arch rolling speed, while professional apps can be isolated via Flatpak or Distrobox containers to guarantee Debian-level rock-solid stability.': 'El '
                                                                                                                                                                                  'núcleo '
                                                                                                                                                                                  'vuela '
                                                                                                                                                                                  'a '
                                                                                                                                                                                  'velocidad '
                                                                                                                                                                                  'pura '
                                                                                                                                                                                  'Arch '
                                                                                                                                                                                  'rolling, '
                                                                                                                                                                                  'mientras '
                                                                                                                                                                                  'aplicaciones '
                                                                                                                                                                                  'profesionales '
                                                                                                                                                                                  'pueden '
                                                                                                                                                                                  'aislarse '
                                                                                                                                                                                  'vía '
                                                                                                                                                                                  'Flatpak '
                                                                                                                                                                                  'o '
                                                                                                                                                                                  'contenedores '
                                                                                                                                                                                  'Distrobox '
                                                                                                                                                                                  'para '
                                                                                                                                                                                  'garantizar '
                                                                                                                                                                                  'estabilidad '
                                                                                                                                                                                  'de '
                                                                                                                                                                                  'roca '
                                                                                                                                                                                  'estilo '
                                                                                                                                                                                  'Debian.',
        'X. Architectural Pragmatism': 'X. Pragmatismo Arquitectónico',
        'Open Source synergy. We inherit and polish battle-tested foundations, writing custom code and maintaining our own repositories only where we add unique value.': 'Sinergia '
                                                                                                                                                                          'Open '
                                                                                                                                                                          'Source. '
                                                                                                                                                                          'Heredamos '
                                                                                                                                                                          'y '
                                                                                                                                                                          'pulimos '
                                                                                                                                                                          'cimientos '
                                                                                                                                                                          'probados '
                                                                                                                                                                          'en '
                                                                                                                                                                          'batalla, '
                                                                                                                                                                          'programando '
                                                                                                                                                                          'código '
                                                                                                                                                                          'propio '
                                                                                                                                                                          'y '
                                                                                                                                                                          'manteniendo '
                                                                                                                                                                          'repositorios '
                                                                                                                                                                          'propios '
                                                                                                                                                                          'solo '
                                                                                                                                                                          'donde '
                                                                                                                                                                          'aportamos '
                                                                                                                                                                          'valor '
                                                                                                                                                                          'único.',
        'XI. Aesthetics as Function': 'XI. La Estética como Función',
        'Design is not an afterthought. Widescreen panoramic UI, Crimson & Charcoal color direction (#b31b1b / #0b0b0d), and vector iconography engineered for focus and control.': 'El '
                                                                                                                                                                                    'diseño '
                                                                                                                                                                                    'no '
                                                                                                                                                                                    'es '
                                                                                                                                                                                    'una '
                                                                                                                                                                                    'ocurrencia '
                                                                                                                                                                                    'tardía. '
                                                                                                                                                                                    'UI '
                                                                                                                                                                                    'panorámica '
                                                                                                                                                                                    'Widescreen, '
                                                                                                                                                                                    'paleta '
                                                                                                                                                                                    'Carmesí '
                                                                                                                                                                                    '& '
                                                                                                                                                                                    'Carbón '
                                                                                                                                                                                    '(#b31b1b '
                                                                                                                                                                                    '/ '
                                                                                                                                                                                    '#0b0b0d) '
                                                                                                                                                                                    'e '
                                                                                                                                                                                    'iconografía '
                                                                                                                                                                                    'vectorial '
                                                                                                                                                                                    'diseñada '
                                                                                                                                                                                    'para '
                                                                                                                                                                                    'concentración '
                                                                                                                                                                                    'y '
                                                                                                                                                                                    'control.',
        'XII. Absolute Privacy': 'XII. Privacidad Absoluta',
        'In the era of covert telemetry, your PC is your private fortress. Zero tracking, zero telemetry, and zero data reporting. What you do on your machine, dies on your machine.': 'En '
                                                                                                                                                                                        'la '
                                                                                                                                                                                        'era '
                                                                                                                                                                                        'de '
                                                                                                                                                                                        'la '
                                                                                                                                                                                        'telemetría '
                                                                                                                                                                                        'encubierta, '
                                                                                                                                                                                        'tu '
                                                                                                                                                                                        'PC '
                                                                                                                                                                                        'es '
                                                                                                                                                                                        'tu '
                                                                                                                                                                                        'fortaleza '
                                                                                                                                                                                        'privada. '
                                                                                                                                                                                        'Cero '
                                                                                                                                                                                        'rastreo, '
                                                                                                                                                                                        'cero '
                                                                                                                                                                                        'telemetría '
                                                                                                                                                                                        'y '
                                                                                                                                                                                        'cero '
                                                                                                                                                                                        'reportes '
                                                                                                                                                                                        'de '
                                                                                                                                                                                        'datos. '
                                                                                                                                                                                        'Lo '
                                                                                                                                                                                        'que '
                                                                                                                                                                                        'haces '
                                                                                                                                                                                        'en '
                                                                                                                                                                                        'tu '
                                                                                                                                                                                        'máquina, '
                                                                                                                                                                                        'muere '
                                                                                                                                                                                        'en '
                                                                                                                                                                                        'tu '
                                                                                                                                                                                        'máquina.',
        'X64 LIOS COMMAND CENTER': 'CENTRO DE MANDO X64 LIOS',
        'FIREWALL UFW': 'CORTAFUEGOS UFW',
        'Welcome': 'Bienvenido',
        'Operating system installed and running at peak hardware capacity.': 'Sistema operativo instalado y ejecutándose a máxima '
                                                                             'capacidad de hardware.',
        'UPDATE SYSTEM': 'ACTUALIZAR SISTEMA',
        'LIVE BTOP MONITOR': 'MONITOR BTOP EN VIVO',
        'REAL-TIME HARDWARE TELEMETRY': 'TELEMETRÍA DE HARDWARE EN TIEMPO REAL',
        'PROCESSOR (CPU)': 'PROCESADOR (CPU)',
        'Threads': 'Hilos',
        'PHYSICAL RAM & ZRAM': 'MEMORIA RAM Y ZRAM',
        'ZRAM Active in RAM • Zero Disk Swap': 'ZRAM Activo en RAM • Cero Swap en Disco',
        'High-Speed System Memory': 'Memoria del Sistema de Alta Velocidad',
        'GRAPHICS & COMPOSITOR (GPU)': 'GRÁFICOS Y COMPOSITOR (GPU)',
        'Hardware Acceleration Active': 'Aceleración por Hardware Activa',
        'ROOT STORAGE (/) & UPTIME': 'DISCO RAÍZ (/) Y UPTIME',
        'Filesystem': 'Sistema',
        'Uptime': 'Activo',
        'OFFICIAL ECOSYSTEM & COMMUNITY': 'ECOSISTEMA Y COMUNIDAD OFICIAL',
        'Official Website & Wiki': 'Sitio Web y Wiki',
        'Official guides, system modules, and documentation.': 'Guías oficiales, módulos del sistema y documentación.',
        'Real-time support channels, setups, and community chat.': 'Canales de soporte en tiempo real, setups y comunidad.',
        'X64 DNS & Low-Latency Optimizer': 'Optimizador de DNS y Baja Latencia X64',
        'Active Network Connection:': 'Conexión de Red Activa:',
        '⚡ Benchmark DNS Latency (Ping)': '⚡ Medir Latencia DNS (Ping)',
        'Testing ping to all DNS servers...': 'Midiendo latencia (ping) a todos los servidores DNS...',
        'Enable Encrypted DNS (DNS-over-TLS / DoT)': 'Activar DNS Cifrado (DNS-over-TLS / DoT)',
        'Reset to Automatic (DHCP)': 'Restablecer a Automático (DHCP)',
        'Apply Selected DNS': 'Aplicar DNS Seleccionado',
        'Close': 'Cerrar',
        'Applying DNS configuration...': 'Aplicando configuración de DNS...',
        'Resetting DNS to automatic DHCP...': 'Restableciendo DNS a DHCP automático...',
        'Operation canceled or authentication failed.': 'Operación cancelada o fallo de autenticación.',
        'DNS successfully applied to connection:': 'Servidor DNS aplicado con éxito a la conexión:',
        'DNS reset to automatic DHCP on:': 'DNS restablecido a DHCP automático en:',
        'Ultra-Fast Gaming': 'Gaming Ultra-Rápido',
        'Anti-Malware Filter': 'Filtro Anti-Malware',
        'Ad & Tracker Blocker': 'Bloqueo de Anuncios',
        'Swiss Privacy': 'Privacidad Suiza',
        'High Availability': 'Alta Disponibilidad',
        'Classic Stability': 'Estabilidad Clásica'},
 'fr': {'Home': 'Accueil',
        'Tweaks & System': 'Système & Tweaks',
        'Gaming Center': 'Centre Gaming',
        'Philosophy': 'Philosophie',
        'Welcome to X64 LIOS': 'Bienvenue sur X64 LIOS',
        'Update System': 'Mettre à jour le système',
        'Synchronize repositories and upgrade all system packages (pacman -Syu).': 'Synchroniser les dépôts et mettre à jour tous les '
                                                                                   'paquets (pacman -Syu).',
        'Discord Community': 'Communauté Discord',
        'System Services & Tweaks': 'Services et Optimisation Système',
        'Control real-time daemons, configure low-latency DNS, and execute system rescue routines with a single click.': 'Contrôlez les '
                                                                                                                         'démons en temps '
                                                                                                                         'réel, configurez '
                                                                                                                         'les DNS basse '
                                                                                                                         'latence et '
                                                                                                                         'exécutez la '
                                                                                                                         'maintenance en '
                                                                                                                         'un clic.',
        'Real-Time Daemons & Services': 'Démons et Services en Temps Réel',
        'System Maintenance & Utilities': 'Maintenance et Utilitaires Système',
        'Troubleshooting & System Rescue': 'Dépannage et Sauvetage Système',
        'FalconD Gaming Daemon': 'FalconD Gaming',
        'Dynamic CPU affinity and automatic performance profiles for games.': 'Affinité CPU dynamique et profils gaming.',
        'Ananicy-cpp Priority': 'Priorité Ananicy-cpp',
        'Automatic process nice/ionice latency tuning in the background.': 'Priorité et latence des processus en direct.',
        'Bpftune Kernel Auto-Tuning': 'Noyau Bpftune',
        'Dynamic eBPF network buffer and sysctl optimization in real time.': 'Optimisation eBPF réseau et noyau en direct.',
        'Systemd-OOMD Anti-Freeze': 'Systemd-OOMD',
        'Prevents hard system freezes under extreme 100% RAM/ZRAM exhaustion.': 'Protection contre le blocage de la mémoire RAM.',
        'Profile-sync-daemon (RAM Browser)': 'Navigateur en RAM',
        'Moves browser profiles to tmpfs RAM for instant speed and less SSD wear.': 'Profils web (PSD) chargés en RAM.',
        'LIOS Update Notifier': 'LIOS Update',
        'System tray timer that checks and alerts when new updates are ready.': 'Alerte automatique des mises à jour.',
        'UFW Security Firewall': 'Pare-feu UFW',
        'Active network protection against unauthorized incoming connections.': 'Protection active des ports et du réseau.',
        'Bluetooth Service': 'Service Bluetooth',
        'Support for wireless controllers, headsets, and Bluetooth peripherals.': 'Manettes et audio sans fil.',
        'NVMe / SSD Trim Timer': 'Trim NVMe / SSD',
        'Weekly scheduled block maintenance to preserve SSD lifespan and speed.': 'Maintenance hebdomadaire des blocs SSD.',
        'ACTIVE': 'ACTIF',
        'INACTIVE': 'INACTIF',
        'Rank Fastest Mirrors': 'Classer les Miroirs',
        'Test and select the fastest download servers.': 'Sélectionne les serveurs les plus rapides.',
        'Clean Package Cache': 'Nettoyer le Cache Pacman',
        'Free up disk space by removing old cached packages (pacman -Sc).': "Libère l'espace des anciens paquets.",
        'Remove Orphan Packages': 'Purger les Orphelins',
        'Purge unused dependency packages left behind on your system.': 'Supprime les dépendances inutilisées.',
        'Change DNS Server': 'Changer le Serveur DNS',
        'Measure ping latency and switch to Cloudflare, AdGuard, Quad9, or DoT.': 'Mesure le ping et active des DNS rapides.',
        'Install Winboat (Windows Apps)': 'Installer Winboat',
        'Run Windows productivity apps seamlessly via container integration.': 'Applications Windows via conteneur léger.',
        'Unlock Pacman Database': 'Déverrouiller la Base Pacman (db.lck)',
        'Remove /var/lib/pacman/db.lck if a previous update was interrupted.': 'Supprime /var/lib/pacman/db.lck après une interruption.',
        'Reset Pacman Keyrings': 'Réinitialiser les Clés GPG (Keyrings)',
        'Reinitialize and populate GPG cryptographic keys if package signatures fail.': 'Régénère les clés GPG si les signatures échouent.',
        'Reinstall All Native Packages': 'Réinstaller Tous les Paquets Natifs',
        'Force reinstall of all native system packages to repair damaged files.': 'Réinstalle tous les paquets natifs pour réparer le '
                                                                                  'système.',
        'KWin (Wayland) Debug Console': 'Console de Débogage KWin (Wayland)',
        'Open the native KWin Wayland diagnostic inspector for windows and VRR.': "Ouvre l'inspecteur KWin pour diagnostiquer Wayland et "
                                                                                  'VRR.',
        'X64 Gaming Center': 'Centre Gaming X64',
        'Modular 1-click installation of gaming launchers, compatibility layers, and FPS overlays.': 'Installation modulaire en 1 clic des '
                                                                                                     'lanceurs de jeux, couches '
                                                                                                     'Proton/UMU, bibliothèques 32 bits et '
                                                                                                     'overlays FPS.',
        'MODULAR COMPONENT INSTALLATION': 'INSTALLATION MODULAIRE PAR COMPOSANT',
        'Full X64 Gaming Suite (All-in-One)': 'Suite Gaming X64 Complète (Tout-en-Un)',
        'Complete arsenal: Steam, Lutris, Heroic, Faugus, Gamescope, Proton-SLR, UMU, Wine, MangoHud, ProtonUp-Qt & 32-bit libs.': 'Arsenal '
                                                                                                                                   'complet '
                                                                                                                                   ': '
                                                                                                                                   'Steam, '
                                                                                                                                   'Lutris, '
                                                                                                                                   'Heroic, '
                                                                                                                                   'Faugus, '
                                                                                                                                   'Gamescope, '
                                                                                                                                   'Proton-SLR, '
                                                                                                                                   'UMU, '
                                                                                                                                   'Wine, '
                                                                                                                                   'MangoHud, '
                                                                                                                                   'ProtonUp-Qt '
                                                                                                                                   'et '
                                                                                                                                   'libs '
                                                                                                                                   '32 '
                                                                                                                                   'bits.',
        'X64 Gaming Core, Proton-SLR & Wine X64': 'Cœur Gaming & Wine X64',
        'Essential 32-bit Vulkan/Audio libs, Proton-SLR, UMU, Wine X64, Winetricks & Protontricks.': 'Bibliothèques 32 bits Vulkan/Audio, '
                                                                                                     'Proton-SLR, UMU, Wine X64, '
                                                                                                     'Winetricks et Protontricks.',
        'Steam': 'Steam',
        'Official Valve gaming platform with native Proton integration.': 'Plateforme officielle de Valve avec intégration native de '
                                                                          'Proton.',
        'Lutris': 'Lutris',
        'Unified open gaming manager for Epic, GOG, Battle.net, EA, and Wine.': 'Gestionnaire de jeux unifié pour Epic, GOG, Battle.net, '
                                                                                'EA et Wine.',
        'Heroic Games Launcher': 'Heroic Games Launcher',
        'Native graphical launcher for Epic Games, GOG, and Amazon Games.': 'Lanceur graphique natif pour Epic Games, GOG et Amazon Games.',
        'Faugus Launcher': 'Faugus Launcher',
        'Ultra-lightweight modern launcher for Battle.net, EA App, Ubisoft, and standalone Windows games via UMU/Proton.': 'Lanceur '
                                                                                                                           'ultra-léger '
                                                                                                                           'pour '
                                                                                                                           'Battle.net, EA '
                                                                                                                           'App, Ubisoft '
                                                                                                                           'et jeux '
                                                                                                                           'Windows via '
                                                                                                                           'UMU/Proton.',
        'MangoHud & GOverlay': 'MangoHud & GOverlay',
        'In-game FPS, frametime, CPU/GPU temperature HUD and graphical configurator.': 'HUD en jeu pour FPS, frametime, températures '
                                                                                       'CPU/GPU et configurateur GOverlay.',
        'Gamescope (Valve Micro-Compositor)': 'Gamescope (Compositeur Valve)',
        'Valve Wayland micro-compositor for FSR upscaling, frame limiting, and resolution isolation.': 'Micro-compositeur Wayland de Valve '
                                                                                                       "pour mise à l'échelle FSR, limite "
                                                                                                       'de FPS et isolation.',
        'ProtonUp-Qt': 'ProtonUp-Qt',
        'Graphical manager to install and update GE-Proton and Wine-GE versions.': 'Gestionnaire graphique pour installer et mettre à jour '
                                                                                   'GE-Proton et Wine-GE.',
        'INSTALLED ✓': 'INSTALLÉ ✓',
        'INSTALL': 'INSTALLER',
        'INSTALL SUITE': 'INSTALLER SUITE',
        'Launch at startup': 'Lancer au démarrage',
        'Architecture:': 'Architecture :',
        'Session:': 'Session :',
        'Installed': 'Installé',
        'X64 Architectural Manifesto': 'Manifeste Architectural X64',
        'X64 LIOS was born as the ultimate answer to Linux fragmentation. We extract the raw power of high-performance kernels, the precision of the gaming ecosystem, and the purity of Arch to forge the definitive operating system.': 'X64 '
                                                                                                                                                                                                                                          'LIOS '
                                                                                                                                                                                                                                          'est '
                                                                                                                                                                                                                                          'né '
                                                                                                                                                                                                                                          'comme '
                                                                                                                                                                                                                                          'la '
                                                                                                                                                                                                                                          'réponse '
                                                                                                                                                                                                                                          'ultime '
                                                                                                                                                                                                                                          'à '
                                                                                                                                                                                                                                          'la '
                                                                                                                                                                                                                                          'fragmentation '
                                                                                                                                                                                                                                          'de '
                                                                                                                                                                                                                                          'Linux. '
                                                                                                                                                                                                                                          'Nous '
                                                                                                                                                                                                                                          'unissons '
                                                                                                                                                                                                                                          'la '
                                                                                                                                                                                                                                          'puissance '
                                                                                                                                                                                                                                          'brute '
                                                                                                                                                                                                                                          'des '
                                                                                                                                                                                                                                          'noyaux '
                                                                                                                                                                                                                                          'haute '
                                                                                                                                                                                                                                          'performance, '
                                                                                                                                                                                                                                          'la '
                                                                                                                                                                                                                                          'précision '
                                                                                                                                                                                                                                          'gaming '
                                                                                                                                                                                                                                          'et '
                                                                                                                                                                                                                                          'la '
                                                                                                                                                                                                                                          'pureté '
                                                                                                                                                                                                                                          "d'Arch.",
        'I. Absolute Freedom': 'I. Liberté Absolue',
        'Upstream purity of Arch Linux with zero PPAs, zero corporate ties, and 99% of system packages intact. Combined with the AUR and modern GUI tools for complete freedom.': 'Pureté '
                                                                                                                                                                                  'Upstream '
                                                                                                                                                                                  "d'Arch "
                                                                                                                                                                                  'Linux '
                                                                                                                                                                                  'sans '
                                                                                                                                                                                  'PPA '
                                                                                                                                                                                  'ni '
                                                                                                                                                                                  'attaches '
                                                                                                                                                                                  'corporatives, '
                                                                                                                                                                                  'combinée '
                                                                                                                                                                                  'à '
                                                                                                                                                                                  "l'AUR "
                                                                                                                                                                                  'et '
                                                                                                                                                                                  'à '
                                                                                                                                                                                  'des '
                                                                                                                                                                                  'outils '
                                                                                                                                                                                  'graphiques '
                                                                                                                                                                                  'modernes.',
        'II. Surgical Optimization': 'II. Optimisation Chirurgicale',
        'X64 low-latency kernel with scx dynamic schedulers, FalconD gaming CPU affinity, ananicy-cpp priority tuning, and pure ZRAM in RAM for zero disk swap latency.': 'Noyau '
                                                                                                                                                                          'X64 '
                                                                                                                                                                          'basse '
                                                                                                                                                                          'latence '
                                                                                                                                                                          'avec '
                                                                                                                                                                          'ordonnanceurs '
                                                                                                                                                                          'scx, '
                                                                                                                                                                          'affinité '
                                                                                                                                                                          'CPU '
                                                                                                                                                                          'FalconD, '
                                                                                                                                                                          'ananicy-cpp '
                                                                                                                                                                          'et '
                                                                                                                                                                          'ZRAM '
                                                                                                                                                                          'pur '
                                                                                                                                                                          'en '
                                                                                                                                                                          'mémoire '
                                                                                                                                                                          'vive.',
        'III. Multi-Environment Ecosystem': 'III. Écosystème Multi-Environnement',
        'Live environment in KDE Plasma 6 Wayland, plus 8 official installation options (KDE, GNOME, COSMIC, Niri, Cinnamon, Xfce, Hyprland, and Server) with 16:9 previews.': 'Environnement '
                                                                                                                                                                               'Live '
                                                                                                                                                                               'sous '
                                                                                                                                                                               'KDE '
                                                                                                                                                                               'Plasma '
                                                                                                                                                                               '6 '
                                                                                                                                                                               'Wayland, '
                                                                                                                                                                               'plus '
                                                                                                                                                                               '8 '
                                                                                                                                                                               'bureaux '
                                                                                                                                                                               'officiels '
                                                                                                                                                                               'à '
                                                                                                                                                                               "l'installation "
                                                                                                                                                                               'avec '
                                                                                                                                                                               'aperçus '
                                                                                                                                                                               '16:9.',
        'IV. Infrastructure Independence': "IV. Indépendance d'Infrastructure",
        'Cascading repository hierarchy. [x64-lios] holds priority #1 at the top of the system, served with SSL from our high-speed CDN infrastructure.': 'Hiérarchie '
                                                                                                                                                          'de '
                                                                                                                                                          'dépôts '
                                                                                                                                                          'en '
                                                                                                                                                          'cascade. '
                                                                                                                                                          '[x64-lios] '
                                                                                                                                                          'détient '
                                                                                                                                                          'la '
                                                                                                                                                          'priorité '
                                                                                                                                                          '#1 '
                                                                                                                                                          'absolue '
                                                                                                                                                          'au '
                                                                                                                                                          'sommet '
                                                                                                                                                          'du '
                                                                                                                                                          'système '
                                                                                                                                                          'via '
                                                                                                                                                          'notre '
                                                                                                                                                          'CDN '
                                                                                                                                                          'SSL.',
        'V. Hardware Mutation': 'V. Mutation Matérielle',
        'During installation, the system audits your CPU: modern processors get AVX2/AVX512 (v3/v4) repositories injected below [x64-lios]. chwd autodetects NVIDIA, AMD, and Intel GPUs.': 'Durant '
                                                                                                                                                                                            "l'installation, "
                                                                                                                                                                                            'le '
                                                                                                                                                                                            'système '
                                                                                                                                                                                            'audite '
                                                                                                                                                                                            'votre '
                                                                                                                                                                                            'CPU '
                                                                                                                                                                                            '(dépôts '
                                                                                                                                                                                            'AVX2/AVX512 '
                                                                                                                                                                                            'v3/v4) '
                                                                                                                                                                                            'et '
                                                                                                                                                                                            'détecte '
                                                                                                                                                                                            'automatiquement '
                                                                                                                                                                                            'les '
                                                                                                                                                                                            'GPU '
                                                                                                                                                                                            'NVIDIA, '
                                                                                                                                                                                            'AMD '
                                                                                                                                                                                            'et '
                                                                                                                                                                                            'Intel.',
        'VI. Modular Architecture': 'VI. Architecture Modulaire',
        'Lightweight installer with zero bloat. Heavy gaming platforms and emulators are cleanly delegated to post-installation setup in X64 Hello after first boot.': 'Installateur '
                                                                                                                                                                       'léger '
                                                                                                                                                                       'sans '
                                                                                                                                                                       'bloatware. '
                                                                                                                                                                       'Les '
                                                                                                                                                                       'plateformes '
                                                                                                                                                                       'de '
                                                                                                                                                                       'jeux '
                                                                                                                                                                       'lourdes '
                                                                                                                                                                       'sont '
                                                                                                                                                                       'déléguées '
                                                                                                                                                                       'proprement '
                                                                                                                                                                       'à '
                                                                                                                                                                       'X64 '
                                                                                                                                                                       'Hello '
                                                                                                                                                                       'après '
                                                                                                                                                                       'le '
                                                                                                                                                                       'premier '
                                                                                                                                                                       'démarrage.',
        'VII. Shield of Resilience': 'VII. Bouclier de Résilience',
        'Temporal immutability with Btrfs & automated Snapper snapshots. Multi-bootloader support choosing Limine, GRUB, systemd-boot, or rEFInd for effortless rollback.': 'Immuabilité '
                                                                                                                                                                            'temporelle '
                                                                                                                                                                            'avec '
                                                                                                                                                                            'Btrfs '
                                                                                                                                                                            'et '
                                                                                                                                                                            'instantanés '
                                                                                                                                                                            'Snapper. '
                                                                                                                                                                            'Support '
                                                                                                                                                                            'multi-bootloader '
                                                                                                                                                                            '(Limine, '
                                                                                                                                                                            'GRUB, '
                                                                                                                                                                            'systemd-boot, '
                                                                                                                                                                            'rEFInd).',
        'VIII. The Death of the Terminal': 'VIII. La Fin du Terminal Obligatoire',
        'GUI-First philosophy for effortless everyday use, paired with an elite hacker terminal experience in Kitty, Fish shell, and Starship pills for power users.': 'Philosophie '
                                                                                                                                                                       'GUI-First '
                                                                                                                                                                       'pour '
                                                                                                                                                                       'le '
                                                                                                                                                                       'quotidien, '
                                                                                                                                                                       'alliée '
                                                                                                                                                                       'à '
                                                                                                                                                                       'un '
                                                                                                                                                                       'terminal '
                                                                                                                                                                       "d'élite "
                                                                                                                                                                       'avec '
                                                                                                                                                                       'Kitty, '
                                                                                                                                                                       'Fish '
                                                                                                                                                                       'shell '
                                                                                                                                                                       'et '
                                                                                                                                                                       'Starship.',
        'IX. Hybrid Rolling Release': 'IX. Rolling Release Hybride',
        'The core flies at pure Arch rolling speed, while professional apps can be isolated via Flatpak or Distrobox containers to guarantee Debian-level rock-solid stability.': 'Le '
                                                                                                                                                                                  'cœur '
                                                                                                                                                                                  'tourne '
                                                                                                                                                                                  'à '
                                                                                                                                                                                  'la '
                                                                                                                                                                                  'vitesse '
                                                                                                                                                                                  "d'Arch "
                                                                                                                                                                                  'rolling, '
                                                                                                                                                                                  'tandis '
                                                                                                                                                                                  'que '
                                                                                                                                                                                  'les '
                                                                                                                                                                                  'applications '
                                                                                                                                                                                  'pro '
                                                                                                                                                                                  'peuvent '
                                                                                                                                                                                  'être '
                                                                                                                                                                                  'isolées '
                                                                                                                                                                                  'via '
                                                                                                                                                                                  'Flatpak '
                                                                                                                                                                                  'ou '
                                                                                                                                                                                  'Distrobox.',
        'X. Architectural Pragmatism': 'X. Pragmatisme Architectural',
        'Open Source synergy. We inherit and polish battle-tested foundations, writing custom code and maintaining our own repositories only where we add unique value.': 'Synergie '
                                                                                                                                                                          'Open '
                                                                                                                                                                          'Source '
                                                                                                                                                                          ': '
                                                                                                                                                                          'nous '
                                                                                                                                                                          'polissons '
                                                                                                                                                                          'des '
                                                                                                                                                                          'fondations '
                                                                                                                                                                          'éprouvées '
                                                                                                                                                                          'et '
                                                                                                                                                                          'maintenons '
                                                                                                                                                                          'nos '
                                                                                                                                                                          'propres '
                                                                                                                                                                          'dépôts '
                                                                                                                                                                          'là '
                                                                                                                                                                          'où '
                                                                                                                                                                          'nous '
                                                                                                                                                                          'apportons '
                                                                                                                                                                          'une '
                                                                                                                                                                          'valeur '
                                                                                                                                                                          'unique.',
        'XI. Aesthetics as Function': "XI. L'Esthétique comme Fonction",
        'Design is not an afterthought. Widescreen panoramic UI, Crimson & Charcoal color direction (#b31b1b / #0b0b0d), and vector iconography engineered for focus and control.': 'Interface '
                                                                                                                                                                                    'panoramique '
                                                                                                                                                                                    'Widescreen, '
                                                                                                                                                                                    'palette '
                                                                                                                                                                                    'Cramoisi '
                                                                                                                                                                                    '& '
                                                                                                                                                                                    'Charbon '
                                                                                                                                                                                    '(#b31b1b '
                                                                                                                                                                                    '/ '
                                                                                                                                                                                    '#0b0b0d) '
                                                                                                                                                                                    'et '
                                                                                                                                                                                    'iconographie '
                                                                                                                                                                                    'vectorielle '
                                                                                                                                                                                    'de '
                                                                                                                                                                                    'haute '
                                                                                                                                                                                    'précision.',
        'XII. Absolute Privacy': 'XII. Confidentialité Absolue',
        'In the era of covert telemetry, your PC is your private fortress. Zero tracking, zero telemetry, and zero data reporting. What you do on your machine, dies on your machine.': 'Votre '
                                                                                                                                                                                        'PC '
                                                                                                                                                                                        'est '
                                                                                                                                                                                        'votre '
                                                                                                                                                                                        'forteresse '
                                                                                                                                                                                        'privée '
                                                                                                                                                                                        ': '
                                                                                                                                                                                        'zéro '
                                                                                                                                                                                        'pistage, '
                                                                                                                                                                                        'zéro '
                                                                                                                                                                                        'télémétrie '
                                                                                                                                                                                        'et '
                                                                                                                                                                                        'zéro '
                                                                                                                                                                                        'collecte '
                                                                                                                                                                                        'de '
                                                                                                                                                                                        'données.',
        'X64 LIOS COMMAND CENTER': 'CENTRE DE COMMANDE X64 LIOS',
        'FIREWALL UFW': 'PARE-FEU UFW',
        'Welcome': 'Bienvenue',
        'Operating system installed and running at peak hardware capacity.': "Système d'exploitation installé et fonctionnant à pleine "
                                                                             'capacité matérielle.',
        'UPDATE SYSTEM': 'METTRE À JOUR',
        'LIVE BTOP MONITOR': 'MONITEUR BTOP EN DIRECT',
        'REAL-TIME HARDWARE TELEMETRY': 'TÉLÉMÉTRIE MATÉRIELLE EN TEMPS RÉEL',
        'PROCESSOR (CPU)': 'PROCESSEUR (CPU)',
        'Threads': 'Threads',
        'PHYSICAL RAM & ZRAM': 'MÉMOIRE RAM & ZRAM',
        'ZRAM Active in RAM • Zero Disk Swap': 'ZRAM Actif en RAM • Zéro Swap Disque',
        'High-Speed System Memory': 'Mémoire Système Haute Vitesse',
        'GRAPHICS & COMPOSITOR (GPU)': 'GRAPHIQUES & COMPOSITEUR (GPU)',
        'Hardware Acceleration Active': 'Accélération Matérielle Active',
        'ROOT STORAGE (/) & UPTIME': 'DISQUE RACINE (/) & UPTIME',
        'Filesystem': 'Système',
        'Uptime': 'Actif',
        'OFFICIAL ECOSYSTEM & COMMUNITY': 'ÉCOSYSTÈME & COMMUNAUTÉ OFFICIELLE',
        'Official Website & Wiki': 'Site Officiel & Wiki',
        'Official guides, system modules, and documentation.': 'Guides officiels, modules système et documentation.',
        'Real-time support channels, setups, and community chat.': "Canaux d'entraide en direct, configurations et discussion.",
        'X64 DNS & Low-Latency Optimizer': 'Optimiseur DNS & Basse Latence X64',
        'Active Network Connection:': 'Connexion Réseau Active :',
        '⚡ Benchmark DNS Latency (Ping)': '⚡ Tester la Latence DNS (Ping)',
        'Testing ping to all DNS servers...': 'Mesure de la latence (ping) vers tous les serveurs DNS...',
        'Enable Encrypted DNS (DNS-over-TLS / DoT)': 'Activer le DNS Chiffré (DNS-over-TLS / DoT)',
        'Reset to Automatic (DHCP)': 'Réinitialiser en Automatique (DHCP)',
        'Apply Selected DNS': 'Appliquer le DNS Sélectionné',
        'Close': 'Fermer',
        'Applying DNS configuration...': 'Application de la configuration DNS...',
        'Resetting DNS to automatic DHCP...': 'Réinitialisation du DNS en DHCP automatique...',
        'Operation canceled or authentication failed.': "Opération annulée ou échec d'authentification.",
        'DNS successfully applied to connection:': 'Serveur DNS appliqué avec succès à la connexion :',
        'DNS reset to automatic DHCP on:': 'DNS réinitialisé en DHCP automatique sur :',
        'Ultra-Fast Gaming': 'Gaming Ultra-Rapide',
        'Anti-Malware Filter': 'Filtre Anti-Malware',
        'Ad & Tracker Blocker': 'Bloqueur de Publicités',
        'Swiss Privacy': 'Confidentialité Suisse',
        'High Availability': 'Haute Disponibilité',
        'Classic Stability': 'Stabilité Classique'},
 'de': {'Home': 'Startseite',
        'Tweaks & System': 'System & Tweaks',
        'Gaming Center': 'Gaming-Center',
        'Philosophy': 'Philosophie',
        'Welcome to X64 LIOS': 'Willkommen bei X64 LIOS',
        'Update System': 'System aktualisieren',
        'Synchronize repositories and upgrade all system packages (pacman -Syu).': 'Paketquellen & System aktualisieren (pacman -Syu).',
        'Discord Community': 'Discord-Community',
        'System Services & Tweaks': 'Systemdienste & Optimierungen',
        'Control real-time daemons, configure low-latency DNS, and execute system rescue routines with a single click.': 'Steuern Sie '
                                                                                                                         'Echtzeit-Daemons, '
                                                                                                                         'konfigurieren '
                                                                                                                         'Sie '
                                                                                                                         'Low-Latency-DNS '
                                                                                                                         'und führen Sie '
                                                                                                                         'Systemrettungen '
                                                                                                                         'mit einem Klick '
                                                                                                                         'aus.',
        'Real-Time Daemons & Services': 'Echtzeit-Daemons & Systemdienste',
        'System Maintenance & Utilities': 'Systemwartung & Werkzeuge',
        'Troubleshooting & System Rescue': 'Fehlerbehebung & Systemrettung',
        'FalconD Gaming Daemon': 'FalconD Gaming',
        'Dynamic CPU affinity and automatic performance profiles for games.': 'Dynamische CPU-Affinität für Spiele.',
        'Ananicy-cpp Priority': 'Ananicy-cpp Priorität',
        'Automatic process nice/ionice latency tuning in the background.': 'Automatische Prozess- und Latenzoptimierung.',
        'Bpftune Kernel Auto-Tuning': 'Bpftune-Kernel',
        'Dynamic eBPF network buffer and sysctl optimization in real time.': 'Live eBPF-Netzwerk- & Kernel-Tuning.',
        'Systemd-OOMD Anti-Freeze': 'Systemd-OOMD Schutz',
        'Prevents hard system freezes under extreme 100% RAM/ZRAM exhaustion.': 'Schutz vor Systemabstürzen bei vollem RAM.',
        'Profile-sync-daemon (RAM Browser)': 'RAM-Browser (PSD)',
        'Moves browser profiles to tmpfs RAM for instant speed and less SSD wear.': 'Browserprofile direkt im schnellen RAM.',
        'LIOS Update Notifier': 'LIOS Update-Melder',
        'System tray timer that checks and alerts when new updates are ready.': 'Automatische Update-Hinweise.',
        'UFW Security Firewall': 'UFW-Firewall',
        'Active network protection against unauthorized incoming connections.': 'Aktiver Netzwerkschutz gegen unbefugte Zugriffe.',
        'Bluetooth Service': 'Bluetooth-Dienst',
        'Support for wireless controllers, headsets, and Bluetooth peripherals.': 'Controller- und Audio-Support.',
        'NVMe / SSD Trim Timer': 'NVMe / SSD Trim',
        'Weekly scheduled block maintenance to preserve SSD lifespan and speed.': 'Wöchentliche SSD-Blockwartung.',
        'ACTIVE': 'AKTIV',
        'INACTIVE': 'INAKTIV',
        'Rank Fastest Mirrors': 'Schnellste Mirror wählen',
        'Test and select the fastest download servers.': 'Wählt die schnellsten Download-Server aus.',
        'Clean Package Cache': 'Paket-Cache leeren',
        'Free up disk space by removing old cached packages (pacman -Sc).': 'Gibt Speicherplatz alter Pakete frei.',
        'Remove Orphan Packages': 'Verwaiste Pakete löschen',
        'Purge unused dependency packages left behind on your system.': 'Entfernt ungenutzte Abhängigkeiten.',
        'Change DNS Server': 'DNS-Server ändern',
        'Measure ping latency and switch to Cloudflare, AdGuard, Quad9, or DoT.': 'Ping messen und schnelle DNS-Server aktivieren.',
        'Install Winboat (Windows Apps)': 'Winboat installieren',
        'Run Windows productivity apps seamlessly via container integration.': 'Windows-Apps nahtlos per Container nutzen.',
        'Unlock Pacman Database': 'Pacman-Datenbank entsperren (db.lck)',
        'Remove /var/lib/pacman/db.lck if a previous update was interrupted.': 'Entfernt /var/lib/pacman/db.lck nach einem Abbruch.',
        'Reset Pacman Keyrings': 'Pacman-Schlüsselbund zurücksetzen',
        'Reinitialize and populate GPG cryptographic keys if package signatures fail.': 'Erneuert GPG-Schlüssel bei Signaturfehlern.',
        'Reinstall All Native Packages': 'Alle nativen Pakete neu installieren',
        'Force reinstall of all native system packages to repair damaged files.': 'Installiert alle Systempakete zur Reparatur neu.',
        'KWin (Wayland) Debug Console': 'KWin (Wayland) Debug-Konsole',
        'Open the native KWin Wayland diagnostic inspector for windows and VRR.': 'Öffnet die KWin-Diagnose für Wayland und VRR.',
        'X64 Gaming Center': 'X64 Gaming-Center',
        'Modular 1-click installation of gaming launchers, compatibility layers, and FPS overlays.': 'Modulare 1-Klick-Installation von '
                                                                                                     'Spiele-Launchern, Proton/UMU-Layern, '
                                                                                                     '32-Bit-Bibliotheken und '
                                                                                                     'FPS-Overlays.',
        'MODULAR COMPONENT INSTALLATION': 'MODULARE KOMPONENTEN-INSTALLATION',
        'Full X64 Gaming Suite (All-in-One)': 'Komplette X64 Gaming-Suite (Alles-in-Einem)',
        'Complete arsenal: Steam, Lutris, Heroic, Faugus, Gamescope, Proton-SLR, UMU, Wine, MangoHud, ProtonUp-Qt & 32-bit libs.': 'Komplettpaket: '
                                                                                                                                   'Steam, '
                                                                                                                                   'Lutris, '
                                                                                                                                   'Heroic, '
                                                                                                                                   'Faugus, '
                                                                                                                                   'Gamescope, '
                                                                                                                                   'Proton-SLR, '
                                                                                                                                   'UMU, '
                                                                                                                                   'Wine, '
                                                                                                                                   'MangoHud, '
                                                                                                                                   'ProtonUp-Qt '
                                                                                                                                   '& '
                                                                                                                                   '32-Bit-Libs.',
        'X64 Gaming Core, Proton-SLR & Wine X64': 'X64 Gaming-Kern & Wine X64',
        'Essential 32-bit Vulkan/Audio libs, Proton-SLR, UMU, Wine X64, Winetricks & Protontricks.': 'Wichtige 32-Bit-Vulkan/Audio-Libs, '
                                                                                                     'Proton-SLR, UMU, Wine X64, '
                                                                                                     'Winetricks & Protontricks.',
        'Steam': 'Steam',
        'Official Valve gaming platform with native Proton integration.': 'Offizielle Valve-Spieleplattform mit nativer '
                                                                          'Proton-Integration.',
        'Lutris': 'Lutris',
        'Unified open gaming manager for Epic, GOG, Battle.net, EA, and Wine.': 'Einheitlicher Spiele-Manager für Epic, GOG, Battle.net, '
                                                                                'EA und Wine.',
        'Heroic Games Launcher': 'Heroic Games Launcher',
        'Native graphical launcher for Epic Games, GOG, and Amazon Games.': 'Nativer Launcher für Epic Games, GOG und Amazon Games.',
        'Faugus Launcher': 'Faugus Launcher',
        'Ultra-lightweight modern launcher for Battle.net, EA App, Ubisoft, and standalone Windows games via UMU/Proton.': 'Ultraschneller '
                                                                                                                           'Launcher für '
                                                                                                                           'Battle.net, EA '
                                                                                                                           'App, Ubisoft '
                                                                                                                           'und '
                                                                                                                           'Windows-Spiele '
                                                                                                                           'via '
                                                                                                                           'UMU/Proton.',
        'MangoHud & GOverlay': 'MangoHud & GOverlay',
        'In-game FPS, frametime, CPU/GPU temperature HUD and graphical configurator.': 'In-Game-HUD für FPS, Frametime, Temperaturen und '
                                                                                       'GOverlay-Konfigurator.',
        'Gamescope (Valve Micro-Compositor)': 'Gamescope (Valve Compositor)',
        'Valve Wayland micro-compositor for FSR upscaling, frame limiting, and resolution isolation.': 'Valves Wayland-Mikro-Compositor '
                                                                                                       'für FSR-Upscaling, FPS-Limit und '
                                                                                                       'Auflösungsisolierung.',
        'ProtonUp-Qt': 'ProtonUp-Qt',
        'Graphical manager to install and update GE-Proton and Wine-GE versions.': 'Grafischer Manager zum Installieren und Aktualisieren '
                                                                                   'von GE-Proton und Wine-GE.',
        'INSTALLED ✓': 'INSTALLIERT ✓',
        'INSTALL': 'INSTALLIEREN',
        'INSTALL SUITE': 'SUITE INSTALLIEREN',
        'Launch at startup': 'Beim Start ausführen',
        'Architecture:': 'Architektur:',
        'Session:': 'Sitzung:',
        'Installed': 'Installiert',
        'X64 Architectural Manifesto': 'Architektonisches Manifest von X64',
        'X64 LIOS was born as the ultimate answer to Linux fragmentation. We extract the raw power of high-performance kernels, the precision of the gaming ecosystem, and the purity of Arch to forge the definitive operating system.': 'X64 '
                                                                                                                                                                                                                                          'LIOS '
                                                                                                                                                                                                                                          'entstand '
                                                                                                                                                                                                                                          'als '
                                                                                                                                                                                                                                          'ultimative '
                                                                                                                                                                                                                                          'Antwort '
                                                                                                                                                                                                                                          'auf '
                                                                                                                                                                                                                                          'die '
                                                                                                                                                                                                                                          'Linux-Fragmentierung. '
                                                                                                                                                                                                                                          'Wir '
                                                                                                                                                                                                                                          'vereinen '
                                                                                                                                                                                                                                          'Hochleistungs-Kernel, '
                                                                                                                                                                                                                                          'Gaming-Präzision '
                                                                                                                                                                                                                                          'und '
                                                                                                                                                                                                                                          'die '
                                                                                                                                                                                                                                          'Reinheit '
                                                                                                                                                                                                                                          'von '
                                                                                                                                                                                                                                          'Arch.',
        'I. Absolute Freedom': 'I. Absolute Freiheit',
        'Upstream purity of Arch Linux with zero PPAs, zero corporate ties, and 99% of system packages intact. Combined with the AUR and modern GUI tools for complete freedom.': 'Upstream-Reinheit '
                                                                                                                                                                                  'von '
                                                                                                                                                                                  'Arch '
                                                                                                                                                                                  'Linux '
                                                                                                                                                                                  'ohne '
                                                                                                                                                                                  'PPAs '
                                                                                                                                                                                  'oder '
                                                                                                                                                                                  'Konzernbindungen, '
                                                                                                                                                                                  'kombiniert '
                                                                                                                                                                                  'mit '
                                                                                                                                                                                  'dem '
                                                                                                                                                                                  'AUR '
                                                                                                                                                                                  'und '
                                                                                                                                                                                  'modernen '
                                                                                                                                                                                  'GUI-Werkzeugen.',
        'II. Surgical Optimization': 'II. Chirurgische Optimierung',
        'X64 low-latency kernel with scx dynamic schedulers, FalconD gaming CPU affinity, ananicy-cpp priority tuning, and pure ZRAM in RAM for zero disk swap latency.': 'X64-Low-Latency-Kernel '
                                                                                                                                                                          'mit '
                                                                                                                                                                          'dynamischen '
                                                                                                                                                                          'scx-Schedulern, '
                                                                                                                                                                          'FalconD, '
                                                                                                                                                                          'ananicy-cpp '
                                                                                                                                                                          'und '
                                                                                                                                                                          'reinem '
                                                                                                                                                                          'ZRAM '
                                                                                                                                                                          'im '
                                                                                                                                                                          'Arbeitsspeicher.',
        'III. Multi-Environment Ecosystem': 'III. Multi-Desktop-Ökosystem',
        'Live environment in KDE Plasma 6 Wayland, plus 8 official installation options (KDE, GNOME, COSMIC, Niri, Cinnamon, Xfce, Hyprland, and Server) with 16:9 previews.': 'Live-System '
                                                                                                                                                                               'mit '
                                                                                                                                                                               'KDE '
                                                                                                                                                                               'Plasma '
                                                                                                                                                                               '6 '
                                                                                                                                                                               'Wayland '
                                                                                                                                                                               'sowie '
                                                                                                                                                                               '8 '
                                                                                                                                                                               'offizielle '
                                                                                                                                                                               'Desktop-Optionen '
                                                                                                                                                                               'bei '
                                                                                                                                                                               'der '
                                                                                                                                                                               'Installation.',
        'IV. Infrastructure Independence': 'IV. Infrastruktur-Unabhängigkeit',
        'Cascading repository hierarchy. [x64-lios] holds priority #1 at the top of the system, served with SSL from our high-speed CDN infrastructure.': 'Eigene '
                                                                                                                                                          'Repository-Hierarchie '
                                                                                                                                                          'mit '
                                                                                                                                                          '[x64-lios] '
                                                                                                                                                          'auf '
                                                                                                                                                          'Priorität '
                                                                                                                                                          '#1, '
                                                                                                                                                          'bereitgestellt '
                                                                                                                                                          'über '
                                                                                                                                                          'unsere '
                                                                                                                                                          'schnelle '
                                                                                                                                                          'SSL-CDN-Infrastruktur.',
        'V. Hardware Mutation': 'V. Hardware-Mutation',
        'During installation, the system audits your CPU: modern processors get AVX2/AVX512 (v3/v4) repositories injected below [x64-lios]. chwd autodetects NVIDIA, AMD, and Intel GPUs.': 'Automatische '
                                                                                                                                                                                            'CPU-Erkennung '
                                                                                                                                                                                            'für '
                                                                                                                                                                                            'AVX2/AVX512 '
                                                                                                                                                                                            '(v3/v4) '
                                                                                                                                                                                            'Repositories '
                                                                                                                                                                                            'sowie '
                                                                                                                                                                                            'automatische '
                                                                                                                                                                                            'GPU-Treiberinstallation '
                                                                                                                                                                                            'via '
                                                                                                                                                                                            'chwd.',
        'VI. Modular Architecture': 'VI. Modulare Architektur',
        'Lightweight installer with zero bloat. Heavy gaming platforms and emulators are cleanly delegated to post-installation setup in X64 Hello after first boot.': 'Schlanker '
                                                                                                                                                                       'Installer '
                                                                                                                                                                       'ohne '
                                                                                                                                                                       'Bloatware. '
                                                                                                                                                                       'Große '
                                                                                                                                                                       'Gaming-Plattformen '
                                                                                                                                                                       'werden '
                                                                                                                                                                       'sauber '
                                                                                                                                                                       'über '
                                                                                                                                                                       'X64 '
                                                                                                                                                                       'Hello '
                                                                                                                                                                       'nach '
                                                                                                                                                                       'dem '
                                                                                                                                                                       'ersten '
                                                                                                                                                                       'Start '
                                                                                                                                                                       'installiert.',
        'VII. Shield of Resilience': 'VII. Schutzschild der Resilienz',
        'Temporal immutability with Btrfs & automated Snapper snapshots. Multi-bootloader support choosing Limine, GRUB, systemd-boot, or rEFInd for effortless rollback.': 'Zeitsicherheit '
                                                                                                                                                                            'durch '
                                                                                                                                                                            'Btrfs '
                                                                                                                                                                            'und '
                                                                                                                                                                            'automatische '
                                                                                                                                                                            'Snapper-Snapshots '
                                                                                                                                                                            'mit '
                                                                                                                                                                            'Unterstützung '
                                                                                                                                                                            'für '
                                                                                                                                                                            'Limine, '
                                                                                                                                                                            'GRUB, '
                                                                                                                                                                            'systemd-boot '
                                                                                                                                                                            'und '
                                                                                                                                                                            'rEFInd.',
        'VIII. The Death of the Terminal': 'VIII. GUI-First-Philosophie',
        'GUI-First philosophy for effortless everyday use, paired with an elite hacker terminal experience in Kitty, Fish shell, and Starship pills for power users.': 'Intuitive '
                                                                                                                                                                       'grafische '
                                                                                                                                                                       'Werkzeuge '
                                                                                                                                                                       'für '
                                                                                                                                                                       'den '
                                                                                                                                                                       'Alltag, '
                                                                                                                                                                       'kombiniert '
                                                                                                                                                                       'mit '
                                                                                                                                                                       'einem '
                                                                                                                                                                       'vorkonfigurierten '
                                                                                                                                                                       'Kitty-, '
                                                                                                                                                                       'Fish- '
                                                                                                                                                                       'und '
                                                                                                                                                                       'Starship-Terminal.',
        'IX. Hybrid Rolling Release': 'IX. Hybrides Rolling Release',
        'The core flies at pure Arch rolling speed, while professional apps can be isolated via Flatpak or Distrobox containers to guarantee Debian-level rock-solid stability.': 'Maximale '
                                                                                                                                                                                  'Aktualität '
                                                                                                                                                                                  'im '
                                                                                                                                                                                  'Basissystem, '
                                                                                                                                                                                  'während '
                                                                                                                                                                                  'produktive '
                                                                                                                                                                                  'Anwendungen '
                                                                                                                                                                                  'stabil '
                                                                                                                                                                                  'über '
                                                                                                                                                                                  'Flatpak '
                                                                                                                                                                                  'oder '
                                                                                                                                                                                  'Distrobox '
                                                                                                                                                                                  'isoliert '
                                                                                                                                                                                  'werden '
                                                                                                                                                                                  'können.',
        'X. Architectural Pragmatism': 'X. Architektonischer Pragmatismus',
        'Open Source synergy. We inherit and polish battle-tested foundations, writing custom code and maintaining our own repositories only where we add unique value.': 'Open-Source-Synergie: '
                                                                                                                                                                          'Wir '
                                                                                                                                                                          'nutzen '
                                                                                                                                                                          'bewährte '
                                                                                                                                                                          'Fundamente '
                                                                                                                                                                          'und '
                                                                                                                                                                          'entwickeln '
                                                                                                                                                                          'eigenen '
                                                                                                                                                                          'Code '
                                                                                                                                                                          'genau '
                                                                                                                                                                          'dort, '
                                                                                                                                                                          'wo '
                                                                                                                                                                          'er '
                                                                                                                                                                          'echten '
                                                                                                                                                                          'Mehrwert '
                                                                                                                                                                          'schafft.',
        'XI. Aesthetics as Function': 'XI. Ästhetik als Funktion',
        'Design is not an afterthought. Widescreen panoramic UI, Crimson & Charcoal color direction (#b31b1b / #0b0b0d), and vector iconography engineered for focus and control.': 'Panorama-UI '
                                                                                                                                                                                    'im '
                                                                                                                                                                                    'Widescreen-Format, '
                                                                                                                                                                                    'Karmesinrot-Anthrazit-Farbwelt '
                                                                                                                                                                                    '(#b31b1b '
                                                                                                                                                                                    '/ '
                                                                                                                                                                                    '#0b0b0d) '
                                                                                                                                                                                    'und '
                                                                                                                                                                                    'gestochen '
                                                                                                                                                                                    'scharfe '
                                                                                                                                                                                    'Vektor-Icons.',
        'XII. Absolute Privacy': 'XII. Absolute Privatsphäre',
        'In the era of covert telemetry, your PC is your private fortress. Zero tracking, zero telemetry, and zero data reporting. What you do on your machine, dies on your machine.': 'Ihr '
                                                                                                                                                                                        'PC '
                                                                                                                                                                                        'ist '
                                                                                                                                                                                        'Ihre '
                                                                                                                                                                                        'private '
                                                                                                                                                                                        'Festung: '
                                                                                                                                                                                        'null '
                                                                                                                                                                                        'Tracking, '
                                                                                                                                                                                        'null '
                                                                                                                                                                                        'Telemetrie '
                                                                                                                                                                                        'und '
                                                                                                                                                                                        'keinerlei '
                                                                                                                                                                                        'Datenweitergabe.',
        'X64 LIOS COMMAND CENTER': 'X64 LIOS KOMMANDOZENTRALE',
        'FIREWALL UFW': 'UFW-FIREWALL',
        'Welcome': 'Willkommen',
        'Operating system installed and running at peak hardware capacity.': 'Betriebssystem installiert und mit maximaler '
                                                                             'Hardware-Leistung aktiv.',
        'UPDATE SYSTEM': 'SYSTEM AKTUALISIEREN',
        'LIVE BTOP MONITOR': 'LIVE BTOP-MONITOR',
        'REAL-TIME HARDWARE TELEMETRY': 'ECHTZEIT-HARDWARE-TELEMETRIE',
        'PROCESSOR (CPU)': 'PROZESSOR (CPU)',
        'Threads': 'Threads',
        'PHYSICAL RAM & ZRAM': 'PHYSISCHER RAM & ZRAM',
        'ZRAM Active in RAM • Zero Disk Swap': 'ZRAM aktiv im RAM • Kein Festplatten-Swap',
        'High-Speed System Memory': 'Hochgeschwindigkeits-Systemspeicher',
        'GRAPHICS & COMPOSITOR (GPU)': 'GRAFIK & COMPOSITOR (GPU)',
        'Hardware Acceleration Active': 'Hardwarebeschleunigung aktiv',
        'ROOT STORAGE (/) & UPTIME': 'ROOT-SPEICHER (/) & LAUFZEIT',
        'Filesystem': 'Dateisystem',
        'Uptime': 'Laufzeit',
        'OFFICIAL ECOSYSTEM & COMMUNITY': 'OFFIZIELLES ÖKOSYSTEM & COMMUNITY',
        'Official Website & Wiki': 'Offizielle Website & Wiki',
        'Official guides, system modules, and documentation.': 'Offizielle Anleitungen, Systemmodule und Dokumentation.',
        'Real-time support channels, setups, and community chat.': 'Echtzeit-Support, Setups und Community-Chat.',
        'X64 DNS & Low-Latency Optimizer': 'X64 DNS- & Low-Latency-Optimierer',
        'Active Network Connection:': 'Aktive Netzwerkverbindung:',
        '⚡ Benchmark DNS Latency (Ping)': '⚡ DNS-Latenz messen (Ping)',
        'Testing ping to all DNS servers...': 'Messe Latenz (Ping) zu allen DNS-Servern...',
        'Enable Encrypted DNS (DNS-over-TLS / DoT)': 'Verschlüsseltes DNS aktivieren (DNS-over-TLS / DoT)',
        'Reset to Automatic (DHCP)': 'Auf Automatisch zurücksetzen (DHCP)',
        'Apply Selected DNS': 'Ausgewähltes DNS anwenden',
        'Close': 'Schließen',
        'Applying DNS configuration...': 'Wende DNS-Konfiguration an...',
        'Resetting DNS to automatic DHCP...': 'Setze DNS auf automatisches DHCP zurück...',
        'Operation canceled or authentication failed.': 'Vorgang abgebrochen oder Authentifizierung fehlgeschlagen.',
        'DNS successfully applied to connection:': 'DNS-Server erfolgreich angewendet auf:',
        'DNS reset to automatic DHCP on:': 'DNS auf automatisches DHCP zurückgesetzt für:',
        'Ultra-Fast Gaming': 'Ultraschnelles Gaming',
        'Anti-Malware Filter': 'Anti-Malware-Filter',
        'Ad & Tracker Blocker': 'Werbe- & Tracker-Blocker',
        'Swiss Privacy': 'Schweizer Datenschutz',
        'High Availability': 'Hohe Verfügbarkeit',
        'Classic Stability': 'Klassische Stabilität'},
 'it': {'Home': 'Home',
        'Tweaks & System': 'Sistema & Tweaks',
        'Gaming Center': 'Centro Gaming',
        'Philosophy': 'Filosofia',
        'Welcome to X64 LIOS': 'Benvenuto in X64 LIOS',
        'Update System': 'Aggiorna Sistema',
        'Synchronize repositories and upgrade all system packages (pacman -Syu).': 'Sincronizza i repository e aggiorna tutti i pacchetti '
                                                                                   'di sistema (pacman -Syu).',
        'Discord Community': 'Comunità Discord',
        'System Services & Tweaks': 'Servizi e Ottimizzazione del Sistema',
        'Control real-time daemons, configure low-latency DNS, and execute system rescue routines with a single click.': 'Controlla i '
                                                                                                                         'demoni in tempo '
                                                                                                                         'reale, configura '
                                                                                                                         'DNS a bassa '
                                                                                                                         'latenza ed '
                                                                                                                         'esegui il '
                                                                                                                         'ripristino di '
                                                                                                                         'sistema con un '
                                                                                                                         'clic.',
        'Real-Time Daemons & Services': 'Demoni e Servizi in Tempo Reale',
        'System Maintenance & Utilities': 'Manutenzione e Utilità di Sistema',
        'Troubleshooting & System Rescue': 'Risoluzione Problemi e Ripristino',
        'FalconD Gaming Daemon': 'FalconD Gaming',
        'Dynamic CPU affinity and automatic performance profiles for games.': 'Affinità CPU dinamica e profili per i giochi.',
        'Ananicy-cpp Priority': 'Priorità Ananicy-cpp',
        'Automatic process nice/ionice latency tuning in the background.': 'Ottimizzazione automatica priorità e latenza.',
        'Bpftune Kernel Auto-Tuning': 'Kernel Bpftune',
        'Dynamic eBPF network buffer and sysctl optimization in real time.': 'Auto-tuning eBPF di rete e kernel in tempo reale.',
        'Systemd-OOMD Anti-Freeze': 'Systemd-OOMD',
        'Prevents hard system freezes under extreme 100% RAM/ZRAM exhaustion.': 'Protezione anti-blocco in caso di RAM satura.',
        'Profile-sync-daemon (RAM Browser)': 'Browser in RAM (PSD)',
        'Moves browser profiles to tmpfs RAM for instant speed and less SSD wear.': 'Profili del browser caricati in RAM.',
        'LIOS Update Notifier': 'Notifiche LIOS Update',
        'System tray timer that checks and alerts when new updates are ready.': 'Avviso automatico di nuovi aggiornamenti.',
        'UFW Security Firewall': 'Firewall UFW',
        'Active network protection against unauthorized incoming connections.': 'Protezione attiva delle porte e della rete.',
        'Bluetooth Service': 'Servizio Bluetooth',
        'Support for wireless controllers, headsets, and Bluetooth peripherals.': 'Supporto per controller e audio wireless.',
        'NVMe / SSD Trim Timer': 'Trim NVMe / SSD',
        'Weekly scheduled block maintenance to preserve SSD lifespan and speed.': 'Manutenzione settimanale dei blocchi SSD.',
        'ACTIVE': 'ATTIVO',
        'INACTIVE': 'INATTIVO',
        'Rank Fastest Mirrors': 'Classifica Mirror Veloci',
        'Test and select the fastest download servers.': 'Seleziona i server di download più rapidi.',
        'Clean Package Cache': 'Pulisci Cache Pacman',
        'Free up disk space by removing old cached packages (pacman -Sc).': 'Libera spazio rimuovendo i vecchi pacchetti.',
        'Remove Orphan Packages': 'Rimuovi Pacchetti Orfani',
        'Purge unused dependency packages left behind on your system.': 'Elimina le dipendenze inutilizzate dal sistema.',
        'Change DNS Server': 'Cambia Server DNS',
        'Measure ping latency and switch to Cloudflare, AdGuard, Quad9, or DoT.': 'Misura il ping in ms e attiva DNS veloci.',
        'Install Winboat (Windows Apps)': 'Installa Winboat',
        'Run Windows productivity apps seamlessly via container integration.': 'App Windows tramite container leggero.',
        'Unlock Pacman Database': 'Sblocca Database Pacman (db.lck)',
        'Remove /var/lib/pacman/db.lck if a previous update was interrupted.': "Rimuove /var/lib/pacman/db.lck dopo un'interruzione.",
        'Reset Pacman Keyrings': 'Ripristina Portachiavi GPG (Keyrings)',
        'Reinitialize and populate GPG cryptographic keys if package signatures fail.': 'Rigenera le firme GPG in caso di errore chiavi.',
        'Reinstall All Native Packages': 'Reinstalla Tutti i Pacchetti Nativi',
        'Force reinstall of all native system packages to repair damaged files.': 'Reinstalla tutti i pacchetti nativi per riparare il '
                                                                                  'sistema.',
        'KWin (Wayland) Debug Console': 'Console di Debug KWin (Wayland)',
        'Open the native KWin Wayland diagnostic inspector for windows and VRR.': "Apre l'ispettore KWin per diagnosticare Wayland e VRR.",
        'X64 Gaming Center': 'Centro Gaming X64',
        'Modular 1-click installation of gaming launchers, compatibility layers, and FPS overlays.': 'Installazione modulare in 1 clic di '
                                                                                                     'launcher di gioco, layer Proton/UMU, '
                                                                                                     'librerie a 32 bit e overlay FPS.',
        'MODULAR COMPONENT INSTALLATION': 'INSTALLAZIONE MODULARE PER COMPONENTI',
        'Full X64 Gaming Suite (All-in-One)': 'Suite Gaming X64 Completa (Tutto in Uno)',
        'Complete arsenal: Steam, Lutris, Heroic, Faugus, Gamescope, Proton-SLR, UMU, Wine, MangoHud, ProtonUp-Qt & 32-bit libs.': 'Arsenale '
                                                                                                                                   'completo: '
                                                                                                                                   'Steam, '
                                                                                                                                   'Lutris, '
                                                                                                                                   'Heroic, '
                                                                                                                                   'Faugus, '
                                                                                                                                   'Gamescope, '
                                                                                                                                   'Proton-SLR, '
                                                                                                                                   'UMU, '
                                                                                                                                   'Wine, '
                                                                                                                                   'MangoHud, '
                                                                                                                                   'ProtonUp-Qt '
                                                                                                                                   'e '
                                                                                                                                   'librerie '
                                                                                                                                   '32 '
                                                                                                                                   'bit.',
        'X64 Gaming Core, Proton-SLR & Wine X64': 'Core Gaming e Wine X64',
        'Essential 32-bit Vulkan/Audio libs, Proton-SLR, UMU, Wine X64, Winetricks & Protontricks.': 'Librerie 32 bit Vulkan/Audio, '
                                                                                                     'Proton-SLR, UMU, Wine X64, '
                                                                                                     'Winetricks e Protontricks.',
        'Steam': 'Steam',
        'Official Valve gaming platform with native Proton integration.': 'Piattaforma ufficiale Valve con integrazione nativa di Proton.',
        'Lutris': 'Lutris',
        'Unified open gaming manager for Epic, GOG, Battle.net, EA, and Wine.': 'Gestore unificato per Epic, GOG, Battle.net, EA e Wine.',
        'Heroic Games Launcher': 'Heroic Games Launcher',
        'Native graphical launcher for Epic Games, GOG, and Amazon Games.': 'Launcher grafico nativo per Epic Games, GOG e Amazon Games.',
        'Faugus Launcher': 'Faugus Launcher',
        'Ultra-lightweight modern launcher for Battle.net, EA App, Ubisoft, and standalone Windows games via UMU/Proton.': 'Launcher '
                                                                                                                           'ultraleggero '
                                                                                                                           'per '
                                                                                                                           'Battle.net, EA '
                                                                                                                           'App, Ubisoft e '
                                                                                                                           'giochi Windows '
                                                                                                                           'via '
                                                                                                                           'UMU/Proton.',
        'MangoHud & GOverlay': 'MangoHud e GOverlay',
        'In-game FPS, frametime, CPU/GPU temperature HUD and graphical configurator.': 'HUD in tempo reale per FPS, frametime, temperature '
                                                                                       'e configuratore GOverlay.',
        'Gamescope (Valve Micro-Compositor)': 'Gamescope (Compositor Valve)',
        'Valve Wayland micro-compositor for FSR upscaling, frame limiting, and resolution isolation.': 'Micro-compositor Wayland di Valve '
                                                                                                       'per upscaling FSR, limite FPS e '
                                                                                                       'isolamento risoluzione.',
        'ProtonUp-Qt': 'ProtonUp-Qt',
        'Graphical manager to install and update GE-Proton and Wine-GE versions.': 'Gestore grafico per installare e aggiornare versioni '
                                                                                   'di GE-Proton e Wine-GE.',
        'INSTALLED ✓': 'INSTALLATO ✓',
        'INSTALL': 'INSTALLA',
        'INSTALL SUITE': 'INSTALLA SUITE',
        'Launch at startup': "Avvia all'accensione",
        'Architecture:': 'Architettura:',
        'Session:': 'Sessione:',
        'Installed': 'Installato',
        'X64 Architectural Manifesto': 'Manifesto Architettonico X64',
        'X64 LIOS was born as the ultimate answer to Linux fragmentation. We extract the raw power of high-performance kernels, the precision of the gaming ecosystem, and the purity of Arch to forge the definitive operating system.': 'X64 '
                                                                                                                                                                                                                                          'LIOS '
                                                                                                                                                                                                                                          'nasce '
                                                                                                                                                                                                                                          'come '
                                                                                                                                                                                                                                          'risposta '
                                                                                                                                                                                                                                          'definitiva '
                                                                                                                                                                                                                                          'alla '
                                                                                                                                                                                                                                          'frammentazione '
                                                                                                                                                                                                                                          'di '
                                                                                                                                                                                                                                          'Linux, '
                                                                                                                                                                                                                                          'unendo '
                                                                                                                                                                                                                                          'kernel '
                                                                                                                                                                                                                                          'ad '
                                                                                                                                                                                                                                          'alte '
                                                                                                                                                                                                                                          'prestazioni, '
                                                                                                                                                                                                                                          'precisione '
                                                                                                                                                                                                                                          'gaming '
                                                                                                                                                                                                                                          'e '
                                                                                                                                                                                                                                          'purezza '
                                                                                                                                                                                                                                          'Arch.',
        'I. Absolute Freedom': 'I. Libertà Assoluta',
        'Upstream purity of Arch Linux with zero PPAs, zero corporate ties, and 99% of system packages intact. Combined with the AUR and modern GUI tools for complete freedom.': 'Purezza '
                                                                                                                                                                                  'Upstream '
                                                                                                                                                                                  'di '
                                                                                                                                                                                  'Arch '
                                                                                                                                                                                  'Linux '
                                                                                                                                                                                  'senza '
                                                                                                                                                                                  'PPA '
                                                                                                                                                                                  'né '
                                                                                                                                                                                  'vincoli '
                                                                                                                                                                                  'aziendali, '
                                                                                                                                                                                  'unita '
                                                                                                                                                                                  'ad '
                                                                                                                                                                                  'AUR '
                                                                                                                                                                                  'e '
                                                                                                                                                                                  'moderni '
                                                                                                                                                                                  'strumenti '
                                                                                                                                                                                  'grafici.',
        'II. Surgical Optimization': 'II. Ottimizzazione Chirurgica',
        'X64 low-latency kernel with scx dynamic schedulers, FalconD gaming CPU affinity, ananicy-cpp priority tuning, and pure ZRAM in RAM for zero disk swap latency.': 'Kernel '
                                                                                                                                                                          'X64 '
                                                                                                                                                                          'a '
                                                                                                                                                                          'bassa '
                                                                                                                                                                          'latenza '
                                                                                                                                                                          'con '
                                                                                                                                                                          'scheduler '
                                                                                                                                                                          'dinamici '
                                                                                                                                                                          'scx, '
                                                                                                                                                                          'FalconD, '
                                                                                                                                                                          'ananicy-cpp '
                                                                                                                                                                          'e '
                                                                                                                                                                          'ZRAM '
                                                                                                                                                                          'puro '
                                                                                                                                                                          'in '
                                                                                                                                                                          'RAM.',
        'III. Multi-Environment Ecosystem': 'III. Ecosistema Multi-Ambiente',
        'Live environment in KDE Plasma 6 Wayland, plus 8 official installation options (KDE, GNOME, COSMIC, Niri, Cinnamon, Xfce, Hyprland, and Server) with 16:9 previews.': 'Ambiente '
                                                                                                                                                                               'Live '
                                                                                                                                                                               'in '
                                                                                                                                                                               'KDE '
                                                                                                                                                                               'Plasma '
                                                                                                                                                                               '6 '
                                                                                                                                                                               'Wayland '
                                                                                                                                                                               'più '
                                                                                                                                                                               '8 '
                                                                                                                                                                               'opzioni '
                                                                                                                                                                               'desktop '
                                                                                                                                                                               'ufficiali '
                                                                                                                                                                               'in '
                                                                                                                                                                               'fase '
                                                                                                                                                                               'di '
                                                                                                                                                                               'installazione '
                                                                                                                                                                               'con '
                                                                                                                                                                               'anteprime '
                                                                                                                                                                               '16:9.',
        'IV. Infrastructure Independence': "IV. Indipendenza dell'Infrastruttura",
        'Cascading repository hierarchy. [x64-lios] holds priority #1 at the top of the system, served with SSL from our high-speed CDN infrastructure.': 'Gerarchia '
                                                                                                                                                          'di '
                                                                                                                                                          'repository '
                                                                                                                                                          'a '
                                                                                                                                                          'cascata '
                                                                                                                                                          'con '
                                                                                                                                                          '[x64-lios] '
                                                                                                                                                          'in '
                                                                                                                                                          'priorità '
                                                                                                                                                          '#1 '
                                                                                                                                                          'assoluta, '
                                                                                                                                                          'servito '
                                                                                                                                                          'tramite '
                                                                                                                                                          'CDN '
                                                                                                                                                          'SSL '
                                                                                                                                                          'ad '
                                                                                                                                                          'alta '
                                                                                                                                                          'velocità.',
        'V. Hardware Mutation': 'V. Mutazione Hardware',
        'During installation, the system audits your CPU: modern processors get AVX2/AVX512 (v3/v4) repositories injected below [x64-lios]. chwd autodetects NVIDIA, AMD, and Intel GPUs.': 'Rilevamento '
                                                                                                                                                                                            'automatico '
                                                                                                                                                                                            'della '
                                                                                                                                                                                            'CPU '
                                                                                                                                                                                            'per '
                                                                                                                                                                                            'repository '
                                                                                                                                                                                            'AVX2/AVX512 '
                                                                                                                                                                                            '(v3/v4) '
                                                                                                                                                                                            'e '
                                                                                                                                                                                            'installazione '
                                                                                                                                                                                            'automatica '
                                                                                                                                                                                            'driver '
                                                                                                                                                                                            'GPU '
                                                                                                                                                                                            'tramite '
                                                                                                                                                                                            'chwd.',
        'VI. Modular Architecture': 'VI. Architettura Modulare',
        'Lightweight installer with zero bloat. Heavy gaming platforms and emulators are cleanly delegated to post-installation setup in X64 Hello after first boot.': 'Installatore '
                                                                                                                                                                       'leggero '
                                                                                                                                                                       'senza '
                                                                                                                                                                       'bloatware. '
                                                                                                                                                                       'Le '
                                                                                                                                                                       'piattaforme '
                                                                                                                                                                       'di '
                                                                                                                                                                       'gioco '
                                                                                                                                                                       'pesanti '
                                                                                                                                                                       'sono '
                                                                                                                                                                       'delegate '
                                                                                                                                                                       'a '
                                                                                                                                                                       'X64 '
                                                                                                                                                                       'Hello '
                                                                                                                                                                       'dopo '
                                                                                                                                                                       'il '
                                                                                                                                                                       'primo '
                                                                                                                                                                       'avvio.',
        'VII. Shield of Resilience': 'VII. Scudo di Resilienza',
        'Temporal immutability with Btrfs & automated Snapper snapshots. Multi-bootloader support choosing Limine, GRUB, systemd-boot, or rEFInd for effortless rollback.': 'Immutabilità '
                                                                                                                                                                            'temporale '
                                                                                                                                                                            'con '
                                                                                                                                                                            'Btrfs '
                                                                                                                                                                            'e '
                                                                                                                                                                            'snapshot '
                                                                                                                                                                            'automatici '
                                                                                                                                                                            'Snapper, '
                                                                                                                                                                            'con '
                                                                                                                                                                            'supporto '
                                                                                                                                                                            'per '
                                                                                                                                                                            'Limine, '
                                                                                                                                                                            'GRUB, '
                                                                                                                                                                            'systemd-boot '
                                                                                                                                                                            'e '
                                                                                                                                                                            'rEFInd.',
        'VIII. The Death of the Terminal': 'VIII. Filosofia GUI-First',
        'GUI-First philosophy for effortless everyday use, paired with an elite hacker terminal experience in Kitty, Fish shell, and Starship pills for power users.': 'Filosofia '
                                                                                                                                                                       'GUI-First '
                                                                                                                                                                       'per '
                                                                                                                                                                       "l'uso "
                                                                                                                                                                       'quotidiano, '
                                                                                                                                                                       'affiancata '
                                                                                                                                                                       'da '
                                                                                                                                                                       'un '
                                                                                                                                                                       'terminale '
                                                                                                                                                                       "d'élite "
                                                                                                                                                                       'con '
                                                                                                                                                                       'Kitty, '
                                                                                                                                                                       'Fish '
                                                                                                                                                                       'shell '
                                                                                                                                                                       'e '
                                                                                                                                                                       'Starship.',
        'IX. Hybrid Rolling Release': 'IX. Rolling Release Ibrido',
        'The core flies at pure Arch rolling speed, while professional apps can be isolated via Flatpak or Distrobox containers to guarantee Debian-level rock-solid stability.': 'Il '
                                                                                                                                                                                  'cuore '
                                                                                                                                                                                  'viaggia '
                                                                                                                                                                                  'alla '
                                                                                                                                                                                  'velocità '
                                                                                                                                                                                  'di '
                                                                                                                                                                                  'Arch '
                                                                                                                                                                                  'rolling, '
                                                                                                                                                                                  'mentre '
                                                                                                                                                                                  'le '
                                                                                                                                                                                  'app '
                                                                                                                                                                                  'professionali '
                                                                                                                                                                                  'possono '
                                                                                                                                                                                  'essere '
                                                                                                                                                                                  'isolate '
                                                                                                                                                                                  'tramite '
                                                                                                                                                                                  'Flatpak '
                                                                                                                                                                                  'o '
                                                                                                                                                                                  'Distrobox.',
        'X. Architectural Pragmatism': 'X. Pragmatismo Architettonico',
        'Open Source synergy. We inherit and polish battle-tested foundations, writing custom code and maintaining our own repositories only where we add unique value.': 'Sinergia '
                                                                                                                                                                          'Open '
                                                                                                                                                                          'Source: '
                                                                                                                                                                          'perfezioniamo '
                                                                                                                                                                          'basi '
                                                                                                                                                                          'collaudate '
                                                                                                                                                                          'e '
                                                                                                                                                                          'manteniamo '
                                                                                                                                                                          'repository '
                                                                                                                                                                          'proprietari '
                                                                                                                                                                          'dove '
                                                                                                                                                                          'aggiungiamo '
                                                                                                                                                                          'valore '
                                                                                                                                                                          'unico.',
        'XI. Aesthetics as Function': "XI. L'Estetica come Funzione",
        'Design is not an afterthought. Widescreen panoramic UI, Crimson & Charcoal color direction (#b31b1b / #0b0b0d), and vector iconography engineered for focus and control.': 'UI '
                                                                                                                                                                                    'panoramica '
                                                                                                                                                                                    'Widescreen, '
                                                                                                                                                                                    'palette '
                                                                                                                                                                                    'Cremisi '
                                                                                                                                                                                    '& '
                                                                                                                                                                                    'Carbone '
                                                                                                                                                                                    '(#b31b1b '
                                                                                                                                                                                    '/ '
                                                                                                                                                                                    '#0b0b0d) '
                                                                                                                                                                                    'e '
                                                                                                                                                                                    'iconografia '
                                                                                                                                                                                    'vettoriale '
                                                                                                                                                                                    'progettata '
                                                                                                                                                                                    'per '
                                                                                                                                                                                    'il '
                                                                                                                                                                                    'controllo.',
        'XII. Absolute Privacy': 'XII. Privacy Assoluta',
        'In the era of covert telemetry, your PC is your private fortress. Zero tracking, zero telemetry, and zero data reporting. What you do on your machine, dies on your machine.': 'Il '
                                                                                                                                                                                        'tuo '
                                                                                                                                                                                        'PC '
                                                                                                                                                                                        'è '
                                                                                                                                                                                        'la '
                                                                                                                                                                                        'tua '
                                                                                                                                                                                        'fortezza '
                                                                                                                                                                                        'privata: '
                                                                                                                                                                                        'zero '
                                                                                                                                                                                        'tracciamento, '
                                                                                                                                                                                        'zero '
                                                                                                                                                                                        'telemetria '
                                                                                                                                                                                        'e '
                                                                                                                                                                                        'zero '
                                                                                                                                                                                        'invio '
                                                                                                                                                                                        'di '
                                                                                                                                                                                        'dati.',
        'X64 LIOS COMMAND CENTER': 'CENTRO DI COMANDO X64 LIOS',
        'FIREWALL UFW': 'FIREWALL UFW',
        'Welcome': 'Benvenuto',
        'Operating system installed and running at peak hardware capacity.': 'Sistema operativo installato e in esecuzione alla massima '
                                                                             'capacità hardware.',
        'UPDATE SYSTEM': 'AGGIORNA SISTEMA',
        'LIVE BTOP MONITOR': 'MONITOR BTOP LIVE',
        'REAL-TIME HARDWARE TELEMETRY': 'TELEMETRIA HARDWARE IN TEMPO REALE',
        'PROCESSOR (CPU)': 'PROCESSORE (CPU)',
        'Threads': 'Thread',
        'PHYSICAL RAM & ZRAM': 'MEMORIA RAM & ZRAM',
        'ZRAM Active in RAM • Zero Disk Swap': 'ZRAM Attivo in RAM • Zero Swap su Disco',
        'High-Speed System Memory': 'Memoria di Sistema ad Alta Velocità',
        'GRAPHICS & COMPOSITOR (GPU)': 'GRAFICA & COMPOSITOR (GPU)',
        'Hardware Acceleration Active': 'Accelerazione Hardware Attiva',
        'ROOT STORAGE (/) & UPTIME': 'DISCO ROOT (/) & UPTIME',
        'Filesystem': 'Filesystem',
        'Uptime': 'Attivo',
        'OFFICIAL ECOSYSTEM & COMMUNITY': 'ECOSISTEMA E COMUNITÀ UFFICIALE',
        'Official Website & Wiki': 'Sito Ufficiale e Wiki',
        'Official guides, system modules, and documentation.': 'Guide ufficiali, moduli di sistema e documentazione.',
        'Real-time support channels, setups, and community chat.': 'Canali di supporto in tempo reale, configurazioni e chat.',
        'X64 DNS & Low-Latency Optimizer': 'Ottimizzatore DNS e Bassa Latenza X64',
        'Active Network Connection:': 'Connessione di Rete Attiva:',
        '⚡ Benchmark DNS Latency (Ping)': '⚡ Misura Latenza DNS (Ping)',
        'Testing ping to all DNS servers...': 'Misurazione latenza (ping) verso tutti i server DNS...',
        'Enable Encrypted DNS (DNS-over-TLS / DoT)': 'Attiva DNS Crittografato (DNS-over-TLS / DoT)',
        'Reset to Automatic (DHCP)': 'Ripristina Automatico (DHCP)',
        'Apply Selected DNS': 'Applica DNS Selezionato',
        'Close': 'Chiudi',
        'Applying DNS configuration...': 'Applicazione configurazione DNS...',
        'Resetting DNS to automatic DHCP...': 'Ripristino DNS a DHCP automatico...',
        'Operation canceled or authentication failed.': 'Operazione annullata o autenticazione fallita.',
        'DNS successfully applied to connection:': 'Server DNS applicato con successo alla connessione:',
        'DNS reset to automatic DHCP on:': 'DNS ripristinato a DHCP automatico su:',
        'Ultra-Fast Gaming': 'Gaming Ultra-Veloce',
        'Anti-Malware Filter': 'Filtro Anti-Malware',
        'Ad & Tracker Blocker': 'Blocco Annunci e Tracker',
        'Swiss Privacy': 'Privacy Svizzera',
        'High Availability': 'Alta Disponibilità',
        'Classic Stability': 'Stabilità Classica'},
 'pt': {'Home': 'Início',
        'Tweaks & System': 'Ajustes e Sistema',
        'Gaming Center': 'Central Gaming',
        'Philosophy': 'Filosofia',
        'Welcome to X64 LIOS': 'Bem-vindo ao X64 LIOS',
        'Update System': 'Atualizar Sistema',
        'Synchronize repositories and upgrade all system packages (pacman -Syu).': 'Sincroniza os repositórios e atualiza todos os pacotes '
                                                                                   'do sistema (pacman -Syu).',
        'Discord Community': 'Comunidade Discord',
        'System Services & Tweaks': 'Serviços e Ajustes do Sistema',
        'Control real-time daemons, configure low-latency DNS, and execute system rescue routines with a single click.': 'Controle daemons '
                                                                                                                         'em tempo real, '
                                                                                                                         'configure DNS de '
                                                                                                                         'baixa latência e '
                                                                                                                         'execute rotinas '
                                                                                                                         'de resgate com '
                                                                                                                         'um único clique.',
        'Real-Time Daemons & Services': 'Daemons e Serviços em Tempo Real',
        'System Maintenance & Utilities': 'Manutenção e Utilitários do Sistema',
        'Troubleshooting & System Rescue': 'Solução de Problemas e Resgate',
        'FalconD Gaming Daemon': 'FalconD Gaming',
        'Dynamic CPU affinity and automatic performance profiles for games.': 'Afinidade dinâmica de CPU para jogos.',
        'Ananicy-cpp Priority': 'Ananicy-cpp',
        'Automatic process nice/ionice latency tuning in the background.': 'Prioridade e latência de processos em tempo real.',
        'Bpftune Kernel Auto-Tuning': 'Auto-Tuning Bpftune',
        'Dynamic eBPF network buffer and sysctl optimization in real time.': 'Auto-tuning eBPF de rede e kernel.',
        'Systemd-OOMD Anti-Freeze': 'Systemd-OOMD',
        'Prevents hard system freezes under extreme 100% RAM/ZRAM exhaustion.': 'Proteção anti-trava de memória RAM.',
        'Profile-sync-daemon (RAM Browser)': 'Navegador na RAM',
        'Moves browser profiles to tmpfs RAM for instant speed and less SSD wear.': 'Perfis do navegador (PSD) na RAM.',
        'LIOS Update Notifier': 'LIOS Update',
        'System tray timer that checks and alerts when new updates are ready.': 'Aviso automático de novas atualizações.',
        'UFW Security Firewall': 'Firewall UFW',
        'Active network protection against unauthorized incoming connections.': 'Blindagem ativa de portas e rede.',
        'Bluetooth Service': 'Serviço Bluetooth',
        'Support for wireless controllers, headsets, and Bluetooth peripherals.': 'Suporte para controles e áudio sem fio.',
        'NVMe / SSD Trim Timer': 'Trim NVMe / SSD',
        'Weekly scheduled block maintenance to preserve SSD lifespan and speed.': 'Manutenção semanal de blocos do SSD.',
        'ACTIVE': 'ATIVO',
        'INACTIVE': 'INATIVO',
        'Rank Fastest Mirrors': 'Classificar Espelhos',
        'Test and select the fastest download servers.': 'Seleciona os servidores de download mais rápidos.',
        'Clean Package Cache': 'Limpar Cache do Pacman',
        'Free up disk space by removing old cached packages (pacman -Sc).': 'Libera espaço de pacotes antigos.',
        'Remove Orphan Packages': 'Remover Pacotes Órfãos',
        'Purge unused dependency packages left behind on your system.': 'Limpa dependências sem uso (pacman -Qtdq).',
        'Change DNS Server': 'Alterar Servidor DNS',
        'Measure ping latency and switch to Cloudflare, AdGuard, Quad9, or DoT.': 'Mede o ping em ms e ativa DNS rápidos.',
        'Install Winboat (Windows Apps)': 'Instalar Winboat',
        'Run Windows productivity apps seamlessly via container integration.': 'Apps do Windows via contêiner leve.',
        'Unlock Pacman Database': 'Desbloquear Banco de Dados (db.lck)',
        'Remove /var/lib/pacman/db.lck if a previous update was interrupted.': 'Remove /var/lib/pacman/db.lck após uma interrupção.',
        'Reset Pacman Keyrings': 'Redefinir Chaves GPG (Keyrings)',
        'Reinitialize and populate GPG cryptographic keys if package signatures fail.': 'Regenera as assinaturas GPG se houver erro de '
                                                                                        'chaves.',
        'Reinstall All Native Packages': 'Reinstalar Todos os Pacotes Nativos',
        'Force reinstall of all native system packages to repair damaged files.': 'Reinstala todos os pacotes nativos para reparar o '
                                                                                  'sistema.',
        'KWin (Wayland) Debug Console': 'Console de Depuração KWin (Wayland)',
        'Open the native KWin Wayland diagnostic inspector for windows and VRR.': 'Abre o inspetor do KWin para diagnosticar Wayland e '
                                                                                  'VRR.',
        'X64 Gaming Center': 'Central Gaming X64',
        'Modular 1-click installation of gaming launchers, compatibility layers, and FPS overlays.': 'Instalação modular em 1 clique de '
                                                                                                     'inicializadores de jogos, camadas '
                                                                                                     'Proton/UMU, bibliotecas 32 bits e '
                                                                                                     'overlays.',
        'MODULAR COMPONENT INSTALLATION': 'INSTALAÇÃO MODULAR POR COMPONENTES',
        'Full X64 Gaming Suite (All-in-One)': 'Suíte Gaming X64 Completa (Tudo em Um)',
        'Complete arsenal: Steam, Lutris, Heroic, Faugus, Gamescope, Proton-SLR, UMU, Wine, MangoHud, ProtonUp-Qt & 32-bit libs.': 'Arsenal '
                                                                                                                                   'completo: '
                                                                                                                                   'Steam, '
                                                                                                                                   'Lutris, '
                                                                                                                                   'Heroic, '
                                                                                                                                   'Faugus, '
                                                                                                                                   'Gamescope, '
                                                                                                                                   'Proton-SLR, '
                                                                                                                                   'UMU, '
                                                                                                                                   'Wine, '
                                                                                                                                   'MangoHud, '
                                                                                                                                   'ProtonUp-Qt '
                                                                                                                                   'e libs '
                                                                                                                                   '32 '
                                                                                                                                   'bits.',
        'X64 Gaming Core, Proton-SLR & Wine X64': 'Motor Gaming e Wine X64',
        'Essential 32-bit Vulkan/Audio libs, Proton-SLR, UMU, Wine X64, Winetricks & Protontricks.': 'Bibliotecas 32 bits Vulkan/Áudio, '
                                                                                                     'Proton-SLR, UMU, Wine X64, '
                                                                                                     'Winetricks e Protontricks.',
        'Steam': 'Steam',
        'Official Valve gaming platform with native Proton integration.': 'Plataforma oficial da Valve com integração nativa ao Proton.',
        'Lutris': 'Lutris',
        'Unified open gaming manager for Epic, GOG, Battle.net, EA, and Wine.': 'Gerenciador aberto unificado para Epic, GOG, Battle.net, '
                                                                                'EA e Wine.',
        'Heroic Games Launcher': 'Heroic Games Launcher',
        'Native graphical launcher for Epic Games, GOG, and Amazon Games.': 'Inicializador gráfico nativo para Epic Games, GOG e Amazon '
                                                                            'Games.',
        'Faugus Launcher': 'Faugus Launcher',
        'Ultra-lightweight modern launcher for Battle.net, EA App, Ubisoft, and standalone Windows games via UMU/Proton.': 'Inicializador '
                                                                                                                           'ultraleve para '
                                                                                                                           'Battle.net, EA '
                                                                                                                           'App, Ubisoft e '
                                                                                                                           'jogos Windows '
                                                                                                                           'via '
                                                                                                                           'UMU/Proton.',
        'MangoHud & GOverlay': 'MangoHud e GOverlay',
        'In-game FPS, frametime, CPU/GPU temperature HUD and graphical configurator.': 'HUD ao vivo de FPS, frametime, temperaturas e '
                                                                                       'configurador GOverlay.',
        'Gamescope (Valve Micro-Compositor)': 'Gamescope (Compositor Valve)',
        'Valve Wayland micro-compositor for FSR upscaling, frame limiting, and resolution isolation.': 'Micro-compositor Wayland da Valve '
                                                                                                       'para upscaling FSR, limite de FPS '
                                                                                                       'e resolução isolada.',
        'ProtonUp-Qt': 'ProtonUp-Qt',
        'Graphical manager to install and update GE-Proton and Wine-GE versions.': 'Gerenciador gráfico para instalar e atualizar versões '
                                                                                   'do GE-Proton e Wine-GE.',
        'INSTALLED ✓': 'INSTALADO ✓',
        'INSTALL': 'INSTALAR',
        'INSTALL SUITE': 'INSTALAR SUÍTE',
        'Launch at startup': 'Iniciar com o sistema',
        'Architecture:': 'Arquitetura:',
        'Session:': 'Sessão:',
        'Installed': 'Instalado',
        'X64 Architectural Manifesto': 'Manifesto Arquitetônico X64',
        'X64 LIOS was born as the ultimate answer to Linux fragmentation. We extract the raw power of high-performance kernels, the precision of the gaming ecosystem, and the purity of Arch to forge the definitive operating system.': 'O '
                                                                                                                                                                                                                                          'X64 '
                                                                                                                                                                                                                                          'LIOS '
                                                                                                                                                                                                                                          'nasceu '
                                                                                                                                                                                                                                          'como '
                                                                                                                                                                                                                                          'a '
                                                                                                                                                                                                                                          'resposta '
                                                                                                                                                                                                                                          'definitiva '
                                                                                                                                                                                                                                          'à '
                                                                                                                                                                                                                                          'fragmentação '
                                                                                                                                                                                                                                          'do '
                                                                                                                                                                                                                                          'Linux. '
                                                                                                                                                                                                                                          'Extraímos '
                                                                                                                                                                                                                                          'a '
                                                                                                                                                                                                                                          'força '
                                                                                                                                                                                                                                          'bruta '
                                                                                                                                                                                                                                          'dos '
                                                                                                                                                                                                                                          'kernels '
                                                                                                                                                                                                                                          'de '
                                                                                                                                                                                                                                          'alto '
                                                                                                                                                                                                                                          'desempenho, '
                                                                                                                                                                                                                                          'a '
                                                                                                                                                                                                                                          'precisão '
                                                                                                                                                                                                                                          'gaming '
                                                                                                                                                                                                                                          'e '
                                                                                                                                                                                                                                          'a '
                                                                                                                                                                                                                                          'pureza '
                                                                                                                                                                                                                                          'do '
                                                                                                                                                                                                                                          'Arch.',
        'I. Absolute Freedom': 'I. Liberdade Absoluta',
        'Upstream purity of Arch Linux with zero PPAs, zero corporate ties, and 99% of system packages intact. Combined with the AUR and modern GUI tools for complete freedom.': 'Pureza '
                                                                                                                                                                                  'Upstream '
                                                                                                                                                                                  'do '
                                                                                                                                                                                  'Arch '
                                                                                                                                                                                  'Linux '
                                                                                                                                                                                  'sem '
                                                                                                                                                                                  'PPAs '
                                                                                                                                                                                  'nem '
                                                                                                                                                                                  'amarras '
                                                                                                                                                                                  'corporativas, '
                                                                                                                                                                                  'combinada '
                                                                                                                                                                                  'com '
                                                                                                                                                                                  'o '
                                                                                                                                                                                  'AUR '
                                                                                                                                                                                  'e '
                                                                                                                                                                                  'ferramentas '
                                                                                                                                                                                  'gráficas '
                                                                                                                                                                                  'modernas.',
        'II. Surgical Optimization': 'II. Otimização Cirúrgica',
        'X64 low-latency kernel with scx dynamic schedulers, FalconD gaming CPU affinity, ananicy-cpp priority tuning, and pure ZRAM in RAM for zero disk swap latency.': 'Kernel '
                                                                                                                                                                          'X64 '
                                                                                                                                                                          'de '
                                                                                                                                                                          'baixa '
                                                                                                                                                                          'latência '
                                                                                                                                                                          'com '
                                                                                                                                                                          'escalonadores '
                                                                                                                                                                          'dinâmicos '
                                                                                                                                                                          'scx, '
                                                                                                                                                                          'afinidade '
                                                                                                                                                                          'de '
                                                                                                                                                                          'CPU '
                                                                                                                                                                          'FalconD, '
                                                                                                                                                                          'ananicy-cpp '
                                                                                                                                                                          'e '
                                                                                                                                                                          'ZRAM '
                                                                                                                                                                          'puro '
                                                                                                                                                                          'na '
                                                                                                                                                                          'RAM.',
        'III. Multi-Environment Ecosystem': 'III. Ecossistema Multi-Ambiente',
        'Live environment in KDE Plasma 6 Wayland, plus 8 official installation options (KDE, GNOME, COSMIC, Niri, Cinnamon, Xfce, Hyprland, and Server) with 16:9 previews.': 'Ambiente '
                                                                                                                                                                               'Live '
                                                                                                                                                                               'em '
                                                                                                                                                                               'KDE '
                                                                                                                                                                               'Plasma '
                                                                                                                                                                               '6 '
                                                                                                                                                                               'Wayland, '
                                                                                                                                                                               'além '
                                                                                                                                                                               'de '
                                                                                                                                                                               '8 '
                                                                                                                                                                               'opções '
                                                                                                                                                                               'oficiais '
                                                                                                                                                                               'de '
                                                                                                                                                                               'instalação '
                                                                                                                                                                               'com '
                                                                                                                                                                               'prévias '
                                                                                                                                                                               '16:9.',
        'IV. Infrastructure Independence': 'IV. Independência de Infraestrutura',
        'Cascading repository hierarchy. [x64-lios] holds priority #1 at the top of the system, served with SSL from our high-speed CDN infrastructure.': 'Hierarquia '
                                                                                                                                                          'própria '
                                                                                                                                                          'de '
                                                                                                                                                          'repositórios '
                                                                                                                                                          'em '
                                                                                                                                                          'cascata '
                                                                                                                                                          'com '
                                                                                                                                                          '[x64-lios] '
                                                                                                                                                          'na '
                                                                                                                                                          'prioridade '
                                                                                                                                                          '#1 '
                                                                                                                                                          'absoluta '
                                                                                                                                                          'via '
                                                                                                                                                          'CDN '
                                                                                                                                                          'SSL '
                                                                                                                                                          'de '
                                                                                                                                                          'alta '
                                                                                                                                                          'velocidade.',
        'V. Hardware Mutation': 'V. Mutação de Hardware',
        'During installation, the system audits your CPU: modern processors get AVX2/AVX512 (v3/v4) repositories injected below [x64-lios]. chwd autodetects NVIDIA, AMD, and Intel GPUs.': 'Auditoria '
                                                                                                                                                                                            'automática '
                                                                                                                                                                                            'de '
                                                                                                                                                                                            'CPU '
                                                                                                                                                                                            'durante '
                                                                                                                                                                                            'a '
                                                                                                                                                                                            'instalação '
                                                                                                                                                                                            'para '
                                                                                                                                                                                            'repositórios '
                                                                                                                                                                                            'AVX2/AVX512 '
                                                                                                                                                                                            '(v3/v4) '
                                                                                                                                                                                            'e '
                                                                                                                                                                                            'detecção '
                                                                                                                                                                                            'de '
                                                                                                                                                                                            'GPUs '
                                                                                                                                                                                            'NVIDIA, '
                                                                                                                                                                                            'AMD '
                                                                                                                                                                                            'e '
                                                                                                                                                                                            'Intel '
                                                                                                                                                                                            'via '
                                                                                                                                                                                            'chwd.',
        'VI. Modular Architecture': 'VI. Arquitetura Modular',
        'Lightweight installer with zero bloat. Heavy gaming platforms and emulators are cleanly delegated to post-installation setup in X64 Hello after first boot.': 'Instalador '
                                                                                                                                                                       'leve '
                                                                                                                                                                       'e '
                                                                                                                                                                       'sem '
                                                                                                                                                                       'bloatware. '
                                                                                                                                                                       'Plataformas '
                                                                                                                                                                       'pesadas '
                                                                                                                                                                       'de '
                                                                                                                                                                       'jogos '
                                                                                                                                                                       'são '
                                                                                                                                                                       'delegadas '
                                                                                                                                                                       'ao '
                                                                                                                                                                       'X64 '
                                                                                                                                                                       'Hello '
                                                                                                                                                                       'após '
                                                                                                                                                                       'o '
                                                                                                                                                                       'primeiro '
                                                                                                                                                                       'boot.',
        'VII. Shield of Resilience': 'VII. Escudo de Resiliência',
        'Temporal immutability with Btrfs & automated Snapper snapshots. Multi-bootloader support choosing Limine, GRUB, systemd-boot, or rEFInd for effortless rollback.': 'Imutabilidade '
                                                                                                                                                                            'temporal '
                                                                                                                                                                            'com '
                                                                                                                                                                            'Btrfs '
                                                                                                                                                                            'e '
                                                                                                                                                                            'snapshots '
                                                                                                                                                                            'automáticos '
                                                                                                                                                                            'do '
                                                                                                                                                                            'Snapper, '
                                                                                                                                                                            'com '
                                                                                                                                                                            'suporte '
                                                                                                                                                                            'a '
                                                                                                                                                                            'Limine, '
                                                                                                                                                                            'GRUB, '
                                                                                                                                                                            'systemd-boot '
                                                                                                                                                                            'e '
                                                                                                                                                                            'rEFInd.',
        'VIII. The Death of the Terminal': 'VIII. A Morte do Terminal Obrigatório',
        'GUI-First philosophy for effortless everyday use, paired with an elite hacker terminal experience in Kitty, Fish shell, and Starship pills for power users.': 'Filosofia '
                                                                                                                                                                       'GUI-First '
                                                                                                                                                                       'para '
                                                                                                                                                                       'uso '
                                                                                                                                                                       'diário '
                                                                                                                                                                       'intuitivo, '
                                                                                                                                                                       'unida '
                                                                                                                                                                       'a '
                                                                                                                                                                       'um '
                                                                                                                                                                       'terminal '
                                                                                                                                                                       'hacker '
                                                                                                                                                                       'de '
                                                                                                                                                                       'elite '
                                                                                                                                                                       'com '
                                                                                                                                                                       'Kitty, '
                                                                                                                                                                       'Fish '
                                                                                                                                                                       'shell '
                                                                                                                                                                       'e '
                                                                                                                                                                       'Starship.',
        'IX. Hybrid Rolling Release': 'IX. Rolling Release Híbrido',
        'The core flies at pure Arch rolling speed, while professional apps can be isolated via Flatpak or Distrobox containers to guarantee Debian-level rock-solid stability.': 'O '
                                                                                                                                                                                  'núcleo '
                                                                                                                                                                                  'voa '
                                                                                                                                                                                  'na '
                                                                                                                                                                                  'velocidade '
                                                                                                                                                                                  'Arch '
                                                                                                                                                                                  'rolling, '
                                                                                                                                                                                  'enquanto '
                                                                                                                                                                                  'aplicativos '
                                                                                                                                                                                  'profissionais '
                                                                                                                                                                                  'podem '
                                                                                                                                                                                  'ser '
                                                                                                                                                                                  'isolados '
                                                                                                                                                                                  'via '
                                                                                                                                                                                  'Flatpak '
                                                                                                                                                                                  'ou '
                                                                                                                                                                                  'Distrobox.',
        'X. Architectural Pragmatism': 'X. Pragmatismo Arquitetônico',
        'Open Source synergy. We inherit and polish battle-tested foundations, writing custom code and maintaining our own repositories only where we add unique value.': 'Sinergia '
                                                                                                                                                                          'Open '
                                                                                                                                                                          'Source: '
                                                                                                                                                                          'lapidamos '
                                                                                                                                                                          'bases '
                                                                                                                                                                          'testadas '
                                                                                                                                                                          'em '
                                                                                                                                                                          'batalha '
                                                                                                                                                                          'e '
                                                                                                                                                                          'mantemos '
                                                                                                                                                                          'repositórios '
                                                                                                                                                                          'próprios '
                                                                                                                                                                          'onde '
                                                                                                                                                                          'agregamos '
                                                                                                                                                                          'valor '
                                                                                                                                                                          'único.',
        'XI. Aesthetics as Function': 'XI. A Estética como Função',
        'Design is not an afterthought. Widescreen panoramic UI, Crimson & Charcoal color direction (#b31b1b / #0b0b0d), and vector iconography engineered for focus and control.': 'UI '
                                                                                                                                                                                    'panorâmica '
                                                                                                                                                                                    'Widescreen, '
                                                                                                                                                                                    'paleta '
                                                                                                                                                                                    'Carmesim '
                                                                                                                                                                                    'e '
                                                                                                                                                                                    'Carvão '
                                                                                                                                                                                    '(#b31b1b '
                                                                                                                                                                                    '/ '
                                                                                                                                                                                    '#0b0b0d) '
                                                                                                                                                                                    'e '
                                                                                                                                                                                    'iconografia '
                                                                                                                                                                                    'vetorial '
                                                                                                                                                                                    'projetada '
                                                                                                                                                                                    'para '
                                                                                                                                                                                    'foco '
                                                                                                                                                                                    'e '
                                                                                                                                                                                    'controle.',
        'XII. Absolute Privacy': 'XII. Privacidade Absoluta',
        'In the era of covert telemetry, your PC is your private fortress. Zero tracking, zero telemetry, and zero data reporting. What you do on your machine, dies on your machine.': 'Seu '
                                                                                                                                                                                        'PC '
                                                                                                                                                                                        'é '
                                                                                                                                                                                        'sua '
                                                                                                                                                                                        'fortaleza '
                                                                                                                                                                                        'privada: '
                                                                                                                                                                                        'zero '
                                                                                                                                                                                        'rastreamento, '
                                                                                                                                                                                        'zero '
                                                                                                                                                                                        'telemetria '
                                                                                                                                                                                        'e '
                                                                                                                                                                                        'zero '
                                                                                                                                                                                        'envio '
                                                                                                                                                                                        'de '
                                                                                                                                                                                        'dados.',
        'X64 LIOS COMMAND CENTER': 'CENTRO DE COMANDO X64 LIOS',
        'FIREWALL UFW': 'FIREWALL UFW',
        'Welcome': 'Bem-vindo',
        'Operating system installed and running at peak hardware capacity.': 'Sistema operacional instalado e operando na capacidade '
                                                                             'máxima do hardware.',
        'UPDATE SYSTEM': 'ATUALIZAR SISTEMA',
        'LIVE BTOP MONITOR': 'MONITOR BTOP AO VIVO',
        'REAL-TIME HARDWARE TELEMETRY': 'TELEMETRIA DE HARDWARE EM TEMPO REAL',
        'PROCESSOR (CPU)': 'PROCESSADOR (CPU)',
        'Threads': 'Threads',
        'PHYSICAL RAM & ZRAM': 'MEMÓRIA RAM E ZRAM',
        'ZRAM Active in RAM • Zero Disk Swap': 'ZRAM Ativo na RAM • Zero Swap em Disco',
        'High-Speed System Memory': 'Memória do Sistema de Alta Velocidade',
        'GRAPHICS & COMPOSITOR (GPU)': 'GRÁFICOS E COMPOSITOR (GPU)',
        'Hardware Acceleration Active': 'Aceleração por Hardware Ativa',
        'ROOT STORAGE (/) & UPTIME': 'DISCO RAIZ (/) E UPTIME',
        'Filesystem': 'Sistema',
        'Uptime': 'Ativo',
        'OFFICIAL ECOSYSTEM & COMMUNITY': 'ECOSSISTEMA E COMUNIDADE OFICIAL',
        'Official Website & Wiki': 'Site Oficial e Wiki',
        'Official guides, system modules, and documentation.': 'Guias oficiais, módulos do sistema e documentação.',
        'Real-time support channels, setups, and community chat.': 'Canais de suporte em tempo real, setups e comunidade.',
        'X64 DNS & Low-Latency Optimizer': 'Otimizador de DNS e Baixa Latência X64',
        'Active Network Connection:': 'Conexão de Rede Ativa:',
        '⚡ Benchmark DNS Latency (Ping)': '⚡ Medir Latência DNS (Ping)',
        'Testing ping to all DNS servers...': 'Medindo latência (ping) para todos os servidores DNS...',
        'Enable Encrypted DNS (DNS-over-TLS / DoT)': 'Ativar DNS Criptografado (DNS-over-TLS / DoT)',
        'Reset to Automatic (DHCP)': 'Redefinir para Automático (DHCP)',
        'Apply Selected DNS': 'Aplicar DNS Selecionado',
        'Close': 'Fechar',
        'Applying DNS configuration...': 'Aplicando configuração de DNS...',
        'Resetting DNS to automatic DHCP...': 'Redefinindo DNS para DHCP automático...',
        'Operation canceled or authentication failed.': 'Operação cancelada ou falha na autenticação.',
        'DNS successfully applied to connection:': 'Servidor DNS aplicado com sucesso à conexão:',
        'DNS reset to automatic DHCP on:': 'DNS redefinido para DHCP automático em:',
        'Ultra-Fast Gaming': 'Gaming Ultra-Rápido',
        'Anti-Malware Filter': 'Filtro Anti-Malware',
        'Ad & Tracker Blocker': 'Bloqueador de Anúncios',
        'Swiss Privacy': 'Privacidade Suíça',
        'High Availability': 'Alta Disponibilidade',
        'Classic Stability': 'Estabilidade Clássica'},
 'ru': {'Home': 'Главная',
        'Tweaks & System': 'Система и Твики',
        'Gaming Center': 'Игровой Центр',
        'Philosophy': 'Философия',
        'Welcome to X64 LIOS': 'Добро пожаловать в X64 LIOS',
        'Update System': 'Обновить систему',
        'Synchronize repositories and upgrade all system packages (pacman -Syu).': 'Синхронизация репозиториев и полное обновление системы '
                                                                                   '(pacman -Syu).',
        'Discord Community': 'Сообщество Discord',
        'System Services & Tweaks': 'Системные службы и оптимизация',
        'Control real-time daemons, configure low-latency DNS, and execute system rescue routines with a single click.': 'Управляйте '
                                                                                                                         'службами в '
                                                                                                                         'реальном '
                                                                                                                         'времени, '
                                                                                                                         'настраивайте '
                                                                                                                         'быстрый DNS и '
                                                                                                                         'выполняйте '
                                                                                                                         'восстановление '
                                                                                                                         'системы в один '
                                                                                                                         'клик.',
        'Real-Time Daemons & Services': 'Службы и демоны в реальном времени',
        'System Maintenance & Utilities': 'Обслуживание и системные утилиты',
        'Troubleshooting & System Rescue': 'Диагностика и восстановление системы',
        'FalconD Gaming Daemon': 'FalconD Gaming',
        'Dynamic CPU affinity and automatic performance profiles for games.': 'Динамические профили CPU для игр.',
        'Ananicy-cpp Priority': 'Ananicy-cpp',
        'Automatic process nice/ionice latency tuning in the background.': 'Приоритет и задержка процессов.',
        'Bpftune Kernel Auto-Tuning': 'Ядро Bpftune',
        'Dynamic eBPF network buffer and sysctl optimization in real time.': 'Динамическая eBPF-оптимизация сети и ядра.',
        'Systemd-OOMD Anti-Freeze': 'Systemd-OOMD',
        'Prevents hard system freezes under extreme 100% RAM/ZRAM exhaustion.': 'Защита ОЗУ от зависаний системы.',
        'Profile-sync-daemon (RAM Browser)': 'Браузер в ОЗУ (PSD)',
        'Moves browser profiles to tmpfs RAM for instant speed and less SSD wear.': 'Профили браузера в быстрой памяти tmpfs.',
        'LIOS Update Notifier': 'LIOS Update',
        'System tray timer that checks and alerts when new updates are ready.': 'Автоматическая проверка доступных обновлений.',
        'UFW Security Firewall': 'Брандмауэр UFW',
        'Active network protection against unauthorized incoming connections.': 'Активная защита портов и сетевых подключений.',
        'Bluetooth Service': 'Служба Bluetooth',
        'Support for wireless controllers, headsets, and Bluetooth peripherals.': 'Поддержка беспроводных геймпадов и аудио.',
        'NVMe / SSD Trim Timer': 'TRIM NVMe / SSD',
        'Weekly scheduled block maintenance to preserve SSD lifespan and speed.': 'Еженедельное обслуживание блоков SSD.',
        'ACTIVE': 'АКТИВЕН',
        'INACTIVE': 'НЕАТИВЕН',
        'Rank Fastest Mirrors': 'Рейтинг быстрых зеркал',
        'Test and select the fastest download servers.': 'Выбор самых быстрых серверов загрузки.',
        'Clean Package Cache': 'Очистить кэш Pacman',
        'Free up disk space by removing old cached packages (pacman -Sc).': 'Освобождает место от старых пакетов (pacman -Sc).',
        'Remove Orphan Packages': 'Удалить пакеты-сироты',
        'Purge unused dependency packages left behind on your system.': 'Очистка неиспользуемых зависимостей.',
        'Change DNS Server': 'Сменить DNS-сервер',
        'Measure ping latency and switch to Cloudflare, AdGuard, Quad9, or DoT.': 'Замер пинга и включение быстрых DNS.',
        'Install Winboat (Windows Apps)': 'Установить Winboat',
        'Run Windows productivity apps seamlessly via container integration.': 'Запуск приложений Windows в контейнере.',
        'Unlock Pacman Database': 'Разблокировать базу Pacman (db.lck)',
        'Remove /var/lib/pacman/db.lck if a previous update was interrupted.': 'Удаляет /var/lib/pacman/db.lck после сбоя обновления.',
        'Reset Pacman Keyrings': 'Сбросить связку ключей GPG',
        'Reinitialize and populate GPG cryptographic keys if package signatures fail.': 'Пересоздаёт ключи GPG при ошибках подписей '
                                                                                        'пакетов.',
        'Reinstall All Native Packages': 'Переустановить все пакеты',
        'Force reinstall of all native system packages to repair damaged files.': 'Полная переустановка системных пакетов для '
                                                                                  'восстановления.',
        'KWin (Wayland) Debug Console': 'Консоль отладки KWin (Wayland)',
        'Open the native KWin Wayland diagnostic inspector for windows and VRR.': 'Открывает инспектор KWin для диагностики Wayland и VRR.',
        'X64 Gaming Center': 'Игровой Центр X64',
        'Modular 1-click installation of gaming launchers, compatibility layers, and FPS overlays.': 'Модульная установка игровых '
                                                                                                     'лаунчеров, Proton/UMU, 32-битных '
                                                                                                     'библиотек и оверлеев в 1 клик.',
        'MODULAR COMPONENT INSTALLATION': 'МОДУЛЬНАЯ УСТАНОВКА КОМПОНЕНТОВ',
        'Full X64 Gaming Suite (All-in-One)': 'Полный игровой набор X64 (Всё-в-Одном)',
        'Complete arsenal: Steam, Lutris, Heroic, Faugus, Gamescope, Proton-SLR, UMU, Wine, MangoHud, ProtonUp-Qt & 32-bit libs.': 'Полный '
                                                                                                                                   'арсенал: '
                                                                                                                                   'Steam, '
                                                                                                                                   'Lutris, '
                                                                                                                                   'Heroic, '
                                                                                                                                   'Faugus, '
                                                                                                                                   'Gamescope, '
                                                                                                                                   'Proton-SLR, '
                                                                                                                                   'UMU, '
                                                                                                                                   'Wine, '
                                                                                                                                   'MangoHud, '
                                                                                                                                   'ProtonUp-Qt '
                                                                                                                                   'и '
                                                                                                                                   '32-бит '
                                                                                                                                   'библиотеки.',
        'X64 Gaming Core, Proton-SLR & Wine X64': 'Игровое ядро и Wine X64',
        'Essential 32-bit Vulkan/Audio libs, Proton-SLR, UMU, Wine X64, Winetricks & Protontricks.': '32-битные библиотеки Vulkan/Аудио, '
                                                                                                     'Proton-SLR, UMU, Wine X64, '
                                                                                                     'Winetricks и Protontricks.',
        'Steam': 'Steam',
        'Official Valve gaming platform with native Proton integration.': 'Официальная платформа Valve с нативной интеграцией Proton.',
        'Lutris': 'Lutris',
        'Unified open gaming manager for Epic, GOG, Battle.net, EA, and Wine.': 'Единый менеджер игр для Epic, GOG, Battle.net, EA и Wine.',
        'Heroic Games Launcher': 'Heroic Games Launcher',
        'Native graphical launcher for Epic Games, GOG, and Amazon Games.': 'Нативный лаунчер для Epic Games, GOG и Amazon Games.',
        'Faugus Launcher': 'Faugus Launcher',
        'Ultra-lightweight modern launcher for Battle.net, EA App, Ubisoft, and standalone Windows games via UMU/Proton.': 'Сверхлёгкий '
                                                                                                                           'лаунчер для '
                                                                                                                           'Battle.net, EA '
                                                                                                                           'App, Ubisoft и '
                                                                                                                           'игр Windows '
                                                                                                                           'через '
                                                                                                                           'UMU/Proton.',
        'MangoHud & GOverlay': 'MangoHud и GOverlay',
        'In-game FPS, frametime, CPU/GPU temperature HUD and graphical configurator.': 'Игровой оверлей FPS, времени кадра, температур и '
                                                                                       'конфигуратор GOverlay.',
        'Gamescope (Valve Micro-Compositor)': 'Gamescope (Композитор Valve)',
        'Valve Wayland micro-compositor for FSR upscaling, frame limiting, and resolution isolation.': 'Микро-композитор Wayland от Valve '
                                                                                                       'для апскейлинга FSR, лимита FPS и '
                                                                                                       'изоляции разрешения.',
        'ProtonUp-Qt': 'ProtonUp-Qt',
        'Graphical manager to install and update GE-Proton and Wine-GE versions.': 'Графический менеджер для установки и обновления '
                                                                                   'GE-Proton и Wine-GE.',
        'INSTALLED ✓': 'УСТАНОВЛЕНО ✓',
        'INSTALL': 'УСТАНОВИТЬ',
        'INSTALL SUITE': 'УСТАНОВИТЬ НАБОР',
        'Launch at startup': 'Запускать при входе',
        'Architecture:': 'Архитектура:',
        'Session:': 'Сессия:',
        'Installed': 'Установлено',
        'X64 Architectural Manifesto': 'Архитектурный манифест X64',
        'X64 LIOS was born as the ultimate answer to Linux fragmentation. We extract the raw power of high-performance kernels, the precision of the gaming ecosystem, and the purity of Arch to forge the definitive operating system.': 'X64 '
                                                                                                                                                                                                                                          'LIOS '
                                                                                                                                                                                                                                          'создан '
                                                                                                                                                                                                                                          'как '
                                                                                                                                                                                                                                          'окончательный '
                                                                                                                                                                                                                                          'ответ '
                                                                                                                                                                                                                                          'на '
                                                                                                                                                                                                                                          'фрагментацию '
                                                                                                                                                                                                                                          'Linux, '
                                                                                                                                                                                                                                          'объединяя '
                                                                                                                                                                                                                                          'мощь '
                                                                                                                                                                                                                                          'высокопроизводительных '
                                                                                                                                                                                                                                          'ядер, '
                                                                                                                                                                                                                                          'игровую '
                                                                                                                                                                                                                                          'точность '
                                                                                                                                                                                                                                          'и '
                                                                                                                                                                                                                                          'чистоту '
                                                                                                                                                                                                                                          'Arch.',
        'I. Absolute Freedom': 'I. Абсолютная свобода',
        'Upstream purity of Arch Linux with zero PPAs, zero corporate ties, and 99% of system packages intact. Combined with the AUR and modern GUI tools for complete freedom.': 'Чистота '
                                                                                                                                                                                  'Arch '
                                                                                                                                                                                  'Linux '
                                                                                                                                                                                  'без '
                                                                                                                                                                                  'PPA '
                                                                                                                                                                                  'и '
                                                                                                                                                                                  'корпоративных '
                                                                                                                                                                                  'ограничений '
                                                                                                                                                                                  'в '
                                                                                                                                                                                  'сочетании '
                                                                                                                                                                                  'с '
                                                                                                                                                                                  'AUR '
                                                                                                                                                                                  'и '
                                                                                                                                                                                  'современными '
                                                                                                                                                                                  'графическими '
                                                                                                                                                                                  'инструментами.',
        'II. Surgical Optimization': 'II. Хирургическая оптимизация',
        'X64 low-latency kernel with scx dynamic schedulers, FalconD gaming CPU affinity, ananicy-cpp priority tuning, and pure ZRAM in RAM for zero disk swap latency.': 'Ядро '
                                                                                                                                                                          'X64 '
                                                                                                                                                                          'с '
                                                                                                                                                                          'низкой '
                                                                                                                                                                          'задержкой, '
                                                                                                                                                                          'планировщиками '
                                                                                                                                                                          'scx, '
                                                                                                                                                                          'игровым '
                                                                                                                                                                          'демоном '
                                                                                                                                                                          'FalconD, '
                                                                                                                                                                          'ananicy-cpp '
                                                                                                                                                                          'и '
                                                                                                                                                                          'быстрым '
                                                                                                                                                                          'ZRAM '
                                                                                                                                                                          'в '
                                                                                                                                                                          'ОЗУ.',
        'III. Multi-Environment Ecosystem': 'III. Мульти-среда рабочего стола',
        'Live environment in KDE Plasma 6 Wayland, plus 8 official installation options (KDE, GNOME, COSMIC, Niri, Cinnamon, Xfce, Hyprland, and Server) with 16:9 previews.': 'Live-среда '
                                                                                                                                                                               'на '
                                                                                                                                                                               'KDE '
                                                                                                                                                                               'Plasma '
                                                                                                                                                                               '6 '
                                                                                                                                                                               'Wayland '
                                                                                                                                                                               'и '
                                                                                                                                                                               '8 '
                                                                                                                                                                               'официальных '
                                                                                                                                                                               'окружений '
                                                                                                                                                                               'рабочего '
                                                                                                                                                                               'стола '
                                                                                                                                                                               'при '
                                                                                                                                                                               'установке.',
        'IV. Infrastructure Independence': 'IV. Независимость инфраструктуры',
        'Cascading repository hierarchy. [x64-lios] holds priority #1 at the top of the system, served with SSL from our high-speed CDN infrastructure.': 'Каскадная '
                                                                                                                                                          'иерархия '
                                                                                                                                                          'репозиториев '
                                                                                                                                                          'с '
                                                                                                                                                          'приоритетом '
                                                                                                                                                          '#1 '
                                                                                                                                                          'для '
                                                                                                                                                          '[x64-lios] '
                                                                                                                                                          'через '
                                                                                                                                                          'высокоскоростную '
                                                                                                                                                          'сеть '
                                                                                                                                                          'CDN '
                                                                                                                                                          'с '
                                                                                                                                                          'SSL.',
        'V. Hardware Mutation': 'V. Аппаратная адаптация',
        'During installation, the system audits your CPU: modern processors get AVX2/AVX512 (v3/v4) repositories injected below [x64-lios]. chwd autodetects NVIDIA, AMD, and Intel GPUs.': 'Автоматический '
                                                                                                                                                                                            'аудит '
                                                                                                                                                                                            'процессора '
                                                                                                                                                                                            'при '
                                                                                                                                                                                            'установке '
                                                                                                                                                                                            '(репозитории '
                                                                                                                                                                                            'AVX2/AVX512 '
                                                                                                                                                                                            'v3/v4) '
                                                                                                                                                                                            'и '
                                                                                                                                                                                            'автоопределение '
                                                                                                                                                                                            'драйверов '
                                                                                                                                                                                            'GPU '
                                                                                                                                                                                            'через '
                                                                                                                                                                                            'chwd.',
        'VI. Modular Architecture': 'VI. Модульная архитектура',
        'Lightweight installer with zero bloat. Heavy gaming platforms and emulators are cleanly delegated to post-installation setup in X64 Hello after first boot.': 'Лёгкий '
                                                                                                                                                                       'установщик '
                                                                                                                                                                       'без '
                                                                                                                                                                       'лишнего '
                                                                                                                                                                       'ПО. '
                                                                                                                                                                       'Игровые '
                                                                                                                                                                       'платформы '
                                                                                                                                                                       'устанавливаются '
                                                                                                                                                                       'в '
                                                                                                                                                                       'один '
                                                                                                                                                                       'клик '
                                                                                                                                                                       'через '
                                                                                                                                                                       'X64 '
                                                                                                                                                                       'Hello '
                                                                                                                                                                       'после '
                                                                                                                                                                       'первого '
                                                                                                                                                                       'запуска.',
        'VII. Shield of Resilience': 'VII. Щит отказоустойчивости',
        'Temporal immutability with Btrfs & automated Snapper snapshots. Multi-bootloader support choosing Limine, GRUB, systemd-boot, or rEFInd for effortless rollback.': 'Надёжность '
                                                                                                                                                                            'Btrfs '
                                                                                                                                                                            'с '
                                                                                                                                                                            'автоматическими '
                                                                                                                                                                            'снимками '
                                                                                                                                                                            'Snapper '
                                                                                                                                                                            'и '
                                                                                                                                                                            'поддержкой '
                                                                                                                                                                            'загрузчиков '
                                                                                                                                                                            'Limine, '
                                                                                                                                                                            'GRUB, '
                                                                                                                                                                            'systemd-boot '
                                                                                                                                                                            'и '
                                                                                                                                                                            'rEFInd.',
        'VIII. The Death of the Terminal': 'VIII. Философия GUI-First',
        'GUI-First philosophy for effortless everyday use, paired with an elite hacker terminal experience in Kitty, Fish shell, and Starship pills for power users.': 'Удобное '
                                                                                                                                                                       'графическое '
                                                                                                                                                                       'управление '
                                                                                                                                                                       'на '
                                                                                                                                                                       'каждый '
                                                                                                                                                                       'день '
                                                                                                                                                                       'в '
                                                                                                                                                                       'сочетании '
                                                                                                                                                                       'с '
                                                                                                                                                                       'настроенным '
                                                                                                                                                                       'терминалом '
                                                                                                                                                                       'Kitty, '
                                                                                                                                                                       'Fish '
                                                                                                                                                                       'и '
                                                                                                                                                                       'Starship.',
        'IX. Hybrid Rolling Release': 'IX. Гибридный Rolling Release',
        'The core flies at pure Arch rolling speed, while professional apps can be isolated via Flatpak or Distrobox containers to guarantee Debian-level rock-solid stability.': 'Свежесть '
                                                                                                                                                                                  'пакетов '
                                                                                                                                                                                  'Arch '
                                                                                                                                                                                  'сочетается '
                                                                                                                                                                                  'с '
                                                                                                                                                                                  'возможностью '
                                                                                                                                                                                  'изоляции '
                                                                                                                                                                                  'рабочих '
                                                                                                                                                                                  'приложений '
                                                                                                                                                                                  'во '
                                                                                                                                                                                  'Flatpak '
                                                                                                                                                                                  'и '
                                                                                                                                                                                  'контейнерах '
                                                                                                                                                                                  'Distrobox.',
        'X. Architectural Pragmatism': 'X. Архитектурный прагматизм',
        'Open Source synergy. We inherit and polish battle-tested foundations, writing custom code and maintaining our own repositories only where we add unique value.': 'Синергия '
                                                                                                                                                                          'Open '
                                                                                                                                                                          'Source: '
                                                                                                                                                                          'проверенный '
                                                                                                                                                                          'фундамент '
                                                                                                                                                                          'и '
                                                                                                                                                                          'собственные '
                                                                                                                                                                          'разработки '
                                                                                                                                                                          'там, '
                                                                                                                                                                          'где '
                                                                                                                                                                          'они '
                                                                                                                                                                          'дают '
                                                                                                                                                                          'максимальную '
                                                                                                                                                                          'пользу.',
        'XI. Aesthetics as Function': 'XI. Эстетика как функция',
        'Design is not an afterthought. Widescreen panoramic UI, Crimson & Charcoal color direction (#b31b1b / #0b0b0d), and vector iconography engineered for focus and control.': 'Широкоформатный '
                                                                                                                                                                                    'интерфейс, '
                                                                                                                                                                                    'палитра '
                                                                                                                                                                                    'Багровый '
                                                                                                                                                                                    'и '
                                                                                                                                                                                    'Угольный '
                                                                                                                                                                                    '(#b31b1b '
                                                                                                                                                                                    '/ '
                                                                                                                                                                                    '#0b0b0d) '
                                                                                                                                                                                    'и '
                                                                                                                                                                                    'чёткая '
                                                                                                                                                                                    'векторная '
                                                                                                                                                                                    'иконографика.',
        'XII. Absolute Privacy': 'XII. Абсолютная приватность',
        'In the era of covert telemetry, your PC is your private fortress. Zero tracking, zero telemetry, and zero data reporting. What you do on your machine, dies on your machine.': 'Ваш '
                                                                                                                                                                                        'ПК '
                                                                                                                                                                                        '— '
                                                                                                                                                                                        'ваша '
                                                                                                                                                                                        'неприкосновенная '
                                                                                                                                                                                        'крепость: '
                                                                                                                                                                                        'ноль '
                                                                                                                                                                                        'слежки, '
                                                                                                                                                                                        'ноль '
                                                                                                                                                                                        'телеметрии '
                                                                                                                                                                                        'и '
                                                                                                                                                                                        'никакой '
                                                                                                                                                                                        'отправки '
                                                                                                                                                                                        'данных.',
        'X64 LIOS COMMAND CENTER': 'КОМАНДНЫЙ ЦЕНТР X64 LIOS',
        'FIREWALL UFW': 'БРАНДМАУЭР UFW',
        'Welcome': 'Добро пожаловать',
        'Operating system installed and running at peak hardware capacity.': 'Операционная система установлена и работает на полной '
                                                                             'мощности оборудования.',
        'UPDATE SYSTEM': 'ОБНОВИТЬ СИСТЕМУ',
        'LIVE BTOP MONITOR': 'МОНИТОР РЕСУРСОВ BTOP',
        'REAL-TIME HARDWARE TELEMETRY': 'ТЕЛЕМЕТРИЯ ОБОРУДОВАНИЯ В РЕАЛЬНОМ ВРЕМЕНИ',
        'PROCESSOR (CPU)': 'ПРОЦЕССОР (CPU)',
        'Threads': 'Потоков',
        'PHYSICAL RAM & ZRAM': 'ПАМЯТЬ ОЗУ И ZRAM',
        'ZRAM Active in RAM • Zero Disk Swap': 'ZRAM активен в ОЗУ • Без подкачки на диск',
        'High-Speed System Memory': 'Высокоскоростная системная память',
        'GRAPHICS & COMPOSITOR (GPU)': 'ГРАФИКА И КОМПОЗИТОР (GPU)',
        'Hardware Acceleration Active': 'Аппаратное ускорение активно',
        'ROOT STORAGE (/) & UPTIME': 'РАЗДЕЛ ROOT (/) И UPTIME',
        'Filesystem': 'ФС',
        'Uptime': 'В работе',
        'OFFICIAL ECOSYSTEM & COMMUNITY': 'ОФИЦИАЛЬНАЯ ЭКОСИСТЕМА И СООБЩЕСТВО',
        'Official Website & Wiki': 'Официальный сайт и Wiki',
        'Official guides, system modules, and documentation.': 'Официальные руководства, модули системы и документация.',
        'Real-time support channels, setups, and community chat.': 'Каналы поддержки в реальном времени и общение.',
        'X64 DNS & Low-Latency Optimizer': 'Оптимизатор DNS и низкой задержки X64',
        'Active Network Connection:': 'Активное сетевое подключение:',
        '⚡ Benchmark DNS Latency (Ping)': '⚡ Измерить задержку DNS (Ping)',
        'Testing ping to all DNS servers...': 'Измерение задержки (пинга) до всех DNS-серверов...',
        'Enable Encrypted DNS (DNS-over-TLS / DoT)': 'Включить шифрованный DNS (DNS-over-TLS / DoT)',
        'Reset to Automatic (DHCP)': 'Сбросить на автоматический (DHCP)',
        'Apply Selected DNS': 'Применить выбранный DNS',
        'Close': 'Закрыть',
        'Applying DNS configuration...': 'Применение настроек DNS...',
        'Resetting DNS to automatic DHCP...': 'Сброс DNS на автоматический DHCP...',
        'Operation canceled or authentication failed.': 'Операция отменена или ошибка аутентификации.',
        'DNS successfully applied to connection:': 'DNS-сервер успешно применён к подключению:',
        'DNS reset to automatic DHCP on:': 'DNS сброшен на автоматический DHCP для:',
        'Ultra-Fast Gaming': 'Ультра-быстрый гейминг',
        'Anti-Malware Filter': 'Фильтр вредоносного ПО',
        'Ad & Tracker Blocker': 'Блокировка рекламы',
        'Swiss Privacy': 'Швейцарская приватность',
        'High Availability': 'Высокая доступность',
        'Classic Stability': 'Стабильный DNS'},
 'en': {'FalconD Gaming Daemon': 'FalconD Gaming',
        'Dynamic CPU affinity and automatic performance profiles for games.': 'Dynamic CPU affinity for gaming.',
        'Ananicy-cpp Priority': 'Ananicy-cpp',
        'Automatic process nice/ionice latency tuning in the background.': 'Live process priority and latency.',
        'Bpftune Kernel Auto-Tuning': 'Bpftune Kernel',
        'Dynamic eBPF network buffer and sysctl optimization in real time.': 'Live eBPF network & kernel tuning.',
        'Systemd-OOMD Anti-Freeze': 'Systemd-OOMD',
        'Prevents hard system freezes under extreme 100% RAM/ZRAM exhaustion.': 'Anti-freeze RAM exhaustion guard.',
        'Profile-sync-daemon (RAM Browser)': 'RAM Browser (PSD)',
        'Moves browser profiles to tmpfs RAM for instant speed and less SSD wear.': 'Browser profiles in tmpfs RAM.',
        'LIOS Update Notifier': 'LIOS Update',
        'System tray timer that checks and alerts when new updates are ready.': 'Automatic system update alerts.',
        'UFW Security Firewall': 'UFW Firewall',
        'Active network protection against unauthorized incoming connections.': 'Active port and network shield.',
        'Bluetooth Service': 'Bluetooth',
        'Support for wireless controllers, headsets, and Bluetooth peripherals.': 'Wireless controllers and audio.',
        'NVMe / SSD Trim Timer': 'NVMe / SSD TRIM',
        'Weekly scheduled block maintenance to preserve SSD lifespan and speed.': 'Weekly SSD block maintenance.',
        'X64 Gaming Core, Proton-SLR & Wine X64': 'X64 Gaming Core & Wine X64',
        'Gamescope (Valve Micro-Compositor)': 'Gamescope (Valve Compositor)'}}

SCHED_TRANSLATIONS = {
    'es': {
        'CPU Scheduler (scx / BORE)': 'Planificador CPU (scx / BORE)',
        'Switch live between BORE, scx_lavd, scx_bpfland, scx_cosmos, scx_flash & scx_rusty.': 'Cambia en vivo entre BORE, scx_lavd, scx_bpfland, scx_cosmos, scx_flash y scx_rusty.',
        'System Boot Error Log': 'Registro de Errores de Arranque',
        'Inspect critical systemd and kernel errors from the current boot (journalctl -p 3 -xb).': 'Inspecciona errores críticos del kernel y systemd en el arranque actual (journalctl -p 3 -xb).',
        'Click to open X64 CPU Scheduler Selector (BORE / sched_ext).': 'Haz clic para abrir el Selector de Planificador CPU (BORE / sched_ext).',
        'X64 CPU Scheduler & Latency Selector': 'Selector de Planificador CPU y Latencia X64',
        'Switch the Linux kernel CPU task scheduler in real time with zero reboot required.': 'Cambia el planificador de tareas de CPU del kernel en tiempo real sin necesidad de reiniciar.',
        'Active Kernel Scheduler:': 'Planificador Activo del Kernel:',
        'BORE (Kernel Default)': 'BORE (Nativo por Defecto)',
        'Native Kernel + FalconD Auto': 'Kernel Nativo + FalconD Auto',
        'Burst-Oriented Response Enhancer built into the kernel. Zero eBPF overhead; works with FalconD.': 'Planificador BORE integrado en el kernel con cero sobrecarga y afinidad dinámica con FalconD.',
        'Competitive Gaming & 1% Low FPS': 'Gaming Competitivo y 1% Low FPS',
        'Latency-critical Virtual Deadline scheduler by Valve & Igalia for maximum frame pacing stability.': 'Planificador Virtual Deadline de Valve e Igalia para máxima estabilidad de frametime en juegos.',
        'Interactive Desktop & Streaming': 'Escritorio Interactivo y Streaming',
        'Prioritizes interactive tasks (games, OBS streaming) even under 100% background CPU compilation.': 'Prioriza tareas interactivas (juegos, OBS) incluso con compilación en segundo plano al 100%.',
        'Lightweight All-Rounder': 'Todoterreno Ligero y Rápido',
        'Ultra-fast general-purpose scheduler optimized for CPU cache locality and low wakeup latency.': 'Planificador general ultrarrápido optimizado para localidad de caché de CPU y baja latencia.',
        'Pro Audio & Multimedia EDF': 'Audio Profesional y Multimedia EDF',
        'Earliest Deadline First (EDF) scheduler guaranteeing strict latency consistency for audio/video.': 'Planificador EDF que garantiza consistencia estricta de latencia para audio y vídeo profesional.',
        'Multi-Core / Multi-CCD Workstation': 'Workstation Multi-Núcleo / Multi-CCD',
        'Multi-domain load balancer engineered for high-core-count CPUs and heavy rendering workloads.': 'Balanceador multidominio diseñado para CPUs de muchos núcleos y cargas pesadas de renderizado.',
        'Workload Profile (scx_loader):': 'Perfil de Carga (scx_loader):',
        '⚡ Gaming': '⚡ Gaming',
        '🎯 Low Latency': '🎯 Baja Latencia',
        '⚙️ Auto': '⚙️ Automático',
        '🔋 Power Save': '🔋 Ahorro de Energía',
        'Persist selected scheduler across system reboots (/etc/scx_loader/config.toml)': 'Mantener este planificador al reiniciar el sistema (/etc/scx_loader/config.toml)',
        'Reset to BORE Default': 'Restablecer a BORE (Por Defecto)',
        'Apply Selected Scheduler': 'Aplicar Planificador',
        'Applying CPU scheduler...': 'Aplicando planificador de CPU...',
        'CPU scheduler switched to:': 'Planificador de CPU cambiado a:',
        'Returned to native BORE kernel scheduler.': 'Restablecido al planificador nativo BORE del kernel.'
    },
    'fr': {
        'CPU Scheduler (scx / BORE)': 'Ordonnanceur CPU (scx / BORE)',
        'Switch live between BORE, scx_lavd, scx_bpfland, scx_cosmos, scx_flash & scx_rusty.': 'Basculez en direct entre BORE, scx_lavd, scx_bpfland, scx_cosmos, scx_flash et scx_rusty.',
        'System Boot Error Log': 'Journal des Erreurs Système',
        'Inspect critical systemd and kernel errors from the current boot (journalctl -p 3 -xb).': 'Inspecter les erreurs critiques du noyau et de systemd (journalctl -p 3 -xb).',
        'Click to open X64 CPU Scheduler Selector (BORE / sched_ext).': 'Cliquez pour ouvrir le sélecteur d’ordonnanceur CPU X64 (BORE / sched_ext).',
        'X64 CPU Scheduler & Latency Selector': 'Sélecteur d’Ordonnanceur CPU & Latence X64',
        'Switch the Linux kernel CPU task scheduler in real time with zero reboot required.': 'Changez l’ordonnanceur CPU du noyau Linux en temps réel sans redémarrer.',
        'Active Kernel Scheduler:': 'Ordonnanceur Noyau Actif :',
        'BORE (Kernel Default)': 'BORE (Défaut du Noyau)',
        'Native Kernel + FalconD Auto': 'Noyau Natif + FalconD Auto',
        'Burst-Oriented Response Enhancer built into the kernel. Zero eBPF overhead; works with FalconD.': 'Ordonnanceur BORE intégré au noyau sans surcharge eBPF, synchronisé avec FalconD.',
        'Competitive Gaming & 1% Low FPS': 'Gaming Compétitif & 1% Low FPS',
        'Latency-critical Virtual Deadline scheduler by Valve & Igalia for maximum frame pacing stability.': 'Ordonnanceur Virtual Deadline par Valve & Igalia pour une stabilité maximale des FPS.',
        'Interactive Desktop & Streaming': 'Bureau Interactif & Streaming',
        'Prioritizes interactive tasks (games, OBS streaming) even under 100% background CPU compilation.': 'Priorise les tâches interactives (jeux, OBS) même sous charge CPU à 100%.',
        'Lightweight All-Rounder': 'Polyvalent Ultra-Léger',
        'Ultra-fast general-purpose scheduler optimized for CPU cache locality and low wakeup latency.': 'Ordonnanceur polyvalent optimisé pour le cache CPU et une faible latence de réveil.',
        'Pro Audio & Multimedia EDF': 'Audio Pro & Multimédia EDF',
        'Earliest Deadline First (EDF) scheduler guaranteeing strict latency consistency for audio/video.': 'Ordonnanceur EDF garantissant une latence stricte pour l’audio et la vidéo.',
        'Multi-Core / Multi-CCD Workstation': 'Workstation Multi-Cœurs / Multi-CCD',
        'Multi-domain load balancer engineered for high-core-count CPUs and heavy rendering workloads.': 'Équilibreur multi-domaines conçu pour les processeurs à grand nombre de cœurs.',
        'Workload Profile (scx_loader):': 'Profil de Charge (scx_loader) :',
        '⚡ Gaming': '⚡ Gaming',
        '🎯 Low Latency': '🎯 Faible Latence',
        '⚙️ Auto': '⚙️ Automatique',
        '🔋 Power Save': '🔋 Économie d’Énergie',
        'Persist selected scheduler across system reboots (/etc/scx_loader/config.toml)': 'Conserver cet ordonnanceur au redémarrage (/etc/scx_loader/config.toml)',
        'Reset to BORE Default': 'Réinitialiser sur BORE',
        'Apply Selected Scheduler': 'Appliquer l’Ordonnanceur',
        'Applying CPU scheduler...': 'Application de l’ordonnanceur CPU...',
        'CPU scheduler switched to:': 'Ordonnanceur CPU basculé sur :',
        'Returned to native BORE kernel scheduler.': 'Retour à l’ordonnanceur natif BORE du noyau.'
    },
    'de': {
        'CPU Scheduler (scx / BORE)': 'CPU-Scheduler (scx / BORE)',
        'Switch live between BORE, scx_lavd, scx_bpfland, scx_cosmos, scx_flash & scx_rusty.': 'Wechseln Sie live zwischen BORE, scx_lavd, scx_bpfland, scx_cosmos, scx_flash & scx_rusty.',
        'System Boot Error Log': 'System-Boot-Fehlerprotokoll',
        'Inspect critical systemd and kernel errors from the current boot (journalctl -p 3 -xb).': 'Kritische Kernel- und Systemd-Fehler des aktuellen Starts prüfen (journalctl -p 3 -xb).',
        'Click to open X64 CPU Scheduler Selector (BORE / sched_ext).': 'Klicken, um den X64 CPU-Scheduler-Wähler (BORE / sched_ext) zu öffnen.',
        'X64 CPU Scheduler & Latency Selector': 'X64 CPU-Scheduler & Latenz-Wähler',
        'Switch the Linux kernel CPU task scheduler in real time with zero reboot required.': 'Wechseln Sie den Linux-Kernel-CPU-Scheduler in Echtzeit ohne Neustart.',
        'Active Kernel Scheduler:': 'Aktiver Kernel-Scheduler:',
        'BORE (Kernel Default)': 'BORE (Kernel-Standard)',
        'Native Kernel + FalconD Auto': 'Nativer Kernel + FalconD Auto',
        'Burst-Oriented Response Enhancer built into the kernel. Zero eBPF overhead; works with FalconD.': 'Im Kernel integrierter BORE-Scheduler ohne eBPF-Overhead; arbeitet mit FalconD.',
        'Competitive Gaming & 1% Low FPS': 'Kompetitives Gaming & 1% Low FPS',
        'Latency-critical Virtual Deadline scheduler by Valve & Igalia for maximum frame pacing stability.': 'Virtual-Deadline-Scheduler von Valve & Igalia für maximale Frametime-Stabilität.',
        'Interactive Desktop & Streaming': 'Interaktiver Desktop & Streaming',
        'Prioritizes interactive tasks (games, OBS streaming) even under 100% background CPU compilation.': 'Priorisiert interaktive Aufgaben (Spiele, OBS) selbst bei 100% Hintergrundlast.',
        'Lightweight All-Rounder': 'Leichtgewichtiger Allrounder',
        'Ultra-fast general-purpose scheduler optimized for CPU cache locality and low wakeup latency.': 'Ultraschneller Allzweck-Scheduler für optimale CPU-Cache-Lokalität.',
        'Pro Audio & Multimedia EDF': 'Pro-Audio & Multimedia EDF',
        'Earliest Deadline First (EDF) scheduler guaranteeing strict latency consistency for audio/video.': 'EDF-Scheduler für strikte Latenzkonsistenz bei Audio- und Videoworkloads.',
        'Multi-Core / Multi-CCD Workstation': 'Multi-Core / Multi-CCD Workstation',
        'Multi-domain load balancer engineered for high-core-count CPUs and heavy rendering workloads.': 'Multi-Domain-Load-Balancer für Prozessoren mit vielen Kernen und Rendering.',
        'Workload Profile (scx_loader):': 'Workload-Profil (scx_loader):',
        '⚡ Gaming': '⚡ Gaming',
        '🎯 Low Latency': '🎯 Niedrige Latenz',
        '⚙️ Auto': '⚙️ Automatisch',
        '🔋 Power Save': '🔋 Energiesparen',
        'Persist selected scheduler across system reboots (/etc/scx_loader/config.toml)': 'Ausgewählten Scheduler beim Systemstart beibehalten (/etc/scx_loader/config.toml)',
        'Reset to BORE Default': 'Auf BORE zurücksetzen',
        'Apply Selected Scheduler': 'Scheduler anwenden',
        'Applying CPU scheduler...': 'CPU-Scheduler wird angewendet...',
        'CPU scheduler switched to:': 'CPU-Scheduler gewechselt zu:',
        'Returned to native BORE kernel scheduler.': 'Auf nativen BORE-Kernel-Scheduler zurückgesetzt.'
    },
    'it': {
        'CPU Scheduler (scx / BORE)': 'Scheduler CPU (scx / BORE)',
        'Switch live between BORE, scx_lavd, scx_bpfland, scx_cosmos, scx_flash & scx_rusty.': 'Passa dal vivo tra BORE, scx_lavd, scx_bpfland, scx_cosmos, scx_flash e scx_rusty.',
        'System Boot Error Log': 'Registro Errori di Avvio',
        'Inspect critical systemd and kernel errors from the current boot (journalctl -p 3 -xb).': 'Ispeziona gli errori critici di systemd e del kernel (journalctl -p 3 -xb).',
        'Click to open X64 CPU Scheduler Selector (BORE / sched_ext).': 'Clicca per aprire il Selettore Scheduler CPU X64 (BORE / sched_ext).',
        'X64 CPU Scheduler & Latency Selector': 'Selettore Scheduler CPU e Latenza X64',
        'Switch the Linux kernel CPU task scheduler in real time with zero reboot required.': 'Cambia lo scheduler CPU del kernel Linux in tempo reale senza riavviare.',
        'Active Kernel Scheduler:': 'Scheduler del Kernel Attivo:',
        'BORE (Kernel Default)': 'BORE (Predefinito del Kernel)',
        'Native Kernel + FalconD Auto': 'Kernel Nativo + FalconD Auto',
        'Burst-Oriented Response Enhancer built into the kernel. Zero eBPF overhead; works with FalconD.': 'Scheduler BORE integrato nel kernel con zero overhead e supporto FalconD.',
        'Competitive Gaming & 1% Low FPS': 'Gaming Competitivo & 1% Low FPS',
        'Latency-critical Virtual Deadline scheduler by Valve & Igalia for maximum frame pacing stability.': 'Scheduler Virtual Deadline di Valve e Igalia per la massima stabilità del frametime.',
        'Interactive Desktop & Streaming': 'Desktop Interattivo & Streaming',
        'Prioritizes interactive tasks (games, OBS streaming) even under 100% background CPU compilation.': 'Dà priorità ai task interattivi (giochi, OBS) anche con CPU al 100%.',
        'Lightweight All-Rounder': 'Tuttofare Leggero e Veloce',
        'Ultra-fast general-purpose scheduler optimized for CPU cache locality and low wakeup latency.': 'Scheduler generico ultraveloce ottimizzato per la località della cache CPU.',
        'Pro Audio & Multimedia EDF': 'Audio Pro & Multimedia EDF',
        'Earliest Deadline First (EDF) scheduler guaranteeing strict latency consistency for audio/video.': 'Scheduler EDF che garantisce latenza rigorosa per audio e video professionale.',
        'Multi-Core / Multi-CCD Workstation': 'Workstation Multi-Core / Multi-CCD',
        'Multi-domain load balancer engineered for high-core-count CPUs and heavy rendering workloads.': 'Bilanciatore multi-dominio per CPU con molti core e carichi di rendering pesanti.',
        'Workload Profile (scx_loader):': 'Profilo di Carico (scx_loader):',
        '⚡ Gaming': '⚡ Gaming',
        '🎯 Low Latency': '🎯 Bassa Latenza',
        '⚙️ Auto': '⚙️ Automatico',
        '🔋 Power Save': '🔋 Risparmio Energetico',
        'Persist selected scheduler across system reboots (/etc/scx_loader/config.toml)': 'Mantieni lo scheduler selezionato al riavvio (/etc/scx_loader/config.toml)',
        'Reset to BORE Default': 'Ripristina BORE Predefinito',
        'Apply Selected Scheduler': 'Applica Scheduler',
        'Applying CPU scheduler...': 'Applicazione dello scheduler CPU...',
        'CPU scheduler switched to:': 'Scheduler CPU cambiato in:',
        'Returned to native BORE kernel scheduler.': 'Ripristinato lo scheduler nativo BORE del kernel.'
    },
    'pt': {
        'CPU Scheduler (scx / BORE)': 'Escalonador de CPU (scx / BORE)',
        'Switch live between BORE, scx_lavd, scx_bpfland, scx_cosmos, scx_flash & scx_rusty.': 'Alterne ao vivo entre BORE, scx_lavd, scx_bpfland, scx_cosmos, scx_flash e scx_rusty.',
        'System Boot Error Log': 'Registo de Erros de Arranque',
        'Inspect critical systemd and kernel errors from the current boot (journalctl -p 3 -xb).': 'Inspecionar erros críticos do kernel e systemd na sessão atual (journalctl -p 3 -xb).',
        'Click to open X64 CPU Scheduler Selector (BORE / sched_ext).': 'Clique para abrir o Seletor de Escalonador de CPU X64 (BORE / sched_ext).',
        'X64 CPU Scheduler & Latency Selector': 'Seletor de Escalonador de CPU e Latência X64',
        'Switch the Linux kernel CPU task scheduler in real time with zero reboot required.': 'Altere o escalonador de CPU do kernel Linux em tempo real sem precisar reiniciar.',
        'Active Kernel Scheduler:': 'Escalonador Ativo do Kernel:',
        'BORE (Kernel Default)': 'BORE (Padrão do Kernel)',
        'Native Kernel + FalconD Auto': 'Kernel Nativo + FalconD Auto',
        'Burst-Oriented Response Enhancer built into the kernel. Zero eBPF overhead; works with FalconD.': 'Escalonador BORE integrado no kernel com zero sobrecarga e suporte FalconD.',
        'Competitive Gaming & 1% Low FPS': 'Gaming Competitivo & 1% Low FPS',
        'Latency-critical Virtual Deadline scheduler by Valve & Igalia for maximum frame pacing stability.': 'Escalonador Virtual Deadline da Valve e Igalia para máxima estabilidade de FPS.',
        'Interactive Desktop & Streaming': 'Desktop Interativo & Streaming',
        'Prioritizes interactive tasks (games, OBS streaming) even under 100% background CPU compilation.': 'Prioriza tarefas interativas (jogos, OBS) mesmo com compilação em 100%.',
        'Lightweight All-Rounder': 'Versátil Leve e Rápido',
        'Ultra-fast general-purpose scheduler optimized for CPU cache locality and low wakeup latency.': 'Escalonador de uso geral ultrarrápido otimizado para cache de CPU e baixa latência.',
        'Pro Audio & Multimedia EDF': 'Áudio Pro & Multimédia EDF',
        'Earliest Deadline First (EDF) scheduler guaranteeing strict latency consistency for audio/video.': 'Escalonador EDF garantindo consistência estrita de latência para áudio e vídeo.',
        'Multi-Core / Multi-CCD Workstation': 'Workstation Multi-Núcleo / Multi-CCD',
        'Multi-domain load balancer engineered for high-core-count CPUs and heavy rendering workloads.': 'Balanceador multi-domínio projetado para CPUs de muitos núcleos e renderização.',
        'Workload Profile (scx_loader):': 'Perfil de Carga (scx_loader):',
        '⚡ Gaming': '⚡ Gaming',
        '🎯 Low Latency': '🎯 Baixa Latência',
        '⚙️ Auto': '⚙️ Automático',
        '🔋 Power Save': '🔋 Economia de Energia',
        'Persist selected scheduler across system reboots (/etc/scx_loader/config.toml)': 'Manter escalonador selecionado ao reiniciar (/etc/scx_loader/config.toml)',
        'Reset to BORE Default': 'Restaurar Padrão BORE',
        'Apply Selected Scheduler': 'Aplicar Escalonador',
        'Applying CPU scheduler...': 'A aplicar escalonador de CPU...',
        'CPU scheduler switched to:': 'Escalonador de CPU alterado para:',
        'Returned to native BORE kernel scheduler.': 'Restaurado para o escalonador nativo BORE do kernel.'
    },
    'ru': {
        'CPU Scheduler (scx / BORE)': 'Планировщик CPU (scx / BORE)',
        'Switch live between BORE, scx_lavd, scx_bpfland, scx_cosmos, scx_flash & scx_rusty.': 'Мгновенное переключение между BORE, scx_lavd, scx_bpfland, scx_cosmos, scx_flash и scx_rusty.',
        'System Boot Error Log': 'Журнал ошибок загрузки',
        'Inspect critical systemd and kernel errors from the current boot (journalctl -p 3 -xb).': 'Просмотр критических ошибок ядра и systemd за текущий сеанс (journalctl -p 3 -xb).',
        'Click to open X64 CPU Scheduler Selector (BORE / sched_ext).': 'Нажмите, чтобы открыть селектор планировщика CPU X64 (BORE / sched_ext).',
        'X64 CPU Scheduler & Latency Selector': 'Селектор планировщика CPU и задержки X64',
        'Switch the Linux kernel CPU task scheduler in real time with zero reboot required.': 'Переключайте планировщик задач ядра Linux в реальном времени без перезагрузки.',
        'Active Kernel Scheduler:': 'Активный планировщик ядра:',
        'BORE (Kernel Default)': 'BORE (Ядро по умолчанию)',
        'Native Kernel + FalconD Auto': 'Нативное ядро + FalconD Auto',
        'Burst-Oriented Response Enhancer built into the kernel. Zero eBPF overhead; works with FalconD.': 'Встроенный в ядро планировщик BORE без накладных расходов eBPF с поддержкой FalconD.',
        'Competitive Gaming & 1% Low FPS': 'Киберспорт и стабильный 1% Low FPS',
        'Latency-critical Virtual Deadline scheduler by Valve & Igalia for maximum frame pacing stability.': 'Планировщик Virtual Deadline от Valve и Igalia для максимальной плавности кадров.',
        'Interactive Desktop & Streaming': 'Интерактивный рабочий стол и стриминг',
        'Prioritizes interactive tasks (games, OBS streaming) even under 100% background CPU compilation.': 'Приоритет интерактивным задачам (игры, OBS) даже при 100% фоновой нагрузке CPU.',
        'Lightweight All-Rounder': 'Лёгкий универсальный режим',
        'Ultra-fast general-purpose scheduler optimized for CPU cache locality and low wakeup latency.': 'Быстрый универсальный планировщик, оптимизированный для кэша процессора.',
        'Pro Audio & Multimedia EDF': 'Про-аудио и мультимедиа EDF',
        'Earliest Deadline First (EDF) scheduler guaranteeing strict latency consistency for audio/video.': 'Планировщик EDF со строгим контролем задержки для работы со звуком и видео.',
        'Multi-Core / Multi-CCD Workstation': 'Многоядерные рабочие станции',
        'Multi-domain load balancer engineered for high-core-count CPUs and heavy rendering workloads.': 'Многодоменная балансировка нагрузки для многоядерных процессоров и рендеринга.',
        'Workload Profile (scx_loader):': 'Профиль нагрузки (scx_loader):',
        '⚡ Gaming': '⚡ Гейминг',
        '🎯 Low Latency': '🎯 Низкая задержка',
        '⚙️ Auto': '⚙️ Авто',
        '🔋 Power Save': '🔋 Энергосбережение',
        'Persist selected scheduler across system reboots (/etc/scx_loader/config.toml)': 'Сохранить выбранный планировщик после перезагрузки (/etc/scx_loader/config.toml)',
        'Reset to BORE Default': 'Сбросить на BORE',
        'Apply Selected Scheduler': 'Применить планировщик',
        'Applying CPU scheduler...': 'Применение планировщика CPU...',
        'CPU scheduler switched to:': 'Планировщик CPU переключён на:',
        'Returned to native BORE kernel scheduler.': 'Возвращён нативный планировщик ядра BORE.'
    }
}

for _lc, _ldict in SCHED_TRANSLATIONS.items():
    if _lc in TRANSLATIONS:
        TRANSLATIONS[_lc].update(_ldict)

COMING_SOON_TRANSLATIONS = {
    'en': {'COMING SOON': 'COMING SOON'},
    'es': {'COMING SOON': 'PRÓXIMAMENTE'},
    'fr': {
        'COMING SOON': 'BIENTÔT DISPONIBLE',
        'Disabling CPU hardware vulnerability mitigations (Spectre, Meltdown, MDS, TAA, etc.) with the <b>mitigations=off</b> kernel parameter recovers <b>3% to 7% CPU performance</b> and reduces frame latency in competitive gaming.<br><br><b>Security Warning:</b> Disabling mitigations exposes the processor to speculative execution side-channel attacks from untrusted local code or unisolated web scripts.<br><br>Do you want to proceed and inject <b>mitigations=off</b> into the bootloader?<br><i>(A system restart will be required to apply this change).</i>': (
            "La désactivation des correctifs de sécurité matériels CPU (Spectre, Meltdown, MDS, TAA, etc.) via le paramètre noyau <b>mitigations=off</b> permet de récupérer <b>3 % à 7 % de performances CPU</b> et réduit la latence en jeu compétitif.<br><br><b>Avertissement de sécurité :</b> Désactiver ces protections expose le processeur aux attaques par canal auxiliaire provenant de code local non fiable.<br><br>Voulez-vous continuer et injecter <b>mitigations=off</b> dans le chargeur d'amorçage ?<br><i>(Un redémarrage du système sera nécessaire pour appliquer ce changement).</i>"
        ),
    },
    'de': {
        'COMING SOON': 'DEMNÄCHST VERFÜGBAR',
        'Complete arsenal: Steam, Lutris, Heroic, Faugus, LACT, Gamescope, Proton-SLR, UMU, Wine, MangoHud, ProtonUp-Qt & 32-bit libs.': 'Komplettes Arsenal: Steam, Lutris, Heroic, Faugus, LACT, Gamescope, Proton-SLR, UMU, Wine, MangoHud, ProtonUp-Qt & 32-Bit-Bibliotheken.',
        'Disabling CPU hardware vulnerability mitigations (Spectre, Meltdown, MDS, TAA, etc.) with the <b>mitigations=off</b> kernel parameter recovers <b>3% to 7% CPU performance</b> and reduces frame latency in competitive gaming.<br><br><b>Security Warning:</b> Disabling mitigations exposes the processor to speculative execution side-channel attacks from untrusted local code or unisolated web scripts.<br><br>Do you want to proceed and inject <b>mitigations=off</b> into the bootloader?<br><i>(A system restart will be required to apply this change).</i>': (
            "Das Deaktivieren der CPU-Hardware-Sicherheitsfilter (Spectre, Meltdown, MDS, TAA usw.) mit dem Kernel-Parameter <b>mitigations=off</b> gewinnt <b>3 % bis 7 % CPU-Leistung</b> zurück und reduziert die Frame-Latenz im kompetitiven Gaming.<br><br><b>Sicherheitswarnung:</b> Das Deaktivieren setzt den Prozessor Seitenkanalangriffen durch nicht vertrauenswürdigen lokalen Code aus.<br><br>Möchten Sie fortfahren und <b>mitigations=off</b> in den Bootloader eintragen?<br><i>(Ein Systemneustart ist erforderlich, um diese Änderung anzuwenden).</i>"
        ),
    },
    'it': {
        'COMING SOON': 'PROSSIMAMENTE',
        'Disabling CPU hardware vulnerability mitigations (Spectre, Meltdown, MDS, TAA, etc.) with the <b>mitigations=off</b> kernel parameter recovers <b>3% to 7% CPU performance</b> and reduces frame latency in competitive gaming.<br><br><b>Security Warning:</b> Disabling mitigations exposes the processor to speculative execution side-channel attacks from untrusted local code or unisolated web scripts.<br><br>Do you want to proceed and inject <b>mitigations=off</b> into the bootloader?<br><i>(A system restart will be required to apply this change).</i>': (
            "La disattivazione delle mitigazioni hardware della CPU (Spectre, Meltdown, MDS, TAA, ecc.) tramite il parametro kernel <b>mitigations=off</b> recupera dal <b>3% al 7% di prestazioni CPU</b> e riduce la latenza nei giochi competitivi.<br><br><b>Avviso di sicurezza:</b> Disattivare le mitigazioni espone il processore ad attacchi side-channel da codice locale non attendibile.<br><br>Vuoi procedere e inserire <b>mitigations=off</b> nel bootloader?<br><i>(Sarà necessario riavviare il sistema per applicare la modifica).</i>"
        ),
    },
    'pt': {'COMING SOON': 'EM BREVE'},
    'ru': {'COMING SOON': 'СКОРО'},
}
for _lc, _ldict in COMING_SOON_TRANSLATIONS.items():
    if _lc in TRANSLATIONS:
        TRANSLATIONS[_lc].update(_ldict)

LANG_CONF_PATH = os.path.expanduser("~/.config/x64-hello/lang.conf")

def _detect_initial_lang():
    if "X64_LANG" in os.environ:
        return os.environ["X64_LANG"]
    try:
        if os.path.exists(LANG_CONF_PATH):
            with open(LANG_CONF_PATH, "r") as f:
                saved = f.read().strip()
                if saved in ("en", "es", "fr", "de", "it", "pt", "ru"):
                    return saved
    except Exception:
        pass
    try:
        _locale_tup = locale.getlocale()
        if not _locale_tup or not _locale_tup[0]:
            _env_lang = os.environ.get("LANG", "es_ES")
            code = _env_lang.split('_')[0].split('.')[0]
        else:
            code = _locale_tup[0].split('_')[0]
        return code if code in ("en", "es", "fr", "de", "it", "pt", "ru") else "es"
    except Exception:
        return "es"


NEW_TAB_TRANSLATIONS = {'es': {'CPU & Performance': 'CPU y Rendimiento', 'Network & Security': 'Red y Seguridad', 'Maintenance & Rescue': 'Mantenimiento y Rescate', 'CPU, Scheduler & System Performance': 'CPU, Planificador y Rendimiento', 'Switch the Linux kernel CPU task scheduler in real time and control background performance daemons.': 'Conmuta en tiempo real el planificador de tareas del kernel Linux y controla los demonios de rendimiento.', 'REAL-TIME CPU SCHEDULER (BORE / SCHED_EXT)': 'PLANIFICADOR DE CPU EN TIEMPO REAL (BORE / SCHED_EXT)', 'PERFORMANCE, MEMORY & STORAGE DAEMONS': 'DEMONIOS DE RENDIMIENTO, MEMORIA Y ALMACENAMIENTO', 'Network, Low-Latency DNS & Security': 'Red, Latencia DNS y Seguridad', 'Benchmark DNS ping latency in real time, enable DNS-over-TLS encryption, and manage your firewall.': 'Mide el ping de los servidores DNS en tiempo real, activa el cifrado DNS-over-TLS y gestiona el cortafuegos.', 'DNS OPTIMIZER & REAL-TIME PING BENCHMARK': 'OPTIMIZADOR DNS Y BENCHMARK DE LATENCIA EN VIVO', 'FIREWALL, BLUETOOTH & KERNEL NETWORK STACK': 'CORTAFUEGOS, BLUETOOTH Y PILA DE RED DEL KERNEL', 'TCP BBR + Anti-Bufferbloat': 'TCP BBR + Anti-Bufferbloat', 'Google BBR congestion control, Fair Queueing (fq), and low-latency network buffers active in kernel.': 'Control de congestión Google BBR, cola justa (fq) y buffers de baja latencia activos en el kernel.', 'Wi-Fi Low-Jitter (PowerSave Off)': 'Wi-Fi Sin Jitter (PowerSave Off)', 'Wireless power-saving disabled (wifi.powersave = 2) to eliminate ping spikes in online gaming.': 'Ahorro energético Wi-Fi desactivado (wifi.powersave = 2) para erradicar picos de ping jugando online.', 'System Maintenance & Rescue': 'Mantenimiento y Rescate del Sistema', 'Keep system packages updated, rank fastest mirrors, clean disk cache, and run emergency repair tools.': 'Mantén tus paquetes al día, clasifica los espejos más veloces, limpia la caché y ejecuta herramientas de rescate.', 'PREVENTIVE MAINTENANCE & SYSTEM UPDATES': 'ACTUALIZACIONES Y MANTENIMIENTO PREVENTIVO', 'SYSTEM DOCTOR & EMERGENCY RESCUE': 'DOCTOR DEL SISTEMA Y RESCATE DE EMERGENCIA', 'Configure ➔': 'Configurar ➔', 'Persist at boot (/etc/scx_loader/config.toml)': 'Mantener fijo al reiniciar (/etc/scx_loader/config.toml)', 'Live Resource Monitor (btop)': 'Monitor de Recursos (btop)', 'Interactive terminal dashboard for CPU frequencies, temperatures, processes, and disk I/O.': 'Panel interactivo en vivo de frecuencias de CPU, temperaturas, procesos y uso de disco.', 'Workload Profile:': 'Perfil:', 'Active Scheduler:': 'Planificador Activo:'}, 'fr': {'CPU & Performance': 'CPU et Performance', 'Network & Security': 'Réseau et Sécurité', 'Maintenance & Rescue': 'Maintenance et Secours', 'CPU, Scheduler & System Performance': 'CPU, Ordonnanceur et Performance', 'Switch the Linux kernel CPU task scheduler in real time and control background performance daemons.': "Changez l'ordonnanceur CPU du noyau Linux en temps réel et gérez les démons de performance.", 'REAL-TIME CPU SCHEDULER (BORE / SCHED_EXT)': 'ORDONNANCEUR CPU EN TEMPS RÉEL (BORE / SCHED_EXT)', 'PERFORMANCE, MEMORY & STORAGE DAEMONS': 'DÉMONS DE PERFORMANCE, MÉMOIRE ET STOCKAGE', 'Network, Low-Latency DNS & Security': 'Réseau, DNS Basse Latence et Sécurité', 'Benchmark DNS ping latency in real time, enable DNS-over-TLS encryption, and manage your firewall.': 'Mesurez le ping DNS en temps réel, activez le chiffrement DNS-over-TLS et gérez votre pare-feu.', 'DNS OPTIMIZER & REAL-TIME PING BENCHMARK': 'OPTIMISEUR DNS ET BENCHMARK DE PING EN DIRECT', 'FIREWALL, BLUETOOTH & KERNEL NETWORK STACK': 'PARE-FEU, BLUETOOTH ET PILE RÉSEAU DU NOYAU', 'TCP BBR + Anti-Bufferbloat': 'TCP BBR + Anti-Bufferbloat', 'Google BBR congestion control, Fair Queueing (fq), and low-latency network buffers active in kernel.': 'Contrôle de congestion Google BBR, file équitable (fq) et tampons basse latence actifs dans le noyau.', 'Wi-Fi Low-Jitter (PowerSave Off)': 'Wi-Fi Sans Jitter (PowerSave Off)', 'Wireless power-saving disabled (wifi.powersave = 2) to eliminate ping spikes in online gaming.': "Économie d'énergie Wi-Fi désactivée (wifi.powersave = 2) pour éliminer les pics de ping en jeu.", 'System Maintenance & Rescue': 'Maintenance et Secours du Système', 'Keep system packages updated, rank fastest mirrors, clean disk cache, and run emergency repair tools.': 'Maintenez vos paquets à jour, classez les miroirs rapides, nettoyez le cache et réparez le système.', 'PREVENTIVE MAINTENANCE & SYSTEM UPDATES': 'MAINTENANCE PRÉVENTIVE ET MISES À JOUR', 'SYSTEM DOCTOR & EMERGENCY RESCUE': "DOCTEUR SYSTÈME ET SECOURS D'URGENCE", 'Configure ➔': 'Configurer ➔', 'Persist at boot (/etc/scx_loader/config.toml)': 'Maintenir au démarrage (/etc/scx_loader/config.toml)', 'Live Resource Monitor (btop)': 'Moniteur de Ressources (btop)', 'Interactive terminal dashboard for CPU frequencies, temperatures, processes, and disk I/O.': 'Tableau de bord interactif des fréquences CPU, températures, processus et disques.', 'Workload Profile:': 'Profil :', 'Active Scheduler:': 'Ordonnanceur Actif :'}, 'de': {'CPU & Performance': 'CPU & Leistung', 'Network & Security': 'Netzwerk & Sicherheit', 'Maintenance & Rescue': 'Wartung & Rettung', 'CPU, Scheduler & System Performance': 'CPU, Scheduler & Systemleistung', 'Switch the Linux kernel CPU task scheduler in real time and control background performance daemons.': 'Wechseln Sie den Linux-Kernel-CPU-Scheduler in Echtzeit und steuern Sie Leistungs-Daemons.', 'REAL-TIME CPU SCHEDULER (BORE / SCHED_EXT)': 'ECHTZEIT-CPU-SCHEDULER (BORE / SCHED_EXT)', 'PERFORMANCE, MEMORY & STORAGE DAEMONS': 'LEISTUNGS-, SPEICHER- & LAUFWERKS-DAEMONS', 'Network, Low-Latency DNS & Security': 'Netzwerk, Niedriglatenz-DNS & Sicherheit', 'Benchmark DNS ping latency in real time, enable DNS-over-TLS encryption, and manage your firewall.': 'Messen Sie die DNS-Ping-Latenz in Echtzeit, aktivieren Sie DNS-over-TLS und verwalten Sie Ihre Firewall.', 'DNS OPTIMIZER & REAL-TIME PING BENCHMARK': 'DNS-OPTIMIERER & ECHTZEIT-PING-BENCHMARK', 'FIREWALL, BLUETOOTH & KERNEL NETWORK STACK': 'FIREWALL, BLUETOOTH & KERNEL-NETZWERK-STACK', 'TCP BBR + Anti-Bufferbloat': 'TCP BBR + Anti-Bufferbloat', 'Google BBR congestion control, Fair Queueing (fq), and low-latency network buffers active in kernel.': 'Google BBR-Staukontrolle, Fair Queueing (fq) und Niedriglatenz-Puffer im Kernel aktiv.', 'Wi-Fi Low-Jitter (PowerSave Off)': 'Wi-Fi Ohne Jitter (PowerSave Aus)', 'Wireless power-saving disabled (wifi.powersave = 2) to eliminate ping spikes in online gaming.': 'WLAN-Energiesparmodus deaktiviert (wifi.powersave = 2) gegen Ping-Spitzen beim Online-Gaming.', 'System Maintenance & Rescue': 'Systemwartung & Rettung', 'Keep system packages updated, rank fastest mirrors, clean disk cache, and run emergency repair tools.': 'Halten Sie Pakete aktuell, wählen Sie schnellste Spiegelserver, leeren Sie den Cache und reparieren Sie das System.', 'PREVENTIVE MAINTENANCE & SYSTEM UPDATES': 'VORBEUGENDE WARTUNG & SYSTEM-UPDATES', 'SYSTEM DOCTOR & EMERGENCY RESCUE': 'SYSTEM-DOKTOR & NOTFALL-RETTUNG', 'Configure ➔': 'Anpassen ➔', 'Persist at boot (/etc/scx_loader/config.toml)': 'Beim Booten beibehalten (/etc/scx_loader/config.toml)', 'Live Resource Monitor (btop)': 'Ressourcenmonitor (btop)', 'Interactive terminal dashboard for CPU frequencies, temperatures, processes, and disk I/O.': 'Interaktives Dashboard für CPU-Frequenzen, Temperaturen, Prozesse und Festplatten-I/O.', 'Workload Profile:': 'Profil:', 'Active Scheduler:': 'Aktiver Scheduler:'}, 'it': {'CPU & Performance': 'CPU e Prestazioni', 'Network & Security': 'Rete e Sicurezza', 'Maintenance & Rescue': 'Manutenzione e Ripristino', 'CPU, Scheduler & System Performance': 'CPU, Scheduler e Prestazioni', 'Switch the Linux kernel CPU task scheduler in real time and control background performance daemons.': 'Cambia lo scheduler CPU del kernel Linux in tempo reale e controlla i demoni di prestazione.', 'REAL-TIME CPU SCHEDULER (BORE / SCHED_EXT)': 'SCHEDULER CPU IN TEMPO REALE (BORE / SCHED_EXT)', 'PERFORMANCE, MEMORY & STORAGE DAEMONS': 'DEMONI DI PRESTAZIONI, MEMORIA E ARCHIVIAZIONE', 'Network, Low-Latency DNS & Security': 'Rete, DNS a Bassa Latenza e Sicurezza', 'Benchmark DNS ping latency in real time, enable DNS-over-TLS encryption, and manage your firewall.': 'Misura il ping DNS in tempo reale, attiva la crittografia DNS-over-TLS e gestisci il firewall.', 'DNS OPTIMIZER & REAL-TIME PING BENCHMARK': 'OTTIMIZZATORE DNS E BENCHMARK PING IN TEMPO REALE', 'FIREWALL, BLUETOOTH & KERNEL NETWORK STACK': 'FIREWALL, BLUETOOTH E STACK DI RETE DEL KERNEL', 'TCP BBR + Anti-Bufferbloat': 'TCP BBR + Anti-Bufferbloat', 'Google BBR congestion control, Fair Queueing (fq), and low-latency network buffers active in kernel.': 'Controllo congestione Google BBR, Fair Queueing (fq) e buffer a bassa latenza attivi nel kernel.', 'Wi-Fi Low-Jitter (PowerSave Off)': 'Wi-Fi Anti-Jitter (PowerSave Off)', 'Wireless power-saving disabled (wifi.powersave = 2) to eliminate ping spikes in online gaming.': 'Risparmio energetico Wi-Fi disattivato (wifi.powersave = 2) per eliminare picchi di ping nei giochi.', 'System Maintenance & Rescue': 'Manutenzione e Ripristino del Sistema', 'Keep system packages updated, rank fastest mirrors, clean disk cache, and run emergency repair tools.': 'Mantieni i pacchetti aggiornati, classifica i mirror più veloci, pulisci la cache e ripara il sistema.', 'PREVENTIVE MAINTENANCE & SYSTEM UPDATES': 'MANUTENZIONE PREVENTIVA E AGGIORNAMENTI', 'SYSTEM DOCTOR & EMERGENCY RESCUE': 'DOTTORE DI SISTEMA E RIPRISTINO DI EMERGENZA', 'Configure ➔': 'Configura ➔', 'Persist at boot (/etc/scx_loader/config.toml)': 'Mantieni al riavvio (/etc/scx_loader/config.toml)', 'Live Resource Monitor (btop)': 'Monitor Risorse (btop)', 'Interactive terminal dashboard for CPU frequencies, temperatures, processes, and disk I/O.': 'Pannello interattivo per frequenze CPU, temperature, processi e utilizzo disco.', 'Workload Profile:': 'Profilo:', 'Active Scheduler:': 'Scheduler Attivo:'}, 'pt': {'CPU & Performance': 'CPU e Desempenho', 'Network & Security': 'Rede e Segurança', 'Maintenance & Rescue': 'Manutenção e Resgate', 'CPU, Scheduler & System Performance': 'CPU, Escalonador e Desempenho', 'Switch the Linux kernel CPU task scheduler in real time and control background performance daemons.': 'Altere o escalonador de CPU do kernel Linux em tempo real e controle os daemons de desempenho.', 'REAL-TIME CPU SCHEDULER (BORE / SCHED_EXT)': 'ESCALONADOR DE CPU EM TEMPO REAL (BORE / SCHED_EXT)', 'PERFORMANCE, MEMORY & STORAGE DAEMONS': 'DAEMONS DE DESEMPENHO, MEMÓRIA E ARMAZENAMENTO', 'Network, Low-Latency DNS & Security': 'Rede, DNS de Baixa Latência e Segurança', 'Benchmark DNS ping latency in real time, enable DNS-over-TLS encryption, and manage your firewall.': 'Meça o ping DNS em tempo real, ative a criptografia DNS-over-TLS e gerencie seu firewall.', 'DNS OPTIMIZER & REAL-TIME PING BENCHMARK': 'OTIMIZADOR DNS E BENCHMARK DE PING EM TEMPO REAL', 'FIREWALL, BLUETOOTH & KERNEL NETWORK STACK': 'FIREWALL, BLUETOOTH E PILHA DE REDE DO KERNEL', 'TCP BBR + Anti-Bufferbloat': 'TCP BBR + Anti-Bufferbloat', 'Google BBR congestion control, Fair Queueing (fq), and low-latency network buffers active in kernel.': 'Controle de congestionamento Google BBR, Fair Queueing (fq) e buffers de baixa latência ativos no kernel.', 'Wi-Fi Low-Jitter (PowerSave Off)': 'Wi-Fi Sem Jitter (PowerSave Off)', 'Wireless power-saving disabled (wifi.powersave = 2) to eliminate ping spikes in online gaming.': 'Economia de energia Wi-Fi desativada (wifi.powersave = 2) para eliminar picos de ping em jogos online.', 'System Maintenance & Rescue': 'Manutenção e Resgate do Sistema', 'Keep system packages updated, rank fastest mirrors, clean disk cache, and run emergency repair tools.': 'Mantenha os pacotes atualizados, classifique os espelhos mais rápidos, limpe o cache e repare o sistema.', 'PREVENTIVE MAINTENANCE & SYSTEM UPDATES': 'MANUTENÇÃO PREVENTIVA E ATUALIZAÇÕES', 'SYSTEM DOCTOR & EMERGENCY RESCUE': 'DOUTOR DO SISTEMA E RESGATE DE EMERGÊNCIA', 'Configure ➔': 'Configurar ➔', 'Persist at boot (/etc/scx_loader/config.toml)': 'Manter ao reiniciar (/etc/scx_loader/config.toml)', 'Live Resource Monitor (btop)': 'Monitor de Recursos (btop)', 'Interactive terminal dashboard for CPU frequencies, temperatures, processes, and disk I/O.': 'Painel interativo de frequências da CPU, temperaturas, processos e uso de disco.', 'Workload Profile:': 'Perfil:', 'Active Scheduler:': 'Escalonador Ativo:'}, 'ru': {'CPU & Performance': 'CPU и Производительность', 'Network & Security': 'Сеть и Безопасность', 'Maintenance & Rescue': 'Обслуживание и Спасение', 'CPU, Scheduler & System Performance': 'Процессор, Планировщик и Производительность', 'Switch the Linux kernel CPU task scheduler in real time and control background performance daemons.': 'Переключайте планировщик CPU ядра Linux в реальном времени и управляйте службами производительности.', 'REAL-TIME CPU SCHEDULER (BORE / SCHED_EXT)': 'ПЛАНИРОВЩИК ПРОЦЕССОРА В РЕАЛЬНОМ ВРЕМЕНИ (BORE / SCHED_EXT)', 'PERFORMANCE, MEMORY & STORAGE DAEMONS': 'СЛУЖБЫ ПРОИЗВОДИТЕЛЬНОСТИ, ПАМЯТИ И ДИСКОВ', 'Network, Low-Latency DNS & Security': 'Сеть, Низколатентный DNS и Безопасность', 'Benchmark DNS ping latency in real time, enable DNS-over-TLS encryption, and manage your firewall.': 'Измеряйте пинг DNS-серверов в реальном времени, включайте шифрование DNS-over-TLS и управляйте брандмауэром.', 'DNS OPTIMIZER & REAL-TIME PING BENCHMARK': 'ОПТИМИЗАТОР DNS И ТЕСТ ЗАДЕРЖКИ (ПИНГА) В РЕАЛЬНОМ ВРЕМЕНИ', 'FIREWALL, BLUETOOTH & KERNEL NETWORK STACK': 'БРАНДМАУЭР, BLUETOOTH И СЕТЕВОЙ СТЕК ЯДРА', 'TCP BBR + Anti-Bufferbloat': 'TCP BBR + Защита от Bufferbloat', 'Google BBR congestion control, Fair Queueing (fq), and low-latency network buffers active in kernel.': 'Управление перегрузкой Google BBR, Fair Queueing (fq) и низколатентные буферы активны в ядре.', 'Wi-Fi Low-Jitter (PowerSave Off)': 'Wi-Fi Без Скачков Пинга', 'Wireless power-saving disabled (wifi.powersave = 2) to eliminate ping spikes in online gaming.': 'Энергосбережение Wi-Fi отключено (wifi.powersave = 2) для устранения скачков пинга в играх.', 'System Maintenance & Rescue': 'Обслуживание и Восстановление Системы', 'Keep system packages updated, rank fastest mirrors, clean disk cache, and run emergency repair tools.': 'Обновляйте пакеты, выбирайте быстрые зеркала, очищайте кэш и запускайте инструменты восстановления.', 'PREVENTIVE MAINTENANCE & SYSTEM UPDATES': 'ПРОФИЛАКТИКА И ОБНОВЛЕНИЕ СИСТЕМЫ', 'SYSTEM DOCTOR & EMERGENCY RESCUE': 'ДОКТОР СИСТЕМЫ И АВАРИЙНОЕ ВОССТАНОВЛЕНИЕ', 'Configure ➔': 'Настроить ➔', 'Persist at boot (/etc/scx_loader/config.toml)': 'Сохранять при запуске (/etc/scx_loader/config.toml)', 'Live Resource Monitor (btop)': 'Монитор Ресурсов (btop)', 'Interactive terminal dashboard for CPU frequencies, temperatures, processes, and disk I/O.': 'Интерактивная панель частот процессора, температур, процессов и дискового ввода-вывода.', 'Workload Profile:': 'Профиль:', 'Active Scheduler:': 'Активный Планировщик:'}}
for _lc, _d in NEW_TAB_TRANSLATIONS.items():
    if _lc in TRANSLATIONS:
        TRANSLATIONS[_lc].update(_d)
POLISH_NEW_TRANSLATIONS = {'en': {'OBS Studio & Wayland Capture': 'OBS Studio & Wayland Capture', 'Live streaming & recording suite with Vulkan/OpenGL capture (obs-vkcapture) and NVENC/VAAPI acceleration.': 'Live streaming & recording suite with Vulkan/OpenGL capture (obs-vkcapture) and NVENC/VAAPI acceleration.', 'Waydroid (Android Gaming)': 'Waydroid (Android Gaming)', 'LXC container to run Android games and mobile applications with direct hardware GPU acceleration.': 'LXC container to run Android games and mobile applications with direct hardware GPU acceleration.', 'HARDWARE SECURITY & KERNEL MITIGATIONS': 'HARDWARE SECURITY & KERNEL MITIGATIONS', 'CPU Security Mitigations (Spectre/Meltdown)': 'CPU Security Mitigations (Spectre/Meltdown)', 'Hardware vulnerability defenses. Disabling them (mitigations=off) yields +3% to +7% CPU FPS at security cost.': 'Hardware vulnerability defenses. Disabling them (mitigations=off) yields +3% to +7% CPU FPS at security cost.', 'MITIGATIONS ACTIVE (SECURE)': 'MITIGATIONS ACTIVE (SECURE)', 'MITIGATIONS OFF (+FPS)': 'MITIGATIONS OFF (+FPS)', 'DISABLE (+FPS)': 'DISABLE (+FPS)', 'RESTORE SECURITY': 'RESTORE SECURITY', 'APPLYING...': 'APPLYING...', 'CPU Hardware Mitigations Security Warning': 'CPU Hardware Mitigations Security Warning', 'Disabling CPU hardware vulnerability mitigations (Spectre, Meltdown, MDS, TAA, etc.) with the <b>mitigations=off</b> kernel parameter recovers <b>3% to 7% CPU performance</b> and reduces frame latency in competitive gaming.<br><br><b>Security Warning:</b> Disabling mitigations exposes the processor to speculative execution side-channel attacks from untrusted local code or unisolated web scripts.<br><br>Do you want to proceed and inject <b>mitigations=off</b> into the bootloader?<br><i>(A system restart will be required to apply this change).</i>': 'Disabling CPU hardware vulnerability mitigations (Spectre, Meltdown, MDS, TAA, etc.) with the <b>mitigations=off</b> kernel parameter recovers <b>3% to 7% CPU performance</b> and reduces frame latency in competitive gaming.<br><br><b>Security Warning:</b> Disabling mitigations exposes the processor to speculative execution side-channel attacks from untrusted local code or unisolated web scripts.<br><br>Do you want to proceed and inject <b>mitigations=off</b> into the bootloader?<br><i>(A system restart will be required to apply this change).</i>', 'Cancel (Keep Secure)': 'Cancel (Keep Secure)', 'Disable Mitigations (+FPS)': 'Disable Mitigations (+FPS)', 'Bootloader updated. Please restart your PC to apply kernel changes.': 'Bootloader updated. Please restart your PC to apply kernel changes.', 'Operation cancelled.': 'Operation cancelled.'}, 'es': {'OBS Studio & Wayland Capture': 'OBS Studio y Captura Wayland', 'Live streaming & recording suite with Vulkan/OpenGL capture (obs-vkcapture) and NVENC/VAAPI acceleration.': 'Estación de streaming y grabación con captura Vulkan/OpenGL (obs-vkcapture) y aceleración NVENC/VAAPI.', 'Waydroid (Android Gaming)': 'Waydroid (Juegos Android)', 'LXC container to run Android games and mobile applications with direct hardware GPU acceleration.': 'Contenedor LXC para ejecutar juegos y aplicaciones Android con aceleración directa por GPU.', 'HARDWARE SECURITY & KERNEL MITIGATIONS': 'SEGURIDAD DE HARDWARE Y MITIGACIONES DEL KERNEL', 'CPU Security Mitigations (Spectre/Meltdown)': 'Mitigaciones de CPU (Spectre/Meltdown)', 'Hardware vulnerability defenses. Disabling them (mitigations=off) yields +3% to +7% CPU FPS at security cost.': 'Protecciones de hardware activas. Desactivarlas (mitigations=off) recupera +3% a +7% FPS a costa de seguridad.', 'MITIGATIONS ACTIVE (SECURE)': 'MITIGACIONES ACTIVAS (SEGURO)', 'MITIGATIONS OFF (+FPS)': 'MITIGACIONES OFF (+FPS)', 'DISABLE (+FPS)': 'DESACTIVAR (+FPS)', 'RESTORE SECURITY': 'RESTAURAR SEGURIDAD', 'APPLYING...': 'APLICANDO...', 'CPU Hardware Mitigations Security Warning': 'Advertencia de Seguridad: Mitigaciones de CPU', 'Disabling CPU hardware vulnerability mitigations (Spectre, Meltdown, MDS, TAA, etc.) with the <b>mitigations=off</b> kernel parameter recovers <b>3% to 7% CPU performance</b> and reduces frame latency in competitive gaming.<br><br><b>Security Warning:</b> Disabling mitigations exposes the processor to speculative execution side-channel attacks from untrusted local code or unisolated web scripts.<br><br>Do you want to proceed and inject <b>mitigations=off</b> into the bootloader?<br><i>(A system restart will be required to apply this change).</i>': 'Desactivar las mitigaciones de hardware del kernel (Spectre, Meltdown, MDS, TAA, etc.) mediante el parámetro <b>mitigations=off</b> recupera entre un <b>3% y un 7% de rendimiento de CPU</b> y menor latencia de fotogramas en juegos competitivos.<br><br><b>Advertencia de Seguridad:</b> Tu procesador quedará expuesto a posibles vulnerabilidades de canal lateral frente a código no verificado o navegadores web.<br><br>¿Deseas continuar e inyectar <b>mitigations=off</b> en el gestor de arranque?<br><i>(Se requerirá reiniciar el equipo para aplicar el cambio).</i>', 'Cancel (Keep Secure)': 'Cancelar (Seguro)', 'Disable Mitigations (+FPS)': 'Desactivar Mitigaciones (+FPS)', 'Bootloader updated. Please restart your PC to apply kernel changes.': 'Bootloader actualizado. Reinicia el equipo para aplicar los cambios del kernel.', 'Operation cancelled.': 'Operación cancelada.'}, 'fr': {'OBS Studio & Wayland Capture': 'OBS Studio et Capture Wayland', 'Live streaming & recording suite with Vulkan/OpenGL capture (obs-vkcapture) and NVENC/VAAPI acceleration.': 'Suite de streaming et capture Vulkan/OpenGL (obs-vkcapture) avec accélération NVENC/VAAPI.', 'Waydroid (Android Gaming)': 'Waydroid (Jeux Android)', 'LXC container to run Android games and mobile applications with direct hardware GPU acceleration.': 'Conteneur LXC pour lancer des jeux et applications Android avec accélération GPU directe.', 'HARDWARE SECURITY & KERNEL MITIGATIONS': 'SÉCURITÉ MATÉRIELLE ET MITIGATIONS DU NOYAU', 'CPU Security Mitigations (Spectre/Meltdown)': 'Mitigations CPU (Spectre/Meltdown)', 'Hardware vulnerability defenses. Disabling them (mitigations=off) yields +3% to +7% CPU FPS at security cost.': 'Défenses actives. Les désactiver (mitigations=off) offre +3% à +7% de FPS au détriment de la sécurité.', 'MITIGATIONS ACTIVE (SECURE)': 'MITIGATIONS ACTIVES (SÉCURISÉ)', 'MITIGATIONS OFF (+FPS)': 'MITIGATIONS DÉSACTIVÉES (+FPS)', 'DISABLE (+FPS)': 'DÉSACTIVER (+FPS)', 'RESTORE SECURITY': 'RÉTABLIR SÉCURITÉ', 'APPLYING...': 'APPLICATION...', 'CPU Hardware Mitigations Security Warning': 'Avertissement de Sécurité : Mitigations CPU', 'Disabling CPU hardware vulnerability mitigations (Spectre, Meltdown, MDS, TAA, etc.) with the <b>mitigations=off</b> kernel parameter recovers <b>3% to 7% CPU performance</b> and reduces frame latency in competitive gaming.<br><br><b>Security Warning:</b> Disabling mitigations exposes the processor to speculative execution side-channel attacks from untrusted local code or unisolated web scripts.<br><br>Do you want to proceed and inject <b>mitigations=off</b> into the bootloader?<br><i>(Un redémarrage est nécessaire pour appliquer ce changement).</i>': "Désactiver les mitigations matérielles (Spectre, Meltdown, MDS, etc.) avec <b>mitigations=off</b> permet de gagner <b>3% à 7% de performances CPU</b> en jeu compétitif.<br><br><b>Avertissement :</b> Votre système sera exposé aux attaques par canal auxiliaire.<br><br>Voulez-vous injecter <b>mitigations=off</b> dans le chargeur d'amorçage ?<br><i>(Un redémarrage est nécessaire pour appliquer ce changement).</i>", 'Cancel (Keep Secure)': 'Annuler (Sécurisé)', 'Disable Mitigations (+FPS)': 'Désactiver Mitigations (+FPS)', 'Bootloader updated. Please restart your PC to apply kernel changes.': 'Chargeur mis à jour. Veuillez redémarrer pour appliquer les modifications.', 'Operation cancelled.': 'Opération annulée.'}, 'de': {'OBS Studio & Wayland Capture': 'OBS Studio & Wayland-Aufnahme', 'Live streaming & recording suite with Vulkan/OpenGL capture (obs-vkcapture) and NVENC/VAAPI acceleration.': 'Streaming- und Aufnahmesuite mit Vulkan/OpenGL-Erfassung (obs-vkcapture) und NVENC/VAAPI.', 'Waydroid (Android Gaming)': 'Waydroid (Android-Gaming)', 'LXC container to run Android games and mobile applications with direct hardware GPU acceleration.': 'LXC-Container zur Ausführung von Android-Spielen mit direkter GPU-Hardwarebeschleunigung.', 'HARDWARE SECURITY & KERNEL MITIGATIONS': 'HARDWARE-SICHERHEIT & KERNEL-MITIGATIONEN', 'CPU Security Mitigations (Spectre/Meltdown)': 'CPU-Mitigationen (Spectre/Meltdown)', 'Hardware vulnerability defenses. Disabling them (mitigations=off) yields +3% to +7% CPU FPS at security cost.': 'Hardware-Schutz aktiv. Deaktivieren (mitigations=off) bringt +3% bis +7% FPS auf Kosten der Sicherheit.', 'MITIGATIONS ACTIVE (SECURE)': 'MITIGATIONEN AKTIV (SICHER)', 'MITIGATIONS OFF (+FPS)': 'MITIGATIONEN AUS (+FPS)', 'DISABLE (+FPS)': 'DEAKTIVIEREN (+FPS)', 'RESTORE SECURITY': 'SCHUTZ WIEDERHERSTELLEN', 'APPLYING...': 'ANWENDEN...', 'CPU Hardware Mitigations Security Warning': 'Sicherheitswarnung: CPU-Hardware-Mitigationen', 'Disabling CPU hardware vulnerability mitigations (Spectre, Meltdown, MDS, TAA, etc.) with the <b>mitigations=off</b> kernel parameter recovers <b>3% to 7% CPU performance</b> and reduces frame latency in competitive gaming.<br><br><b>Security Warning:</b> Disabling mitigations exposes the processor to speculative execution side-channel attacks from untrusted local code or unisolated web scripts.<br><br>Do you want to proceed and inject <b>mitigations=off</b> into the bootloader?<br><i>(Ein Neustart ist erforderlich).</i>': 'Das Deaktivieren der CPU-Mitigationen (Spectre, Meltdown usw.) mit <b>mitigations=off</b> bringt <b>3% bis 7% mehr CPU-Leistung</b> beim Gaming.<br><br><b>Sicherheitswarnung:</b> Setzt das System Seitenkanal-Angriffen aus.<br><br>Möchten Sie <b>mitigations=off</b> in den Bootloader einfügen?<br><i>(Ein Neustart ist erforderlich).</i>', 'Cancel (Keep Secure)': 'Abbrechen (Sicher)', 'Disable Mitigations (+FPS)': 'Mitigationen Deaktivieren (+FPS)', 'Bootloader updated. Please restart your PC to apply kernel changes.': 'Bootloader aktualisiert. Bitte starten Sie neu, um Änderungen zu übernehmen.', 'Operation cancelled.': 'Vorgang abgebrochen.'}, 'it': {'OBS Studio & Wayland Capture': 'OBS Studio e Cattura Wayland', 'Live streaming & recording suite with Vulkan/OpenGL capture (obs-vkcapture) and NVENC/VAAPI acceleration.': 'Suite di streaming e registrazione con cattura Vulkan/OpenGL (obs-vkcapture) e NVENC/VAAPI.', 'Waydroid (Android Gaming)': 'Waydroid (Giochi Android)', 'LXC container to run Android games and mobile applications with direct hardware GPU acceleration.': 'Container LXC per eseguire giochi e app Android con accelerazione hardware diretta della GPU.', 'HARDWARE SECURITY & KERNEL MITIGATIONS': 'SICUREZZA HARDWARE E MITIGAZIONI KERNEL', 'CPU Security Mitigations (Spectre/Meltdown)': 'Mitigazioni CPU (Spectre/Meltdown)', 'Hardware vulnerability defenses. Disabling them (mitigations=off) yields +3% to +7% CPU FPS at security cost.': 'Protezioni attive. Disattivandole (mitigations=off) si ottiene +3% - +7% FPS a scapito della sicurezza.', 'MITIGATIONS ACTIVE (SECURE)': 'MITIGAZIONI ATTIVE (SICURO)', 'MITIGATIONS OFF (+FPS)': 'MITIGAZIONI OFF (+FPS)', 'DISABLE (+FPS)': 'DISATTIVA (+FPS)', 'RESTORE SECURITY': 'RIPRISTINA SICUREZZA', 'APPLYING...': 'APPLICAZIONE...', 'CPU Hardware Mitigations Security Warning': 'Avviso di Sicurezza: Mitigazioni CPU', 'Disabling CPU hardware vulnerability mitigations (Spectre, Meltdown, MDS, TAA, etc.) with the <b>mitigations=off</b> kernel parameter recovers <b>3% to 7% CPU performance</b> and reduces frame latency in competitive gaming.<br><br><b>Security Warning:</b> Disabling mitigations exposes the processor to speculative execution side-channel attacks from untrusted local code or unisolated web scripts.<br><br>Do you want to proceed and inject <b>mitigations=off</b> into the bootloader?<br><i>(È necessario riavviare il sistema per applicare la modifica).</i>': 'Disattivare le mitigazioni hardware con <b>mitigations=off</b> recupera tra il <b>3% e il 7% di prestazioni CPU</b> nei giochi.<br><br><b>Avviso di Sicurezza:</b> Espone il processore ad attacchi di tipo side-channel.<br><br>Vuoi procedere inserendo <b>mitigations=off</b> nel bootloader?<br><i>(È necessario riavviare il sistema per applicare la modifica).</i>', 'Cancel (Keep Secure)': 'Annulla (Sicuro)', 'Disable Mitigations (+FPS)': 'Disattiva Mitigazioni (+FPS)', 'Bootloader updated. Please restart your PC to apply kernel changes.': 'Bootloader aggiornato. Riavvia il computer per applicare le modifiche.', 'Operation cancelled.': 'Operazione annullata.'}, 'pt': {'OBS Studio & Wayland Capture': 'OBS Studio e Captura Wayland', 'Live streaming & recording suite with Vulkan/OpenGL capture (obs-vkcapture) and NVENC/VAAPI acceleration.': 'Estação de streaming e gravação com captura Vulkan/OpenGL (obs-vkcapture) e aceleração NVENC/VAAPI.', 'Waydroid (Android Gaming)': 'Waydroid (Jogos Android)', 'LXC container to run Android games and mobile applications with direct hardware GPU acceleration.': 'Contêiner LXC para executar jogos e aplicativos Android com aceleração direta por GPU.', 'HARDWARE SECURITY & KERNEL MITIGATIONS': 'SEGURANÇA DE HARDWARE E MITIGAÇÕES DO KERNEL', 'CPU Security Mitigations (Spectre/Meltdown)': 'Mitigações de CPU (Spectre/Meltdown)', 'Hardware vulnerability defenses. Disabling them (mitigations=off) yields +3% to +7% CPU FPS at security cost.': 'Proteções ativas. Desativá-las (mitigations=off) recupera +3% a +7% FPS à custa da segurança.', 'MITIGATIONS ACTIVE (SECURE)': 'MITIGAÇÕES ATIVAS (SEGURO)', 'MITIGATIONS OFF (+FPS)': 'MITIGAÇÕES OFF (+FPS)', 'DISABLE (+FPS)': 'DESACTIVAR (+FPS)', 'RESTORE SECURITY': 'RESTAURAR SEGURANÇA', 'APPLYING...': 'APLICANDO...', 'CPU Hardware Mitigations Security Warning': 'Aviso de Segurança: Mitigações de CPU', 'Disabling CPU hardware vulnerability mitigations (Spectre, Meltdown, MDS, TAA, etc.) with the <b>mitigations=off</b> kernel parameter recovers <b>3% to 7% CPU performance</b> and reduces frame latency in competitive gaming.<br><br><b>Security Warning:</b> Disabling mitigations exposes the processor to speculative execution side-channel attacks from untrusted local code or unisolated web scripts.<br><br>Do you want to proceed and inject <b>mitigations=off</b> into the bootloader?<br><i>(A system restart will be required to apply this change).</i>': 'Desativar as mitigações do kernel com <b>mitigations=off</b> recupera entre <b>3% e 7% de desempenho da CPU</b> em jogos competitivos.<br><br><b>Aviso de Segurança:</b> O processador ficará exposto a ataques de canal lateral.<br><br>Deseja continuar e injetar <b>mitigations=off</b> no bootloader?<br><i>(Será necessário reiniciar o sistema para aplicar a alteração).</i>', 'Cancel (Keep Secure)': 'Cancelar (Seguro)', 'Disable Mitigations (+FPS)': 'Desativar Mitigações (+FPS)', 'Bootloader updated. Please restart your PC to apply kernel changes.': 'Bootloader atualizado. Reinicie o computador para aplicar as alterações.', 'Operation cancelled.': 'Operação cancelada.'}, 'ru': {'OBS Studio & Wayland Capture': 'OBS Studio и Захват Wayland', 'Live streaming & recording suite with Vulkan/OpenGL capture (obs-vkcapture) and NVENC/VAAPI acceleration.': 'Стриминг и запись с прямым Vulkan/OpenGL захватом (obs-vkcapture) и ускорением NVENC/VAAPI.', 'Waydroid (Android Gaming)': 'Waydroid (Android-Игры)', 'LXC container to run Android games and mobile applications with direct hardware GPU acceleration.': 'LXC-контейнер для запуска Android-игр и приложений с прямым аппаратным ускорением GPU.', 'HARDWARE SECURITY & KERNEL MITIGATIONS': 'БЕЗОПАСНОСТЬ И МИТИГАЦИИ ЯДРА', 'CPU Security Mitigations (Spectre/Meltdown)': 'Митигации CPU (Spectre/Meltdown)', 'Hardware vulnerability defenses. Disabling them (mitigations=off) yields +3% to +7% CPU FPS at security cost.': 'Защита процессора активна. Отключение (mitigations=off) дает +3%..+7% FPS за счет безопасности.', 'MITIGATIONS ACTIVE (SECURE)': 'ЗАЩИТА АКТИВНА (БЕЗОПАСНО)', 'MITIGATIONS OFF (+FPS)': 'ЗАЩИТА ВЫКЛ (+FPS)', 'DISABLE (+FPS)': 'ОТКЛЮЧИТЬ (+FPS)', 'RESTORE SECURITY': 'ВКЛЮЧИТЬ ЗАЩИТУ', 'APPLYING...': 'ПРИМЕНЕНИЕ...', 'CPU Hardware Mitigations Security Warning': 'Предупреждение Безопасности: Митигации CPU', 'Disabling CPU hardware vulnerability mitigations (Spectre, Meltdown, MDS, TAA, etc.) with the <b>mitigations=off</b> kernel parameter recovers <b>3% to 7% CPU performance</b> and reduces frame latency in competitive gaming.<br><br><b>Security Warning:</b> Disabling mitigations exposes the processor to speculative execution side-channel attacks from untrusted local code or unisolated web scripts.<br><br>Do you want to proceed and inject <b>mitigations=off</b> into the bootloader?<br><i>(A system restart will be required to apply this change).</i>': 'Отключение аппаратных митигаций ядра (Spectre, Meltdown и др.) параметром <b>mitigations=off</b> возвращает <b>3-7% производительности процессора</b> в играх.<br><br><b>Предупреждение:</b> Процессор становится уязвим для атак по сторонним каналам.<br><br>Продолжить и прописать <b>mitigations=off</b> в загрузчик?<br><i>(Для применения потребуется перезагрузка).</i>', 'Cancel (Keep Secure)': 'Отмена (Безопасно)', 'Disable Mitigations (+FPS)': 'Отключить Защиту (+FPS)', 'Bootloader updated. Please restart your PC to apply kernel changes.': 'Загрузчик обновлен. Перезагрузите компьютер для применения параметров ядра.', 'Operation cancelled.': 'Операция отменена.'}}
for _lc, _d in POLISH_NEW_TRANSLATIONS.items():
    if _lc in TRANSLATIONS:
        TRANSLATIONS[_lc].update(_d)

LACT_TRANSLATIONS = {
    'en': {
        'LACT (GPU Overclock & Fan Control)': 'LACT (GPU Overclock & Fan Control)',
        'Fan curves, undervolt, power limits (TDP), clock frequencies, and live thermals for AMD, NVIDIA & Intel GPUs.': 'Fan curves, undervolt, power limits (TDP), clock frequencies, and live thermals for AMD, NVIDIA & Intel GPUs.',
        'Complete arsenal: Steam, Lutris, Heroic, Faugus, LACT, Gamescope, Proton-SLR, UMU, Wine, MangoHud, ProtonUp-Qt & 32-bit libs.': 'Complete arsenal: Steam, Lutris, Heroic, Faugus, LACT, Gamescope, Proton-SLR, UMU, Wine, MangoHud, ProtonUp-Qt & 32-bit libs.',
        'OPEN ↗': 'OPEN ↗',
        'Installed. Click to open application.': 'Installed. Click to open application.',
        'Component is installed.': 'Component is installed.'
    },
    'es': {
        'LACT (GPU Overclock & Fan Control)': 'LACT (Control GPU y Ventiladores)',
        'Fan curves, undervolt, power limits (TDP), clock frequencies, and live thermals for AMD, NVIDIA & Intel GPUs.': 'Curvas de ventilador, undervolt, límites de energía (TDP), frecuencias y telemetría para GPU AMD, NVIDIA e Intel.',
        'Complete arsenal: Steam, Lutris, Heroic, Faugus, LACT, Gamescope, Proton-SLR, UMU, Wine, MangoHud, ProtonUp-Qt & 32-bit libs.': 'Arsenal completo: Steam, Lutris, Heroic, Faugus, LACT, Gamescope, Proton-SLR, UMU, Wine, MangoHud, ProtonUp-Qt y librerías 32-bits.',
        'OPEN ↗': 'ABRIR ↗',
        'Installed. Click to open application.': 'Instalado. Clic para abrir la aplicación.',
        'Component is installed.': 'El componente está instalado.'
    },
    'fr': {
        'LACT (GPU Overclock & Fan Control)': 'LACT (Contrôle GPU & Ventilateurs)',
        'Fan curves, undervolt, power limits (TDP), clock frequencies, and live thermals for AMD, NVIDIA & Intel GPUs.': 'Courbes de ventilateur, undervolt, limites TDP, fréquences et températures pour GPU AMD, NVIDIA et Intel.',
        'Complete arsenal: Steam, Lutris, Heroic, Faugus, LACT, Gamescope, Proton-SLR, UMU, Wine, MangoHud, ProtonUp-Qt & 32-bit libs.': 'Arsenal complet : Steam, Lutris, Heroic, Faugus, LACT, Gamescope, Proton-SLR, UMU, Wine, MangoHud, ProtonUp-Qt et libs 32 bits.',
        'OPEN ↗': 'OUVRIR ↗',
        'Installed. Click to open application.': "Installé. Cliquez pour ouvrir l'application.",
        'Component is installed.': 'Le composant est installé.'
    },
    'de': {
        'LACT (GPU Overclock & Fan Control)': 'LACT (GPU-Takt & Lüftersteuerung)',
        'Fan curves, undervolt, power limits (TDP), clock frequencies, and live thermals for AMD, NVIDIA & Intel GPUs.': 'Lüfterkurven, Undervolting, TDP-Grenzwerte, Taktraten und Live-Temperaturen für AMD-, NVIDIA- und Intel-GPUs.',
        'Complete arsenal: Steam, Lutris, Heroic, Faugus, LACT, Gamescope, Proton-SLR, UMU, Wine, MangoHud, ProtonUp-Qt & 32-Bit-Libs.': 'Komplettes Arsenal: Steam, Lutris, Heroic, Faugus, LACT, Gamescope, Proton-SLR, UMU, Wine, MangoHud, ProtonUp-Qt & 32-Bit-Libs.',
        'OPEN ↗': 'ÖFFNEN ↗',
        'Installed. Click to open application.': 'Installiert. Klicken zum Öffnen.',
        'Component is installed.': 'Komponente ist installiert.'
    },
    'it': {
        'LACT (GPU Overclock & Fan Control)': 'LACT (Controllo GPU e Ventole)',
        'Fan curves, undervolt, power limits (TDP), clock frequencies, and live thermals for AMD, NVIDIA & Intel GPUs.': 'Curve ventole, undervolt, limiti TDP, frequenze e temperature per GPU AMD, NVIDIA e Intel.',
        'Complete arsenal: Steam, Lutris, Heroic, Faugus, LACT, Gamescope, Proton-SLR, UMU, Wine, MangoHud, ProtonUp-Qt & 32-bit libs.': 'Arsenale completo: Steam, Lutris, Heroic, Faugus, LACT, Gamescope, Proton-SLR, UMU, Wine, MangoHud, ProtonUp-Qt e librerie a 32 bit.',
        'OPEN ↗': 'APRI ↗',
        'Installed. Click to open application.': "Installato. Clicca per aprire l'applicazione.",
        'Component is installed.': 'Il componente è installato.'
    },
    'pt': {
        'LACT (GPU Overclock & Fan Control)': 'LACT (Controle de GPU e Ventoinhas)',
        'Fan curves, undervolt, power limits (TDP), clock frequencies, and live thermals for AMD, NVIDIA & Intel GPUs.': 'Curvas de ventoinha, undervolt, limites TDP, frequências e temperaturas para GPUs AMD, NVIDIA e Intel.',
        'Complete arsenal: Steam, Lutris, Heroic, Faugus, LACT, Gamescope, Proton-SLR, UMU, Wine, MangoHud, ProtonUp-Qt & 32-bit libs.': 'Arsenal completo: Steam, Lutris, Heroic, Faugus, LACT, Gamescope, Proton-SLR, UMU, Wine, MangoHud, ProtonUp-Qt e bibliotecas de 32 bits.',
        'OPEN ↗': 'ABRIR ↗',
        'Installed. Click to open application.': 'Instalado. Clique para abrir o aplicativo.',
        'Component is installed.': 'O componente está instalado.'
    },
    'ru': {
        'LACT (GPU Overclock & Fan Control)': 'LACT (Разгон GPU и Вентиляторы)',
        'Fan curves, undervolt, power limits (TDP), clock frequencies, and live thermals for AMD, NVIDIA & Intel GPUs.': 'Кривые вентиляторов, андервольтинг, лимиты TDP, частоты и мониторинг для видеокарт AMD, NVIDIA и Intel.',
        'Complete arsenal: Steam, Lutris, Heroic, Faugus, LACT, Gamescope, Proton-SLR, UMU, Wine, MangoHud, ProtonUp-Qt & 32-bit libs.': 'Полный арсенал: Steam, Lutris, Heroic, Faugus, LACT, Gamescope, Proton-SLR, UMU, Wine, MangoHud, ProtonUp-Qt и 32-битные библиотеки.',
        'OPEN ↗': 'ОТКРЫТЬ ↗',
        'Installed. Click to open application.': 'Установлено. Нажмите для запуска.',
        'Component is installed.': 'Компонент установлен.'
    }
}
for _lc, _d in LACT_TRANSLATIONS.items():
    if _lc in TRANSLATIONS:
        TRANSLATIONS[_lc].update(_d)



# Compact card titles so 3-column grids never clip in any language
FIT_TRANSLATIONS = {
    'en': {
        'Reset Pacman Keyrings': 'Reset GPG Keyrings',
        'Unlock Pacman Database': 'Unlock Pacman (db.lck)',
        'Reinstall All Native Packages': 'Reinstall Native Packages',
        'KWin (Wayland) Debug Console': 'KWin Debug Console',
    },
    'es': {
        'Reset Pacman Keyrings': 'Restablecer Keyrings GPG',
        'Unlock Pacman Database': 'Desbloquear Pacman (db.lck)',
        'Reinstall All Native Packages': 'Reinstalar Paquetes Nativos',
        'KWin (Wayland) Debug Console': 'Consola de Depuración KWin',
    },
    'fr': {
        'Reset Pacman Keyrings': 'Réinitialiser Clés GPG',
        'Unlock Pacman Database': 'Déverrouiller Pacman (db.lck)',
        'Reinstall All Native Packages': 'Réinstaller Paquets Natifs',
        'KWin (Wayland) Debug Console': 'Console de Débogage KWin',
        'Ananicy-cpp Priority': 'Ananicy-cpp',
    },
    'de': {
        'Reset Pacman Keyrings': 'GPG-Schlüssel zurücksetzen',
        'Unlock Pacman Database': 'Pacman entsperren (db.lck)',
        'Reinstall All Native Packages': 'Native Pakete neu installieren',
        'KWin (Wayland) Debug Console': 'KWin-Debug-Konsole',
        'Ananicy-cpp Priority': 'Ananicy-cpp',
        'Systemd-OOMD Anti-Freeze': 'Systemd-OOMD',
        'LIOS Update Notifier': 'LIOS Update-Info',
    },
    'it': {
        'Reset Pacman Keyrings': 'Ripristina Chiavi GPG',
        'Unlock Pacman Database': 'Sblocca Pacman (db.lck)',
        'Reinstall All Native Packages': 'Reinstalla Pacchetti Nativi',
        'KWin (Wayland) Debug Console': 'Console Debug KWin',
        'Ananicy-cpp Priority': 'Ananicy-cpp',
        'Profile-sync-daemon (RAM Browser)': 'Browser in RAM',
        'LIOS Update Notifier': 'Avvisi LIOS Update',
    },
    'pt': {
        'Reset Pacman Keyrings': 'Redefinir Chaves GPG',
        'Unlock Pacman Database': 'Desbloquear Pacman (db.lck)',
        'Reinstall All Native Packages': 'Reinstalar Pacotes Nativos',
        'KWin (Wayland) Debug Console': 'Console de Depuração KWin',
        'Bpftune Kernel Auto-Tuning': 'Bpftune Auto-Tuning',
    },
    'ru': {
        'Reset Pacman Keyrings': 'Сброс ключей GPG',
        'Unlock Pacman Database': 'Разблокировать Pacman',
        'Reinstall All Native Packages': 'Переустановить пакеты',
        'KWin (Wayland) Debug Console': 'Консоль отладки KWin',
        'Profile-sync-daemon (RAM Browser)': 'Браузер в ОЗУ',
        'BORE (Kernel Default)': 'BORE (Стандарт)',
        'CPU & Performance': 'CPU и Скорость',
    },
}
for _lc, _d in FIT_TRANSLATIONS.items():
    if _lc in TRANSLATIONS:
        TRANSLATIONS[_lc].update(_d)
    elif _lc == 'en':
        TRANSLATIONS['en'] = dict(_d)

SUNSHINE_TRANSLATIONS = {
    'en': {
        'Sunshine & Moonlight (Game Streaming)': 'Sunshine & Moonlight (Game Streaming)',
        'Complete game streaming duo: Sunshine host server + Moonlight client to stream or play remotely at ultra-low latency.': 'Complete game streaming duo: Sunshine host server + Moonlight client to stream or play remotely at ultra-low latency.'
    },
    'es': {
        'Sunshine & Moonlight (Game Streaming)': 'Sunshine y Moonlight (Streaming)',
        'Complete game streaming duo: Sunshine host server + Moonlight client to stream or play remotely at ultra-low latency.': 'Dúo completo de streaming: servidor Sunshine + cliente Moonlight para emitir o jugar en remoto a baja latencia.'
    },
    'fr': {
        'Sunshine & Moonlight (Game Streaming)': 'Sunshine & Moonlight (Streaming)',
        'Complete game streaming duo: Sunshine host server + Moonlight client to stream or play remotely at ultra-low latency.': 'Duo complet de streaming : serveur Sunshine + client Moonlight pour diffuser ou jouer à distance à très faible latence.'
    },
    'de': {
        'Sunshine & Moonlight (Game Streaming)': 'Sunshine & Moonlight (Streaming)',
        'Complete game streaming duo: Sunshine host server + Moonlight client to stream or play remotely at ultra-low latency.': 'Komplettes Streaming-Duo: Sunshine-Server + Moonlight-Client zum Senden oder Empfangen von PC-Spielen mit minimaler Latenz.'
    },
    'it': {
        'Sunshine & Moonlight (Game Streaming)': 'Sunshine & Moonlight (Streaming)',
        'Complete game streaming duo: Sunshine host server + Moonlight client to stream or play remotely at ultra-low latency.': 'Duo completo di streaming: server Sunshine + client Moonlight per trasmettere o giocare in remoto a bassissima latenza.'
    },
    'pt': {
        'Sunshine & Moonlight (Game Streaming)': 'Sunshine e Moonlight (Streaming)',
        'Complete game streaming duo: Sunshine host server + Moonlight client to stream or play remotely at ultra-low latency.': 'Dupla completa de streaming: servidor Sunshine + cliente Moonlight para transmitir ou jogar remotamente com baixa latência.'
    },
    'ru': {
        'Sunshine & Moonlight (Game Streaming)': 'Sunshine и Moonlight (Стриминг)',
        'Complete game streaming duo: Sunshine host server + Moonlight client to stream or play remotely at ultra-low latency.': 'Полный комплект стриминга: сервер Sunshine + клиент Moonlight для трансляции и удаленной игры с ультранизкой задержкой.'
    }
}
for _lc, _d in SUNSHINE_TRANSLATIONS.items():
    if _lc in TRANSLATIONS:
        TRANSLATIONS[_lc].update(_d)

STATUS_BADGE_TRANSLATIONS = {
    'en': {'ACTIVE': 'ACTIVE', 'DISABLED': 'DISABLED'},
    'es': {'ACTIVE': 'ACTIVADO', 'DISABLED': 'DESACTIVADO'},
    'fr': {'ACTIVE': 'ACTIVÉ', 'DISABLED': 'DÉSACTIVÉ'},
    'de': {'ACTIVE': 'AKTIV', 'DISABLED': 'DEAKTIVIERT'},
    'it': {'ACTIVE': 'ATTIVO', 'DISABLED': 'DISATTIVATO'},
    'pt': {'ACTIVE': 'ATIVADO', 'DISABLED': 'DESATIVADO'},
    'ru': {'ACTIVE': 'АКТИВЕН', 'DISABLED': 'ОТКЛЮЧЕН'}
}
for _lc, _d in STATUS_BADGE_TRANSLATIONS.items():
    if _lc in TRANSLATIONS:
        TRANSLATIONS[_lc].update(_d)

_lang_code = _detect_initial_lang()

def tr(text):
    if _lang_code in TRANSLATIONS and text in TRANSLATIONS[_lang_code]:
        return TRANSLATIONS[_lang_code][text]
    return text


TOOLTIP_LABELS = {
    'es': ('¿Qué es?', '¿Para qué sirve?', '¿Cuándo activarlo / usarlo?'),
    'en': ('What is it?', 'What is it for?', 'When to enable / use it?'),
    'fr': ("Qu'est-ce que c'est ?", 'À quoi ça sert ?', "Quand l'activer / l'utiliser ?"),
    'de': ('Was ist das?', 'Wofür wird es genutzt?', 'Wann aktivieren / nutzen?'),
    'it': ("Cos'è?", 'A cosa serve?', 'Quando attivarlo / usarlo?'),
    'pt': ('O que é?', 'Para que serve?', 'Quando ativar / usar?'),
    'ru': ('Что это?', 'Для чего нужно?', 'Когда включать / использовать?'),
}

TOOLTIP_GUIDES = {
    'es': {
        'falcond.service': (
            'Demonio inteligente de detección automática de videojuegos (Steam, Proton, Wine y binarios nativos).',
            'Conmuta dinámicamente el perfil de energía de la CPU a máximo rendimiento, ajusta la afinidad de núcleos y frena tareas secundarias para eliminar micro-tirones (stuttering).',
            'Mantenlo ACTIVADO siempre si juegas en este equipo. Solo desactívalo en portátiles usando batería cuando busques ahorro energético extremo.'
        ),
        'ananicy-cpp.service': (
            'Gestor automático de prioridades de procesos (nice / ionice) escrito en C++ con reglas optimizadas para gaming y escritorio.',
            'Asigna prioridad de CPU y entrada/salida de disco a tu aplicación activa (juego, navegador o editor) y reduce el impacto de procesos en segundo plano.',
            'Mantenlo ACTIVADO permanentemente en cualquier PC de escritorio o laptop para una respuesta instantánea de la interfaz.'
        ),
        'bpftune.service': (
            'Optimizador autónomo desarrollado por Oracle basado en programas eBPF dentro del kernel Linux.',
            'Analiza el tráfico de red y uso de memoria en tiempo real para auto-ajustar buffers TCP y parámetros sysctl dinámicamente.',
            'Viene INACTIVO porque el kernel X64 ya incluye TCP BBR + FQ precalibrados. Actívalo si realizas transferencias masivas en redes 2.5G/10G o servidores locales.'
        ),
        'psd.service': (
            'Profile-Sync-Daemon: servicio que monta el perfil completo de tu navegador web (Chromium, Firefox, Brave, Zen) en memoria RAM (tmpfs).',
            'Acelera drásticamente la apertura de pestañas, caché e historial y reduce hasta un 90% las escrituras constantes que desgastan tu SSD/NVMe.',
            'Actívalo si tienes 16 GB de RAM o más. Déjalo INACTIVO en equipos con 8 GB de RAM o menos para reservar toda la memoria a tus juegos.'
        ),
        'systemd-oomd.service': (
            'Vigía de agotamiento de memoria (Out-Of-Memory Daemon) de systemd.',
            'Monitorea la presión de memoria y cierra forzosamente procesos pesados si la RAM física y el ZRAM llegan al 100% de saturación.',
            'Recomendado INACTIVO para Gaming: evita que cierre bruscamente tus juegos durante picos de compilación de shaders Vulkan (ZRAM ya amortigua la memoria). Actívalo solo en equipos con poca RAM (4-8 GB) si sufres congelamientos por exceso de pestañas.'
        ),
        'fstrim.timer': (
            'Temporizador semanal del sistema para el mantenimiento de bloques en unidades de estado sólido (NVMe y SSD SATA).',
            'Informa al controlador del SSD qué bloques ya no contienen datos válidos, evitando la degradación de velocidad de escritura y prolongando su vida útil.',
            'Mantenlo ACTIVADO siempre que tu sistema operativo resida en un disco SSD o NVMe.'
        ),
        'mitigations': (
            'Parches de seguridad del kernel Linux contra vulnerabilidades de ejecución especulativa del procesador (Spectre, Meltdown, MDS, TAA).',
            'Protegen tu CPU contra lecturas no autorizadas de memoria entre procesos. Desactivarlos (mitigations=off) elimina los controles de salto del kernel, ganando entre +3% y +7% de FPS y menor latencia.',
            'Mantenlo en SEGURO (ACTIVO) para uso general o trabajo. Desactívalo únicamente si buscas el máximo rendimiento competitivo en juegos y ejecutas software de confianza.'
        ),
        'scx_bore': (
            'Planificador nativo en C integrado directamente en el núcleo Linux-CachyOS (Burst-Oriented Response Enhancer).',
            'Prioriza los hilos interactivos frente a cargas pesadas sin coste adicional de CPU y trabaja en sinergia automática con FalconD.',
            'Ideal como opción predeterminada todo-terreno: máxima estabilidad, cero sobrecarga eBPF y excelente rendimiento general.'
        ),
        'scx_lavd': (
            'Planificador eBPF (Latency-critical Virtual Deadline) desarrollado por Valve e Igalia para gaming competitivo (perfil automático: Gaming --performance).',
            'Calcula plazos virtuales para los hilos de renderizado y audio del juego, maximizando la estabilidad de los FPS mínimos (1% Low FPS).',
            'Actívalo cuando juegues títulos competitivos (CS2, Valorant/Overwatch, Apex) o juegos AAA exigentes en CPU.'
        ),
        'scx_bpfland': (
            'Planificador eBPF interactivo precalibrado en perfil de Baja Latencia (rodaja mínima de 500 µs).',
            'Detecta qué ventanas e hilos interactúan con el usuario y les garantiza tiempo de CPU inmediato incluso si el procesador está al 100%.',
            'Úsalo si haces streaming con OBS, compilas código o renderizas vídeo al mismo tiempo que juegas o usas el escritorio.'
        ),
        'scx_cosmos': (
            'Planificador eBPF ultraligero de propósito general precalibrado en modo Automático con afinidad de caché L2/L3.',
            'Minimiza la migración innecesaria de hilos entre núcleos, reduciendo la latencia de despertar y el consumo energético.',
            'Recomendado para uso diario equilibrado, ofimática avanzada y portátiles donde buscas fluidez con buena eficiencia.'
        ),
        'scx_flash': (
            'Planificador eBPF basado en el algoritmo Earliest Deadline First (EDF) precalibrado en perfil de Baja Latencia Multimedia.',
            'Garantiza tiempos de respuesta deterministas y estrictos (sin cortes ni xruns) para buffers de audio y vídeo en tiempo real.',
            'Actívalo para producción musical (DAW / PipeWire baja latencia), edición de vídeo o transmisión sin cortes de audio.'
        ),
        'scx_rusty': (
            'Planificador eBPF multidominio escrito en Rust precalibrado para procesadores de múltiples complejos de caché (Multi-CCD).',
            'Balancea inteligentemente la carga entre chiplets (ej. AMD Ryzen 9 con 12/16 núcleos o Threadripper) evitando cuellos de botella entre cachés L3.',
            'Úsalo en estaciones de trabajo de alto conteo de núcleos para renderizado 3D, virtualización o compilación pesada.'
        ),
        'scx_persist': (
            'Opción de persistencia de arranque que guarda tu planificador elegido en /etc/scx_loader/config.toml.',
            'Permite decidir si quieres probar un planificador solo durante la sesión actual (sin marcar) o dejarlo fijo cada vez que enciendas el PC (marcado).',
            'Márcalo únicamente cuando hayas probado un planificador en tus juegos o trabajo y quieras que cargue siempre al iniciar.'
        ),
        'scx_apply': (
            'Conmutador en caliente del planificador de tareas del kernel Linux mediante scxctl.',
            'Aplica instantáneamente el planificador seleccionado junto con su perfil óptimo precalibrado sin necesidad de reiniciar el ordenador.',
            'Haz clic en cualquiera de las 6 tarjetas superiores y pulsa este botón para activar el cambio al instante.'
        ),
        'ufw.service': (
            'Cortafuegos de red perimetral (Uncomplicated Firewall) gestionado sobre tablas netfilter/iptables del kernel.',
            'Bloquea automáticamente cualquier intento de conexión entrante no autorizada hacia tu PC mientras permite todo tu tráfico saliente normal.',
            'Mantenlo ACTIVADO siempre, especialmente si conectas tu equipo a redes Wi-Fi públicas, routers compartidos o LAN.'
        ),
        'bluetooth.service': (
            'Pila oficial de protocolos inalámbricos BlueZ de Linux.',
            'Permite emparejar y utilizar mandos de consola (DualSense PS5, Xbox Wireless, Switch Pro), auriculares Bluetooth, teclados y ratones.',
            'Mantenlo ACTIVADO si usas mandos o audio inalámbrico. Puedes desactivarlo en PCs de escritorio sin antena Bluetooth.'
        ),
        'tcp_bbr': (
            'Algoritmo moderno de control de congestión de red desarrollado por Google junto con el planificador de paquetes Fair Queueing (FQ).',
            'Maximiza el ancho de banda real y evita el "Bufferbloat" (subidas bruscas de ping cuando alguien más descarga archivos en tu red).',
            'Viene preconfigurado y ACTIVO de fábrica en el kernel de X64 LIOS; no requiere intervención manual.'
        ),
        'wifi_lowjitter': (
            'Regla de baja latencia inalámbrica (wifi.powersave = 2) aplicada a NetworkManager.',
            'Impide que el chip Wi-Fi entre en micro-estados de suspensión entre paquetes, erradicando los picos de lag (jitter) en partidas online.',
            'Viene ACTIVO de fábrica en X64 LIOS para garantizar estabilidad de nivel cableado jugando por Wi-Fi.'
        ),
        'maint_update': (
            'Lanzador directo del Centro Oficial de Actualizaciones de X64 LIOS (x64-update).',
            'Sincroniza los repositorios oficiales [x64-lios], CachyOS, Arch, paquetes AUR y aplicaciones Flatpak en una interfaz gráfica segura.',
            'Ejecútalo 1 o 2 veces por semana para mantener tus drivers, kernel y parches de seguridad al día.'
        ),
        'maint_mirrors': (
            'Herramienta de benchmark de servidores de descarga (cachyos-rate-mirrors).',
            'Mide la velocidad y latencia real desde tu ubicación hacia todos los servidores mundiales y ordena los más rápidos primero.',
            'Úsalo si notas que las descargas o instalaciones de paquetes van más lentas de lo habitual.'
        ),
        'maint_cache': (
            'Rutina de limpieza del almacén local de paquetes descargados (/var/cache/pacman/pkg/).',
            'Elimina los instaladores comprimidos (.pkg.tar.zst) de versiones antiguas que Pacman guarda por respaldo, recuperando varios GB de disco.',
            'Úsalo cada par de meses o cuando quieras liberar espacio rápido en tu unidad SSD/NVMe.'
        ),
        'maint_orphans': (
            'Escáner y limpiador de dependencias huérfanas (pacman -Qtdq).',
            'Detecta y desinstala librerías auxiliares que fueron instaladas para algún programa que ya borraste y que hoy no usa nadie.',
            'Ejecútalo periódicamente tras desinstalar aplicaciones para mantener el sistema limpio.'
        ),
        'maint_winboat': (
            'Entorno contenedorizado ligero basado en Docker para ejecutar aplicaciones de productividad de Windows.',
            'Configura automáticamente Docker y Winboat para integrar programas de oficina o utilidades de Windows dentro de tu escritorio Linux.',
            'Instálalo solo si necesitas alguna herramienta específica de Windows que no tenga versión nativa ni alternativa en Linux.'
        ),
        'x64-update.timer': (
            'Demonio centinela y temporizador de bandeja del sistema (x64-update-tray).',
            'Verifica silenciosamente en segundo plano si existen nuevas actualizaciones disponibles y muestra el icono de estado junto al reloj.',
            'Mantenlo ACTIVADO si quieres enterarte al instante de nuevas actualizaciones; desactívalo si prefieres comprobarlas manualmente.'
        ),
        'rescue_keyrings': (
            'Reparador automático del llavero criptográfico GPG de Pacman (/etc/pacman.d/gnupg).',
            'Reinicializa y vuelve a firmar los certificados oficiales de Arch, CachyOS y X64 LIOS.',
            'Úsalo únicamente si al actualizar o instalar un paquete recibes errores de "firma inválida o corrupta (PGP signature)".'
        ),
        'rescue_unlock': (
            'Desbloqueador de emergencia de la base de datos de paquetes (/var/lib/pacman/db.lck).',
            'Elimina el archivo cerrojo que queda huérfano cuando una actualización previa se interrumpió por un apagón o cierre forzoso.',
            'Úsalo solo cuando Pacman o X64 Update te indiquen "no se pudo bloquear la base de datos (unable to lock database)".'
        ),
        'rescue_reinstall': (
            'Rutina de reconstrucción integral de todos los paquetes nativos instalados (pacman -Sy $(pacman -Qnq)).',
            'Descarga y sobreescribe todos los binarios y librerías del sistema sin borrar tus archivos personales ni configuraciones de usuario.',
            'Úsalo como herramienta de rescate mayor si borraste por accidente archivos del sistema en /usr o tras un corte eléctrico grave.'
        ),
        'rescue_journal': (
            'Inspector forense de registros críticos del arranque actual (journalctl -p 3 -xb).',
            'Filtra y muestra exclusivamente los errores de severidad alta del kernel, drivers y servicios de systemd ocurridos al encender el PC.',
            'Úsalo para diagnosticar fallos de hardware, errores de montaje de discos o servicios que no levantan.'
        ),
        'rescue_kwin': (
            'Consola oficial de diagnóstico interno del compositor KWin Wayland de KDE Plasma.',
            'Muestra en tiempo real qué ventanas corren en Wayland nativo o XWayland, estado de FreeSync/VRR (Adaptive Sync), monitores y buffers DRM.',
            'Úsala para verificar si el refresco variable (VRR) está activo en tu monitor gamer o depurar problemas gráficos.'
        ),
        'rescue_btop': (
            'Monitor interactivo de recursos del sistema en alta definición (btop++).',
            'Visualiza en tiempo real la carga y frecuencia de cada núcleo de CPU, temperatura, consumo de RAM/ZRAM, tráfico de red y procesos.',
            'Ábrelo en cualquier momento para vigilar el rendimiento o cerrar algún proceso que consuma demasiados recursos.'
        ),
        'dns_1.1.1.1': (
            'Resolvedor DNS global de ultra-baja latencia operado por Cloudflare (1.1.1.1 / 1.0.0.1).',
            'Resuelve dominios web y servidores de juego en pocos milisegundos con soporte completo de cifrado DNS-over-TLS (DoT) y cero registro de tu IP.',
            'Elígelo como primera opción para Gaming Competitivo y navegación general a máxima velocidad.'
        ),
        'dns_1.1.1.2': (
            'Variante de seguridad de Cloudflare 1.1.1.1 for Families con filtro activo contra malware y phishing.',
            'Bloquea automáticamente a nivel de red dominios conocidos por distribuir troyanos, ransomware, spyware y páginas de estafa antes de que carguen.',
            'Actívalo si buscas la misma velocidad de Cloudflare pero con una capa extra de protección preventiva al navegar.'
        ),
        'dns_94.140.14.14': (
            'Resolvedor DNS público de AdGuard con bloqueo integrado de publicidad y rastreadores.',
            'Filtra dominios de anuncios invasivos, telemetría corporativa y trackers analíticos directamente en la red para todo el sistema operativo.',
            'Úsalo si quieres bloquear publicidad en navegadores y aplicaciones sin instalar extensiones adicionales.'
        ),
        'dns_9.9.9.9': (
            'Servicio DNS sin ánimo de lucro con sede en Suiza (Quad9 Foundation) protegido por leyes suizas de privacidad.',
            'Combina inteligencia de amenazas de más de 20 proveedores de ciberseguridad para bloquear dominios maliciosos con privacidad estricta.',
            'Ideal para usuarios enfocados en privacidad extrema, banca online y seguridad corporativa.'
        ),
        'dns_8.8.8.8': (
            'Infraestructura DNS mundial de alta disponibilidad operada por Google (8.8.8.8 / 8.8.4.4).',
            'Ofrece enrutamiento Anycast masivo y compatibilidad universal con cualquier CDN o servidor de descarga internacional.',
            'Úsalo si algún servidor regional presenta problemas de resolución con otros proveedores o obtiene el menor ping en tu benchmark.'
        ),
        'dns_208.67.222.222': (
            'Uno de los servidores DNS más veteranos y estables de Internet, mantenido por Cisco Umbrella (OpenDNS).',
            'Proporciona resolución clásica de altísima fiabilidad y protección contra suplantación de identidad (phishing).',
            'Úsalo como alternativa sólida si tu proveedor de Internet (ISP) tiene mejor enrutamiento hacia nodos de Cisco.'
        ),
        'cachyos-gaming-meta cachyos-gaming-applications protonup-qt lact|lact-git': (
            'Meta-paquete maestro Todo-en-Uno que instala el ecosistema Gaming completo de X64 LIOS en un solo clic.',
            'Instala Steam, Lutris, Heroic, Faugus, Wine/Proton-SLR, UMU, MangoHud, Gamescope, LACT, ProtonUp-Qt y todas las librerías Vulkan/OpenGL de 32 y 64 bits.',
            'Usa este botón si quieres dejar tu PC 100% lista para jugar cualquier título de cualquier tienda sin instalar piezas por separado.'
        ),
        'cachyos-gaming-meta umu-launcher protontricks': (
            'Núcleo base de compatibilidad para juegos de Windows en Linux (Wine X64, Proton-SLR, UMU Launcher, Winetricks y librerías 32-bit).',
            'Proporciona los traductores DirectX a Vulkan (DXVK / VKD3D-Proton), códecs de audio/vídeo y librerías necesarias para que los juegos arranquen.',
            'Imprescindible como base si prefieres instalar solo un lanzador específico (como Lutris o Heroic) en lugar de la Suite Completa.'
        ),
        'steam': (
            'Plataforma oficial de videojuegos de Valve con integración nativa de Steam Play (Proton).',
            'Permite descargar y ejecutar miles de juegos de Windows y Linux con soporte de mandos, guardado en la nube y pre-caché de shaders Vulkan.',
            'Instálalo si tienes biblioteca de juegos en Steam.'
        ),
        'lutris': (
            'Gestor universal de videojuegos de código abierto para Linux.',
            'Unifica en una sola biblioteca juegos de EA App, Battle.net, Ubisoft Connect, GOG, emuladores e instaladores clásicos de Windows mediante scripts automáticos.',
            'Instálalo si juegas títulos fuera de Steam o clásicos de PC con instalador propio.'
        ),
        'heroic-games-launcher': (
            'Lanzador gráfico moderno y ligero alternativo a Epic Games Launcher, GOG Galaxy y Amazon Games.',
            'Permite iniciar sesión, descargar y jugar tu catálogo de Epic, GOG y Prime Gaming gestionando versiones de Wine/Proton y sincronización en la nube.',
            'Instálalo si tienes juegos gratuitos o comprados en Epic Games Store, GOG o Amazon.'
        ),
        'faugus-launcher': (
            'Lanzador minimalista ultrarrápido basado en UMU-Launcher (el motor oficial de Proton fuera de Steam).',
            'Ejecuta clientes como Battle.net (World of Warcraft, Diablo IV, Overwatch 2), EA App o ejecutables .exe sueltos usando el mismo contenedor Proton de Steam.',
            'Ideal si buscas la forma más rápida, limpia y ligera de abrir Battle.net o juegos portables sin configuraciones complejas.'
        ),
        'mangohud goverlay': (
            'Capa de telemetría en pantalla (MangoHud) junto con su panel de diseño gráfico (GOverlay).',
            'Muestra dentro de tus juegos los FPS, gráfica de frametime, temperaturas de CPU/GPU, consumo en vatios (W) y uso de VRAM en tiempo real.',
            'Instálalo para monitorizar el rendimiento de tu hardware mientras juegas (se activa/oculta con Shift_R + F12).'
        ),
        'lact|lact-git': (
            'Linux GPU Control Application: centro de control avanzado de tarjetas gráficas AMD, NVIDIA e Intel.',
            'Permite personalizar curvas de ventiladores, ajustar límites de potencia (TDP/Watts), hacer overclock o undervolt y vigilar temperaturas en vivo.',
            'Instálalo si quieres controlar el ruido de los ventiladores de tu GPU o ajustar sus frecuencias y voltajes.'
        ),
        'gamescope': (
            'Micro-compositor Wayland desarrollado por Valve para SteamOS y Steam Deck.',
            'Aísla la resolución del juego respecto a tu escritorio, permite reescalado espacial AMD FSR / NIS en cualquier juego y limita los FPS con precisión.',
            'Úsalo como parámetro de lanzamiento (ej. gamescope -W 1920 -H 1080 -f -- %command%) en juegos que dan problemas al minimizar con Alt+Tab.'
        ),
        'protonup-qt': (
            'Gestor gráfico para descargar y actualizar motores de compatibilidad personalizados (GE-Proton, Luxtorpeda, Wine-GE).',
            'Instala automáticamente las últimas versiones de GloriousEggroll (GE-Proton) directamente en Steam, Lutris y Heroic con un par de clics.',
            'Instálalo si algún juego reciente requiere parches de vídeo (cinemáticas MediaFoundation) aún no incluidos en el Proton oficial de Valve.'
        ),
        'obs-studio obs-vkcapture': (
            'Estudio profesional de grabación y transmisión en directo (OBS Studio) preconfigurado con captura directa Vulkan/OpenGL.',
            'Permite grabar partidas a 60/120 FPS o transmitir en Twitch/YouTube usando codificación por hardware (NVENC / VAAPI) sin pérdida de rendimiento.',
            'Instálalo si creas contenido, grabas clips de tus partidas o haces streaming.'
        ),
        'waydroid': (
            'Contenedor LXC de alto rendimiento que ejecuta un sistema Android completo sobre el mismo kernel Linux.',
            'Permite instalar y jugar títulos móviles de Android con aceleración gráfica directa por GPU y soporte de pantalla completa.',
            'Instálalo si quieres usar apps o juegos de Android directamente en tu PC sin la lentitud de un emulador tradicional.'
        ),
        'sunshine moonlight-qt': (
            'Suite completa de juego remoto de ultra-baja latencia: servidor emisor Sunshine + cliente receptor Moonlight (moonlight-qt).',
            'Sunshine transmite los juegos de tu PC hacia tu TV, móvil o portátil; Moonlight te permite conectarte desde este PC a otro equipo gamer.',
            'Instálalo para convertir tu red local en tu propio sistema de Cloud Gaming privado en ambas direcciones.'
        ),
    },
    'en': {
        'falcond.service': (
            'Intelligent daemon that automatically detects running video games (Steam, Proton, Wine, and native binaries).',
            'Dynamically switches CPU power profiles to maximum performance, tunes core affinity, and throttles background tasks to eliminate micro-stuttering.',
            'Keep it ACTIVE at all times if you game on this PC. Only disable it on laptops running on battery when seeking maximum battery life.'
        ),
        'ananicy-cpp.service': (
            'Automatic process priority manager (nice / ionice) written in C++ with curated rules for gaming and desktop responsiveness.',
            'Prioritizes CPU and disk I/O for your active foreground app (game, browser, editor) while restraining heavy background tasks.',
            'Keep it ACTIVE permanently on any desktop or laptop for a snappy, stutter-free user interface.'
        ),
        'bpftune.service': (
            'Autonomous kernel tuner developed by Oracle powered by eBPF programs inside the Linux kernel.',
            'Monitors live network traffic and memory pressure to dynamically auto-tune TCP buffers and sysctl kernel parameters.',
            'INACTIVE by default because the X64 kernel already ships pre-tuned with TCP BBR + FQ. Enable it for high-speed 2.5G/10G LAN transfers or local servers.'
        ),
        'psd.service': (
            'Profile-Sync-Daemon: mounts your web browser profile (Chromium, Firefox, Brave, Zen) directly into system RAM (tmpfs).',
            'Dramatically speeds up tab loading, history, and cache while reducing constant SSD/NVMe write wear by up to 90%, syncing safely on shutdown.',
            'Enable it if you have 16 GB+ of RAM. Leave it INACTIVE on systems with 8 GB RAM or less to save all memory for your games.'
        ),
        'systemd-oomd.service': (
            'Systemd Out-Of-Memory (OOM) watchdog daemon.',
            'Monitors memory pressure and forcibly terminates heavy processes before the entire system freezes under 100% RAM + ZRAM exhaustion.',
            'Recommended INACTIVE for Gaming: prevents false-positive kills of games during heavy Vulkan shader compilation spikes (ZRAM already cushions RAM). Enable only on low-RAM PCs (4-8 GB) if you experience hard freezes.'
        ),
        'fstrim.timer': (
            'Weekly scheduled system timer for block maintenance on solid-state drives (NVMe and SATA SSDs).',
            'Informs the SSD controller which blocks are no longer in use, preventing write-speed degradation over time and extending drive lifespan.',
            'Keep it ACTIVE whenever your operating system is installed on an SSD or NVMe drive.'
        ),
        'mitigations': (
            'Linux kernel security patches against speculative execution CPU hardware vulnerabilities (Spectre, Meltdown, MDS, TAA).',
            'Protects your CPU against side-channel memory leaks. Disabling them (mitigations=off) removes kernel boundary checks, gaining +3% to +7% CPU FPS and lower frame latency.',
            'Keep SECURE (ACTIVE) for general use. Disable only if you want maximum competitive gaming FPS and run trusted software.'
        ),
        'scx_bore': (
            'Native C scheduler built directly into the Linux-CachyOS kernel (Burst-Oriented Response Enhancer).',
            'Prioritizes interactive bursts over heavy background loads with zero eBPF overhead and works seamlessly with FalconD.',
            'Ideal all-round default choice: rock-solid stability, zero overhead, and great responsiveness.'
        ),
        'scx_lavd': (
            'Latency-critical Virtual Deadline eBPF scheduler by Valve & Igalia for competitive gaming (auto-profile: Gaming --performance).',
            'Computes virtual deadlines for game rendering and audio threads, maximizing 1% Low FPS stability and frame pacing.',
            'Enable it when playing competitive esports titles (CS2, Overwatch, Apex) or CPU-bound AAA games.'
        ),
        'scx_bpfland': (
            'Interactive eBPF scheduler pre-tuned with the Low Latency (500 µs slice) profile for smooth multitasking.',
            'Detects interactive user threads and guarantees immediate CPU time even when background compilation hits 100% CPU.',
            'Use it if you livestream with OBS, compile code, or render video while gaming or multitasking.'
        ),
        'scx_cosmos': (
            'Ultra-lightweight general-purpose eBPF scheduler pre-tuned in Auto mode with L2/L3 CPU cache locality.',
            'Minimizes unnecessary thread migrations across cores, reducing wakeup latency and power consumption.',
            'Recommended for balanced daily computing, productivity, and laptops seeking smooth efficiency.'
        ),
        'scx_flash': (
            'Earliest Deadline First (EDF) eBPF scheduler pre-tuned with the strict Multimedia Low-Latency profile.',
            'Guarantees strict, deterministic latency consistency for real-time audio and video processing buffers.',
            'Enable it for professional audio production (DAW / low-latency PipeWire), video editing, or glitch-free broadcasting.'
        ),
        'scx_rusty': (
            'Multi-domain eBPF load balancer written in Rust pre-tuned for multi-CCD / high-core-count processor architectures.',
            'Intelligently balances threads across CPU chiplets (e.g. 12/16-core AMD Ryzen 9 or Threadripper) to avoid L3 cache cross-talk bottlenecks.',
            'Use it on high-core-count workstations for 3D rendering, virtualization, or heavy parallel compilation.'
        ),
        'scx_persist': (
            'Boot persistence toggle that writes your selected scheduler into /etc/scx_loader/config.toml.',
            'Lets you choose between testing a scheduler for the current session only (unchecked) or keeping it active on every boot (checked).',
            'Check this box once you have tested a scheduler in your games or workflow and want it loaded permanently.'
        ),
        'scx_apply': (
            'Live hot-switcher for the Linux kernel CPU task scheduler powered by scxctl.',
            'Applies the selected scheduler and its optimal pre-calibrated profile immediately with zero reboot required.',
            'Click any of the 6 scheduler cards above and press this button to switch schedulers on the fly.'
        ),
        'ufw.service': (
            'Perimeter network firewall (Uncomplicated Firewall) powered by Linux kernel netfilter rules.',
            'Automatically blocks unauthorized incoming connection attempts to your PC while allowing all normal outgoing traffic.',
            'Keep it ACTIVE at all times, especially when connecting to public Wi-Fi, shared routers, or local networks.'
        ),
        'bluetooth.service': (
            'Official Linux BlueZ wireless protocol stack.',
            'Enables pairing and communication with wireless gamepads (PS5 DualSense, Xbox, Switch Pro), Bluetooth headsets, keyboards, and mice.',
            'Keep it ACTIVE if you use wireless controllers or audio. You can disable it on desktop PCs without Bluetooth hardware.'
        ),
        'tcp_bbr': (
            'Modern network congestion control algorithm developed by Google paired with Fair Queueing (FQ) packet scheduling.',
            'Maximizes throughput and prevents "Bufferbloat" (massive ping spikes when other devices download files on your network).',
            'Pre-configured and ACTIVE out of the box in the X64 LIOS kernel; no manual action required.'
        ),
        'wifi_lowjitter': (
            'Wireless low-latency rule (wifi.powersave = 2) applied to NetworkManager.',
            'Prevents the Wi-Fi radio from entering micro-sleep states between packets, eliminating lag spikes (jitter) in online multiplayer games.',
            'ACTIVE out of the box in X64 LIOS to ensure wired-grade ping stability over Wi-Fi.'
        ),
        'maint_update': (
            'Direct launcher for the official X64 LIOS Update Center (x64-update).',
            'Synchronizes [x64-lios], CachyOS, Arch repositories, AUR packages, and Flatpak apps in a safe native graphical interface.',
            'Run it once or twice a week to keep your GPU drivers, kernel, and security patches up to date.'
        ),
        'maint_mirrors': (
            'Download server speed and latency benchmark tool (cachyos-rate-mirrors).',
            'Tests connection latency from your location to global mirror servers and sorts the fastest ones to the top of your list.',
            'Run it if package downloads or system updates feel slower than usual.'
        ),
        'maint_cache': (
            'Cleanup utility for the local downloaded package store (/var/cache/pacman/pkg/).',
            'Removes old compressed package archives (.pkg.tar.zst) kept by Pacman, freeing up several gigabytes of disk space.',
            'Use it every couple of months or whenever you want to reclaim space on your SSD/NVMe.'
        ),
        'maint_orphans': (
            'Orphaned dependency scanner and cleaner (pacman -Qtdq).',
            'Finds and removes leftover helper libraries that were installed for applications you have since uninstalled.',
            'Run it periodically after removing software to keep your installation lean.'
        ),
        'maint_winboat': (
            'Lightweight Docker-based containerized environment for running Windows productivity applications.',
            'Automatically sets up Docker and Winboat to integrate Windows office or utility programs seamlessly into your Linux desktop.',
            'Install it only if you need a specific Windows desktop application that has no native Linux version.'
        ),
        'x64-update.timer': (
            'Background sentinel timer and system tray notifier applet (x64-update-tray).',
            'Silently checks for available system updates in the background and displays a status icon next to your panel clock.',
            'Keep it ACTIVE for automatic update alerts, or disable it if you prefer checking for updates manually.'
        ),
        'rescue_keyrings': (
            'Automated repair tool for the Pacman GPG cryptographic keyring (/etc/pacman.d/gnupg).',
            'Reinitializes and refreshes official digital signatures for Arch, CachyOS, and X64 LIOS repositories.',
            'Use it only if package installation fails with "invalid or corrupted package (PGP signature)" errors.'
        ),
        'rescue_unlock': (
            'Emergency unlocker for the Pacman package database (/var/lib/pacman/db.lck).',
            'Deletes the stale lock file left behind when a previous package transaction was interrupted by a power loss or forced close.',
            'Use it only when Pacman or X64 Update reports "unable to lock database".'
        ),
        'rescue_reinstall': (
            'Full reinstallation routine for all native system packages (pacman -Sy $(pacman -Qnq)).',
            'Re-downloads and overwrites all system binaries and libraries in /usr without touching your personal files or user configs.',
            'Use as a major rescue tool if system files were accidentally deleted or corrupted after a sudden power outage.'
        ),
        'rescue_journal': (
            'Forensic inspector for critical boot errors (journalctl -p 3 -xb).',
            'Filters and displays only high-severity kernel, driver, and systemd service errors from the current boot session.',
            'Use it to diagnose hardware initialization issues, disk mount errors, or failing services.'
        ),
        'rescue_kwin': (
            'Official built-in diagnostic inspector for the KDE Plasma KWin Wayland compositor.',
            'Shows live details on native Wayland vs XWayland windows, FreeSync/VRR (Adaptive Sync) state, displays, and DRM buffers.',
            'Use it to verify if Variable Refresh Rate (VRR) is active on your gaming monitor or debug window rendering.'
        ),
        'rescue_btop': (
            'High-definition interactive terminal resource monitor (btop++).',
            'Displays real-time per-core CPU load and clock speeds, temperatures, RAM/ZRAM usage, disk I/O, network traffic, and processes.',
            'Open it anytime to monitor system thermals or terminate a runaway process.'
        ),
        'dns_1.1.1.1': (
            'Ultra-low-latency global DNS resolver operated by Cloudflare (1.1.1.1 / 1.0.0.1).',
            'Resolves web domains and game servers in milliseconds with full DNS-over-TLS (DoT) encryption and a strict zero-IP-logging policy.',
            'Choose it as your primary option for Competitive Gaming and fastest everyday browsing.'
        ),
        'dns_1.1.1.2': (
            'Security-hardened variant of Cloudflare 1.1.1.1 with built-in anti-malware and anti-phishing filtering.',
            'Automatically blocks known trojan, ransomware, spyware, and phishing domains at the DNS layer before they can load.',
            'Enable it if you want Cloudflare speed combined with proactive network-level malware protection.'
        ),
        'dns_94.140.14.14': (
            'Public DNS resolver by AdGuard with integrated ad and tracker blocking.',
            'Filters intrusive advertisements, corporate telemetry, and analytics trackers system-wide across all browsers and apps.',
            'Use it if you want network-level ad blocking without installing extra browser extensions.'
        ),
        'dns_9.9.9.9': (
            'Swiss non-profit DNS service (Quad9 Foundation) protected by strict Swiss privacy laws.',
            'Combines threat intelligence from 20+ cybersecurity providers to block malicious domains while never logging personal data.',
            'Ideal for privacy-focused users, online banking, and high-security environments.'
        ),
        'dns_8.8.8.8': (
            'High-availability global DNS infrastructure operated by Google (8.8.8.8 / 8.8.4.4).',
            'Delivers massive Anycast routing reliability and universal compatibility with international CDNs and game download servers.',
            'Use it if a regional service has resolution issues elsewhere or if it achieves the lowest latency in your benchmark.'
        ),
        'dns_208.67.222.222': (
            'One of the longest-running and most stable DNS resolvers on the Internet, maintained by Cisco Umbrella (OpenDNS).',
            'Provides rock-solid enterprise domain resolution and built-in phishing protection.',
            'Use it as a dependable alternative if your ISP routes preferentially to Cisco peering nodes.'
        ),
        'cachyos-gaming-meta cachyos-gaming-applications protonup-qt lact|lact-git': (
            'Master All-in-One meta-package that installs the complete X64 LIOS Gaming ecosystem in a single click.',
            'Installs Steam, Lutris, Heroic, Faugus, Wine/Proton-SLR, UMU, MangoHud, Gamescope, LACT, ProtonUp-Qt, and all 32/64-bit Vulkan/OpenGL libraries.',
            'Use this button to make your PC 100% ready for any game across all storefronts without installing tools individually.'
        ),
        'cachyos-gaming-meta umu-launcher protontricks': (
            'Core compatibility foundation for running Windows games on Linux (Wine X64, Proton-SLR, UMU Launcher, Winetricks & 32-bit libs).',
            'Provides DirectX-to-Vulkan translators (DXVK / VKD3D-Proton), media codecs, and runtime libraries required by modern games.',
            'Essential base package if you prefer installing only one specific launcher instead of the Full Gaming Suite.'
        ),
        'steam': (
            'Official Valve gaming platform with native Steam Play (Proton) integration.',
            'Downloads and runs thousands of Windows and Linux titles with controller support, cloud saves, and Vulkan shader pre-caching.',
            'Install it if you own games on Steam.'
        ),
        'lutris': (
            'Unified open-source gaming library manager for Linux.',
            'Brings together games from EA App, Battle.net, Ubisoft Connect, GOG, emulators, and standalone Windows installers via automated scripts.',
            'Install it if you play non-Steam PC games or classic standalone installers.'
        ),
        'heroic-games-launcher': (
            'Modern, lightweight native graphical launcher for Epic Games Store, GOG Galaxy, and Amazon Prime Gaming.',
            'Lets you log in, download, and launch your Epic, GOG, and Amazon libraries with per-game Wine/Proton management and cloud saves.',
            'Install it if you claim free games or own titles on Epic Games, GOG, or Amazon.'
        ),
        'faugus-launcher': (
            'Ultra-fast minimalist launcher powered by UMU-Launcher (the official Proton runtime outside Steam).',
            'Runs Battle.net (World of Warcraft, Diablo IV, Overwatch 2), EA App, or standalone .exe games inside Steam’s Proton container.',
            'Ideal when you want the cleanest, fastest way to run Battle.net or portable Windows games with zero bloat.'
        ),
        'mangohud goverlay': (
            'In-game performance telemetry overlay (MangoHud) paired with its graphical configurator (GOverlay).',
            'Displays live FPS, frametime graphs, CPU/GPU temperatures, wattage draw (W), and VRAM usage directly inside your games.',
            'Install it to monitor hardware performance while gaming (toggle overlay in-game with Right Shift + F12).'
        ),
        'lact|lact-git': (
            'Linux GPU Control Application: advanced control center for AMD, NVIDIA, and Intel graphics cards.',
            'Lets you customize fan curves, adjust power limits (TDP/Watts), apply overclocking or undervolting, and monitor live thermals.',
            'Install it if you want to tune GPU fan acoustics, thermals, or clock speeds.'
        ),
        'gamescope': (
            'Wayland micro-compositor engineered by Valve for SteamOS and Steam Deck.',
            'Isolates game resolution from your desktop, enables spatial upscaling (AMD FSR / NIS) in any game, and enforces frame rate caps.',
            'Use it as a launch option (e.g. gamescope -W 1920 -H 1080 -f -- %command%) for games that dislike Alt+Tab or need upscaling.'
        ),
        'protonup-qt': (
            'Graphical manager to download and update custom compatibility engines (GE-Proton, Luxtorpeda, Wine-GE).',
            'Automatically installs the latest GloriousEggroll (GE-Proton) builds directly into Steam, Lutris, and Heroic in two clicks.',
            'Install it if a game needs community video codec patches (MediaFoundation cutscenes) or bleeding-edge Proton fixes.'
        ),
        'obs-studio obs-vkcapture': (
            'Professional livestreaming and screen recording suite (OBS Studio) bundled with native Vulkan/OpenGL game capture.',
            'Records gameplay at 60/120 FPS or streams to Twitch/YouTube using hardware encoding (NVENC / VAAPI) with minimal FPS impact.',
            'Install it if you record gameplay clips, create videos, or livestream.'
        ),
        'waydroid': (
            'High-performance LXC container that runs a full Android system directly on the host Linux kernel.',
            'Lets you install and play mobile Android games and apps with direct hardware GPU acceleration and multi-touch/mouse support.',
            'Install it if you want to run Android games or mobile apps natively on your PC without heavy emulation.'
        ),
        'sunshine moonlight-qt': (
            'Complete ultra-low-latency game streaming suite: Sunshine host server + Moonlight desktop client (moonlight-qt).',
            'Sunshine streams your PC games to your TV, phone, or handheld, while Moonlight lets this PC connect to another gaming rig.',
            'Install it to turn your local network into a two-way private cloud gaming ecosystem.'
        ),
    },
    'fr': {
        'falcond.service': (
            'Démon intelligent qui détecte automatiquement le lancement de vos jeux vidéo (Steam, Proton, Wine et natifs).',
            'Bascule le profil CPU sur performance maximale, ajuste l’affinité des cœurs et réduit les tâches de fond pour éliminer les micro-saccades.',
            'Gardez-le ACTIVÉ en permanence si vous jouez. Désactivez-le uniquement sur PC portable sur batterie pour économiser de l’énergie.'
        ),
        'ananicy-cpp.service': (
            'Gestionnaire automatique de priorités de processus (nice / ionice) en C++ avec règles optimisées pour le jeu et le bureau.',
            'Donne la priorité CPU et disque à votre application au premier plan tout en limitant les processus lourds en arrière-plan.',
            'Gardez-le ACTIVÉ en permanence pour une fluidité maximale du bureau et des jeux.'
        ),
        'bpftune.service': (
            'Optimiseur autonome développé par Oracle basé sur des programmes eBPF dans le noyau Linux.',
            'Analyse le trafic réseau et la mémoire en temps réel pour ajuster dynamiquement les tampons TCP et paramètres sysctl.',
            'INACTIF par défaut car le noyau X64 intègre déjà TCP BBR + FQ. Activez-le pour les réseaux 2.5G/10G ou serveurs locaux.'
        ),
        'psd.service': (
            'Profile-Sync-Daemon : monte le profil complet de votre navigateur web (Chromium, Firefox, Brave, Zen) directement en RAM (tmpfs).',
            'Accélère l’ouverture des onglets et réduit jusqu’à 90 % les écritures sur votre SSD/NVMe, avec synchronisation sûre à l’arrêt.',
            'Activez-le si vous avez 16 Go de RAM ou plus. Laissez-le INACTIF avec 8 Go de RAM ou moins pour réserver la mémoire aux jeux.'
        ),
        'systemd-oomd.service': (
            'Service de surveillance de saturation mémoire (Out-Of-Memory Daemon) de systemd.',
            'Ferme de force les applications lourdes avant que le système ne gèle si la RAM et le ZRAM atteignent 100 %.',
            'Recommandé INACTIF pour le Gaming : évite la fermeture brutale d’un jeu lors de la compilation de shaders Vulkan. Activez-le uniquement sur les PC ayant peu de RAM (4-8 Go).'
        ),
        'fstrim.timer': (
            'Minuteur hebdomadaire d’entretien des blocs pour disques SSD NVMe et SATA.',
            'Nettoie les cellules mémoire inutilisées pour maintenir la vitesse d’écriture et prolonger la durée de vie du SSD.',
            'Gardez-le ACTIVÉ tant que votre système est installé sur un SSD ou NVMe.'
        ),
        'mitigations': (
            'Correctifs de sécurité du noyau Linux contre les failles matérielles CPU (Spectre, Meltdown, MDS, TAA).',
            'Protège la mémoire CPU. Les désactiver (mitigations=off) offre +3 % à +7 % de FPS et réduit la latence en jeu.',
            'Gardez SÉCURISÉ (ACTIF) pour un usage général. Désactivez uniquement pour maximiser les FPS en jeu compétitif.'
        ),
    },
    'de': {
        'falcond.service': (
            'Intelligenter Daemon zur automatischen Erkennung laufender Spiele (Steam, Proton, Wine und native Spiele).',
            'Schaltet das CPU-Energieprofil dynamisch auf Höchstleistung, optimiert die Kern-Affinität und drosselt Hintergrundaufgaben gegen Mikroruckler.',
            'Für Gamer immer AKTIV lassen. Nur auf Laptops im Akkubetrieb deaktivieren, um maximale Akkulaufzeit zu erzielen.'
        ),
        'ananicy-cpp.service': (
            'Automatischer Prozessprioritäts-Manager (nice / ionice) in C++ mit Regelwerk für Gaming und Desktop.',
            'Priorisiert CPU- und Festplatten-I/O für Ihre aktive Anwendung (Spiel, Browser) und bremst Hintergrundlasten.',
            'Dauerhaft AKTIV lassen für eine verzögerungsfreie Reaktionsfähigkeit des Systems.'
        ),
        'bpftune.service': (
            'Autonomer Kernel-Optimierer von Oracle auf Basis von eBPF-Programmen im Linux-Kernel.',
            'Überwacht Netzwerkverkehr und Speicherlast in Echtzeit, um TCP-Puffer und sysctl-Werte dynamisch anzupassen.',
            'Standardmäßig INAKTIV, da der X64-Kernel bereits TCP BBR + FQ nutzt. Ideal für 2.5G/10G-Netzwerke oder lokale Server.'
        ),
        'psd.service': (
            'Profile-Sync-Daemon: lädt Ihr gesamtes Webbrowser-Profil (Chromium, Firefox, Brave, Zen) direkt in den Arbeitsspeicher (tmpfs).',
            'Beschleunigt das Öffnen von Tabs enorm und schont Ihre SSD/NVMe durch bis zu 90 % weniger Schreibzugriffe.',
            'Aktivieren ab 16 GB RAM. Bei 8 GB RAM oder weniger INAKTIV lassen, damit Spielen der volle Speicher bleibt.'
        ),
        'systemd-oomd.service': (
            'Systemd Out-Of-Memory (OOM) Schutz-Daemon.',
            'Beendet speicherintensive Prozesse, bevor das System bei 100 % RAM- und ZRAM-Auslastung komplett einfriert.',
            'Für Gaming INAKTIV empfohlen: verhindert, dass Spiele beim Kompilieren von Vulkan-Shadern fälschlich beendet werden. Nur bei wenig RAM (4-8 GB) aktivieren.'
        ),
        'fstrim.timer': (
            'Wöchentlicher System-Timer zur Blockwartung von NVMe- und SATA-SSDs.',
            'Teilt dem SSD-Controller freie Datenblöcke mit, erhält die Schreibgeschwindigkeit und verlängert die Lebensdauer.',
            'Immer AKTIV lassen, wenn das System auf einer SSD oder NVMe installiert ist.'
        ),
        'mitigations': (
            'Linux-Kernel-Sicherheitsfilter gegen spekulative CPU-Hardwarelücken (Spectre, Meltdown, MDS, TAA).',
            'Schützt den Prozessor vor Seitenkanalangriffen. Deaktivieren (mitigations=off) bringt +3 % bis +7 % mehr FPS.',
            'Für den Alltag SICHER (AKTIV) lassen. Nur für maximale FPS im kompetitiven Gaming deaktivieren.'
        ),
    },
    'it': {
        'falcond.service': (
            'Demone intelligente che rileva automaticamente l’avvio dei videogiochi (Steam, Proton, Wine e nativi).',
            'Imposta dinamicamente la CPU alle massime prestazioni, ottimizza l’affinità dei core e riduce i processi in background per eliminare lo stuttering.',
            'Mantienilo sempre ATTIVO se giochi sul PC. Disattivalo solo su laptop a batteria per risparmiare energia.'
        ),
        'ananicy-cpp.service': (
            'Gestore automatico delle priorità dei processi (nice / ionice) in C++ con profili per gaming e desktop.',
            'Assegna priorità CPU e disco all’applicazione in primo piano limitando i rallentamenti causati dai processi in background.',
            'Mantienilo sempre ATTIVO per garantire massima reattività del desktop.'
        ),
        'bpftune.service': (
            'Ottimizzatore autonomo sviluppato da Oracle basato su programmi eBPF nel kernel Linux.',
            'Analizza il traffico di rete e la memoria in tempo reale per regolare dinamicamente i buffer TCP e i parametri sysctl.',
            'INATTIVO di default poiché il kernel X64 include già TCP BBR + FQ. Attivalo per reti 2.5G/10G o server locali.'
        ),
        'psd.service': (
            'Profile-Sync-Daemon: monta il profilo del browser web (Chromium, Firefox, Brave, Zen) direttamente nella memoria RAM (tmpfs).',
            'Rende istantanea l’apertura delle schede e riduce fino al 90% le scritture su SSD/NVMe, sincronizzando i dati allo spegnimento.',
            'Attivalo se hai 16 GB di RAM o più. Lascialo INATTIVO con 8 GB o meno per riservare la RAM ai giochi.'
        ),
        'systemd-oomd.service': (
            'Demone di protezione da esaurimento memoria (Out-Of-Memory) di systemd.',
            'Termina forzatamente i processi pesanti prima che il sistema si blocchi quando RAM e ZRAM raggiungono il 100%.',
            'Consigliato INATTIVO per il Gaming: evita chiusure improvvise dei giochi durante la compilazione degli shader Vulkan. Attivalo solo su PC con poca RAM (4-8 GB).'
        ),
        'fstrim.timer': (
            'Timer settimanale di sistema per la manutenzione dei blocchi su unità SSD NVMe e SATA.',
            'Pulisce i blocchi dati inutilizzati preservando le prestazioni di scrittura e la durata dell’SSD.',
            'Mantienilo sempre ATTIVO su qualsiasi disco SSD o NVMe.'
        ),
        'mitigations': (
            'Patch di sicurezza del kernel Linux contro le vulnerabilità hardware della CPU (Spectre, Meltdown, MDS, TAA).',
            'Protegge la CPU da attacchi side-channel. Disattivarle (mitigations=off) garantisce da +3% a +7% di FPS nei giochi.',
            'Mantieni SICURO (ATTIVO) per uso generale. Disattiva solo per massimizzare gli FPS nel gaming competitivo.'
        ),
    },
    'pt': {
        'falcond.service': (
            'Daemon inteligente que detecta automaticamente quando você abre um jogo (Steam, Proton, Wine e nativos).',
            'Altera dinamicamente o perfil da CPU para desempenho máximo, ajusta a afinidade de núcleos e reduz tarefas de fundo para eliminar engasgos (stuttering).',
            'Mantenha sempre ATIVADO para jogar. Desative apenas em notebooks fora da tomada quando quiser economizar bateria.'
        ),
        'ananicy-cpp.service': (
            'Gerenciador automático de prioridades de processos (nice / ionice) em C++ com regras para jogos e desktop.',
            'Dá prioridade de CPU e disco para a janela em uso (jogo, navegador) e freia processos pesados em segundo plano.',
            'Mantenha sempre ATIVADO para máxima fluidez do sistema.'
        ),
        'bpftune.service': (
            'Otimizador autônomo desenvolvido pela Oracle baseado em programas eBPF no kernel Linux.',
            'Monitora o tráfego de rede e memória em tempo real para auto-ajustar buffers TCP e parâmetros sysctl.',
            'Vem INATIVO pois o kernel X64 já traz TCP BBR + FQ ativos. Ative para transferências em redes 2.5G/10G ou servidores locais.'
        ),
        'psd.service': (
            'Profile-Sync-Daemon: monta o perfil do seu navegador (Chromium, Firefox, Brave, Zen) diretamente na memória RAM (tmpfs).',
            'Deixa o navegador instantâneo e reduz em até 90% as gravações que desgastam seu SSD/NVMe, salvando tudo ao desligar.',
            'Ative se tiver 16 GB de RAM ou mais. Deixe INATIVO em PCs com 8 GB ou menos para reservar toda a RAM aos jogos.'
        ),
        'systemd-oomd.service': (
            'Vigia de esgotamento de memória (Out-Of-Memory Daemon) do systemd.',
            'Fecha aplicativos pesados antes que o sistema congele caso a RAM e o ZRAM cheguem a 100% de uso.',
            'Recomendado INATIVO para Jogos: evita que seus jogos sejam fechados abruptamente durante picos de compilação de shaders Vulkan. Ative apenas em PCs com pouca RAM (4-8 GB).'
        ),
        'fstrim.timer': (
            'Temporizador semanal do sistema para manutenção de blocos em unidades SSD NVMe e SATA.',
            'Informa ao SSD quais blocos foram apagados, mantendo a velocidade de gravação máxima e prolongando a vida útil.',
            'Mantenha sempre ATIVADO em qualquer computador com SSD ou NVMe.'
        ),
        'mitigations': (
            'Proteções do kernel Linux contra vulnerabilidades de execução especulativa da CPU (Spectre, Meltdown, MDS, TAA).',
            'Protegem a memória da CPU. Desativá-las (mitigations=off) recupera de +3% a +7% de FPS e reduz a latência em jogos.',
            'Mantenha SEGURO (ATIVO) para uso diário. Desative apenas se buscar o máximo de FPS em jogos competitivos.'
        ),
    },
    'ru': {
        'falcond.service': (
            'Интеллектуальная служба автоматического обнаружения запущенных игр (Steam, Proton, Wine и нативных).',
            'Динамически переключает процессор в режим максимальной производительности, настраивает привязку ядер и снижает фоновую нагрузку для устранения фризов.',
            'Держите ВКЛЮЧЕННЫМ, если вы играете на ПК. Отключайте только на ноутбуках при работе от батареи для экономии заряда.'
        ),
        'ananicy-cpp.service': (
            'Автоматический менеджер приоритетов процессов (nice / ionice) на C++ с базой правил для игр и рабочего стола.',
            'Отдает приоритет процессора и диска активному окну (игре, браузеру) и ограничивает фоновые задачи.',
            'Держите постоянно ВКЛЮЧЕННЫМ для мгновенного отклика системы.'
        ),
        'bpftune.service': (
            'Автономный оптимизатор ядра от Oracle на базе программ eBPF внутри ядра Linux.',
            'Анализирует сетевой трафик и память в реальном времени для автоматической подстройки буферов TCP и параметров sysctl.',
            'По умолчанию ОТКЛЮЧЕН, так как ядро X64 уже настроено с TCP BBR + FQ. Включайте для скоростных сетей 2.5G/10G или серверов.'
        ),
        'psd.service': (
            'Profile-Sync-Daemon: переносит профиль вашего браузера (Chromium, Firefox, Brave, Zen) напрямую в оперативную память (tmpfs).',
            'Многократно ускоряет работу вкладок и кэша, а также снижает износ SSD/NVMe-накопителя до 90%.',
            'Включайте при наличии 16 ГБ ОЗУ и более. Оставьте ОТКЛЮЧЕННЫМ при 8 ГБ ОЗУ и менее, чтобы сохранить память для игр.'
        ),
        'systemd-oomd.service': (
            'Служба защиты от исчерпания оперативной памяти (Out-Of-Memory Daemon).',
            'Принудительно закрывает тяжелые процессы до полного зависания ПК при заполнении ОЗУ и ZRAM на 100%.',
            'Для игр рекомендуется ОТКЛЮЧИТЬ: предотвращает внезапное закрытие игр во время компиляции шейдеров Vulkan (ZRAM уже защищает память). Включайте только на ПК с 4–8 ГБ ОЗУ.'
        ),
        'fstrim.timer': (
            'Еженедельный системный таймер обслуживания блоков твердотельных накопителей (NVMe и SATA SSD).',
            'Очищает неиспользуемые ячейки памяти SSD, предотвращая падение скорости записи и продлевая срок службы диска.',
            'Всегда держите ВКЛЮЧЕННЫМ, если система установлена на SSD или NVMe.'
        ),
        'mitigations': (
            'Защитные патчи ядра Linux от аппаратных уязвимостей процессора (Spectre, Meltdown, MDS, TAA).',
            'Защищают процессор от утечек памяти. Их отключение (mitigations=off) дает прирост от +3% до +7% FPS и снижает задержку кадров.',
            'Держите АКТИВНЫМИ для обычной работы. Отключайте только ради максимального FPS в киберспортивных играх.'
        ),
    }
}


def format_rich_tooltip(title, badge="", guide_key=None, fallback_desc=""):
    lang_dict = TOOLTIP_GUIDES.get(_lang_code) or TOOLTIP_GUIDES.get("en", {})
    guide = lang_dict.get(guide_key) or TOOLTIP_GUIDES.get("en", {}).get(guide_key)
    lbl_what, lbl_for, lbl_when = TOOLTIP_LABELS.get(_lang_code, TOOLTIP_LABELS["en"])
    badge_html = f" <span style='color:#9292a0; font-size:11px; font-weight:normal;'>({badge})</span>" if badge else ""
    if not guide:
        return (
            f"<table width='390' cellspacing='0' cellpadding='2'><tr><td>"
            f"<b style='color:#ffffff; font-size:12.5px;'>{title}</b>{badge_html}<br>"
            f"<span style='color:#d4d4dc; font-size:11.5px;'>{fallback_desc}</span>"
            f"</td></tr></table>"
        )
    what_txt, for_txt, when_txt = guide
    return (
        f"<table width='430' cellspacing='0' cellpadding='2'><tr><td>"
        f"<b style='color:#ffffff; font-size:13px;'>{title}</b>{badge_html}"
        f"<hr style='border:none; background-color:#2e2e3a; height:1px; margin:5px 0;'>"
        f"<p style='margin:3px 0; line-height:1.35; font-size:11.5px; color:#e2e2ea;'>"
        f"<b style='color:#ef4444;'>• {lbl_what}</b> {what_txt}</p>"
        f"<p style='margin:4px 0; line-height:1.35; font-size:11.5px; color:#e2e2ea;'>"
        f"<b style='color:#ef4444;'>• {lbl_for}</b> {for_txt}</p>"
        f"<p style='margin:3px 0; line-height:1.35; font-size:11.5px; color:#e2e2ea;'>"
        f"<b style='color:#ef4444;'>• {lbl_when}</b> {when_txt}</p>"
        f"</td></tr></table>"
    )


class FitLabel(QLabel):
    """Single-line QLabel that shrinks its font (down to min_ratio) and finally
    elides with '…' so text never gets hard-clipped in narrow grid cards."""

    def __init__(self, text="", parent=None, min_ratio=0.82):
        super().__init__(text, parent)
        self._min_ratio = min_ratio
        self.setMinimumWidth(0)

    def minimumSizeHint(self):
        return QSize(0, super().minimumSizeHint().height())

    def paintEvent(self, event):
        text = self.text()
        if not text or self.textFormat() == Qt.TextFormat.RichText or self.wordWrap():
            return super().paintEvent(event)
        rect = self.contentsRect()
        font = QFont(self.font())
        use_px = font.pixelSize() > 0
        base = float(font.pixelSize()) if use_px else font.pointSizeF()
        size = base
        fm = QFontMetrics(font)
        while fm.horizontalAdvance(text) > rect.width() and size > base * self._min_ratio:
            size -= 0.5
            if use_px:
                font.setPixelSize(max(1, int(round(size))))
            else:
                font.setPointSizeF(size)
            fm = QFontMetrics(font)
        if fm.horizontalAdvance(text) > rect.width():
            text = fm.elidedText(text, Qt.TextElideMode.ElideRight, rect.width())
        painter = QPainter(self)
        painter.setFont(font)
        painter.setPen(self.palette().color(QPalette.ColorRole.WindowText))
        painter.drawText(rect, int(self.alignment()), text)
        painter.end()


LOGO_PATH = "/usr/share/pixmaps/x64-cube.png"
if not os.path.exists(LOGO_PATH):
    for candidate in [
        os.path.join(os.path.dirname(__file__), "x64-cube.png"),
        "/usr/share/pixmaps/x64-logo.png"
    ]:
        if os.path.exists(candidate):
            LOGO_PATH = candidate
            break

AUTOSTART_PATH = os.path.expanduser("~/.config/autostart/x64-hello.desktop")
SYSTEM_DESKTOP_PATH = "/usr/share/applications/x64-hello.desktop"

SCROLLBAR_STYLE = """
    QScrollArea { border: none; background: transparent; }
    QScrollBar:vertical { background: #121212; width: 8px; margin: 0px; border-radius: 4px; }
    QScrollBar::handle:vertical { background: #333333; min-height: 30px; border-radius: 4px; }
    QScrollBar::handle:vertical:hover { background: #cc0000; }
    QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical { height: 0px; }
    QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { background: none; }
"""


SVG_ICONS = {
    "home": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ff3333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" fill="#ff3333" fill-opacity="0.14"/><polyline points="9 22 9 12 15 12 15 22" stroke="#ffffff"/></svg>''',
    "info": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ff3333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10" fill="#ff3333" fill-opacity="0.14"/><line x1="12" y1="16" x2="12" y2="12" stroke="#ffffff" stroke-width="2.4"/><line x1="12" y1="8" x2="12.01" y2="8" stroke="#ffffff" stroke-width="3"/></svg>''',
    "wifi": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ff3333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12.55a11 11 0 0 1 14.08 0"/><path d="M1.42 9a16 16 0 0 1 21.16 0"/><path d="M8.53 16.11a6 6 0 0 1 6.95 0" stroke="#ffffff"/><line x1="12" y1="20" x2="12.01" y2="20" stroke="#ffffff" stroke-width="3"/></svg>''',
    "cpu": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ff3333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="4" width="16" height="16" rx="2"/><rect x="9" y="9" width="6" height="6" stroke="#ffffff"/><path d="M9 1v3M15 1v3M9 20v3M15 20v3M20 9h3M20 14h3M1 9h3M1 14h3"/></svg>''',
    "memory": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ff3333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="6" width="20" height="12" rx="2"/><path d="M6 10v4M10 10v4M14 10v4M18 10v4" stroke="#ffffff"/><path d="M5 18v3M9 18v3M15 18v3M19 18v3"/></svg>''',
    "video-display": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ff3333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="3" width="20" height="14" rx="2"/><circle cx="12" cy="10" r="3" stroke="#ffffff"/><path d="M8 21h8M12 17v4"/></svg>''',
    "drive-harddisk": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ff3333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="4" width="20" height="16" rx="2"/><line x1="2" y1="14" x2="22" y2="14"/><circle cx="18" cy="17" r="1" fill="#ffffff" stroke="#ffffff"/><circle cx="14" cy="17" r="1" fill="#ffffff" stroke="#ffffff"/></svg>''',
    "wiki": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10" stroke="#ff3333"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg>''',
    "github": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="#ffffff"><path d="M12 .5C5.65.5.5 5.65.5 12c0 5.09 3.29 9.4 7.86 10.92.58.11.79-.25.79-.56 0-.28-.01-1.02-.02-2-3.2.7-3.88-1.54-3.88-1.54-.52-1.33-1.28-1.68-1.28-1.68-1.05-.71.08-.7.08-.7 1.16.08 1.77 1.19 1.77 1.19 1.03 1.76 2.7 1.25 3.36.96.1-.75.4-1.25.73-1.54-2.55-.29-5.24-1.28-5.24-5.69 0-1.26.45-2.28 1.18-3.09-.12-.29-.51-1.46.11-3.05 0 0 .97-.31 3.17 1.18a11.02 11.02 0 0 1 5.78 0c2.2-1.49 3.16-1.18 3.16-1.18.63 1.59.24 2.76.12 3.05.74.81 1.18 1.83 1.18 3.09 0 4.42-2.7 5.39-5.27 5.68.41.36.78 1.06.78 2.14 0 1.55-.01 2.79-.01 3.17 0 .31.21.68.8.56A11.51 11.51 0 0 0 23.5 12C23.5 5.65 18.35.5 12 .5z"/></svg>''',
    "discord": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="#ffffff"><path d="M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.061 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.028zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"/></svg>''',
    "bolt": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ff3333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2" stroke="#ffffff" fill="#ff3333" fill-opacity="0.22"/></svg>''',
    "sliders": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ff3333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="4" y1="21" x2="4" y2="14"/><line x1="4" y1="10" x2="4" y2="3"/><line x1="12" y1="21" x2="12" y2="12"/><line x1="12" y1="8" x2="12" y2="3"/><line x1="20" y1="21" x2="20" y2="16"/><line x1="20" y1="12" x2="20" y2="3"/><line x1="1" y1="14" x2="7" y2="14" stroke="#ffffff"/><line x1="9" y1="8" x2="15" y2="8" stroke="#ffffff"/><line x1="17" y1="16" x2="23" y2="16" stroke="#ffffff"/></svg>''',
    "shield": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ff3333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/><path d="M9 12l2 2 4-4" stroke="#ffffff"/></svg>''',
    "bluetooth": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6.5 6.5 17.5 17.5 12 23 12 1 17.5 6.5 6.5 17.5" stroke="#ff3333"/></svg>''',
    "bell": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ff3333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"/><path d="M13.73 21a2 2 0 0 1-3.46 0" stroke="#ffffff"/></svg>''',
    "refresh": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ff3333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="23 4 23 10 17 10" stroke="#ffffff"/><polyline points="1 20 1 14 7 14" stroke="#ffffff"/><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"/></svg>''',
    "dns": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ff3333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="2" width="20" height="8" rx="2"/><rect x="2" y="14" width="20" height="8" rx="2"/><line x1="6" y1="6" x2="6.01" y2="6" stroke="#ffffff" stroke-width="3"/><line x1="6" y1="18" x2="6.01" y2="18" stroke="#ffffff" stroke-width="3"/></svg>''',
    "trash": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ff3333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" stroke="#ffffff"/></svg>''',
    "unlock": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ff3333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2"/><path d="M7 11V7a5 5 0 0 1 9.9-1" stroke="#ffffff"/></svg>''',
    "key": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ff3333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4" stroke="#ffffff"/></svg>''',
    "window-app": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ff3333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><line x1="3" y1="9" x2="21" y2="9" stroke="#ffffff"/><line x1="9" y1="21" x2="9" y2="9" stroke="#ffffff"/></svg>''',
    "bug": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ff3333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="8" y="6" width="8" height="14" rx="4" stroke="#ffffff"/><path d="M19 7l-3 2M5 7l3 2M19 19l-3-2M5 19l3-2M20 13h-4M4 13h4M10 4l1 2M14 4l-1 2"/></svg>''',
    "gamepad": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ff3333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="6" y1="12" x2="10" y2="12" stroke="#ffffff"/><line x1="8" y1="10" x2="8" y2="14" stroke="#ffffff"/><line x1="15" y1="13" x2="15.01" y2="13" stroke="#ffffff" stroke-width="3"/><line x1="18" y1="11" x2="18.01" y2="11" stroke="#ffffff" stroke-width="3"/><rect x="2" y="6" width="20" height="12" rx="4"/></svg>''',
    "steam": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10" fill="#ff3333" fill-opacity="0.14"/><polygon points="12.5,6.8 17.8,11.3 10.9,17.7 6.9,14.1" fill="#ffffff"/><circle cx="15.3" cy="8.9" r="3.6" fill="#ffffff"/><circle cx="9.0" cy="15.8" r="2.75" fill="#ffffff"/><circle cx="9.0" cy="15.8" r="1.85" fill="#180a0c"/><line x1="2.5" y1="13.1" x2="9.0" y2="15.8" stroke="#ffffff" stroke-width="2.3" stroke-linecap="round"/><circle cx="15.3" cy="8.9" r="2.15" fill="#180a0c"/><circle cx="15.3" cy="8.9" r="1.25" fill="#ffffff"/><circle cx="12" cy="12" r="10" fill="none" stroke="#ff3333" stroke-width="1.8"/></svg>''',
    "lutris": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ff3333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="12 2 21 7 21 17 12 22 3 17 3 7" fill="#ff3333" fill-opacity="0.15"/><path d="M9 8v8h6" stroke="#ffffff" stroke-width="2.4"/></svg>''',
    "heroic": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ff3333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2l8 4v6c0 5.5-3.8 9.7-8 11-4.2-1.3-8-5.5-8-11V6l8-4z" fill="#ff3333" fill-opacity="0.14"/><path d="M12 6v12M9 9h6" stroke="#ffffff" stroke-width="2.2"/></svg>''',
    "rocket": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ff3333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z" stroke="#ffffff"/><path d="M12 15l-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z"/><circle cx="15" cy="9" r="1.5" fill="#ffffff" stroke="#ffffff"/></svg>''',
    "gauge": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ff3333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 14l4-4" stroke="#ffffff" stroke-width="2.3"/><circle cx="12" cy="14" r="2" fill="#ffffff" stroke="#ffffff"/><path d="M3.34 19a10 10 0 1 1 17.32 0"/></svg>''',
    "layers": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ff3333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="12 2 2 7 12 12 22 7 12 2" stroke="#ffffff" fill="#ff3333" fill-opacity="0.18"/><polyline points="2 12 12 17 22 12"/><polyline points="2 17 12 22 22 17" stroke="#ffffff"/></svg>''',
    "obs": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ff3333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M23 7l-7 5 7 5V7z" fill="#ff3333" fill-opacity="0.25"/><rect x="1" y="5" width="15" height="14" rx="2" stroke="#ffffff"/><circle cx="8.5" cy="12" r="3" stroke="#ff3333"/><circle cx="8.5" cy="12" r="1" fill="#ffffff"/></svg>''',
    "android": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ff3333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 16v4M19 16v4" stroke="#ff3333"/><rect x="5" y="9" width="14" height="9" rx="2" fill="#ff3333" fill-opacity="0.15" stroke="#ffffff"/><path d="M7 5l1.5 2M17 5l-1.5 2" stroke="#ff3333"/><circle cx="9" cy="13" r="1" fill="#ffffff" stroke="#ffffff"/><circle cx="15" cy="13" r="1" fill="#ffffff" stroke="#ffffff"/><path d="M2 11v5M22 11v5" stroke="#ff3333"/></svg>''',
    "shield-warn": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ff3333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" fill="#ff3333" fill-opacity="0.14"/><line x1="12" y1="8" x2="12" y2="12" stroke="#ffffff" stroke-width="2.2"/><line x1="12" y1="16" x2="12.01" y2="16" stroke="#ffffff" stroke-width="3"/></svg>''',
    "gpu-fan": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ff3333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9" stroke="#ff3333" fill="#ff3333" fill-opacity="0.14"/><circle cx="12" cy="12" r="3" fill="#ffffff" stroke="#ffffff"/><path d="M12 9c1.5-2 3.5-3 5-3s2 1.5 1 3.5-3 2-6 2.5" stroke="#ffffff"/><path d="M9 12c-2-1.5-3-3.5-3-5s1.5-2 3.5-1 2 3 2.5 6" stroke="#ffffff"/><path d="M12 15c-1.5 2-3.5 3-5 3s-2-1.5-1-3.5 3-2 6-2.5" stroke="#ffffff"/><path d="M15 12c2 1.5 3 3.5 3 5s-1.5 2-3.5 1-2-3-2.5-6" stroke="#ffffff"/></svg>''',
    "sunshine": b'''<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="#ff3333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="5" fill="#ff3333" fill-opacity="0.22" stroke="#ffffff" stroke-width="2.2"/><line x1="12" y1="1" x2="12" y2="3" stroke="#ff3333" stroke-width="2.4"/><line x1="12" y1="21" x2="12" y2="23" stroke="#ff3333" stroke-width="2.4"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64" stroke="#ffffff" stroke-width="2.2"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78" stroke="#ffffff" stroke-width="2.2"/><line x1="1" y1="12" x2="3" y2="12" stroke="#ff3333" stroke-width="2.4"/><line x1="21" y1="12" x2="23" y2="12" stroke="#ff3333" stroke-width="2.4"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36" stroke="#ffffff" stroke-width="2.2"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22" stroke="#ffffff" stroke-width="2.2"/></svg>'''
}

def make_svg_pixmap(icon_key, size=28, accent="#ff3333"):
    if icon_key in SVG_ICONS:
        pix = QPixmap()
        svg_data = SVG_ICONS[icon_key]
        if accent and accent != "#ff3333":
            svg_data = svg_data.replace(b"#ff3333", accent.encode("utf-8"))
        if pix.loadFromData(svg_data, "SVG"):
            return pix.scaled(size, size, Qt.AspectRatioMode.KeepAspectRatio, Qt.TransformationMode.SmoothTransformation)
    icon = QIcon.fromTheme(icon_key)
    if not icon.isNull():
        return icon.pixmap(size, size)
    return QPixmap()


import socket
import time

DNS_PROVIDERS = [
    {
        "name": "Cloudflare Gaming",
        "tag": "Ultra-Fast Gaming",
        "ipv4": "1.1.1.1,1.0.0.1",
        "ipv6": "2606:4700:4700::1111,2606:4700:4700::1001",
        "dot": "cloudflare-dns.com",
        "ping_ip": "1.1.1.1"
    },
    {
        "name": "Cloudflare Security",
        "tag": "Anti-Malware Filter",
        "ipv4": "1.1.1.2,1.0.0.2",
        "ipv6": "2606:4700:4700::1112,2606:4700:4700::1002",
        "dot": "security.cloudflare-dns.com",
        "ping_ip": "1.1.1.2"
    },
    {
        "name": "AdGuard DNS",
        "tag": "Ad & Tracker Blocker",
        "ipv4": "94.140.14.14,94.140.15.15",
        "ipv6": "2a10:50c0::ad1:ff,2a10:50c0::ad2:ff",
        "dot": "dns.adguard-dns.com",
        "ping_ip": "94.140.14.14"
    },
    {
        "name": "Quad9 Privacy",
        "tag": "Swiss Privacy",
        "ipv4": "9.9.9.9,149.112.112.112",
        "ipv6": "2620:fe::fe,2620:fe::9",
        "dot": "dns.quad9.net",
        "ping_ip": "9.9.9.9"
    },
    {
        "name": "Google Public DNS",
        "tag": "High Availability",
        "ipv4": "8.8.8.8,8.8.4.4",
        "ipv6": "2001:4860:4860::8888,2001:4860:4860::8844",
        "dot": "dns.google",
        "ping_ip": "8.8.8.8"
    },
    {
        "name": "Cisco OpenDNS",
        "tag": "Classic Stability",
        "ipv4": "208.67.222.222,208.67.220.220",
        "ipv6": "2620:119:35::35,2620:119:53::53",
        "dot": "dns.opendns.com",
        "ping_ip": "208.67.222.222"
    }
]
_BG_WORKERS = set()


class DnsPingWorker(QThread):
    results_ready = pyqtSignal(dict)

    @staticmethod
    def _probe_dns_ms(ip):
        dns_query = b"\x12\x34\x01\x00\x00\x01\x00\x00\x00\x00\x00\x00\x06google\x03com\x00\x00\x01\x00\x01"
        sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        sock.settimeout(1.2)
        t0 = time.perf_counter()
        try:
            sock.sendto(dns_query, (ip, 53))
            sock.recvfrom(512)
            return (time.perf_counter() - t0) * 1000.0
        except Exception:
            pass
        finally:
            sock.close()

        t1 = time.perf_counter()
        try:
            s_tcp = socket.create_connection((ip, 53), timeout=1.2)
            s_tcp.close()
            return (time.perf_counter() - t1) * 1000.0
        except Exception:
            return None

    def run(self):
        latencies = {}
        for p in DNS_PROVIDERS:
            ip = p["ping_ip"]
            latencies[ip] = self._probe_dns_ms(ip)
        self.results_ready.emit(latencies)


class DnsOptimizerPanel(QFrame):
    def __init__(self, parent=None):
        super().__init__(parent)
        self.setObjectName("DnsOptimizerPanel")
        self.setStyleSheet("""
            QFrame#DnsOptimizerPanel {
                background-color: rgba(255, 255, 255, 0.02);
                border: 1px solid rgba(255, 255, 255, 0.07);
                border-radius: 12px;
            }
            QLabel {
                color: #ffffff;
                background: transparent;
            }
            QComboBox {
                background-color: #15151c;
                color: #ffffff;
                border: 1px solid #33333e;
                border-radius: 8px;
                padding: 5px 12px;
                font-size: 12.5px;
                font-weight: bold;
            }
            QComboBox:hover {
                border: 1px solid #cc0000;
            }
            QComboBox::drop-down {
                border: none;
                background: transparent;
                width: 24px;
            }
            QComboBox QAbstractItemView {
                background-color: #121216;
                color: #ffffff;
                selection-background-color: #cc0000;
                border: 1px solid #33333c;
            }
            QCheckBox {
                background: transparent;
                color: #e0e0e0;
                font-size: 12.5px;
                font-weight: bold;
                spacing: 8px;
                padding: 2px;
            }
            QCheckBox::indicator {
                width: 17px;
                height: 17px;
                border-radius: 4px;
                border: 1px solid #555560;
                background-color: #16161d;
            }
            QCheckBox::indicator:checked {
                background-color: #cc0000;
                border: 1px solid #ff3333;
            }
        """)
        self._ping_worker = None
        self._has_benchmarked = False
        self.selected_idx = 0
        self.provider_buttons = []

        layout = QVBoxLayout(self)
        layout.setContentsMargins(14, 8, 14, 8)
        layout.setSpacing(10)

        conn_row = QHBoxLayout()
        conn_row.setSpacing(10)
        lbl_conn = QLabel(tr("Active Network Connection:"))
        lbl_conn.setStyleSheet("color: #bbbbbb; font-size: 12.5px; font-weight: bold; border: none;")
        self.conn_combo = QComboBox()
        self.conn_combo.setMinimumWidth(210)
        self.conn_combo.setFixedHeight(34)
        self.populate_connections()
        conn_row.addWidget(lbl_conn)
        conn_row.addWidget(self.conn_combo)

        ping_txt = tr("⚡ Benchmark DNS Latency (Ping)").replace("⚡ ", "").strip()
        self.btn_ping = QPushButton(f"◈  {ping_txt}")
        self.btn_ping.setCursor(Qt.CursorShape.PointingHandCursor)
        self.btn_ping.setFixedHeight(34)
        self.btn_ping.setStyleSheet("""
            QPushButton {
                background-color: rgba(220, 38, 38, 0.12);
                color: #f4f4f5;
                border: 1px solid rgba(220, 38, 38, 0.42);
                border-radius: 8px;
                padding: 0 14px;
                font-weight: bold;
                font-size: 12px;
            }
            QPushButton:hover {
                background-color: rgba(220, 38, 38, 0.24);
                border: 1px solid #ef4444;
                color: #ffffff;
            }
        """)
        self.btn_ping.clicked.connect(self.run_ping_benchmark)
        conn_row.addWidget(self.btn_ping)

        self.status_lbl = FitLabel("", min_ratio=0.85)
        self.status_lbl.setStyleSheet("color: #ef4444; font-size: 12px; font-weight: bold; background: transparent; border: none;")
        conn_row.addSpacing(6)
        conn_row.addWidget(self.status_lbl, 1)
        layout.addLayout(conn_row)

        # 3x2 Grid of 6 DNS Providers
        grid = QGridLayout()
        grid.setHorizontalSpacing(10)
        grid.setVerticalSpacing(8)
        for col in range(3):
            grid.setColumnStretch(col, 1)

        for i, p in enumerate(DNS_PROVIDERS):
            btn = QPushButton()
            btn.setAttribute(Qt.WidgetAttribute.WA_Hover, True)
            btn.setAttribute(Qt.WidgetAttribute.WA_StyledBackground, True)
            btn.setFixedHeight(78)
            btn.setMinimumWidth(0)
            btn.setSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Fixed)
            btn.setCursor(Qt.CursorShape.PointingHandCursor)
            ipv4_pretty = p["ipv4"].split(",")[0]
            btn.setToolTip(format_rich_tooltip(
                p["name"],
                ipv4_pretty,
                guide_key=f"dns_{p['ping_ip']}",
                fallback_desc=f"{tr(p['tag'])} • TLS (DoT): {p['dot']}"
            ))
            btn.clicked.connect(lambda checked=False, idx=i: self.select_provider(idx))

            b_lay = QVBoxLayout(btn)
            b_lay.setContentsMargins(12, 7, 12, 7)
            b_lay.setSpacing(2)

            top_h = QHBoxLayout()
            lbl_n = QLabel(p["name"])
            lbl_n.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
            lbl_n.setStyleSheet("color: #ffffff; font-weight: bold; font-size: 13px; border: none; background: transparent;")
            lbl_ms = QLabel("<span style='color:#52525b;'>●</span> — ms")
            lbl_ms.setTextFormat(Qt.TextFormat.RichText)
            lbl_ms.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
            lbl_ms.setStyleSheet("""
                color: #a1a1aa; background-color: rgba(255,255,255,0.045);
                border: 1px solid rgba(255,255,255,0.10); border-radius: 6px;
                padding: 2px 7px; font-weight: bold; font-size: 10.5px;
            """)
            top_h.addWidget(lbl_n)
            top_h.addStretch(1)
            top_h.addWidget(lbl_ms)
            b_lay.addLayout(top_h)

            ipv4_pretty = p["ipv4"].split(",")[0]
            lbl_ip = FitLabel(f"{tr(p['tag'])}  •  {ipv4_pretty}")
            lbl_ip.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
            lbl_ip.setStyleSheet("color: #cbd5e1; font-size: 10.5px; font-weight: bold; border: none; background: transparent;")
            b_lay.addWidget(lbl_ip)

            lbl_dot = QLabel(f"TLS (DoT): {p['dot']}")
            lbl_dot.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
            lbl_dot.setStyleSheet("color: #888894; font-size: 10.5px; border: none; background: transparent;")
            b_lay.addWidget(lbl_dot)

            self.provider_buttons.append((btn, lbl_ms))
            grid.addWidget(btn, i // 3, i % 3)

        layout.addLayout(grid)
        self.select_provider(0)

        btm_row = QHBoxLayout()
        btm_row.setSpacing(10)

        self.chk_dot = QCheckBox(tr("Enable Encrypted DNS (DNS-over-TLS / DoT)"))
        self.chk_dot.setChecked(True)
        self.chk_dot.setCursor(Qt.CursorShape.PointingHandCursor)
        btm_row.addWidget(self.chk_dot)
        btm_row.addStretch(1)

        btn_reset = QPushButton(tr("Reset to Automatic (DHCP)"))
        btn_reset.setCursor(Qt.CursorShape.PointingHandCursor)
        btn_reset.setFixedHeight(34)
        btn_reset.setStyleSheet("""
            QPushButton {
                background-color: rgba(255, 255, 255, 0.06);
                color: #cccccc;
                border: 1px solid #33333c;
                border-radius: 8px;
                padding: 0 14px;
                font-weight: bold;
                font-size: 11.5px;
            }
            QPushButton:hover {
                background-color: rgba(255, 255, 255, 0.12);
                color: #ffffff;
            }
        """)
        btn_reset.clicked.connect(self.reset_dns)

        btn_apply = QPushButton(tr("Apply Selected DNS"))
        btn_apply.setCursor(Qt.CursorShape.PointingHandCursor)
        btn_apply.setFixedHeight(34)
        btn_apply.setStyleSheet("""
            QPushButton {
                background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #d60000, stop:1 #850000);
                color: #ffffff;
                border: 1px solid #ff3333;
                border-radius: 8px;
                padding: 0 18px;
                font-weight: bold;
                font-size: 12px;
            }
            QPushButton:hover {
                background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #ff1a1a, stop:1 #a30000);
            }
        """)
        btn_apply.clicked.connect(self.apply_dns)

        btm_row.addWidget(btn_reset)
        btm_row.addWidget(btn_apply)
        layout.addLayout(btm_row)

    def populate_connections(self):
        self.conn_combo.clear()
        try:
            res = subprocess.run(
                ["nmcli", "-t", "-f", "NAME,TYPE", "connection", "show", "--active"],
                stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, timeout=2
            )
            conns = []
            for line in res.stdout.splitlines():
                if ":" in line:
                    name, ctype = line.split(":", 1)
                    if ctype != "loopback" and name:
                        conns.append(name)
            if not conns:
                res2 = subprocess.run(
                    ["nmcli", "-t", "-f", "NAME,TYPE", "connection", "show"],
                    stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, timeout=2
                )
                for line in res2.stdout.splitlines():
                    if ":" in line:
                        name, ctype = line.split(":", 1)
                        if ctype != "loopback" and name:
                            conns.append(name)
            for c in conns:
                self.conn_combo.addItem(c)
        except Exception:
            pass

    def select_provider(self, idx):
        self.selected_idx = idx
        for i, (btn, _) in enumerate(self.provider_buttons):
            if i == idx:
                btn.setStyleSheet("""
                    QPushButton {
                        background-color: rgba(220, 38, 38, 0.12);
                        border: 1.5px solid #ef4444;
                        border-radius: 10px;
                        text-align: left;
                    }
                """)
            else:
                btn.setStyleSheet("""
                    QPushButton {
                        background-color: rgba(255, 255, 255, 0.025);
                        border: 1px solid rgba(255, 255, 255, 0.07);
                        border-radius: 10px;
                        text-align: left;
                    }
                    QPushButton:hover {
                        background-color: rgba(255, 255, 255, 0.055);
                        border: 1px solid rgba(220, 38, 38, 0.45);
                    }
                """)

    def run_ping_benchmark(self):
        if self._ping_worker and self._ping_worker.isRunning():
            return
        self._has_benchmarked = True
        self.status_lbl.setStyleSheet("color: #f59e0b; font-size: 12px; font-weight: bold; background: transparent; border: none;")
        self.status_lbl.setText(tr("Testing ping to all DNS servers..."))
        worker = DnsPingWorker()
        self._ping_worker = worker
        _BG_WORKERS.add(worker)
        worker.results_ready.connect(self.on_ping_results)
        worker.finished.connect(lambda w=worker: _BG_WORKERS.discard(w))
        worker.start()

    def on_ping_results(self, latencies):
        best_idx = None
        best_ms = 999999.0
        pill_css = """
            color: #e4e4e7; background-color: rgba(255, 255, 255, 0.045);
            border: 1px solid rgba(255, 255, 255, 0.10); border-radius: 6px;
            padding: 2px 7px; font-weight: bold; font-size: 10.5px;
        """
        for i, p in enumerate(DNS_PROVIDERS):
            _, lbl_ms = self.provider_buttons[i]
            lbl_ms.setTextFormat(Qt.TextFormat.RichText)
            ms = latencies.get(p["ping_ip"])
            if ms is not None:
                if ms < 35:
                    dot_col = "#10b981"
                elif ms < 85:
                    dot_col = "#f59e0b"
                else:
                    dot_col = "#ef4444"
                lbl_ms.setText(f"<span style='color:{dot_col};'>●</span> {ms:.1f} ms")
                lbl_ms.setStyleSheet(pill_css)
                if ms < best_ms:
                    best_ms = ms
                    best_idx = i
            else:
                lbl_ms.setText("<span style='color:#52525b;'>○</span> timeout")
                lbl_ms.setStyleSheet("""
                    color: #71717a; background-color: rgba(255, 255, 255, 0.03);
                    border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 6px;
                    padding: 2px 7px; font-weight: bold; font-size: 10.5px;
                """)
        if best_idx is not None:
            self.select_provider(best_idx)
            self.status_lbl.setStyleSheet("color: #d4d4d8; font-size: 12px; font-weight: bold; background: transparent; border: none;")
            self.status_lbl.setTextFormat(Qt.TextFormat.RichText)
            self.status_lbl.setText(f"<span style='color:#ef4444;'>✓</span> {DNS_PROVIDERS[best_idx]['name']} ({best_ms:.1f} ms)")
        else:
            self.status_lbl.setText("")

    def _run_dns_pkexec(self, sh_cmd, pending_msg, success_msg):
        self.status_lbl.setStyleSheet("color: #f39c12; font-size: 12px; font-weight: bold; background: transparent; border: none;")
        self.status_lbl.setText(f"⟳ {pending_msg}")
        proc = QProcess(self)

        def _on_done(exit_code, _exit_status):
            if exit_code == 0:
                self.status_lbl.setStyleSheet("color: #ef4444; font-size: 12px; font-weight: bold; background: transparent; border: none;")
                self.status_lbl.setText(f"✓ {success_msg}")
            else:
                self.status_lbl.setStyleSheet("color: #ff4d4d; font-size: 12px; font-weight: bold; background: transparent; border: none;")
                self.status_lbl.setText(f"✕ {tr('Operation canceled or authentication failed.')}")
            proc.deleteLater()

        proc.finished.connect(_on_done)
        proc.start("pkexec", ["sh", "-c", sh_cmd])

    def apply_dns(self):
        conn = self.conn_combo.currentText().strip()
        if not conn:
            return
        p = DNS_PROVIDERS[self.selected_idx]
        dot_val = "2" if self.chk_dot.isChecked() else "0"
        sh_cmd = (
            f"nmcli connection modify '{conn}' "
            f"ipv4.ignore-auto-dns yes ipv4.dns '{p['ipv4']}' "
            f"ipv6.ignore-auto-dns yes ipv6.dns '{p['ipv6']}' "
            f"connection.dns-over-tls {dot_val} && "
            f"nmcli connection up '{conn}'"
        )
        self._run_dns_pkexec(
            sh_cmd,
            tr("Applying DNS configuration..."),
            f"{tr('DNS successfully applied to connection:')} {conn} ({p['name']})"
        )

    def reset_dns(self):
        conn = self.conn_combo.currentText().strip()
        if not conn:
            return
        sh_cmd = (
            f"nmcli connection modify '{conn}' "
            f"ipv4.ignore-auto-dns no ipv4.dns '' "
            f"ipv6.ignore-auto-dns no ipv6.dns '' "
            f"connection.dns-over-tls -1 && "
            f"nmcli connection up '{conn}'"
        )
        self._run_dns_pkexec(
            sh_cmd,
            tr("Resetting DNS to automatic DHCP..."),
            f"{tr('DNS reset to automatic DHCP on:')} {conn}"
        )


SCX_SCHEDULERS = [
    {
        "id": "bore",
        "name": "BORE (Kernel Default)",
        "badge": "Native C",
        "default_mode": "auto",
        "tag": "Native Kernel + FalconD Auto",
        "desc": "Burst-Oriented Response Enhancer built into the kernel. Zero eBPF overhead; works with FalconD."
    },
    {
        "id": "lavd",
        "name": "scx_lavd (Valve)",
        "badge": "eBPF • Gaming",
        "default_mode": "gaming",
        "tag": "Competitive Gaming & 1% Low FPS",
        "desc": "Latency-critical Virtual Deadline scheduler by Valve & Igalia for maximum frame pacing stability."
    },
    {
        "id": "bpfland",
        "name": "scx_bpfland",
        "badge": "eBPF • Interactive",
        "default_mode": "lowlatency",
        "tag": "Interactive Desktop & Streaming",
        "desc": "Prioritizes interactive tasks (games, OBS streaming) even under 100% background CPU compilation."
    },
    {
        "id": "cosmos",
        "name": "scx_cosmos",
        "badge": "eBPF • Balanced",
        "default_mode": "auto",
        "tag": "Lightweight All-Rounder",
        "desc": "Ultra-fast general-purpose scheduler optimized for CPU cache locality and low wakeup latency."
    },
    {
        "id": "flash",
        "name": "scx_flash",
        "badge": "eBPF • Multimedia",
        "default_mode": "lowlatency",
        "tag": "Pro Audio & Multimedia EDF",
        "desc": "Earliest Deadline First (EDF) scheduler guaranteeing strict latency consistency for audio/video."
    },
    {
        "id": "rusty",
        "name": "scx_rusty",
        "badge": "eBPF • Workstation",
        "default_mode": "auto",
        "tag": "Multi-Core / Multi-CCD Workstation",
        "desc": "Multi-domain load balancer engineered for high-core-count CPUs and heavy rendering workloads."
    }
]

SCX_MODES = [
    ("gaming", "⚡ Gaming", "Gaming"),
    ("lowlatency", "🎯 Low Latency", "LowLatency"),
    ("auto", "⚙️ Auto", "Auto"),
    ("powersave", "🔋 Power Save", "PowerSave")
]

_SCX_OVERRIDE_CACHE = {"sched": None, "mode": None, "until": 0.0}


def get_active_cpu_scheduler():
    now = time.monotonic()
    if _SCX_OVERRIDE_CACHE["sched"] and now < _SCX_OVERRIDE_CACHE["until"]:
        return _SCX_OVERRIDE_CACHE["sched"]
    try:
        if os.path.exists("/sys/kernel/sched_ext/state"):
            with open("/sys/kernel/sched_ext/state", "r") as f:
                st = f.read().strip()
            if st == "enabled" and os.path.exists("/sys/kernel/sched_ext/root/ops"):
                with open("/sys/kernel/sched_ext/root/ops", "r") as f:
                    ops = f.read().strip()
                if ops:
                    short = ops.split("_")[0].strip().lower()
                    return f"scx_{short}"
    except Exception:
        pass
    return "BORE"


def query_scxctl_runtime():
    """Returns (active_sched_id, active_mode_id, pretty_label)"""
    try:
        res = subprocess.run(
            ["scxctl", "get"],
            stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, timeout=1.5
        )
        out = res.stdout.strip()
        if out.lower().startswith("running "):
            parts = out.split()
            sched_raw = parts[1].lower() if len(parts) > 1 else "lavd"
            mode_raw = parts[3].lower() if len(parts) > 3 else "auto"
            mode_pretty = parts[3] if len(parts) > 3 else "Auto"
            return sched_raw, mode_raw, f"scx_{sched_raw} ({mode_pretty})"
    except Exception:
        pass
    cur = get_active_cpu_scheduler()
    if cur.startswith("scx_"):
        s_id = cur.replace("scx_", "").split()[0].strip().lower()
        return s_id, "auto", cur
    return "bore", "auto", tr("BORE (Kernel Default)")


class ScxSchedulerPanel(QFrame):
    def __init__(self, parent_app=None):
        super().__init__(parent_app)
        self.parent_app = parent_app
        self.setObjectName("ScxSchedulerPanel")
        self.setStyleSheet("""
            QFrame#ScxSchedulerPanel {
                background-color: rgba(255, 255, 255, 0.02);
                border: 1px solid rgba(255, 255, 255, 0.07);
                border-radius: 12px;
            }
            QLabel {
                color: #ffffff;
                background: transparent;
            }
            QCheckBox {
                background: transparent;
                color: #e0e0e0;
                font-size: 12px;
                font-weight: bold;
                spacing: 8px;
                padding: 2px;
            }
            QCheckBox::indicator {
                width: 17px;
                height: 17px;
                border-radius: 4px;
                border: 1px solid #555560;
                background-color: #16161d;
            }
            QCheckBox::indicator:checked {
                background-color: #cc0000;
                border: 1px solid #ff3333;
            }
        """)

        self.selected_idx = 0
        self.selected_mode = "gaming"
        self.active_sched_id = "bore"
        self.active_mode_id = "auto"
        self.sched_buttons = []

        layout = QVBoxLayout(self)
        layout.setContentsMargins(16, 12, 16, 12)
        layout.setSpacing(10)

        # Top Status + Pre-Calibrated Automatic Profile Indicator
        top_bar = QHBoxLayout()
        top_bar.setSpacing(8)

        lbl_act_title = QLabel(tr("Active Scheduler:"))
        lbl_act_title.setStyleSheet("color: #bbbbbb; font-size: 12.5px; font-weight: bold; border: none;")
        top_bar.addWidget(lbl_act_title)

        self.lbl_active_pill = QLabel("<span style='color:#ef4444;'>●</span> BORE")
        self.lbl_active_pill.setTextFormat(Qt.TextFormat.RichText)
        self.lbl_active_pill.setStyleSheet("""
            color: #ffffff; background-color: rgba(220, 38, 38, 0.10);
            border: 1px solid rgba(239, 68, 68, 0.40); border-radius: 6px;
            padding: 3px 10px; font-weight: bold; font-size: 11.5px;
        """)
        top_bar.addWidget(self.lbl_active_pill)
        top_bar.addStretch(1)

        self.lbl_auto_profile_pill = QLabel("")
        self.lbl_auto_profile_pill.setStyleSheet("""
            color: #e4e4e7;
            background-color: rgba(220, 38, 38, 0.10);
            border: 1px solid rgba(220, 38, 38, 0.34);
            border-radius: 6px;
            padding: 3px 10px;
            font-weight: bold;
            font-size: 11px;
        """)
        top_bar.addWidget(self.lbl_auto_profile_pill)

        layout.addLayout(top_bar)

        # 3x2 Symmetric Grid of 6 Schedulers
        grid = QGridLayout()
        grid.setHorizontalSpacing(10)
        grid.setVerticalSpacing(8)
        for col in range(3):
            grid.setColumnStretch(col, 1)

        for i, s in enumerate(SCX_SCHEDULERS):
            btn = QPushButton()
            btn.setAttribute(Qt.WidgetAttribute.WA_Hover, True)
            btn.setAttribute(Qt.WidgetAttribute.WA_StyledBackground, True)
            btn.setFixedHeight(80)
            btn.setMinimumWidth(0)
            btn.setSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Fixed)
            btn.setCursor(Qt.CursorShape.PointingHandCursor)
            btn.clicked.connect(lambda checked=False, idx=i: self.select_scheduler(idx, auto_mode=True))

            b_lay = QVBoxLayout(btn)
            b_lay.setContentsMargins(12, 8, 12, 8)
            b_lay.setSpacing(2)

            top_h = QHBoxLayout()
            disp_name = tr(s["name"]) if s["id"] == "bore" else s["name"]
            btn.setToolTip(format_rich_tooltip(
                disp_name,
                s["badge"],
                guide_key=f"scx_{s['id']}",
                fallback_desc=tr(s["desc"])
            ))
            lbl_n = FitLabel(disp_name)
            lbl_n.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
            lbl_n.setStyleSheet("color: #ffffff; font-weight: bold; font-size: 12.5px; border: none; background: transparent;")

            lbl_badge = QLabel(s["badge"])
            lbl_badge.setTextFormat(Qt.TextFormat.RichText)
            lbl_badge.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
            top_h.addWidget(lbl_n)
            top_h.addStretch(1)
            top_h.addWidget(lbl_badge)
            b_lay.addLayout(top_h)

            lbl_tag = FitLabel(tr(s["tag"]))
            lbl_tag.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
            lbl_tag.setStyleSheet("color: #cbd5e1; font-size: 10.5px; font-weight: bold; border: none; background: transparent;")
            b_lay.addWidget(lbl_tag)

            lbl_desc = QLabel(tr(s["desc"]))
            lbl_desc.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
            lbl_desc.setWordWrap(True)
            _hfw = lbl_desc.sizePolicy()
            _hfw.setHeightForWidth(True)
            lbl_desc.setSizePolicy(_hfw)
            lbl_desc.setStyleSheet("color: #9999a4; font-size: 10px; border: none; background: transparent;")
            b_lay.addWidget(lbl_desc)

            self.sched_buttons.append((btn, lbl_badge, s))
            grid.addWidget(btn, i // 3, i % 3)

        layout.addLayout(grid)

        # Bottom Action & Persistence Bar
        btm_row = QHBoxLayout()
        btm_row.setSpacing(10)

        self.chk_persist = QCheckBox(tr("Persist at boot (/etc/scx_loader/config.toml)"))
        self.chk_persist.setChecked(False)
        self.chk_persist.setCursor(Qt.CursorShape.PointingHandCursor)
        self.chk_persist.setToolTip(format_rich_tooltip(
            tr("Persist at boot (/etc/scx_loader/config.toml)"),
            "scx_loader",
            guide_key="scx_persist"
        ))
        btm_row.addWidget(self.chk_persist)

        self.status_lbl = FitLabel("", min_ratio=0.85)
        self.status_lbl.setStyleSheet("color: #ef4444; font-size: 12px; font-weight: bold; background: transparent; border: none;")
        self.status_lbl.setFixedHeight(16)
        btm_row.addStretch(1)

        btn_reset = QPushButton(tr("Reset to BORE Default"))
        btn_reset.setCursor(Qt.CursorShape.PointingHandCursor)
        btn_reset.setFixedHeight(34)
        btn_reset.setToolTip(format_rich_tooltip(
            tr("Reset to BORE Default"),
            "Native C",
            guide_key="scx_bore"
        ))
        btn_reset.setStyleSheet("""
            QPushButton {
                background-color: rgba(255, 255, 255, 0.06);
                color: #cccccc;
                border: 1px solid #33333c;
                border-radius: 8px;
                padding: 0 14px;
                font-weight: bold;
                font-size: 11.5px;
            }
            QPushButton:hover {
                background-color: rgba(255, 255, 255, 0.12);
                color: #ffffff;
            }
        """)
        btn_reset.clicked.connect(self.reset_to_bore)

        btn_apply = QPushButton(tr("Apply Selected Scheduler"))
        btn_apply.setCursor(Qt.CursorShape.PointingHandCursor)
        btn_apply.setFixedHeight(34)
        btn_apply.setToolTip(format_rich_tooltip(
            tr("Apply Selected Scheduler"),
            "scxctl",
            guide_key="scx_apply"
        ))
        btn_apply.setStyleSheet("""
            QPushButton {
                background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #d60000, stop:1 #850000);
                color: #ffffff;
                border: 1px solid #ff3333;
                border-radius: 8px;
                padding: 0 18px;
                font-weight: bold;
                font-size: 12px;
            }
            QPushButton:hover {
                background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #ff1a1a, stop:1 #a30000);
            }
        """)
        btn_apply.clicked.connect(self.apply_scheduler)

        btm_row.addWidget(btn_reset)
        btm_row.addWidget(btn_apply)
        layout.addLayout(btm_row)
        layout.addWidget(self.status_lbl)

        self.refresh_runtime_state(select_active=True)

    def refresh_runtime_state(self, select_active=False):
        s_id, m_id, pretty = query_scxctl_runtime()
        self.active_sched_id = s_id
        self.active_mode_id = m_id
        self.lbl_active_pill.setTextFormat(Qt.TextFormat.RichText)
        self.lbl_active_pill.setText(f"<span style='color:#ef4444;'>●</span>&nbsp;&nbsp;<span style='color:#ffffff;'>{pretty}</span>")
        self.lbl_active_pill.setToolTip(format_rich_tooltip(
            pretty,
            tr("ACTIVE"),
            guide_key=f"scx_{s_id}"
        ))
        self.lbl_active_pill.setStyleSheet("""
            color: #ffffff; background-color: rgba(220, 38, 38, 0.10);
            border: 1px solid rgba(239, 68, 68, 0.40); border-radius: 6px;
            padding: 3px 10px; font-weight: bold; font-size: 11.5px;
        """)

        found_idx = 0
        for i, (_btn, lbl_badge, s_info) in enumerate(self.sched_buttons):
            if s_info["id"] == s_id:
                found_idx = i
                lbl_badge.setTextFormat(Qt.TextFormat.RichText)
                lbl_badge.setText(f"<span style='color:#ef4444;'>●</span> {tr('ACTIVE')}")
                lbl_badge.setStyleSheet("""
                    color: #ffffff; background-color: rgba(239, 68, 68, 0.18);
                    border: 1px solid rgba(239, 68, 68, 0.50); border-radius: 6px;
                    padding: 2px 7px; font-weight: bold; font-size: 10px;
                """)
            else:
                lbl_badge.setText(s_info["badge"])
                lbl_badge.setStyleSheet("""
                    color: #9ca3af; background-color: rgba(255,255,255,0.04);
                    border: 1px solid rgba(255,255,255,0.09); border-radius: 6px;
                    padding: 2px 7px; font-weight: bold; font-size: 10px;
                """)

        if select_active:
            self.select_scheduler(found_idx, auto_mode=True)
        else:
            self.select_scheduler(self.selected_idx, auto_mode=True)

        if self.parent_app and hasattr(self.parent_app, "update_hardware_telemetry"):
            self.parent_app.update_hardware_telemetry(force=True)

    def select_scheduler(self, idx, auto_mode=True):
        self.selected_idx = idx
        for i, (btn, _lbl_badge, _s_info) in enumerate(self.sched_buttons):
            if i == idx:
                btn.setStyleSheet("""
                    QPushButton {
                        background-color: rgba(220, 38, 38, 0.12);
                        border: 1.5px solid #ef4444;
                        border-radius: 10px;
                        text-align: left;
                    }
                """)
            else:
                btn.setStyleSheet("""
                    QPushButton {
                        background-color: rgba(255, 255, 255, 0.025);
                        border: 1px solid rgba(255, 255, 255, 0.07);
                        border-radius: 10px;
                        text-align: left;
                    }
                    QPushButton:hover {
                        background-color: rgba(255, 255, 255, 0.055);
                        border: 1px solid rgba(220, 38, 38, 0.45);
                    }
                """)
        chosen = SCX_SCHEDULERS[idx]
        self.select_mode(chosen["default_mode"])

    @staticmethod
    def _strip_emoji(txt):
        for e in ("⚡", "🎯", "⚙️", "⚙", "🔋"):
            txt = txt.replace(e, "")
        return txt.strip()

    def select_mode(self, mode_id):
        self.selected_mode = mode_id
        chosen = SCX_SCHEDULERS[self.selected_idx]
        mode_labels = {
            "bore": f"◈  {tr('Native Kernel + FalconD Auto')}",
            "gaming": f"{tr('Workload Profile:')} {self._strip_emoji(tr('⚡ Gaming'))}",
            "lowlatency": f"{tr('Workload Profile:')} {self._strip_emoji(tr('🎯 Low Latency'))}",
            "auto": f"{tr('Workload Profile:')} {self._strip_emoji(tr('⚙️ Auto'))}",
            "powersave": f"{tr('Workload Profile:')} {self._strip_emoji(tr('🔋 Power Save'))}",
        }
        if chosen["id"] == "bore":
            pill_txt = mode_labels["bore"]
        else:
            pill_txt = mode_labels.get(mode_id, mode_labels["auto"])
        self.lbl_auto_profile_pill.setText(f" {pill_txt} ")
        disp_name = tr(chosen["name"]) if chosen["id"] == "bore" else chosen["name"]
        self.lbl_auto_profile_pill.setToolTip(format_rich_tooltip(
            disp_name,
            chosen["badge"],
            guide_key=f"scx_{chosen['id']}",
            fallback_desc=tr(chosen["desc"])
        ))

    def _build_persist_cmd(self, sched_id, mode_id):
        mode_toml = "Auto"
        for m_id, _m_lbl, m_t in SCX_MODES:
            if m_id == mode_id:
                mode_toml = m_t
                break
        if sched_id == "bore":
            header_lines = (
                "# Default scheduler at boot (BORE kernel default active; managed dynamically by FalconD)\n"
                "# default_sched = \"scx_bpfland\"\n"
                "# default_mode = \"Auto\"\n"
            )
        else:
            header_lines = (
                f"default_sched = \"scx_{sched_id}\"\n"
                f"default_mode = \"{mode_toml}\"\n"
            )
        toml_body = (
            "# ==============================================================================\n"
            "# X64 LIOS Linux - sched_ext (scx_loader) Low-Latency Gaming Profile\n"
            "# ==============================================================================\n"
            + header_lines + "\n"
            "[scheds.scx_bpfland]\n"
            "auto_mode = [\"-s\", \"20000\", \"-S\", \"1000\"]\n"
            "gaming_mode = [\"-m\", \"performance\", \"-s\", \"20000\", \"-S\", \"500\"]\n"
            "lowlatency_mode = [\"-s\", \"5000\", \"-S\", \"500\", \"-l\", \"5000\", \"-m\", \"performance\"]\n"
            "powersave_mode = [\"-m\", \"powersave\", \"-s\", \"20000\", \"-S\", \"5000\"]\n\n"
            "[scheds.scx_lavd]\n"
            "auto_mode = [\"--autopilot\"]\n"
            "gaming_mode = [\"--performance\"]\n"
            "lowlatency_mode = [\"--performance\"]\n"
            "powersave_mode = [\"--powersave\"]\n\n"
            "[scheds.scx_flash]\n"
            "auto_mode = []\n"
            "gaming_mode = [\"-m\", \"all\", \"-s\", \"20000\", \"-S\", \"500\"]\n"
            "lowlatency_mode = [\"-m\", \"all\", \"-s\", \"5000\", \"-S\", \"500\", \"-L\"]\n"
            "powersave_mode = [\"-m\", \"powersave\"]\n\n"
            "[scheds.scx_rusty]\n"
            "auto_mode = []\n"
        )
        return f"printf %s {shlex.quote(toml_body)} > /etc/scx_loader/config.toml"

    def _execute_scx_change(self, sched_id, mode_id):
        self.status_lbl.setStyleSheet("color: #f39c12; font-size: 12px; font-weight: bold; background: transparent; border: none;")
        self.status_lbl.setText(f"⟳ {tr('Applying CPU scheduler...')}")

        if sched_id == "bore":
            scx_cmd = "scxctl stop >/dev/null 2>&1 || true"
            target_cache = "BORE"
            success_msg = tr("Returned to native BORE kernel scheduler.")
        else:
            scx_cmd = f"scxctl switch -s {sched_id} -m {mode_id} >/dev/null 2>&1 || scxctl start -s {sched_id} -m {mode_id}"
            target_cache = f"scx_{sched_id}"
            success_msg = f"{tr('CPU scheduler switched to:')} scx_{sched_id} ({mode_id.capitalize()})"

        persist = self.chk_persist.isChecked()
        proc = QProcess(self)

        def _on_done(exit_code, _exit_status):
            if exit_code == 0:
                _SCX_OVERRIDE_CACHE["sched"] = target_cache
                _SCX_OVERRIDE_CACHE["mode"] = mode_id
                _SCX_OVERRIDE_CACHE["until"] = time.monotonic() + 3.5
                self.status_lbl.setStyleSheet("color: #ef4444; font-size: 12px; font-weight: bold; background: transparent; border: none;")
                self.status_lbl.setText(f"✓ {success_msg}")
                self.refresh_runtime_state(select_active=False)
                QTimer.singleShot(1800, lambda: self.refresh_runtime_state(select_active=False))
            else:
                self.status_lbl.setStyleSheet("color: #ff4d4d; font-size: 12px; font-weight: bold; background: transparent; border: none;")
                self.status_lbl.setText(f"✕ {tr('Operation canceled or authentication failed.')}")
            proc.deleteLater()

        proc.finished.connect(_on_done)
        if persist:
            persist_cmd = self._build_persist_cmd(sched_id, mode_id)
            proc.start("pkexec", ["sh", "-c", f"({scx_cmd}) && {persist_cmd}"])
        else:
            proc.start("sh", ["-c", scx_cmd])

    def apply_scheduler(self):
        chosen = SCX_SCHEDULERS[self.selected_idx]
        self._execute_scx_change(chosen["id"], self.selected_mode)

    def reset_to_bore(self):
        self.select_scheduler(0, auto_mode=True)
        self._execute_scx_change("bore", "auto")


class KernelStatusCard(QFrame):
    def __init__(self, title, desc, badge_text, icon_name, height=78, guide_key=None):
        super().__init__()
        self.setObjectName("KernelStatusCard")
        self.setAttribute(Qt.WidgetAttribute.WA_Hover, True)
        self.setAttribute(Qt.WidgetAttribute.WA_StyledBackground, True)
        self.setFixedHeight(height)
        self.setMinimumWidth(0)
        self.setSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Fixed)
        self.setToolTip(format_rich_tooltip(title, badge_text, guide_key=guide_key, fallback_desc=desc))
        self.setStyleSheet("""
            QFrame#KernelStatusCard {
                background-color: rgba(255, 255, 255, 0.025);
                border-radius: 11px;
                border: 1px solid rgba(255, 255, 255, 0.065);
            }
            QFrame#KernelStatusCard:hover {
                background-color: rgba(255, 255, 255, 0.05);
                border: 1px solid rgba(255, 255, 255, 0.18);
            }
        """)

        hbox = QHBoxLayout(self)
        hbox.setContentsMargins(14, 6, 14, 6)
        hbox.setSpacing(12)

        icon_box = QFrame()
        icon_box.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        icon_box.setFixedSize(40, 40)
        icon_box.setStyleSheet("""
            QFrame {
                background-color: rgba(220, 38, 38, 0.10);
                border: 1px solid rgba(220, 38, 38, 0.28);
                border-radius: 10px;
            }
        """)
        ibox_layout = QVBoxLayout(icon_box)
        ibox_layout.setContentsMargins(0, 0, 0, 0)
        ibox_layout.setAlignment(Qt.AlignmentFlag.AlignCenter)

        icon_label = QLabel()
        icon_label.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        pix = make_svg_pixmap(icon_name, 20)
        if not pix.isNull():
            icon_label.setPixmap(pix)
        icon_label.setStyleSheet("background: transparent; border: none;")
        ibox_layout.addWidget(icon_label)
        hbox.addWidget(icon_box)

        vbox = QVBoxLayout()
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(2)
        vbox.addStretch(1)

        lbl_title = FitLabel(title)
        lbl_title.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        lbl_title.setMinimumWidth(0)
        lbl_title.setSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Preferred)
        lbl_title.setStyleSheet("color: #ffffff; font-weight: bold; font-size: 13px; border: none; background: transparent;")
        vbox.addWidget(lbl_title)

        lbl_desc = QLabel(desc)
        lbl_desc.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        lbl_desc.setMinimumWidth(0)
        lbl_desc.setSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Preferred)
        lbl_desc.setStyleSheet("color: #a0a0a8; font-size: 11px; border: none; background: transparent;")
        lbl_desc.setWordWrap(True)
        _hfw = lbl_desc.sizePolicy()
        _hfw.setHeightForWidth(True)
        lbl_desc.setSizePolicy(_hfw)
        vbox.addWidget(lbl_desc)

        vbox.addStretch(1)
        hbox.addLayout(vbox, 1)

        lbl_badge = QLabel(f"<span style='color:#ef4444;'>●</span>&nbsp;&nbsp;{badge_text}")
        lbl_badge.setTextFormat(Qt.TextFormat.RichText)
        lbl_badge.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        lbl_badge.setStyleSheet("""
            color: #ffffff;
            background-color: rgba(220, 38, 38, 0.10);
            border: 1px solid rgba(239, 68, 68, 0.38);
            border-radius: 7px;
            padding: 4px 10px;
            font-weight: bold;
            font-size: 10.5px;
        """)
        hbox.addWidget(lbl_badge, 0, Qt.AlignmentFlag.AlignVCenter)


class PremiumButton(QPushButton):
    def __init__(self, title, desc, icon_name, url=None, cmd=None, callback=None, height=82, guide_key=None):
        super().__init__()
        self.url = url
        self.cmd = cmd
        self.callback = callback
        self.setAttribute(Qt.WidgetAttribute.WA_Hover, True)
        self.setAttribute(Qt.WidgetAttribute.WA_StyledBackground, True)
        self.setFixedHeight(height)
        self.setMinimumWidth(0)
        self.setSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Fixed)
        self.setCursor(Qt.CursorShape.PointingHandCursor)
        self.setToolTip(format_rich_tooltip(title, "", guide_key=guide_key, fallback_desc=desc))

        self.setStyleSheet("""
            PremiumButton {
                background-color: rgba(255, 255, 255, 0.025);
                border-radius: 12px;
                border: 1px solid rgba(255, 255, 255, 0.065);
                text-align: left;
            }
            PremiumButton:hover {
                background-color: rgba(255, 255, 255, 0.06);
                border: 1px solid rgba(220, 38, 38, 0.55);
            }
        """)

        hbox = QHBoxLayout()
        hbox.setContentsMargins(14, 6, 14, 6)
        hbox.setSpacing(12)

        icon_box = QFrame()
        icon_box.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        icon_box.setFixedSize(40, 40)
        icon_box.setStyleSheet("""
            QFrame {
                background-color: rgba(220, 38, 38, 0.10);
                border: 1px solid rgba(220, 38, 38, 0.28);
                border-radius: 10px;
            }
        """)
        ibox_layout = QVBoxLayout(icon_box)
        ibox_layout.setContentsMargins(0, 0, 0, 0)
        ibox_layout.setAlignment(Qt.AlignmentFlag.AlignCenter)

        icon_label = QLabel()
        icon_label.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        pixmap = make_svg_pixmap(icon_name, 21)
        if not pixmap.isNull():
            icon_label.setPixmap(pixmap)
        else:
            icon_label.setText("⚡")
            icon_label.setStyleSheet("font-size: 18px; background: transparent; border: none;")
        icon_label.setStyleSheet("background: transparent; border: none;")
        ibox_layout.addWidget(icon_label)
        hbox.addWidget(icon_box)

        vbox = QVBoxLayout()
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(3)
        vbox.addStretch(1)

        lbl_title = FitLabel(title)
        lbl_title.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        lbl_title.setMinimumWidth(0)
        lbl_title.setSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Preferred)
        lbl_title.setStyleSheet("color: #ffffff; font-weight: bold; font-size: 13px; border: none; background: transparent;")
        vbox.addWidget(lbl_title)

        lbl_desc = QLabel(desc)
        lbl_desc.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        lbl_desc.setMinimumWidth(0)
        lbl_desc.setSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Preferred)
        lbl_desc.setStyleSheet("color: #a8a8b0; font-size: 11px; border: none; background: transparent;")
        lbl_desc.setWordWrap(True)
        _hfw = lbl_desc.sizePolicy()
        _hfw.setHeightForWidth(True)
        lbl_desc.setSizePolicy(_hfw)
        vbox.addWidget(lbl_desc)

        vbox.addStretch(1)
        hbox.addLayout(vbox, 1)
        self.setLayout(hbox)
        self.clicked.connect(self.action)

    def action(self):
        if self.callback:
            self.callback()
        elif self.url:
            webbrowser.open(self.url)
        elif self.cmd:
            os.system(f"{self.cmd} &")



class MitigationsConfirmDialog(QDialog):
    def __init__(self, parent=None):
        super().__init__(parent)
        self.setWindowTitle(tr("CPU Hardware Mitigations Security Warning"))
        self.setFixedSize(540, 290)
        self.setStyleSheet("""
            QDialog {
                background-color: #0e0e12;
                border: 1px solid #cc0000;
                border-radius: 12px;
            }
            QLabel {
                color: #ffffff;
                background: transparent;
            }
        """)

        layout = QVBoxLayout(self)
        layout.setContentsMargins(22, 18, 22, 18)
        layout.setSpacing(12)

        header_row = QHBoxLayout()
        header_row.setSpacing(12)

        icon_lbl = QLabel()
        pix = make_svg_pixmap("shield-warn", 32)
        if not pix.isNull():
            icon_lbl.setPixmap(pix)
        else:
            icon_lbl.setText("⚠️")
            icon_lbl.setStyleSheet("font-size: 26px;")
        header_row.addWidget(icon_lbl)

        title_lbl = QLabel(tr("CPU Hardware Mitigations Security Warning"))
        title_lbl.setStyleSheet("color: #ff3333; font-weight: bold; font-size: 15px;")
        header_row.addWidget(title_lbl, 1)
        layout.addLayout(header_row)

        desc_lbl = QLabel(tr(
            "Disabling CPU hardware vulnerability mitigations (Spectre, Meltdown, MDS, TAA, etc.) with the <b>mitigations=off</b> kernel parameter recovers <b>3% to 7% CPU performance</b> and reduces frame latency in competitive gaming.<br><br><b>Security Warning:</b> Disabling mitigations exposes the processor to speculative execution side-channel attacks from untrusted local code or unisolated web scripts.<br><br>Do you want to proceed and inject <b>mitigations=off</b> into the bootloader?<br><i>(A system restart will be required to apply this change).</i>"
        ))
        desc_lbl.setWordWrap(True)
        desc_lbl.setStyleSheet("color: #cccccc; font-size: 11px; line-height: 1.35;")
        layout.addWidget(desc_lbl)
        layout.addStretch(1)

        btn_row = QHBoxLayout()
        btn_row.setSpacing(12)
        btn_row.addStretch(1)

        btn_cancel = QPushButton(tr("Cancel (Keep Secure)"))
        btn_cancel.setCursor(Qt.CursorShape.PointingHandCursor)
        btn_cancel.setFixedHeight(32)
        btn_cancel.setStyleSheet("""
            QPushButton {
                background-color: rgba(255, 255, 255, 0.08);
                color: #ffffff;
                border: 1px solid #44444c;
                border-radius: 8px;
                padding: 0 16px;
                font-weight: bold;
                font-size: 11px;
            }
            QPushButton:hover {
                background-color: rgba(255, 255, 255, 0.16);
            }
        """)
        btn_cancel.clicked.connect(self.reject)
        btn_row.addWidget(btn_cancel)

        btn_confirm = QPushButton(tr("Disable Mitigations (+FPS)"))
        btn_confirm.setCursor(Qt.CursorShape.PointingHandCursor)
        btn_confirm.setFixedHeight(32)
        btn_confirm.setStyleSheet("""
            QPushButton {
                background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #cc0000, stop:1 #800000);
                color: #ffffff;
                border: 1px solid #ff3333;
                border-radius: 8px;
                padding: 0 16px;
                font-weight: bold;
                font-size: 11px;
            }
            QPushButton:hover {
                background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #ff1a1a, stop:1 #a30000);
            }
        """)
        btn_confirm.clicked.connect(self.accept)
        btn_row.addWidget(btn_confirm)

        layout.addLayout(btn_row)


class CardToggleSwitch(QPushButton):
    def __init__(self, checked=False, parent=None):
        super().__init__(parent)
        self._checked = bool(checked)
        self.setFixedSize(44, 24)
        self.setCursor(Qt.CursorShape.PointingHandCursor)
        self.setAttribute(Qt.WidgetAttribute.WA_Hover, True)
        self.setStyleSheet("background: transparent; border: none;")

    def set_checked(self, checked):
        self._checked = bool(checked)
        self.update()

    def is_checked(self):
        return self._checked

    def paintEvent(self, _event):
        p = QPainter(self)
        p.setRenderHint(QPainter.RenderHint.Antialiasing)
        if not self.isEnabled():
            p.setOpacity(0.55)
        hovered = self.underMouse() and self.isEnabled()
        if self._checked:
            border_col = "#ff4d4d" if hovered else "#ff3333"
            fill_col = "#d60000" if hovered else "#b80000"
            p.setPen(QPen(QColor(border_col), 1.2))
            p.setBrush(QBrush(QColor(fill_col)))
            p.drawRoundedRect(1, 1, 42, 22, 11, 11)
            p.setPen(Qt.PenStyle.NoPen)
            p.setBrush(QBrush(QColor("#ffffff")))
            p.drawEllipse(23, 4, 16, 16)
        else:
            border_col = "#ef4444" if hovered else "#383842"
            fill_col = "#24242c" if hovered else "#1a1a20"
            thumb_col = "#d4d4d8" if hovered else "#777782"
            p.setPen(QPen(QColor(border_col), 1.2))
            p.setBrush(QBrush(QColor(fill_col)))
            p.drawRoundedRect(1, 1, 42, 22, 11, 11)
            p.setPen(Qt.PenStyle.NoPen)
            p.setBrush(QBrush(QColor(thumb_col)))
            p.drawEllipse(5, 4, 16, 16)
        p.end()


class MitigationsSwitchCard(QFrame):
    def __init__(self, parent_app=None):
        super().__init__()
        self.parent_app = parent_app
        self.setObjectName("MitigationsCard")
        self.setAttribute(Qt.WidgetAttribute.WA_Hover, True)
        self.setAttribute(Qt.WidgetAttribute.WA_StyledBackground, True)
        self.setCursor(Qt.CursorShape.PointingHandCursor)
        self.setFixedHeight(64)
        self.setMinimumWidth(0)
        self.setSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Fixed)
        self.setStyleSheet("""
            QFrame#MitigationsCard {
                background-color: rgba(255, 255, 255, 0.025);
                border-radius: 12px;
                border: 1px solid rgba(255, 255, 255, 0.065);
            }
            QFrame#MitigationsCard:hover {
                background-color: rgba(255, 255, 255, 0.05);
                border: 1px solid rgba(220, 38, 38, 0.45);
            }
        """)

        hbox = QHBoxLayout(self)
        hbox.setContentsMargins(13, 5, 13, 5)
        hbox.setSpacing(10)

        icon_box = QFrame()
        icon_box.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        icon_box.setFixedSize(36, 36)
        icon_box.setStyleSheet("""
            QFrame {
                background-color: rgba(220, 38, 38, 0.10);
                border: 1px solid rgba(220, 38, 38, 0.28);
                border-radius: 10px;
            }
        """)
        ibox_layout = QVBoxLayout(icon_box)
        ibox_layout.setContentsMargins(0, 0, 0, 0)
        ibox_layout.setAlignment(Qt.AlignmentFlag.AlignCenter)

        icon_label = QLabel()
        icon_label.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        pix = make_svg_pixmap("shield-warn", 20)
        if not pix.isNull():
            icon_label.setPixmap(pix)
        else:
            icon_label.setText("🛡️")
            icon_label.setStyleSheet("font-size: 16px; background: transparent; border: none;")
        icon_label.setStyleSheet("background: transparent; border: none;")
        ibox_layout.addWidget(icon_label)
        hbox.addWidget(icon_box)

        vbox = QVBoxLayout()
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(2)
        vbox.addStretch(1)

        lbl_title = FitLabel(tr("CPU Security Mitigations (Spectre/Meltdown)"))
        lbl_title.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        lbl_title.setMinimumWidth(0)
        lbl_title.setSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Preferred)
        lbl_title.setStyleSheet("color: #ffffff; font-weight: bold; font-size: 13px; border: none; background: transparent;")
        vbox.addWidget(lbl_title)

        self.lbl_desc = QLabel(tr("Hardware vulnerability defenses. Disabling them (mitigations=off) yields +3% to +7% CPU FPS at security cost."))
        self.lbl_desc.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        self.lbl_desc.setMinimumWidth(0)
        self.lbl_desc.setSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Preferred)
        self.lbl_desc.setStyleSheet("color: #a0a0a8; font-size: 10.2px; border: none; background: transparent;")
        self.lbl_desc.setWordWrap(True)
        vbox.addWidget(self.lbl_desc)

        vbox.addStretch(1)
        hbox.addLayout(vbox, 1)

        self.status_pill = QLabel()
        self.status_pill.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        self.status_pill.setFixedHeight(26)
        self.status_pill.setAlignment(Qt.AlignmentFlag.AlignCenter)
        hbox.addWidget(self.status_pill)

        self.toggle_btn = CardToggleSwitch(True, self)
        self.toggle_btn.clicked.connect(self.toggle_action)
        hbox.addWidget(self.toggle_btn)

        mit_tip = format_rich_tooltip(
            tr("CPU Security Mitigations (Spectre/Meltdown)"),
            "mitigations=off",
            guide_key="mitigations",
            fallback_desc=self.lbl_desc.text()
        )
        self.setToolTip(mit_tip)
        self.toggle_btn.setToolTip(mit_tip)

        self._disabled_state = False
        self.refresh_state()

    def mousePressEvent(self, event):
        if event.button() == Qt.MouseButton.LeftButton and self.toggle_btn.isEnabled():
            self.toggle_action()
        else:
            super().mousePressEvent(event)

    def check_is_disabled(self):
        try:
            with open("/proc/cmdline", "r") as f:
                if "mitigations=off" in f.read().split():
                    return True
        except Exception:
            pass
        for path in ["/etc/default/grub", "/etc/default/limine", "/boot/limine.conf", "/boot/efi/limine.conf", "/boot/refind_linux.conf"]:
            if os.path.exists(path):
                try:
                    with open(path, "r") as f:
                        if "mitigations=off" in f.read():
                            return True
                except Exception:
                    pass
        if os.path.isdir("/boot/loader/entries"):
            try:
                for fname in os.listdir("/boot/loader/entries"):
                    if fname.endswith(".conf"):
                        with open(os.path.join("/boot/loader/entries", fname), "r") as f:
                            if "mitigations=off" in f.read():
                                return True
            except Exception:
                pass
        return False

    def refresh_state(self):
        self._disabled_state = self.check_is_disabled()
        self.status_pill.setTextFormat(Qt.TextFormat.RichText)
        self.toggle_btn.set_checked(not self._disabled_state)
        if self._disabled_state:
            self.status_pill.setText(f"<span style='color:#f59e0b;'>▲</span>&nbsp;&nbsp;<span style='color:#f59e0b;'>{tr('MITIGATIONS OFF (+FPS)')}</span>")
            self.status_pill.setStyleSheet("""
                color: #f59e0b;
                background-color: rgba(245, 158, 11, 0.08);
                border: 1px solid rgba(245, 158, 11, 0.30);
                border-radius: 6px;
                padding: 0 10px;
                font-weight: bold;
                font-size: 10px;
            """)
        else:
            self.status_pill.setText(f"<span style='color:#ef4444;'>●</span>&nbsp;&nbsp;<span style='color:#ffffff;'>{tr('MITIGATIONS ACTIVE (SECURE)')}</span>")
            self.status_pill.setStyleSheet("""
                color: #ffffff;
                background-color: rgba(220, 38, 38, 0.10);
                border: 1px solid rgba(239, 68, 68, 0.38);
                border-radius: 6px;
                padding: 0 10px;
                font-weight: bold;
                font-size: 10px;
            """)

    def toggle_action(self):
        if not self._disabled_state:
            dialog = MitigationsConfirmDialog(self)
            if dialog.exec() != QDialog.DialogCode.Accepted:
                return

        action_arg = "off" if not self._disabled_state else "on"
        self.toggle_btn.setEnabled(False)

        tool_cmd = "/usr/bin/x64-toggle-mitigations"
        if not os.path.exists(tool_cmd):
            local_tool = os.path.join(os.path.dirname(os.path.abspath(__file__)), "x64-toggle-mitigations")
            if os.path.exists(local_tool):
                tool_cmd = local_tool

        proc = QProcess(self)
        def _on_done(exit_code, _exit_status):
            self.toggle_btn.setEnabled(True)
            self.refresh_state()
            if exit_code == 0:
                self.lbl_desc.setText(f"✓ {tr('Bootloader updated. Please restart your PC to apply kernel changes.')}")
                self.lbl_desc.setStyleSheet("color: #ef4444; font-size: 10.5px; font-weight: bold; border: none; background: transparent;")
            else:
                self.lbl_desc.setText(tr("Operation cancelled."))
                self.lbl_desc.setStyleSheet("color: #ff9999; font-size: 10.5px; border: none; background: transparent;")
            proc.deleteLater()

        proc.finished.connect(_on_done)
        proc.start("pkexec", [tool_cmd, action_arg])


class ServiceSwitchCard(QFrame):
    def __init__(self, title, desc, unit_name, icon_name, parent_app=None, is_user=False, req_pkg=None, height=78):
        super().__init__()
        self.title = title
        self.unit_name = unit_name
        self.parent_app = parent_app
        self.is_user = is_user
        self.req_pkg = req_pkg
        self._active = False
        self.setObjectName("ServiceCard")
        self.setAttribute(Qt.WidgetAttribute.WA_Hover, True)
        self.setAttribute(Qt.WidgetAttribute.WA_StyledBackground, True)
        self.setCursor(Qt.CursorShape.PointingHandCursor)
        self.setFixedHeight(height)
        self.setMinimumWidth(0)
        self.setSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Fixed)
        rich_tip = format_rich_tooltip(title, unit_name, guide_key=unit_name, fallback_desc=desc)
        self.setToolTip(rich_tip)
        self.setStyleSheet("""
            QFrame#ServiceCard {
                background-color: rgba(255, 255, 255, 0.025);
                border-radius: 12px;
                border: 1px solid rgba(255, 255, 255, 0.065);
            }
            QFrame#ServiceCard:hover {
                background-color: rgba(255, 255, 255, 0.055);
                border: 1px solid rgba(220, 38, 38, 0.45);
            }
        """)

        hbox = QHBoxLayout()
        hbox.setContentsMargins(13, 5, 13, 5)
        hbox.setSpacing(10)

        icon_box = QFrame()
        icon_box.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        icon_box.setFixedSize(38, 38)
        icon_box.setStyleSheet("""
            QFrame {
                background-color: rgba(220, 38, 38, 0.10);
                border: 1px solid rgba(220, 38, 38, 0.28);
                border-radius: 10px;
            }
        """)
        ibox_layout = QVBoxLayout(icon_box)
        ibox_layout.setContentsMargins(0, 0, 0, 0)
        ibox_layout.setAlignment(Qt.AlignmentFlag.AlignCenter)

        icon_label = QLabel()
        icon_label.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        pix = make_svg_pixmap(icon_name, 20)
        if not pix.isNull():
            icon_label.setPixmap(pix)
        else:
            icon_label.setText("⚙️")
            icon_label.setStyleSheet("font-size: 16px; background: transparent; border: none;")
        icon_label.setStyleSheet("background: transparent; border: none;")
        ibox_layout.addWidget(icon_label)
        hbox.addWidget(icon_box)

        vbox = QVBoxLayout()
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(2)
        vbox.addStretch(1)

        lbl_title = FitLabel(title)
        lbl_title.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        lbl_title.setMinimumWidth(0)
        lbl_title.setSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Preferred)
        lbl_title.setStyleSheet("color: #ffffff; font-weight: bold; font-size: 13px; border: none; background: transparent;")
        vbox.addWidget(lbl_title)

        lbl_desc = QLabel(desc)
        lbl_desc.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        lbl_desc.setMinimumWidth(0)
        lbl_desc.setSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Preferred)
        lbl_desc.setStyleSheet("color: #a0a0a8; font-size: 11px; border: none; background: transparent;")
        lbl_desc.setWordWrap(True)
        _hfw = lbl_desc.sizePolicy()
        _hfw.setHeightForWidth(True)
        lbl_desc.setSizePolicy(_hfw)
        vbox.addWidget(lbl_desc)

        vbox.addStretch(1)
        hbox.addLayout(vbox, 1)

        self.toggle_btn = CardToggleSwitch(False, self)
        self.toggle_btn.setToolTip(rich_tip)
        self.toggle_btn.clicked.connect(self.toggle_service)
        hbox.addWidget(self.toggle_btn)

        self.setLayout(hbox)
        self.set_active_state(False)

    def mousePressEvent(self, event):
        if event.button() == Qt.MouseButton.LeftButton and self.toggle_btn.isEnabled():
            self.toggle_service()
        else:
            super().mousePressEvent(event)

    def set_active_state(self, active):
        self._active = active
        self.toggle_btn.set_checked(active)

    def toggle_service(self):
        if not self._active and self.req_pkg and self.req_pkg not in INSTALLED_PKGS_CACHE:
            if self.is_user:
                act_part = f"systemctl --user enable --now {self.unit_name}"
                if self.unit_name == "psd.service":
                    act_part = f"psd p >/dev/null 2>&1 || true; {act_part}"
                elif self.unit_name in ["x64-update.timer", "arch-update.timer"]:
                    act_part += "; cp -f /usr/share/applications/x64-update-tray.desktop ~/.config/autostart/ 2>/dev/null || true; (x64-update-tray >/dev/null 2>&1 &)"
            elif self.unit_name == "ufw.service":
                act_part = "if systemctl is-active --quiet sshd; then sudo ufw allow 22/tcp >/dev/null 2>&1 || true; fi && sudo ufw --force enable && sudo systemctl enable --now ufw.service"
            else:
                act_part = f"sudo systemctl enable --now {self.unit_name}"

            body = (
                f"printf '\033[1;31m==> [X64 SERVICE MANAGER]\033[0m El servicio \033[1;37m{self.title}\033[0m requiere instalar el paquete \033[1;33m{self.req_pkg}\033[0m.\n\n'; "
                f"sudo pacman -Sy --needed --overwrite '*' {self.req_pkg} && {act_part}"
            )
            cmd = build_x64_term_cmd(
                f"X64 Service Installer - {self.req_pkg}",
                f"INSTALACIÓN Y ACTIVACIÓN DE SERVICIO ({self.req_pkg})",
                body
            )
            os.system(f"{cmd} &")
            return

        action = "disable --now" if self._active else "enable --now"
        self.toggle_btn.setEnabled(False)
        proc = QProcess(self)

        def _on_svc_done(_exit_code, _exit_status):
            self.toggle_btn.setEnabled(True)
            if self.parent_app:
                self.parent_app.refresh_services_async()
            proc.deleteLater()

        proc.finished.connect(_on_svc_done)

        if self.is_user:
            if self.unit_name == "psd.service" and not self._active:
                subprocess.run(["sh", "-c", "psd p >/dev/null 2>&1 || true"], timeout=2)
            proc.start("systemctl", ["--user", *action.split(), self.unit_name])
            if self.unit_name in ["x64-update.timer", "arch-update.timer"]:
                if not self._active:
                    subprocess.Popen(["sh", "-c", "cp -f /usr/share/applications/x64-update-tray.desktop ~/.config/autostart/ 2>/dev/null || true; x64-update-tray &"])
                else:
                    subprocess.Popen(["sh", "-c", "rm -f ~/.config/autostart/x64-update-tray.desktop 2>/dev/null || true; killall x64-update-tray 2>/dev/null || true"])
        elif self.unit_name == "ufw.service":
            ufw_cmd = (
                "ufw disable && systemctl disable --now ufw.service"
                if self._active else "if systemctl is-active --quiet sshd; then ufw allow 22/tcp >/dev/null 2>&1 || true; fi && ufw --force enable && systemctl enable --now ufw.service"
            )
            proc.start("pkexec", ["sh", "-c", ufw_cmd])
        elif self.unit_name == "systemd-oomd.service":
            oomd_cmd = (
                "mkdir -p /etc/systemd/system/system.slice.d /etc/systemd/system/user-.slice.d && "
                "ln -sf /dev/null /etc/systemd/system/system.slice.d/10-oomd-per-slice-defaults.conf && "
                "ln -sf /dev/null /etc/systemd/system/user-.slice.d/10-oomd-per-slice-defaults.conf && "
                "systemctl daemon-reload && systemctl disable --now systemd-oomd.service systemd-oomd.socket"
                if self._active else
                "rm -f /etc/systemd/system/system.slice.d/10-oomd-per-slice-defaults.conf "
                "/etc/systemd/system/user-.slice.d/10-oomd-per-slice-defaults.conf && "
                "systemctl daemon-reload && systemctl enable --now systemd-oomd.service"
            )
            proc.start("pkexec", ["sh", "-c", oomd_cmd])
        else:
            proc.start("pkexec", ["systemctl", *action.split(), self.unit_name])


def get_gaming_gpu_support_pkgs():
    """Detecta los drivers 64-bit instalados y devuelve sus pares 32-bit exactos para gaming."""
    support = ["lib32-mesa", "ttf-liberation"]
    vk_map = {
        "nvidia-utils": "lib32-nvidia-utils",
        "nvidia-580xx-utils": "lib32-nvidia-580xx-utils",
        "nvidia-550xx-utils": "lib32-nvidia-550xx-utils",
        "nvidia-535xx-utils": "lib32-nvidia-535xx-utils",
        "nvidia-470xx-utils": "lib32-nvidia-470xx-utils",
        "nvidia-390xx-utils": "lib32-nvidia-390xx-utils",
        "vulkan-radeon": "lib32-vulkan-radeon",
        "vulkan-intel": "lib32-vulkan-intel",
        "vulkan-virtio": "lib32-vulkan-virtio",
        "vulkan-nouveau": "lib32-vulkan-nouveau",
        "vulkan-swrast": "lib32-vulkan-swrast",
    }
    found_vk = False
    for pkg64, pkg32 in vk_map.items():
        if pkg64 in INSTALLED_PKGS_CACHE:
            support.append(pkg32)
            found_vk = True
    for pkg in INSTALLED_PKGS_CACHE:
        if pkg.startswith("nvidia-") and pkg.endswith("-utils"):
            support.append(f"lib32-{pkg}")
            found_vk = True
    if not found_vk:
        gpu_up = STATIC_HW.get("gpu_model", "").upper()
        if "NVIDIA" in gpu_up:
            support.extend(["nvidia-utils", "lib32-nvidia-utils"])
        elif "AMD" in gpu_up or "RADEON" in gpu_up or "ATI" in gpu_up:
            support.extend(["vulkan-radeon", "lib32-vulkan-radeon"])
        elif "INTEL" in gpu_up:
            support.extend(["vulkan-intel", "lib32-vulkan-intel"])
        elif "VIRTIO" in gpu_up or "QEMU" in gpu_up or "RED HAT" in gpu_up:
            support.extend(["vulkan-virtio", "lib32-vulkan-virtio"])
        else:
            support.extend(["vulkan-swrast", "lib32-vulkan-swrast"])
    return " ".join(dict.fromkeys(support))


class GamingInstallCard(QFrame):
    def __init__(self, title, desc, check_pkg, install_pkgs, icon_name, is_suite=False, post_cmd=None, launch_cmd=None):
        super().__init__()
        self.title = title
        self.check_pkg = check_pkg
        self.install_pkgs = install_pkgs
        self.is_suite = is_suite
        self.post_cmd = post_cmd
        self.launch_cmd = launch_cmd
        self.setObjectName("GamingCard")
        self.setAttribute(Qt.WidgetAttribute.WA_Hover, True)
        self.setAttribute(Qt.WidgetAttribute.WA_StyledBackground, True)
        self.setFixedHeight(80 if is_suite else 74)
        self.setMinimumWidth(0)
        self.setSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Fixed)
        pkg_badge = " Gaming Suite " if is_suite else check_pkg.split()[0].split("|")[0]
        self._rich_tip = format_rich_tooltip(title, pkg_badge, guide_key=check_pkg, fallback_desc=desc)
        self.setToolTip(self._rich_tip)

        border_color = "rgba(220, 38, 38, 0.35)" if is_suite else "rgba(255, 255, 255, 0.065)"
        bg_color = "rgba(220, 38, 38, 0.06)" if is_suite else "rgba(255, 255, 255, 0.025)"
        self.setStyleSheet(f"""
            QFrame#GamingCard {{
                background-color: {bg_color};
                border-radius: 12px;
                border: 1px solid {border_color};
            }}
            QFrame#GamingCard:hover {{
                background-color: rgba(255, 255, 255, 0.06);
                border: 1px solid rgba(220, 38, 38, 0.55);
            }}
        """)

        hbox = QHBoxLayout()
        hbox.setContentsMargins(16 if is_suite else 12, 3, 16 if is_suite else 12, 3)
        hbox.setSpacing(12)

        icon_box = QFrame()
        icon_box.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        box_sz = 42 if is_suite else 36
        icon_box.setFixedSize(box_sz, box_sz)
        if is_suite:
            icon_box.setStyleSheet("""
                QFrame {
                    background-color: rgba(220, 38, 38, 0.15);
                    border: 1px solid rgba(220, 38, 38, 0.45);
                    border-radius: 10px;
                }
            """)
        else:
            icon_box.setStyleSheet("""
                QFrame {
                    background-color: rgba(220, 38, 38, 0.10);
                    border: 1px solid rgba(220, 38, 38, 0.28);
                    border-radius: 10px;
                }
            """)
        ibox_layout = QVBoxLayout(icon_box)
        ibox_layout.setContentsMargins(0, 0, 0, 0)
        ibox_layout.setAlignment(Qt.AlignmentFlag.AlignCenter)

        icon_label = QLabel()
        icon_label.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        pix = make_svg_pixmap(icon_name, 22 if is_suite else 19, accent="#ff3333")
        if not pix.isNull():
            icon_label.setPixmap(pix)
        else:
            icon_label.setText("🎮")
            icon_label.setStyleSheet("font-size: 18px; background: transparent; border: none;")
        icon_label.setStyleSheet("background: transparent; border: none;")
        ibox_layout.addWidget(icon_label)
        hbox.addWidget(icon_box)

        vbox = QVBoxLayout()
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(2)
        vbox.addStretch(1)

        lbl_title = FitLabel(title)
        lbl_title.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        lbl_title.setMinimumWidth(0)
        lbl_title.setSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Preferred)
        t_sz = 14.5 if is_suite else 12.5
        lbl_title.setStyleSheet(f"color: #ffffff; font-weight: bold; font-size: {t_sz}px; border: none; background: transparent;")
        vbox.addWidget(lbl_title)

        lbl_desc = QLabel(desc)
        lbl_desc.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        lbl_desc.setMinimumWidth(0)
        lbl_desc.setSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Preferred)
        d_sz = 11 if is_suite else 10.2
        lbl_desc.setStyleSheet(f"color: #aaaaaa; font-size: {d_sz}px; border: none; background: transparent;")
        lbl_desc.setWordWrap(True)
        _hfw = lbl_desc.sizePolicy()
        _hfw.setHeightForWidth(True)
        lbl_desc.setSizePolicy(_hfw)
        vbox.addWidget(lbl_desc)

        vbox.addStretch(1)
        hbox.addLayout(vbox, 1)

        self.btn_action = QPushButton()
        self.btn_action.setFixedHeight(32 if is_suite else 27)
        self.btn_action.setMinimumWidth(126 if is_suite else 98)
        self.btn_action.setCursor(Qt.CursorShape.PointingHandCursor)
        self.btn_action.setToolTip(self._rich_tip)
        self.btn_action.clicked.connect(self.install_action)
        hbox.addWidget(self.btn_action)

        self.setLayout(hbox)
        self.setCursor(Qt.CursorShape.PointingHandCursor)
        self.refresh_state()

    def mousePressEvent(self, event):
        if event.button() == Qt.MouseButton.LeftButton:
            self.install_action()
        else:
            super().mousePressEvent(event)

    def is_installed(self):
        for group in self.check_pkg.split():
            alts = group.split("|")
            if not any(a in INSTALLED_PKGS_CACHE for a in alts):
                return False
        return True

    def refresh_state(self):
        if self.is_installed():
            if self.launch_cmd:
                self.btn_action.setText(tr("OPEN ↗"))
            else:
                self.btn_action.setText(tr("INSTALLED ✓"))
            self.btn_action.setToolTip(self._rich_tip)
            self.btn_action.setStyleSheet("""
                QPushButton {
                    background-color: rgba(255, 255, 255, 0.05);
                    color: #e4e4e7;
                    border: 1px solid rgba(255, 255, 255, 0.14);
                    border-radius: 8px;
                    padding: 0 12px;
                    font-weight: bold;
                    font-size: 11px;
                }
                QPushButton:hover {
                    background-color: rgba(255, 255, 255, 0.09);
                    border: 1px solid rgba(255, 255, 255, 0.25);
                    color: #ffffff;
                }
            """)
        else:
            label = tr("INSTALL SUITE") if self.is_suite else tr("INSTALL")
            self.btn_action.setText(label)
            self.btn_action.setStyleSheet("""
                QPushButton {
                    background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #cc0000, stop:1 #800000);
                    color: #ffffff;
                    border: 1px solid #ff1a1a;
                    border-radius: 8px;
                    padding: 0 12px;
                    font-weight: bold;
                    font-size: 11px;
                }
                QPushButton:hover {
                    background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #ff1a1a, stop:1 #a30000);
                }
            """)

    def install_action(self):
        if self.is_installed():
            if self.launch_cmd:
                subprocess.Popen(self.launch_cmd, shell=True)
            return

        needs_gpu_libs = any(k in self.install_pkgs for k in ("cachyos-gaming", "steam", "lutris", "heroic", "faugus"))
        extra_gpu_pkgs = f"{get_gaming_gpu_support_pkgs()} " if needs_gpu_libs else ""
        body = (
            f"printf '\\033[1;31m==> [X64 GAMING CENTER]\\033[0m Instalando componente: \\033[1;37m{self.title}\\033[0m\\n\\n'; "
            f"if ! grep -q '^\\[multilib\\]' /etc/pacman.conf; then "
            f"  sudo sed -i '/^#\\[multilib\\]/,/^#Include/ s/^#//' /etc/pacman.conf; "
            f"fi; "
            f"sudo pacman -Syu --needed --overwrite '*' {extra_gpu_pkgs}{self.install_pkgs}" + (f" && {{ {self.post_cmd}; }}" if self.post_cmd else "")
        )
        cmd = build_x64_term_cmd("X64 LIOS Gaming Installer", "INSTALADOR MODULAR DE GAMING", body)
        os.system(f"{cmd} &")


class MiniToggleSwitch(QWidget):
    def __init__(self, checked=True, parent=None):
        super().__init__(parent)
        self._checked = checked
        self.setFixedSize(34, 18)

    def set_checked(self, checked):
        self._checked = bool(checked)
        self.update()

    def paintEvent(self, _event):
        p = QPainter(self)
        p.setRenderHint(QPainter.RenderHint.Antialiasing)
        if self._checked:
            p.setPen(QPen(QColor("#ff3333"), 1))
            p.setBrush(QBrush(QColor("#b80000")))
            p.drawRoundedRect(1, 1, 32, 16, 8, 8)
            p.setPen(Qt.PenStyle.NoPen)
            p.setBrush(QBrush(QColor("#ffffff")))
            p.drawEllipse(18, 3, 12, 12)
        else:
            p.setPen(QPen(QColor("#383842"), 1))
            p.setBrush(QBrush(QColor("#1a1a20")))
            p.drawRoundedRect(1, 1, 32, 16, 8, 8)
            p.setPen(Qt.PenStyle.NoPen)
            p.setBrush(QBrush(QColor("#777782")))
            p.drawEllipse(4, 3, 12, 12)
        p.end()


class NavButton(QPushButton):
    def __init__(self, title, icon_name, index, parent_app):
        super().__init__()
        self.index = index
        self.icon_name = icon_name
        self.parent_app = parent_app
        self.setAttribute(Qt.WidgetAttribute.WA_Hover, True)
        self.setAttribute(Qt.WidgetAttribute.WA_StyledBackground, True)
        self.setFixedHeight(40)
        self.setCursor(Qt.CursorShape.PointingHandCursor)

        hbox = QHBoxLayout()
        hbox.setContentsMargins(12, 0, 10, 0)
        hbox.setSpacing(10)

        icon_lbl = QLabel()
        icon_lbl.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        self.icon_lbl = icon_lbl
        pix = make_svg_pixmap(icon_name, 19, accent="#ef4444")
        if not pix.isNull():
            icon_lbl.setPixmap(pix)
        icon_lbl.setStyleSheet("background: transparent; border: none;")
        hbox.addWidget(icon_lbl)

        text_lbl = QLabel(title)
        text_lbl.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        text_lbl.setStyleSheet("color: #a1a1aa; font-weight: bold; font-size: 13px; background: transparent; border: none;")
        self.text_lbl = text_lbl
        hbox.addWidget(text_lbl)
        hbox.addStretch(1)

        self.setLayout(hbox)
        self.clicked.connect(self.activate)
        self.set_inactive_style()

    def set_active_style(self):
        self.setStyleSheet("""
            NavButton {
                background-color: rgba(220, 38, 38, 0.16);
                border-radius: 8px;
                border: none;
                border-left: 3px solid #ef4444;
                border-top-left-radius: 4px;
                border-bottom-left-radius: 4px;
            }
        """)
        pix = make_svg_pixmap(self.icon_name, 19, accent="#ff3333")
        if not pix.isNull():
            self.icon_lbl.setPixmap(pix)
        self.text_lbl.setStyleSheet("color: #ffffff; font-weight: bold; font-size: 13px; background: transparent; border: none;")

    def set_inactive_style(self):
        self.setStyleSheet("""
            NavButton {
                background-color: transparent;
                border-radius: 8px;
                border: none;
            }
            NavButton:hover {
                background-color: rgba(255, 255, 255, 0.05);
            }
        """)
        pix = make_svg_pixmap(self.icon_name, 19, accent="#ef4444")
        if not pix.isNull():
            self.icon_lbl.setPixmap(pix)
        self.text_lbl.setStyleSheet("color: #a1a1aa; font-weight: bold; font-size: 13px; background: transparent; border: none;")

    def activate(self):
        self.parent_app.change_page(self.index)


class TelemetryCard(QFrame):
    def __init__(self, category, model_text, sub_text, icon_name, initial_val="0%", initial_pct=0, on_click=None):
        super().__init__()
        self.on_click = on_click
        self.setObjectName("TelemetryCard")
        self.setAttribute(Qt.WidgetAttribute.WA_Hover, True)
        self.setAttribute(Qt.WidgetAttribute.WA_StyledBackground, True)
        if self.on_click:
            self.setCursor(Qt.CursorShape.PointingHandCursor)
        self.setFixedHeight(112)
        self.setMinimumWidth(0)
        self.setSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Fixed)
        self.setStyleSheet("""
            QFrame#TelemetryCard {
                background-color: rgba(255, 255, 255, 0.025);
                border-radius: 12px;
                border: 1px solid rgba(255, 255, 255, 0.065);
            }
            QFrame#TelemetryCard:hover {
                background-color: rgba(255, 255, 255, 0.05);
                border: 1px solid rgba(220, 38, 38, 0.50);
            }
        """)

        hbox = QHBoxLayout()
        hbox.setContentsMargins(20, 14, 20, 14)
        hbox.setSpacing(18)

        icon_box = QFrame()
        icon_box.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        icon_box.setFixedSize(54, 54)
        icon_box.setStyleSheet("""
            QFrame {
                background-color: rgba(220, 38, 38, 0.10);
                border: 1px solid rgba(220, 38, 38, 0.28);
                border-radius: 10px;
            }
        """)
        ibox_layout = QVBoxLayout()
        ibox_layout.setContentsMargins(0, 0, 0, 0)
        ibox_layout.setAlignment(Qt.AlignmentFlag.AlignCenter)
        icon_lbl = QLabel()
        icon_lbl.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        pix = make_svg_pixmap(icon_name, 28)
        if not pix.isNull():
            icon_lbl.setPixmap(pix)
        else:
            icon_lbl.setText("⚡")
            icon_lbl.setStyleSheet("font-size: 22px; background: transparent; border: none;")
        icon_lbl.setStyleSheet("background: transparent; border: none;")
        ibox_layout.addWidget(icon_lbl)
        icon_box.setLayout(ibox_layout)
        hbox.addWidget(icon_box)

        vbox = QVBoxLayout()
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(4)

        top_row = QHBoxLayout()
        top_row.setContentsMargins(0, 0, 0, 0)
        self.lbl_cat = QLabel(category)
        self.lbl_cat.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        self.lbl_cat.setStyleSheet("color: #9ca3af; font-size: 11px; font-weight: bold; letter-spacing: 0.6px; background: transparent; border: none;")
        self.lbl_val = QLabel(initial_val)
        self.lbl_val.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        self.lbl_val.setStyleSheet("color: #ffffff; font-size: 12.5px; font-weight: bold; background: transparent; border: none;")
        top_row.addWidget(self.lbl_cat)
        top_row.addStretch(1)
        top_row.addWidget(self.lbl_val)
        vbox.addLayout(top_row)

        self.lbl_model = QLabel(model_text)
        self.lbl_model.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        self.lbl_model.setMinimumWidth(0)
        self.lbl_model.setSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Preferred)
        self.lbl_model.setStyleSheet("color: #ffffff; font-size: 14px; font-weight: bold; background: transparent; border: none;")
        vbox.addWidget(self.lbl_model)

        sub_row = QHBoxLayout()
        sub_row.setContentsMargins(0, 0, 0, 0)
        sub_row.setSpacing(8)
        self.lbl_sub = QLabel(sub_text)
        self.lbl_sub.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        self.lbl_sub.setMinimumWidth(0)
        self.lbl_sub.setSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Preferred)
        self.lbl_sub.setStyleSheet("color: #a1a1aa; font-size: 12px; background: transparent; border: none;")
        sub_row.addWidget(self.lbl_sub, 1)

        self.action_badge = None
        if self.on_click:
            self.action_badge = QPushButton()
            self.action_badge.setCursor(Qt.CursorShape.PointingHandCursor)
            self.action_badge.setFixedHeight(22)
            self.action_badge.clicked.connect(self.on_click)
            sub_row.addWidget(self.action_badge)

        vbox.addLayout(sub_row)

        self.bar = QProgressBar()
        self.bar.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        self.bar.setFixedHeight(6)
        self.bar.setRange(0, 100)
        self.bar.setValue(initial_pct)
        self.bar.setTextVisible(False)
        self.bar.setStyleSheet("""
            QProgressBar {
                background-color: #18181f;
                border: none;
                border-radius: 3px;
            }
            QProgressBar::chunk {
                background: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 #991b1b, stop:1 #ef4444);
                border-radius: 3px;
            }
        """)
        vbox.addWidget(self.bar)

        hbox.addLayout(vbox, 1)
        self.setLayout(hbox)

    def set_sched_badge(self, sched_name):
        if not self.action_badge:
            return
        self.action_badge.setText(f"● {sched_name.upper()}  •  {tr('Configure ➔')}")
        self.action_badge.setStyleSheet("""
            QPushButton {
                color: #f4f4f5;
                background-color: rgba(220, 38, 38, 0.12);
                border: 1px solid rgba(220, 38, 38, 0.38);
                border-radius: 6px;
                padding: 0 9px;
                font-weight: bold;
                font-size: 10.5px;
            }
            QPushButton:hover {
                background-color: rgba(220, 38, 38, 0.24);
                border: 1px solid #ef4444;
                color: #ffffff;
            }
        """)

    def mousePressEvent(self, event):
        if self.on_click and event.button() == Qt.MouseButton.LeftButton:
            self.on_click()
        else:
            super().mousePressEvent(event)

    def update_telemetry(self, val_str, pct, sub_str=None):
        self.lbl_val.setText(val_str)
        self.bar.setValue(max(3, min(100, int(pct))))
        if sub_str is not None:
            self.lbl_sub.setText(sub_str)


class CommunityPillCard(QPushButton):
    def __init__(self, title, desc, badge_text, icon_name, url=None):
        super().__init__()
        self.url = url
        self.setAttribute(Qt.WidgetAttribute.WA_Hover, True)
        self.setAttribute(Qt.WidgetAttribute.WA_StyledBackground, True)
        self.setFixedHeight(112)
        self.setMinimumWidth(0)
        self.setSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Fixed)
        self.setCursor(Qt.CursorShape.PointingHandCursor if self.url else Qt.CursorShape.ArrowCursor)
        self.setToolTip(f"<b>{title}</b><br>{desc}")
        hover_border = "rgba(220, 38, 38, 0.55)" if self.url else "rgba(255, 255, 255, 0.14)"
        hover_bg = "rgba(255, 255, 255, 0.055)" if self.url else "rgba(255, 255, 255, 0.038)"
        self.setStyleSheet(f"""
            CommunityPillCard {{
                background-color: rgba(255, 255, 255, 0.025);
                border-radius: 12px;
                border: 1px solid rgba(255, 255, 255, 0.065);
                text-align: left;
            }}
            CommunityPillCard:hover {{
                background-color: {hover_bg};
                border: 1px solid {hover_border};
            }}
        """)

        hbox = QHBoxLayout()
        hbox.setContentsMargins(16, 14, 16, 14)
        hbox.setSpacing(14)

        icon_box = QFrame()
        icon_box.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        icon_box.setFixedSize(48, 48)
        icon_box.setStyleSheet("""
            QFrame {
                background-color: rgba(220, 38, 38, 0.10);
                border: 1px solid rgba(220, 38, 38, 0.28);
                border-radius: 10px;
            }
        """)
        ibox_layout = QVBoxLayout()
        ibox_layout.setContentsMargins(0, 0, 0, 0)
        ibox_layout.setAlignment(Qt.AlignmentFlag.AlignCenter)
        icon_lbl = QLabel()
        icon_lbl.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        pix = make_svg_pixmap(icon_name, 24)
        if not pix.isNull():
            icon_lbl.setPixmap(pix)
        icon_lbl.setStyleSheet("background: transparent; border: none;")
        ibox_layout.addWidget(icon_lbl)
        icon_box.setLayout(ibox_layout)
        hbox.addWidget(icon_box, 0, Qt.AlignmentFlag.AlignTop)

        vbox = QVBoxLayout()
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(4)

        lbl_title = FitLabel(title)
        lbl_title.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        lbl_title.setMinimumWidth(0)
        lbl_title.setSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Preferred)
        lbl_title.setStyleSheet("color: #ffffff; font-weight: bold; font-size: 15px; background: transparent; border: none;")
        vbox.addWidget(lbl_title)

        lbl_desc = QLabel(desc)
        lbl_desc.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        lbl_desc.setMinimumWidth(0)
        lbl_desc.setSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Preferred)
        lbl_desc.setStyleSheet("color: #a0a0a0; font-size: 12px; line-height: 1.3; background: transparent; border: none;")
        lbl_desc.setWordWrap(True)
        _hfw = lbl_desc.sizePolicy()
        _hfw.setHeightForWidth(True)
        lbl_desc.setSizePolicy(_hfw)
        vbox.addWidget(lbl_desc)

        vbox.addStretch(1)

        lbl_badge = QLabel(badge_text)
        lbl_badge.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        if self.url:
            lbl_badge.setMinimumWidth(0)
            lbl_badge.setSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Preferred)
            lbl_badge.setStyleSheet("color: #ef4444; font-size: 11px; font-weight: bold; background: transparent; border: none;")
            vbox.addWidget(lbl_badge)
        else:
            lbl_badge.setSizePolicy(QSizePolicy.Policy.Maximum, QSizePolicy.Policy.Preferred)
            lbl_badge.setStyleSheet("""
                color: #cbd5e1;
                background-color: rgba(255, 255, 255, 0.05);
                border: 1px solid rgba(255, 255, 255, 0.14);
                border-radius: 5px;
                padding: 2px 9px;
                font-size: 10px;
                font-weight: bold;
                letter-spacing: 0.9px;
            """)
            vbox.addWidget(lbl_badge, 0, Qt.AlignmentFlag.AlignLeft)

        hbox.addLayout(vbox, 1)
        self.setLayout(hbox)
        if self.url:
            self.clicked.connect(self.open_link)

    def open_link(self):
        if not self.url:
            return
        try:
            subprocess.Popen(["xdg-open", self.url], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
        except Exception:
            webbrowser.open(self.url)


class X64Hello(QWidget):
    def __init__(self):
        super().__init__()
        self.nav_buttons = []
        self.service_cards = []
        self.gaming_cards = []
        self._svc_worker = None
        self._prev_cpu_Idle = 0
        self._prev_cpu_Total = 0
        self.initUI()

        self.pacman_watcher = QFileSystemWatcher(["/var/lib/pacman/local"], self)
        self.pacman_watcher.directoryChanged.connect(self.on_pacman_db_changed)

        self.hw_timer = QTimer(self)
        self.hw_timer.timeout.connect(self.update_hardware_telemetry)
        self.hw_timer.start(1500)
        self.update_hardware_telemetry(force=True)

        self.refresh_services_async()

    def update_hardware_telemetry(self, force=False):
        if not force and self.stacked_widget.currentIndex() != 0:
            return
        try:
            with open("/proc/stat", "r") as f:
                fields = [int(x) for x in f.readline().split()[1:]]
            idle = fields[3] + (fields[4] if len(fields) > 4 else 0)
            total = sum(fields)
            diff_total = total - self._prev_cpu_Total
            diff_idle = idle - self._prev_cpu_Idle
            self._prev_cpu_Total = total
            self._prev_cpu_Idle = idle
            cpu_pct = 0.0
            if diff_total > 0:
                cpu_pct = max(0.0, min(100.0, 100.0 * (diff_total - diff_idle) / diff_total))
            active_sched = get_active_cpu_scheduler()
            kernel_rel = platform.release().replace('-cachyos', '')
            self.card_cpu.update_telemetry(
                f"{cpu_pct:.1f}%  •  {STATIC_HW['cpu_cores']} {tr('Threads')}",
                cpu_pct,
                f"Kernel: {kernel_rel}"
            )
            self.card_cpu.set_sched_badge(active_sched)
        except Exception:
            pass

        try:
            mem = {}
            with open("/proc/meminfo", "r") as f:
                for line in f:
                    parts = line.split(":")
                    if len(parts) == 2:
                        mem[parts[0].strip()] = int(parts[1].split()[0])
            total_kb = mem.get("MemTotal", 1)
            avail_kb = mem.get("MemAvailable", total_kb)
            used_kb = max(0, total_kb - avail_kb)
            ram_pct = (used_kb / total_kb) * 100.0
            used_gb = used_kb / (1024 * 1024)
            total_gb = total_kb / (1024 * 1024)
            self.card_ram.update_telemetry(
                f"{used_gb:.1f} / {total_gb:.1f} GB ({ram_pct:.0f}%)",
                ram_pct
            )
        except Exception:
            pass

        try:
            st = os.statvfs("/")
            total_b = st.f_blocks * st.f_frsize
            free_b = st.f_bavail * st.f_frsize
            used_b = max(0, total_b - free_b)
            disk_pct = (used_b / total_b) * 100.0 if total_b > 0 else 0
            used_d_gb = used_b / (1024 ** 3)
            total_d_gb = total_b / (1024 ** 3)

            uptime_str = "0m"
            with open("/proc/uptime", "r") as f:
                up_sec = int(float(f.read().split()[0]))
                hrs = up_sec // 3600
                mins = (up_sec % 3600) // 60
                uptime_str = f"{hrs}h {mins}m" if hrs > 0 else f"{mins}m"

            self.card_disk.update_telemetry(
                f"{used_d_gb:.1f} / {total_d_gb:.1f} GB ({disk_pct:.0f}%)",
                disk_pct,
                f"{tr('Filesystem')} {STATIC_HW['root_fs']}  •  {tr('Uptime')}: {uptime_str}"
            )
        except Exception:
            pass

    def refresh_services_async(self):
        if self._svc_worker and self._svc_worker.isRunning():
            return
        sys_units = list(dict.fromkeys(c.unit_name for c in self.service_cards if not c.is_user))
        user_units = list(dict.fromkeys(c.unit_name for c in self.service_cards if c.is_user))
        worker = ServiceStatusWorker(sys_units, user_units)
        self._svc_worker = worker
        _BG_WORKERS.add(worker)
        worker.status_ready.connect(self.on_services_status)
        worker.finished.connect(lambda w=worker: _BG_WORKERS.discard(w))
        worker.start()

    def open_dns_dialog(self):
        self.change_page(2)

    def open_scx_dialog(self):
        self.change_page(1)

    def set_hero_pill_state(self, pill, name, is_active):
        pill.setTextFormat(Qt.TextFormat.RichText)
        if is_active:
            pill.setText(f"<span style='color:#ef4444;'>●</span>&nbsp;&nbsp;{name}: <span style='color:#ffffff;'>{tr('ACTIVE')}</span>")
            pill.setStyleSheet("""
                color: #ffffff; background-color: rgba(220, 38, 38, 0.10);
                border: 1px solid rgba(239, 68, 68, 0.38); border-radius: 6px;
                font-size: 10.5px; font-weight: bold; padding: 3px 10px;
            """)
        else:
            pill.setText(f"<span style='color:#52525b;'>○</span>&nbsp;&nbsp;{name}: <span style='color:#71717a;'>{tr('INACTIVE')}</span>")
            pill.setStyleSheet("""
                color: #a1a1aa; background-color: rgba(255, 255, 255, 0.035);
                border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 6px;
                font-size: 10.5px; font-weight: bold; padding: 3px 10px;
            """)

    def on_services_status(self, status_dict):
        for card in self.service_cards:
            if card.unit_name in status_dict:
                card.set_active_state(status_dict[card.unit_name])
        if hasattr(self, "pill_falcond") and "falcond.service" in status_dict:
            self.set_hero_pill_state(self.pill_falcond, "FALCOND", status_dict["falcond.service"])
        if hasattr(self, "pill_ananicy") and "ananicy-cpp.service" in status_dict:
            self.set_hero_pill_state(self.pill_ananicy, "ANANICY-CPP", status_dict["ananicy-cpp.service"])
        if hasattr(self, "pill_ufw") and "ufw.service" in status_dict:
            self.set_hero_pill_state(self.pill_ufw, tr("FIREWALL UFW"), status_dict["ufw.service"])

    def on_pacman_db_changed(self, _path=None):
        reload_installed_pkgs_cache()
        for card in self.gaming_cards:
            card.refresh_state()
        self.refresh_services_async()
        QTimer.singleShot(1500, self.refresh_services_async)

    def initUI(self):
        self.setObjectName("X64HelloRoot")
        self.setWindowTitle('X64 LIOS - Hello')
        self.setFixedSize(1250, 720)
        self.setStyleSheet("""
            QWidget#X64HelloRoot {
                background-color: #080808;
            }
            QToolTip {
                background-color: #141419;
                color: #f2f2f2;
                border: 1px solid #cc0000;
                border-radius: 6px;
                padding: 6px 10px;
                font-size: 12px;
            }
        """)

        self.main_layout = QHBoxLayout()
        self.main_layout.setContentsMargins(0, 0, 0, 0)
        self.main_layout.setSpacing(0)
        self.setLayout(self.main_layout)

        self.build_ui(initial_page=0)

    def build_ui(self, initial_page=0):
        while self.main_layout.count():
            item = self.main_layout.takeAt(0)
            w = item.widget()
            if w is not None:
                w.setParent(None)
                w.deleteLater()

        self.nav_buttons = []
        self.service_cards = []
        self.gaming_cards = []

        sidebar = QFrame()
        sidebar.setFixedWidth(270)
        sidebar.setStyleSheet("""
            QFrame {
                background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #050505, stop:1 #110000);
                border-right: 1px solid #1a1a1a;
            }
        """)
        sidebar_layout = QVBoxLayout()
        sidebar_layout.setContentsMargins(20, 24, 20, 18)
        sidebar.setLayout(sidebar_layout)

        logo_label = QLabel()
        pixmap = QPixmap(LOGO_PATH)
        if not pixmap.isNull():
            logo_label.setPixmap(pixmap.scaled(120, 120, Qt.AspectRatioMode.KeepAspectRatio, Qt.TransformationMode.SmoothTransformation))
        logo_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
        logo_label.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        logo_label.setStyleSheet("background: transparent; border: none;")
        sidebar_layout.addWidget(logo_label)
        sidebar_layout.addSpacing(16)

        nav_vbox = QVBoxLayout()
        nav_vbox.setSpacing(7)

        tabs = [
            (tr("Home"), "home"),
            (tr("CPU & Performance"), "cpu"),
            (tr("Network & Security"), "shield"),
            (tr("Maintenance & Rescue"), "sliders"),
            (tr("Gaming Center"), "gamepad"),
            (tr("Philosophy"), "info")
        ]

        for i, (text, icon) in enumerate(tabs):
            btn = NavButton(text, icon, i, self)
            self.nav_buttons.append(btn)
            nav_vbox.addWidget(btn)

        sidebar_layout.addLayout(nav_vbox)
        sidebar_layout.addStretch(1)

        kernel_ver = platform.release().replace('-cachyos', '')
        arch = platform.machine()
        desktop = os.environ.get("XDG_CURRENT_DESKTOP", "KDE Plasma")
        session_type = os.environ.get("XDG_SESSION_TYPE", "wayland").capitalize()
        hud_text = (
            f"X64 LIOS 2026 ({tr('Installed')})\n"
            f"{tr('Architecture:')} {arch}\n"
            f"Kernel: {kernel_ver}\n"
            f"{tr('Session:')} {desktop} ({session_type})"
        )
        info_label = QLabel(hud_text)
        info_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
        info_label.setStyleSheet("color: #8a8a93; font-size: 11.5px; font-weight: bold; line-height: 1.45; background: transparent; border: none;")
        sidebar_layout.addWidget(info_label)
        sidebar_layout.addSpacing(10)

        sidebar_sep = QFrame()
        sidebar_sep.setFixedHeight(1)
        sidebar_sep.setStyleSheet("background-color: rgba(255, 255, 255, 0.08); border: none;")
        sidebar_layout.addWidget(sidebar_sep)
        sidebar_layout.addSpacing(8)

        self.autostart_btn = QPushButton()
        self.autostart_btn.setFixedHeight(28)
        self.autostart_btn.setCursor(Qt.CursorShape.PointingHandCursor)
        self.autostart_btn.setStyleSheet("""
            QPushButton {
                background-color: transparent;
                border: 1px solid transparent;
                border-radius: 8px;
            }
            QPushButton:hover {
                background-color: rgba(255, 255, 255, 0.035);
            }
        """)
        auto_hbox = QHBoxLayout(self.autostart_btn)
        auto_hbox.setContentsMargins(8, 0, 6, 0)
        auto_hbox.setSpacing(8)

        self.autostart_lbl = QLabel(tr("Launch at startup"))
        self.autostart_lbl.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        auto_hbox.addWidget(self.autostart_lbl)
        auto_hbox.addStretch(1)

        self.autostart_switch = MiniToggleSwitch()
        self.autostart_switch.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        auto_hbox.addWidget(self.autostart_switch)

        self.autostart_btn.clicked.connect(self.toggle_autostart)
        self.update_autostart_btn()
        sidebar_layout.addWidget(self.autostart_btn)
        sidebar_layout.addSpacing(8)

        lang_hbox = QHBoxLayout()
        lang_hbox.addStretch(1)

        current_lang_str = {
            'en': 'English', 'es': 'Español', 'fr': 'Français', 'de': 'Deutsch',
            'it': 'Italiano', 'pt': 'Português', 'ru': 'Русский'
        }.get(_lang_code, 'Español')
        iso_code = _lang_code.upper()

        self.lang_btn = QPushButton()
        self.lang_btn.setCursor(Qt.CursorShape.PointingHandCursor)
        self.lang_btn.setFixedHeight(26)
        self.lang_btn.setStyleSheet("""
            QPushButton {
                background-color: rgba(255, 255, 255, 0.055);
                border: 1px solid rgba(255, 255, 255, 0.13);
                border-radius: 13px;
            }
            QPushButton:hover {
                background-color: rgba(220, 38, 38, 0.15);
                border: 1px solid rgba(239, 68, 68, 0.55);
            }
            QPushButton::menu-indicator { image: none; }
        """)
        pill_hbox = QHBoxLayout(self.lang_btn)
        pill_hbox.setContentsMargins(12, 0, 13, 0)
        pill_hbox.setSpacing(6)

        pill_lbl = QLabel(
            f"<span style='color:#ef4444;'>●</span>&nbsp;&nbsp;"
            f"<span style='color:#f4f4f5; font-weight:bold;'>{current_lang_str}</span>"
            f"&nbsp;&nbsp;<span style='color:#71717a;'>·</span>&nbsp;&nbsp;"
            f"<span style='color:#a1a1aa; font-size:10.5px; font-weight:bold;'>{iso_code}</span>"
        )
        pill_lbl.setTextFormat(Qt.TextFormat.RichText)
        pill_lbl.setAlignment(Qt.AlignmentFlag.AlignCenter)
        pill_lbl.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
        pill_lbl.setStyleSheet("font-size: 11.5px; background: transparent; border: none;")
        pill_hbox.addWidget(pill_lbl)
        pill_lbl.adjustSize()
        self.lang_btn.setFixedWidth(max(136, pill_lbl.sizeHint().width() + 32))

        lang_menu = QMenu(self.lang_btn)
        lang_menu.setCursor(Qt.CursorShape.PointingHandCursor)
        lang_menu.setMinimumWidth(165)
        lang_menu.setStyleSheet("""
            QMenu {
                background-color: #0d0d11;
                color: #e4e4e7;
                border: 1px solid rgba(255, 255, 255, 0.14);
                border-radius: 10px;
                padding: 5px;
            }
            QMenu::item {
                padding: 6px 16px 6px 12px;
                border-radius: 6px;
                font-size: 12px;
                font-weight: 600;
            }
            QMenu::item:selected {
                background-color: rgba(220, 38, 38, 0.22);
                color: #ffffff;
            }
        """)

        langs = [
            ("en", "English"), ("es", "Español"), ("fr", "Français"),
            ("de", "Deutsch"), ("it", "Italiano"), ("pt", "Português"),
            ("ru", "Русский")
        ]

        for code, name in langs:
            prefix = "✓   " if code == _lang_code else "      "
            action = QAction(f"{prefix}{name}  ({code.upper()})", lang_menu)
            action.triggered.connect(lambda checked=False, c=code: self.change_language(c))
            lang_menu.addAction(action)

        self.lang_btn.setMenu(lang_menu)
        lang_hbox.addWidget(self.lang_btn)
        lang_hbox.addStretch(1)
        sidebar_layout.addLayout(lang_hbox)

        self.main_layout.addWidget(sidebar)

        self.stacked_widget = QStackedWidget()
        self.stacked_widget.setStyleSheet("QStackedWidget { background-color: #0f0f0f; }")
        self.main_layout.addWidget(self.stacked_widget)

        self.stacked_widget.addWidget(self.create_page_home())
        self.stacked_widget.addWidget(self.create_page_cpu_perf())
        self.stacked_widget.addWidget(self.create_page_network_sec())
        self.stacked_widget.addWidget(self.create_page_maintenance())
        self.stacked_widget.addWidget(self.create_page_gaming())
        self.stacked_widget.addWidget(self.create_page_philosophy())

        self.change_page(initial_page)

        if hasattr(self, "btn_close") and self.btn_close:
            self.btn_close.deleteLater()
        self.btn_close = QPushButton("✕", self)
        self.btn_close.setFixedSize(30, 30)
        self.btn_close.setCursor(Qt.CursorShape.PointingHandCursor)
        self.btn_close.setToolTip(tr("Close"))
        self.btn_close.setStyleSheet("""
            QPushButton {
                background-color: rgba(255, 255, 255, 0.05);
                color: #a1a1aa;
                border: 1px solid rgba(255, 255, 255, 0.08);
                border-radius: 15px;
                font-size: 13px;
                font-weight: bold;
            }
            QPushButton:hover {
                background-color: #ef4444;
                color: #ffffff;
                border: 1px solid #ef4444;
            }
            QPushButton:pressed {
                background-color: #dc2626;
                color: #ffffff;
                border: 1px solid #dc2626;
            }
        """)
        self.btn_close.clicked.connect(self.close)
        self.btn_close.move(self.width() - 44, 12)
        desktop_name = (os.environ.get("XDG_CURRENT_DESKTOP") or "").lower()
        session_name = (os.environ.get("DESKTOP_SESSION") or "").lower()
        is_tiling = any(k in desktop_name or k in session_name for k in ["hyprland", "niri", "sway", "i3", "river", "bspwm", "qtile", "dwm"])
        self.btn_close.setVisible(is_tiling)
        if is_tiling:
            self.btn_close.raise_()

    def mousePressEvent(self, event):
        if event.button() == Qt.MouseButton.LeftButton:
            if event.pos().y() <= 60 or event.pos().x() <= 270:
                wh = self.window().windowHandle()
                if wh:
                    wh.startSystemMove()
                    event.accept()
                    return
        super().mousePressEvent(event)

    def resizeEvent(self, event):
        super().resizeEvent(event)
        if hasattr(self, "btn_close") and self.btn_close:
            self.btn_close.move(self.width() - 44, 12)
            self.btn_close.raise_()

    def is_autostart_enabled(self):
        return os.path.exists(AUTOSTART_PATH)

    def update_autostart_btn(self):
        enabled = self.is_autostart_enabled()
        if hasattr(self, "autostart_switch"):
            self.autostart_switch.set_checked(enabled)
        if hasattr(self, "autostart_lbl"):
            color = "#f4f4f5" if enabled else "#9ca3af"
            self.autostart_lbl.setStyleSheet(
                f"color: {color}; font-size: 12px; font-weight: bold; background: transparent; border: none;"
            )

    def toggle_autostart(self):
        try:
            if self.is_autostart_enabled():
                os.remove(AUTOSTART_PATH)
            else:
                os.makedirs(os.path.dirname(AUTOSTART_PATH), exist_ok=True)
                if os.path.exists(SYSTEM_DESKTOP_PATH):
                    shutil.copyfile(SYSTEM_DESKTOP_PATH, AUTOSTART_PATH)
                else:
                    with open(AUTOSTART_PATH, "w") as f:
                        f.write(
                            "[Desktop Entry]\n"
                            "Name=X64 LIOS Hello\n"
                            "Exec=/usr/bin/x64-hello\n"
                            "Icon=x64-hello-icon\n"
                            "Terminal=false\n"
                            "Type=Application\n"
                        )
        except Exception:
            pass
        self.update_autostart_btn()

    def create_page_home(self):
        page = QWidget()
        layout = QVBoxLayout()
        layout.setContentsMargins(46, 32, 46, 28)
        layout.setSpacing(0)
        layout.setAlignment(Qt.AlignmentFlag.AlignTop)
        page.setLayout(layout)

        # 1. HERO COMMAND BANNER
        hero = QFrame()
        hero.setObjectName("HeroBanner")
        hero.setFixedHeight(144)
        hero.setStyleSheet("""
            QFrame#HeroBanner {
                background: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 rgba(204, 0, 0, 0.18), stop:0.45 rgba(45, 0, 0, 0.10), stop:1 rgba(255, 255, 255, 0.025));
                border-radius: 14px;
                border: 1px solid rgba(220, 38, 38, 0.38);
                border-left: 4px solid #ef4444;
            }
        """)
        hero_hbox = QHBoxLayout()
        hero_hbox.setContentsMargins(26, 15, 26, 15)
        hero_hbox.setSpacing(20)

        hero_left = QVBoxLayout()
        hero_left.setSpacing(6)

        badges_row = QHBoxLayout()
        badges_row.setSpacing(10)

        self.pill_falcond = QLabel()
        self.set_hero_pill_state(self.pill_falcond, "FALCOND", False)

        self.pill_ananicy = QLabel()
        self.set_hero_pill_state(self.pill_ananicy, "ANANICY-CPP", False)

        self.pill_ufw = QLabel()
        self.set_hero_pill_state(self.pill_ufw, tr("FIREWALL UFW"), False)

        badges_row.addWidget(self.pill_falcond)
        badges_row.addWidget(self.pill_ananicy)
        badges_row.addWidget(self.pill_ufw)
        badges_row.addStretch(1)
        hero_left.addLayout(badges_row)

        hero_title = QLabel(tr("X64 LIOS COMMAND CENTER"))
        hero_title.setStyleSheet("color: #ffffff; font-size: 26px; font-weight: bold; background: transparent; border: none;")
        hero_left.addWidget(hero_title)

        user_name = os.environ.get("USER", "user")
        host_name = platform.node()
        hero_sub = QLabel(f"{tr('Welcome')}, <b style='color:#ffffff;'>{user_name}@{host_name}</b> — {tr('Operating system installed and running at peak hardware capacity.')}")
        hero_sub.setTextFormat(Qt.TextFormat.RichText)
        hero_sub.setWordWrap(True)
        hero_sub.setStyleSheet("color: #aaaaaa; font-size: 13px; background: transparent; border: none;")
        hero_left.addWidget(hero_sub)

        hero_hbox.addLayout(hero_left, 1)

        hero_right = QVBoxLayout()
        hero_right.setSpacing(8)
        hero_right.setAlignment(Qt.AlignmentFlag.AlignVCenter)

        btn_hero_upd = QPushButton(f"⟳   {tr('UPDATE SYSTEM')}")
        btn_hero_upd.setFixedHeight(42)
        btn_hero_upd.setMinimumWidth(210)
        btn_hero_upd.setCursor(Qt.CursorShape.PointingHandCursor)
        btn_hero_upd.setStyleSheet("""
            QPushButton {
                background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #d60000, stop:1 #850000);
                color: #ffffff;
                border: 1px solid #ff3333;
                border-radius: 8px;
                padding: 0 16px;
                font-weight: bold;
                font-size: 12px;
            }
            QPushButton:hover {
                background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #ff1a1a, stop:1 #b30000);
            }
        """)
        upd_cmd = get_system_update_cmd()
        btn_hero_upd.clicked.connect(lambda: os.system(f"{upd_cmd} &"))
        hero_right.addWidget(btn_hero_upd)

        btn_hero_btop = QPushButton(f"◈   {tr('LIVE BTOP MONITOR')}")
        btn_hero_btop.setFixedHeight(36)
        btn_hero_btop.setMinimumWidth(210)
        btn_hero_btop.setCursor(Qt.CursorShape.PointingHandCursor)
        btn_hero_btop.setStyleSheet("""
            QPushButton {
                background-color: rgba(255, 255, 255, 0.05);
                color: #d4d4d8;
                border: 1px solid rgba(255, 255, 255, 0.14);
                border-radius: 8px;
                padding: 0 16px;
                font-weight: bold;
                font-size: 11px;
            }
            QPushButton:hover {
                background-color: rgba(220, 38, 38, 0.18);
                border: 1px solid rgba(220, 38, 38, 0.55);
                color: #ffffff;
            }
        """)
        btop_cmd = "kitty -o remember_window_size=no -o background_opacity=1.0 -o initial_window_width=105c -o initial_window_height=30c --title 'X64 LIOS Resource Monitor' -e btop"
        btn_hero_btop.clicked.connect(lambda: os.system(f"{btop_cmd} &"))
        hero_right.addWidget(btn_hero_btop)

        hero_hbox.addLayout(hero_right)
        hero.setLayout(hero_hbox)
        layout.addWidget(hero)
        layout.addSpacing(20)

        # 2. REAL-TIME HARDWARE TELEMETRY (2x2)
        sec_hw = QLabel(tr("REAL-TIME HARDWARE TELEMETRY"))
        sec_hw.setStyleSheet("color: #ef4444; font-weight: bold; font-size: 11.5px; letter-spacing: 1.4px; background: transparent;")
        layout.addWidget(sec_hw)
        layout.addSpacing(10)

        hw_grid = QGridLayout()
        hw_grid.setSpacing(16)
        hw_grid.setColumnStretch(0, 1)
        hw_grid.setColumnStretch(1, 1)

        kernel_rel = platform.release().replace('-cachyos', '')
        init_sched = get_active_cpu_scheduler()
        self.card_cpu = TelemetryCard(
            tr("PROCESSOR (CPU)"),
            STATIC_HW["cpu_model"],
            f"Kernel: {kernel_rel}",
            "cpu",
            f"0.0%  •  {STATIC_HW['cpu_cores']} {tr('Threads')}",
            8,
            on_click=self.open_scx_dialog
        )
        self.card_cpu.set_sched_badge(init_sched)
        self.card_cpu.setToolTip(f"<b>{tr('PROCESSOR (CPU)')}</b><br>{tr('Click to open X64 CPU Scheduler Selector (BORE / sched_ext).')}")

        ram_sub = tr("ZRAM Active in RAM • Zero Disk Swap") if STATIC_HW["zram_active"] else tr("High-Speed System Memory")
        self.card_ram = TelemetryCard(
            tr("PHYSICAL RAM & ZRAM"),
            "DDR System Memory",
            ram_sub,
            "memory",
            "0.0 / 0.0 GB",
            20
        )
        desktop_env = os.environ.get("XDG_CURRENT_DESKTOP", "KDE Plasma")
        sess_type = os.environ.get("XDG_SESSION_TYPE", "wayland").capitalize()
        self.card_gpu = TelemetryCard(
            tr("GRAPHICS & COMPOSITOR (GPU)"),
            STATIC_HW["gpu_model"],
            tr("Hardware Acceleration Active"),
            "video-display",
            f"{sess_type}  •  {desktop_env}",
            16
        )
        self.card_disk = TelemetryCard(
            tr("ROOT STORAGE (/) & UPTIME"),
            f"NVMe / SSD ({STATIC_HW['root_fs']})",
            f"{tr('Filesystem')} {STATIC_HW['root_fs']}",
            "drive-harddisk",
            "0.0 / 0.0 GB",
            15
        )

        hw_grid.addWidget(self.card_cpu, 0, 0)
        hw_grid.addWidget(self.card_ram, 0, 1)
        hw_grid.addWidget(self.card_gpu, 1, 0)
        hw_grid.addWidget(self.card_disk, 1, 1)
        layout.addLayout(hw_grid)
        layout.addSpacing(22)

        # 3. ECOSYSTEM & COMMUNITY (1x2 Spacious Cards)
        sec_eco = QLabel(tr("OFFICIAL ECOSYSTEM & COMMUNITY"))
        sec_eco.setStyleSheet("color: #ef4444; font-weight: bold; font-size: 11.5px; letter-spacing: 1.4px; background: transparent;")
        layout.addWidget(sec_eco)
        layout.addSpacing(10)

        eco_grid = QGridLayout()
        eco_grid.setSpacing(16)
        eco_grid.setColumnStretch(0, 1)
        eco_grid.setColumnStretch(1, 1)

        btn_docs = CommunityPillCard(
            tr("Official Website & Wiki"),
            tr("Official guides, system modules, and documentation."),
            "https://x64lios.com  ➔",
            "wiki",
            "https://x64lios.com"
        )
        btn_discord = CommunityPillCard(
            tr("Discord Community"),
            tr("Real-time support channels, setups, and community chat."),
            f"◈   {tr('COMING SOON')}",
            "discord",
            None
        )

        eco_grid.addWidget(btn_docs, 0, 0)
        eco_grid.addWidget(btn_discord, 0, 1)
        layout.addLayout(eco_grid)

        return page

    def create_page_cpu_perf(self):
        page = QWidget()
        layout = QVBoxLayout()
        layout.setContentsMargins(36, 12, 36, 10)
        layout.setSpacing(0)
        layout.setAlignment(Qt.AlignmentFlag.AlignTop)
        page.setLayout(layout)

        title = QLabel(tr("CPU, Scheduler & System Performance"))
        title.setStyleSheet("color: #ffffff; font-size: 23px; font-weight: bold; background: transparent;")
        layout.addWidget(title)
        layout.addSpacing(2)

        desc = QLabel(tr("Switch the Linux kernel CPU task scheduler in real time and control background performance daemons."))
        desc.setStyleSheet("color: #a0a0a0; font-size: 11.8px; background: transparent;")
        layout.addWidget(desc)
        layout.addSpacing(8)

        sec1 = QLabel(tr("REAL-TIME CPU SCHEDULER (BORE / SCHED_EXT)"))
        sec1.setStyleSheet("color: #ef4444; font-weight: bold; font-size: 11.2px; letter-spacing: 1.4px; background: transparent;")
        layout.addWidget(sec1)
        layout.addSpacing(4)

        self.scx_panel = ScxSchedulerPanel(self)
        layout.addWidget(self.scx_panel)
        layout.addSpacing(8)

        sec2 = QLabel(tr("PERFORMANCE, MEMORY & STORAGE DAEMONS"))
        sec2.setStyleSheet("color: #ef4444; font-weight: bold; font-size: 11.2px; letter-spacing: 1.4px; background: transparent;")
        layout.addWidget(sec2)
        layout.addSpacing(4)

        perf_services = [
            (tr("FalconD Gaming Daemon"), tr("Dynamic CPU affinity and automatic performance profiles for games."), "falcond.service", "bolt", False, "falcond"),
            (tr("Ananicy-cpp Priority"), tr("Automatic process nice/ionice latency tuning in the background."), "ananicy-cpp.service", "sliders", False, "ananicy-cpp"),
            (tr("Bpftune Kernel Auto-Tuning"), tr("Dynamic eBPF network buffer and sysctl optimization in real time."), "bpftune.service", "cpu", False, "bpftune-git"),
            (tr("Profile-sync-daemon (RAM Browser)"), tr("Moves browser profiles to tmpfs RAM for instant speed and less SSD wear."), "psd.service", "bolt", True, "profile-sync-daemon"),
            (tr("Systemd-OOMD Anti-Freeze"), tr("Prevents hard system freezes under extreme 100% RAM/ZRAM exhaustion."), "systemd-oomd.service", "memory", False, None),
            (tr("NVMe / SSD Trim Timer"), tr("Weekly scheduled block maintenance to preserve SSD lifespan and speed."), "fstrim.timer", "drive-harddisk", False, None),
        ]

        svc_grid = QGridLayout()
        svc_grid.setHorizontalSpacing(10)
        svc_grid.setVerticalSpacing(6)
        for col in range(3):
            svc_grid.setColumnStretch(col, 1)

        for idx, (s_title, s_desc, s_unit, s_icon, s_user, s_pkg) in enumerate(perf_services):
            card = ServiceSwitchCard(s_title, s_desc, s_unit, s_icon, self, is_user=s_user, req_pkg=s_pkg, height=76)
            self.service_cards.append(card)
            svc_grid.addWidget(card, idx // 3, idx % 3)

        layout.addLayout(svc_grid)
        layout.addSpacing(8)

        sec3 = QLabel(tr("HARDWARE SECURITY & KERNEL MITIGATIONS"))
        sec3.setStyleSheet("color: #ef4444; font-weight: bold; font-size: 11.2px; letter-spacing: 1.4px; background: transparent;")
        layout.addWidget(sec3)
        layout.addSpacing(4)

        self.mitigations_card = MitigationsSwitchCard(self)
        layout.addWidget(self.mitigations_card)

        return page

    def create_page_network_sec(self):
        page = QWidget()
        layout = QVBoxLayout()
        layout.setContentsMargins(36, 22, 36, 20)
        layout.setSpacing(0)
        layout.setAlignment(Qt.AlignmentFlag.AlignTop)
        page.setLayout(layout)

        title = QLabel(tr("Network, Low-Latency DNS & Security"))
        title.setStyleSheet("color: #ffffff; font-size: 25px; font-weight: bold; background: transparent;")
        layout.addWidget(title)
        layout.addSpacing(2)

        desc = QLabel(tr("Benchmark DNS ping latency in real time, enable DNS-over-TLS encryption, and manage your firewall."))
        desc.setStyleSheet("color: #a0a0a0; font-size: 12.5px; background: transparent;")
        layout.addWidget(desc)
        layout.addSpacing(14)

        sec1 = QLabel(tr("DNS OPTIMIZER & REAL-TIME PING BENCHMARK"))
        sec1.setStyleSheet("color: #ef4444; font-weight: bold; font-size: 11.5px; letter-spacing: 1.4px; background: transparent;")
        layout.addWidget(sec1)
        layout.addSpacing(8)

        self.dns_panel = DnsOptimizerPanel(self)
        layout.addWidget(self.dns_panel)
        layout.addSpacing(20)

        sec2 = QLabel(tr("FIREWALL, BLUETOOTH & KERNEL NETWORK STACK"))
        sec2.setStyleSheet("color: #ef4444; font-weight: bold; font-size: 11.5px; letter-spacing: 1.4px; background: transparent;")
        layout.addWidget(sec2)
        layout.addSpacing(8)

        net_grid = QGridLayout()
        net_grid.setHorizontalSpacing(14)
        net_grid.setVerticalSpacing(12)
        net_grid.setColumnStretch(0, 1)
        net_grid.setColumnStretch(1, 1)

        card_ufw = ServiceSwitchCard(
            tr("UFW Security Firewall"),
            tr("Active network protection against unauthorized incoming connections."),
            "ufw.service", "shield", self, is_user=False, req_pkg="ufw", height=90
        )
        self.service_cards.append(card_ufw)

        card_bt = ServiceSwitchCard(
            tr("Bluetooth Service"),
            tr("Support for wireless controllers, headsets, and Bluetooth peripherals."),
            "bluetooth.service", "bluetooth", self, is_user=False, req_pkg="bluez", height=90
        )
        self.service_cards.append(card_bt)

        tcp_cc = "BBR"
        try:
            with open("/proc/sys/net/ipv4/tcp_congestion_control", "r") as f:
                tcp_cc = f.read().strip().upper()
        except Exception:
            pass

        card_bbr = KernelStatusCard(
            tr("TCP BBR + Anti-Bufferbloat"),
            tr("Google BBR congestion control, Fair Queueing (fq), and low-latency network buffers active in kernel."),
            f"{tcp_cc} + FQ",
            "bolt",
            height=90,
            guide_key="tcp_bbr"
        )

        card_wifi = KernelStatusCard(
            tr("Wi-Fi Low-Jitter (PowerSave Off)"),
            tr("Wireless power-saving disabled (wifi.powersave = 2) to eliminate ping spikes in online gaming."),
            tr("ACTIVE"),
            "wifi",
            height=90,
            guide_key="wifi_lowjitter"
        )

        net_grid.addWidget(card_ufw, 0, 0)
        net_grid.addWidget(card_bt, 0, 1)
        net_grid.addWidget(card_bbr, 1, 0)
        net_grid.addWidget(card_wifi, 1, 1)
        layout.addLayout(net_grid)
        return page

    def create_page_maintenance(self):
        page = QWidget()
        layout = QVBoxLayout()
        layout.setContentsMargins(36, 20, 36, 16)
        layout.setSpacing(0)
        layout.setAlignment(Qt.AlignmentFlag.AlignTop)
        page.setLayout(layout)

        title = QLabel(tr("System Maintenance & Rescue"))
        title.setStyleSheet("color: #ffffff; font-size: 25px; font-weight: bold; background: transparent;")
        layout.addWidget(title)
        layout.addSpacing(2)

        desc = QLabel(tr("Keep system packages updated, rank fastest mirrors, clean disk cache, and run emergency repair tools."))
        desc.setStyleSheet("color: #a0a0a0; font-size: 12.5px; background: transparent;")
        layout.addWidget(desc)
        layout.addSpacing(14)

        sec1 = QLabel(tr("PREVENTIVE MAINTENANCE & SYSTEM UPDATES"))
        sec1.setStyleSheet("color: #ef4444; font-weight: bold; font-size: 11.5px; letter-spacing: 1.4px; background: transparent;")
        layout.addWidget(sec1)
        layout.addSpacing(8)

        util_grid = QGridLayout()
        util_grid.setHorizontalSpacing(12)
        util_grid.setVerticalSpacing(10)
        for col in range(3):
            util_grid.setColumnStretch(col, 1)

        btn_upd = PremiumButton(
            tr("Update System"),
            tr("Synchronize repositories and upgrade all system packages (pacman -Syu)."),
            "refresh",
            cmd=get_system_update_cmd(),
            height=100,
            guide_key="maint_update"
        )
        btn_mirrors = PremiumButton(
            tr("Rank Fastest Mirrors"),
            tr("Test and select the fastest download servers."),
            "wiki",
            cmd=build_x64_term_cmd(
                "X64 LIOS Mirror Ranking",
                "CLASIFICACIÓN DE ESPEJOS (MIRRORS)",
                "printf '\033[1;31m==> [X64 MIRRORS]\033[0m \033[1;37mAnalizando latencia y velocidad de servidores de descarga...\033[0m\n\n'; sudo cachyos-rate-mirrors"
            ),
            height=100,
            guide_key="maint_mirrors"
        )
        btn_cache = PremiumButton(
            tr("Clean Package Cache"),
            tr("Free up disk space by removing old cached packages (pacman -Sc)."),
            "trash",
            cmd=build_x64_term_cmd(
                "X64 LIOS Cache Cleaner",
                "LIMPIEZA DE CACHÉ DE PAQUETES",
                "printf '\033[1;31m==> [X64 CACHE]\033[0m \033[1;37mLiberando espacio en disco de paquetes antiguos (pacman -Sc)...\033[0m\n\n'; sudo pacman -Sc"
            ),
            height=100,
            guide_key="maint_cache"
        )
        btn_orphans = PremiumButton(
            tr("Remove Orphan Packages"),
            tr("Purge unused dependency packages left behind on your system."),
            "trash",
            cmd=build_x64_term_cmd(
                "X64 LIOS Orphan Cleaner",
                "PURGA DE PAQUETES HUÉRFANOS",
                "printf '\033[1;31m==> [X64 CLEANER]\033[0m \033[1;37mBuscando dependencias huérfanas sin uso...\033[0m\n\n'; orphans=$(pacman -Qtdq); if [ -n \"$orphans\" ]; then sudo pacman -Rns $orphans; else printf '\033[1;32m✓ No hay paquetes huérfanos en el sistema.\033[0m\n'; fi"
            ),
            height=100,
            guide_key="maint_orphans"
        )
        btn_winboat = PremiumButton(
            tr("Install Winboat (Windows Apps)"),
            tr("Run Windows productivity apps seamlessly via container integration."),
            "window-app",
            cmd=build_x64_term_cmd(
                "X64 LIOS Winboat Installer",
                "INSTALADOR DE WINBOAT Y CONTENEDORES",
                "printf '\033[1;31m==> [X64 WINBOAT]\033[0m \033[1;37mInstalando Winboat y motor de contenedores Docker...\033[0m\n\n'; sudo pacman -Sy --needed winboat docker docker-compose && sudo systemctl enable --now docker.socket && sudo gpasswd -a $USER docker"
            ),
            height=100,
            guide_key="maint_winboat"
        )
        card_upd_tray = ServiceSwitchCard(
            tr("LIOS Update Notifier"),
            tr("System tray timer that checks and alerts when new updates are ready."),
            "x64-update.timer", "bell", self, is_user=True, req_pkg="x64-update", height=100
        )
        self.service_cards.append(card_upd_tray)

        util_grid.addWidget(btn_upd, 0, 0)
        util_grid.addWidget(btn_mirrors, 0, 1)
        util_grid.addWidget(btn_cache, 0, 2)
        util_grid.addWidget(btn_orphans, 1, 0)
        util_grid.addWidget(btn_winboat, 1, 1)
        util_grid.addWidget(card_upd_tray, 1, 2)
        layout.addLayout(util_grid)
        layout.addSpacing(20)

        sec2 = QLabel(tr("SYSTEM DOCTOR & EMERGENCY RESCUE"))
        sec2.setStyleSheet("color: #ef4444; font-weight: bold; font-size: 11.5px; letter-spacing: 1.4px; background: transparent;")
        layout.addWidget(sec2)
        layout.addSpacing(8)

        rescue_grid = QGridLayout()
        rescue_grid.setHorizontalSpacing(12)
        rescue_grid.setVerticalSpacing(10)
        for col in range(3):
            rescue_grid.setColumnStretch(col, 1)

        btn_keyrings = PremiumButton(
            tr("Reset Pacman Keyrings"),
            tr("Reinitialize and populate GPG cryptographic keys if package signatures fail."),
            "key",
            cmd=build_x64_term_cmd(
                "X64 LIOS Keyring Reset",
                "RESTABLECIMIENTO DE LLAVES CRIPTOGRÁFICAS (KEYRINGS)",
                "printf '\033[1;31m==> [X64 KEYRINGS]\033[0m \033[1;37mRegenerando depósito de firmas GPG de Pacman...\033[0m\n\n'; sudo rm -rf /etc/pacman.d/gnupg/ && sudo pacman-key --init && sudo pacman-key --populate && sudo pacman-key --recv-keys F3B607488DB35A47 --keyserver keyserver.ubuntu.com && sudo pacman-key --lsign-key F3B607488DB35A47"
            ),
            height=100,
            guide_key="rescue_keyrings"
        )
        btn_unlock = PremiumButton(
            tr("Unlock Pacman Database"),
            tr("Remove /var/lib/pacman/db.lck if a previous update was interrupted."),
            "unlock",
            cmd=build_x64_term_cmd(
                "X64 LIOS Database Unlocker",
                "DESBLOQUEO DE BASE DE DATOS PACMAN",
                "printf '\033[1;31m==> [X64 RESCUE]\033[0m \033[1;37mVerificando estado de /var/lib/pacman/db.lck...\033[0m\n\n'; if [ -f /var/lib/pacman/db.lck ]; then sudo rm -f /var/lib/pacman/db.lck && printf '\033[1;32m✓ Archivo db.lck eliminado. Base de datos desbloqueada.\033[0m\n'; else printf '\033[1;32m✓ La base de datos no está bloqueada (no existe db.lck).\033[0m\n'; fi"
            ),
            height=100,
            guide_key="rescue_unlock"
        )
        btn_reinstall = PremiumButton(
            tr("Reinstall All Native Packages"),
            tr("Force reinstall of all native system packages to repair damaged files."),
            "refresh",
            cmd=build_x64_term_cmd(
                "X64 LIOS System Reinstaller",
                "REINSTALACIÓN COMPLETA DE PAQUETES NATIVOS",
                "printf '\033[1;31m==> [X64 RESCUE]\033[0m \033[1;37mReinstalando todos los paquetes nativos del sistema...\033[0m\n\n'; sudo pacman -Sy $(pacman -Qnq)"
            ),
            height=100,
            guide_key="rescue_reinstall"
        )
        btn_journal = PremiumButton(
            tr("System Boot Error Log"),
            tr("Inspect critical systemd and kernel errors from the current boot (journalctl -p 3 -xb)."),
            "shield",
            cmd=build_x64_term_cmd(
                "X64 LIOS Boot Error Inspector",
                "REGISTRO DE ERRORES CRÍTICOS DEL SISTEMA",
                "printf '\033[1;31m==> [X64 DIAGNOSTICS]\033[0m \033[1;37mAnalizando eventos críticos del kernel y systemd (journalctl -p 3 -xb)...\033[0m\n\n'; out=$(journalctl -p 3 -xb --no-pager); if [ -n \"$out\" ]; then echo \"$out\"; else printf '\033[1;32m✓ Cero errores críticos registrados en este arranque.\033[0m\n'; fi"
            ),
            height=100,
            guide_key="rescue_journal"
        )
        btn_kwin = PremiumButton(
            tr("KWin (Wayland) Debug Console"),
            tr("Open the native KWin Wayland diagnostic inspector for windows and VRR."),
            "bug",
            cmd="/usr/lib/qt6/bin/qdbus org.kde.KWin /KWin org.kde.KWin.showDebugConsole 2>/dev/null || qdbus6 org.kde.KWin /KWin org.kde.KWin.showDebugConsole 2>/dev/null || qdbus org.kde.KWin /KWin org.kde.KWin.showDebugConsole 2>/dev/null || dbus-send --session --dest=org.kde.KWin --type=method_call /KWin org.kde.KWin.showDebugConsole",
            height=100,
            guide_key="rescue_kwin"
        )
        btn_btop = PremiumButton(
            tr("Live Resource Monitor (btop)"),
            tr("Interactive terminal dashboard for CPU frequencies, temperatures, processes, and disk I/O."),
            "gauge",
            cmd="kitty -o remember_window_size=no -o background_opacity=1.0 -o initial_window_width=105c -o initial_window_height=30c --title 'X64 LIOS Resource Monitor' -e btop",
            height=100,
            guide_key="rescue_btop"
        )

        rescue_grid.addWidget(btn_keyrings, 0, 0)
        rescue_grid.addWidget(btn_unlock, 0, 1)
        rescue_grid.addWidget(btn_reinstall, 0, 2)
        rescue_grid.addWidget(btn_journal, 1, 0)
        rescue_grid.addWidget(btn_kwin, 1, 1)
        rescue_grid.addWidget(btn_btop, 1, 2)
        layout.addLayout(rescue_grid)

        return page

    def create_page_gaming(self):
        page = QWidget()
        layout = QVBoxLayout(page)
        layout.setContentsMargins(36, 12, 36, 10)
        layout.setSpacing(0)
        layout.setAlignment(Qt.AlignmentFlag.AlignTop)

        title = QLabel(tr("X64 Gaming Center"))
        title.setStyleSheet("color: #ffffff; font-size: 24px; font-weight: bold; background: transparent;")
        layout.addWidget(title)
        layout.addSpacing(2)

        desc = QLabel(tr("Modular 1-click installation of gaming launchers, compatibility layers, and FPS overlays."))
        desc.setStyleSheet("color: #a0a0a0; font-size: 11.8px; background: transparent;")
        layout.addWidget(desc)
        layout.addSpacing(8)

        # TOP FULL-WIDTH HERO CARD: FULL GAMING SUITE
        suite_card = GamingInstallCard(
            tr("Full X64 Gaming Suite (All-in-One)"),
            tr("Complete arsenal: Steam, Lutris, Heroic, Faugus, LACT, Gamescope, Proton-SLR, UMU, Wine, MangoHud, ProtonUp-Qt & 32-bit libs."),
            "cachyos-gaming-meta cachyos-gaming-applications protonup-qt lact|lact-git",
            "cachyos-gaming-meta cachyos-gaming-applications protonup-qt lact",
            "gamepad",
            is_suite=True,
            post_cmd="sudo systemctl enable --now lactd.service 2>/dev/null || true; printf '\\n\\033[1;32m[✓] Suite Gaming X64 instalada al completo y servicio lactd activo.\\033[0m\\n'"
        )
        self.gaming_cards.append(suite_card)
        layout.addWidget(suite_card)
        layout.addSpacing(8)

        sec_mod = QLabel(tr("MODULAR COMPONENT INSTALLATION"))
        sec_mod.setStyleSheet("color: #ef4444; font-weight: bold; font-size: 11.2px; letter-spacing: 1.4px; background: transparent;")
        layout.addWidget(sec_mod)
        layout.addSpacing(5)

        modular_items = [
            (
                tr("X64 Gaming Core, Proton-SLR & Wine X64"),
                tr("Essential 32-bit Vulkan/Audio libs, Proton-SLR, UMU, Wine X64, Winetricks & Protontricks."),
                "cachyos-gaming-meta umu-launcher protontricks",
                "cachyos-gaming-meta umu-launcher protontricks winetricks",
                "bolt",
                None,
                None
            ),
            (
                tr("Steam"),
                tr("Official Valve gaming platform with native Proton integration."),
                "steam",
                "steam",
                "steam",
                None,
                "steam"
            ),
            (
                tr("Lutris"),
                tr("Unified open gaming manager for Epic, GOG, Battle.net, EA, and Wine."),
                "lutris",
                "lutris",
                "lutris",
                None,
                "lutris"
            ),
            (
                tr("Heroic Games Launcher"),
                tr("Native graphical launcher for Epic Games, GOG, and Amazon Games."),
                "heroic-games-launcher",
                "heroic-games-launcher",
                "heroic",
                None,
                "heroic"
            ),
            (
                tr("Faugus Launcher"),
                tr("Ultra-lightweight modern launcher for Battle.net, EA App, Ubisoft, and standalone Windows games via UMU/Proton."),
                "faugus-launcher",
                "faugus-launcher",
                "rocket",
                None,
                "faugus-launcher"
            ),
            (
                tr("MangoHud & GOverlay"),
                tr("In-game FPS, frametime, CPU/GPU temperature HUD and graphical configurator."),
                "mangohud goverlay",
                "mangohud lib32-mangohud goverlay",
                "gauge",
                None,
                "goverlay"
            ),
            (
                tr("LACT (GPU Overclock & Fan Control)"),
                tr("Fan curves, undervolt, power limits (TDP), clock frequencies, and live thermals for AMD, NVIDIA & Intel GPUs."),
                "lact|lact-git",
                "lact",
                "gpu-fan",
                "sudo systemctl enable --now lactd.service; printf '\\n\\033[1;32m[✓] LACT instalado y demonio lactd habilitado para arranque automático.\\033[0m\\n'",
                "lact gui"
            ),
            (
                tr("Gamescope (Valve Micro-Compositor)"),
                tr("Valve Wayland micro-compositor for FSR upscaling, frame limiting, and resolution isolation."),
                "gamescope",
                "gamescope",
                "video-display",
                None,
                None
            ),
            (
                tr("ProtonUp-Qt"),
                tr("Graphical manager to install and update GE-Proton and Wine-GE versions."),
                "protonup-qt",
                "protonup-qt",
                "layers",
                None,
                "protonup-qt"
            ),
            (
                tr("OBS Studio & Wayland Capture"),
                tr("Live streaming & recording suite with Vulkan/OpenGL capture (obs-vkcapture) and NVENC/VAAPI acceleration."),
                "obs-studio obs-vkcapture",
                "obs-studio obs-vkcapture lib32-obs-vkcapture",
                "obs",
                None,
                "obs"
            ),
            (
                tr("Waydroid (Android Gaming)"),
                tr("LXC container to run Android games and mobile applications with direct hardware GPU acceleration."),
                "waydroid",
                "waydroid",
                "android",
                "sudo systemctl enable --now waydroid-container.service; /usr/bin/x64-waydroid-launcher --configure-only 2>/dev/null || true; printf '\\n\\033[1;32m[✓] Waydroid instalado en modo Bajo Demanda (0 MB RAM en reposo).\\033[0m\\nHaz clic en \\033[1;37mABRIR\\033[0m en X64 Hello para inicializar o arrancar Android.\\n'",
                "x64-waydroid-launcher"
            ),
            (
                tr("Sunshine & Moonlight (Game Streaming)"),
                tr("Complete game streaming duo: Sunshine host server + Moonlight client to stream or play remotely at ultra-low latency."),
                "sunshine moonlight-qt",
                "sunshine moonlight-qt avahi",
                "sunshine",
                "sudo systemctl enable --now avahi-daemon.service 2>/dev/null; /usr/bin/x64-sunshine-launcher --setup-only 2>/dev/null || true; printf '\\n\\033[1;32m[✓] Sunshine + Moonlight instalados en modo Bajo Demanda (0 MB RAM en reposo).\\033[0m\\nHaz clic en \\033[1;37mABRIR\\033[0m en X64 Hello para iniciar el servidor de streaming cuando desees jugar.\\n'",
                "x64-sunshine-launcher"
            )
        ]

        mod_grid = QGridLayout()
        mod_grid.setHorizontalSpacing(12)
        mod_grid.setVerticalSpacing(6)
        mod_grid.setColumnStretch(0, 1)
        mod_grid.setColumnStretch(1, 1)

        for idx, item in enumerate(modular_items):
            g_title, g_desc, g_check, g_install, g_icon = item[:5]
            g_post = item[5] if len(item) > 5 else None
            g_launch = item[6] if len(item) > 6 else None
            card = GamingInstallCard(g_title, g_desc, g_check, g_install, g_icon, is_suite=False, post_cmd=g_post, launch_cmd=g_launch)
            self.gaming_cards.append(card)
            mod_grid.addWidget(card, idx // 2, idx % 2)

        layout.addLayout(mod_grid)
        return page

    def create_page_philosophy(self):
        page = QWidget()
        layout = QVBoxLayout()
        layout.setContentsMargins(36, 20, 36, 16)
        layout.setSpacing(4)
        page.setLayout(layout)

        philo_i18n = {
            "es": {
                "cat": "// FUNDAMENTOS ARQUITECTÓNICOS Y MANIFIESTO",
                "title": "Manifiesto Arquitectónico X64",
                "intro": "X64 LIOS nace como la respuesta definitiva a la fragmentación de Linux. Extraemos la fuerza bruta de los kernels de alto rendimiento, la precisión del ecosistema gaming y la pureza de Arch para forjar el sistema operativo definitivo.",
                "pillars": [
                    (
                        "I. La Libertad Absoluta",
                        "Pureza Upstream de Arch Linux con cero PPAs, cero ataduras corporativas y el 99% de los paquetes del sistema intactos. Combinado con AUR y herramientas gráficas modernas para una libertad total.",
                        (
                            "Base pura Arch Linux Rolling Release sin parches invasivos que rompan la compatibilidad upstream.",
                            "Garantiza acceso inmediato a todo el catálogo oficial de Arch, AUR y Flatpak sin bloqueos artificiales ni dependencias rotas.",
                            "Activo permanentemente como cimiento base de tu sistema operativo."
                        )
                    ),
                    (
                        "II. Optimización Quirúrgica",
                        "Kernel Linux-CachyOS con schedulers dinámicos sched_ext (scx_lavd / BORE), afinidad gaming FalconD, ananicy-cpp y ZRAM puro en RAM sin falsos cierres de systemd-oomd.",
                        (
                            "Pila de rendimiento de ultra-baja latencia en espacio de kernel (eBPF / BORE) y espacio de usuario.",
                            "Maximiza los FPS mínimos (1% Low), prioriza procesos interactivos y protege tus juegos durante compilaciones masivas de shaders Vulkan mediante ZRAM zstd.",
                            "Activo de fábrica y personalizable en tiempo real desde la pestaña CPU y Rendimiento."
                        )
                    ),
                    (
                        "III. Ecosistema Multi-Entorno & Silent Boot",
                        "Arranque limpio Silent Handover (Plymouth → SDDM sin parpadeos) y 8 entornos oficiales (KDE Plasma 6, GNOME, COSMIC, Niri, Cinnamon, Xfce, Hyprland y Servidor).",
                        (
                            "Arquitectura gráfica Wayland/X11 con transición continua de framebuffer KMS y soporte oficial para 8 escritorios.",
                            "Elimina textos de consola y parpadeos visuales al encender el PC, entregando tu entorno favorito preconfigurado con identidad X64.",
                            "Elegible durante la instalación en Calamares y activo en cada arranque."
                        )
                    ),
                    (
                        "IV. Repositorios Soberanos",
                        "Jerarquía soberana de repositorios en cascada. [x64-lios] ostenta la prioridad #1 absoluta sobre CachyOS y Arch, entregando paquetes propios y optimizaciones vía SSL sin cuellos de botella.",
                        (
                            "Infraestructura propia de distribución de paquetes (repo.x64lios.com) auditada con paridad estricta.",
                            "Entrega actualizaciones instantáneas de nuestras herramientas (x64-hello, x64-update, temas y perfiles) con prioridad máxima.",
                            "Se aplica automáticamente en cada actualización mediante X64 Update o pacman."
                        )
                    ),
                    (
                        "V. Mutación de Hardware (v3 / v4)",
                        "Durante la instalación el sistema audita tu silicio: CPUs modernas reciben repositorios AVX2/AVX-512 (x86-64-v3/v4) bajo [x64-lios] y chwd autodetecta GPUs NVIDIA, AMD e Intel.",
                        (
                            "Motor inteligente de detección de instrucciones microarquitectónicas de CPU y perfiles de drivers gráficos.",
                            "Exprime las instrucciones vectoriales modernas de tu procesador para ganar hasta un 15% de rendimiento extra, manteniendo compatibilidad total en CPUs clásicas.",
                            "Configurado automáticamente a medida de tu hardware durante la instalación."
                        )
                    ),
                    (
                        "VI. Arquitectura Modular Sin Bloatware",
                        "Sistema base quirúrgico con solo ~600–800 MB de RAM en reposo. Las suites pesadas de juegos, launchers y utilidades se delegan a instalación modular de 1 clic en X64 Hello.",
                        (
                            "Diseño minimalista libre de programas preinstalados innecesarios o servicios basura en segundo plano.",
                            "Reserva el 100% de tu memoria RAM y ciclos de CPU para tus videojuegos y flujo de trabajo, permitiéndote instalar solo lo que realmente utilizas.",
                            "Gestionable a la carta desde la pestaña Gaming Center."
                        )
                    ),
                    (
                        "VII. Escudo Btrfs y 4 Gestores de Arranque",
                        "Inmutabilidad temporal con Btrfs + Snapper integrada en los 4 gestores de arranque oficiales (Limine, GRUB, systemd-boot y rEFInd), con autodetección segura de Dual-Boot con Windows.",
                        (
                            "Sistema de respaldo por instantáneas fotográficas arrancables antes de cada actualización del sistema.",
                            "Permite restaurar el sistema en segundos desde el menú de encendido si algo falla, protegiendo intacto tu arranque dual.",
                            "Snapshots automáticos activos antes de cada actualización del sistema."
                        )
                    ),
                    (
                        "VIII. Filosofía GUI-First y Terminal Hacker",
                        "Control diario intuitivo mediante aplicaciones gráficas nativas en PyQt6, unido a una experiencia de terminal hacker de élite en Kitty, Fish shell, Fastfetch y Starship pills.",
                        (
                            "Convergencia entre paneles de control visuales de 1 clic y una consola de comandos preconfigurada al detalle.",
                            "Permite administrar el kernel, red, drivers y mantenimiento sin tocar comandos, brindando a la vez la mejor terminal para usuarios avanzados.",
                            "Disponible en todo momento en las apps nativas X64 y en la terminal Kitty."
                        )
                    ),
                    (
                        "IX. Rolling Release de Vanguardia",
                        "Evolución continua basada en Arch Linux. Tu sistema incorpora fluidamente los últimos kernels, drivers Mesa/NVIDIA y mejoras de Proton sin reinstalaciones, guiado por X64 Update.",
                        (
                            "Modelo de actualización continua donde tu sistema operativo siempre se mantiene en la última versión.",
                            "Recibe soporte inmediato para nuevo hardware y mejoras de FPS en Vulkan/Proton apenas se publican, bajo la supervisión segura de X64 Update.",
                            "Al sincronizar paquetes semanalmente desde el botón Actualizar Sistema."
                        )
                    ),
                    (
                        "X. Pila de Red Competitiva",
                        "Control de congestión Google TCP BBR + Fair Queueing (FQ) contra bufferbloat, Wi-Fi sin ahorro energético (Low-Jitter), benchmark DNS en vivo con DNS-over-TLS y cortafuegos UFW.",
                        (
                            "Optimización profunda del stack TCP/IP del kernel Linux y cifrado de resolución de nombres.",
                            "Elimina los picos de lag (jitter) jugando por Wi-Fi, evita subidas de ping cuando otros descargan en tu red y protege tus conexiones entrantes.",
                            "TCP BBR y Wi-Fi Low-Jitter activos de fábrica; DNS y Firewall ajustables en Red y Seguridad."
                        )
                    ),
                    (
                        "XI. La Estética como Función",
                        "El diseño no es secundario. Interfaz panorámica Widescreen, dirección de arte Carmesí & Carbón (#b31b1b / #0b0b0d), tooltips educativos y vectores diseñados para foco y control.",
                        (
                            "Identidad visual cohesiva de alto contraste y cero distracciones en todo el ecosistema X64 LIOS.",
                            "Reduce la fatiga visual en sesiones prolongadas y expone telemetría y controles técnicos con claridad inmediata.",
                            "Presente desde el gestor de arranque y SDDM hasta el escritorio y las herramientas X64."
                        )
                    ),
                    (
                        "XII. Privacidad por Diseño",
                        "Cero recopilación de métricas, diagnósticos o rastreo encubierto en segundo plano. A diferencia de los sistemas comerciales, X64 LIOS jamás monitoriza tu actividad: tu hardware es tuyo.",
                        (
                            "Compromiso arquitectónico inquebrantable de cero telemetría y cero servicios espía.",
                            "Garantiza soberanía digital absoluta sobre tus archivos, procesos y red, sin telemetría corporativa consumiendo recursos en segundo plano.",
                            "Garantizado por diseño en el 100% de los paquetes de X64 LIOS."
                        )
                    ),
                ]
            },
            "en": {
                "cat": "// ARCHITECTURAL FOUNDATIONS & MANIFESTO",
                "title": "X64 Architectural Manifesto",
                "intro": "X64 LIOS was born as the ultimate answer to Linux fragmentation. We extract the raw power of high-performance kernels, the precision of the gaming ecosystem, and the purity of Arch to forge the definitive operating system.",
                "pillars": [
                    (
                        "I. Absolute Freedom",
                        "Upstream purity of Arch Linux with zero PPAs, zero corporate ties, and 99% of system packages intact. Combined with the AUR and modern GUI tools for complete freedom.",
                        (
                            "Pure Arch Linux Rolling Release foundation without invasive patches that break upstream compatibility.",
                            "Guarantees instant access to the entire official Arch, AUR, and Flatpak catalog without artificial locks or broken dependencies.",
                            "Permanently active as the core foundation of your operating system."
                        )
                    ),
                    (
                        "II. Surgical Optimization",
                        "Linux-CachyOS kernel with live sched_ext (scx_lavd / BORE) schedulers, FalconD gaming CPU affinity, ananicy-cpp priority tuning, and pure ZRAM in RAM with zero false systemd-oomd kills.",
                        (
                            "Ultra-low-latency performance stack across both kernel space (eBPF / BORE) and user space.",
                            "Maximizes 1% Low FPS stability, prioritizes interactive tasks, and protects games during heavy Vulkan shader compilation via zstd ZRAM.",
                            "Active out of the box and customizable in real time from the CPU & Performance tab."
                        )
                    ),
                    (
                        "III. Multi-Environment & Silent Boot",
                        "Flicker-free Silent Handover boot (Plymouth → SDDM) and 8 official desktop environments (KDE Plasma 6, GNOME, COSMIC, Niri, Cinnamon, Xfce, Hyprland, and Server).",
                        (
                            "Wayland/X11 graphics architecture with seamless KMS framebuffer handover and native support for 8 desktops.",
                            "Eliminates boot console text and screen flicker at startup while delivering your favorite desktop pre-tuned with X64 identity.",
                            "Selectable during Calamares installation and active on every boot."
                        )
                    ),
                    (
                        "IV. Sovereign Repositories",
                        "Sovereign cascading repository hierarchy. [x64-lios] holds priority #1 above CachyOS and Arch, delivering custom packages and optimizations over SSL without bottlenecks.",
                        (
                            "Dedicated package distribution infrastructure (repo.x64lios.com) audited with strict parity.",
                            "Delivers instant updates for X64 tools (x64-hello, x64-update, themes, and profiles) with top priority.",
                            "Automatically applied on every system sync via X64 Update or pacman."
                        )
                    ),
                    (
                        "V. Hardware Mutation (v3 / v4)",
                        "During installation, the system audits your silicon: modern CPUs receive AVX2/AVX-512 (x86-64-v3/v4) repositories below [x64-lios], and chwd autodetects NVIDIA, AMD, and Intel GPUs.",
                        (
                            "Intelligent CPU microarchitecture instruction detector and automated GPU driver profiler.",
                            "Unlocks modern vector instructions on your processor for up to 15% extra performance while keeping 100% compatibility on older CPUs.",
                            "Automatically configured for your hardware during system installation."
                        )
                    ),
                    (
                        "VI. Zero-Bloat Modular Architecture",
                        "Surgical base system consuming only ~600–800 MB idle RAM. Heavy gaming suites, launchers, and utilities are delegated to 1-click modular installation in X64 Hello.",
                        (
                            "Lean system design free from unnecessary preinstalled bloatware or idle background daemons.",
                            "Dedicates 100% of your RAM and CPU cycles to your games and workflows, letting you install only the launchers you actually use.",
                            "Manageable anytime on demand from the Gaming Center tab."
                        )
                    ),
                    (
                        "VII. Btrfs Shield & 4 Official Bootloaders",
                        "Temporal immutability with Btrfs + Snapper integrated across Limine, GRUB, systemd-boot, and rEFInd, with safe non-invasive Windows Dual-Boot detection.",
                        (
                            "Automated bootable snapshot recovery system before every system upgrade.",
                            "Lets you roll back any faulty update in seconds directly from the boot menu while keeping Dual-Boot intact.",
                            "Snapshots run automatically before every system update."
                        )
                    ),
                    (
                        "VIII. GUI-First & Hacker Terminal",
                        "Effortless everyday control via native PyQt6 graphical apps, paired with an elite hacker terminal experience in Kitty, Fish shell, Fastfetch, and Starship pills.",
                        (
                            "Synergy between 1-click visual control panels and a meticulously pre-configured command-line environment.",
                            "Lets any user manage kernels, networking, drivers, and maintenance without touching the CLI, while giving power users an elite terminal.",
                            "Available anytime across X64 native apps and the Kitty terminal."
                        )
                    ),
                    (
                        "IX. Cutting-Edge Rolling Release",
                        "Continuous evolution based on Arch Linux. Your system seamlessly incorporates the latest kernels, Mesa/NVIDIA drivers, and Proton advances without reinstallations via X64 Update.",
                        (
                            "Continuous delivery model where your operating system never becomes obsolete.",
                            "Brings immediate support for new hardware and Vulkan/Proton FPS improvements as soon as they release, backed by Snapper snapshots.",
                            "Applied whenever you update your system via X64 Update."
                        )
                    ),
                    (
                        "X. Competitive Network Stack",
                        "Google TCP BBR + Fair Queueing (FQ) anti-bufferbloat congestion control, Wi-Fi Low-Jitter (powersave off), live DNS ping benchmarking with DNS-over-TLS, and UFW firewall.",
                        (
                            "Deep Linux kernel TCP/IP stack optimization paired with encrypted DNS resolution.",
                            "Eliminates Wi-Fi ping spikes (jitter) in online games, prevents latency jumps during background downloads, and blocks unauthorized incoming traffic.",
                            "TCP BBR and Wi-Fi Low-Jitter are active by default; DNS and Firewall are tuned in Network & Security."
                        )
                    ),
                    (
                        "XI. Aesthetics as Function",
                        "Design is not an afterthought. Widescreen panoramic UI, Crimson & Charcoal color direction (#b31b1b / #0b0b0d), educational hover tooltips, and vector iconography.",
                        (
                            "Cohesive, high-contrast, distraction-free visual identity across the entire X64 LIOS ecosystem.",
                            "Reduces eye strain during long sessions and presents live telemetry and technical controls with instant clarity.",
                            "Present from the bootloader and SDDM login screen to the desktop and X64 apps."
                        )
                    ),
                    (
                        "XII. Privacy by Design",
                        "Zero metrics collection, diagnostics, or covert background tracking. Unlike commercial operating systems, X64 LIOS never monitors your activity or phones home. Your hardware belongs to you.",
                        (
                            "Uncompromising architectural commitment to zero telemetry and zero background spyware.",
                            "Guarantees complete digital sovereignty over your files, processes, and network without corporate trackers wasting bandwidth.",
                            "Guaranteed by design across 100% of X64 LIOS packages."
                        )
                    ),
                ]
            },
            "fr": {
                "cat": "// FONDEMENTS ET MANIFESTE ARCHITECTURAL",
                "title": "Manifeste Architectural X64",
                "intro": "X64 LIOS est né comme la réponse ultime à la fragmentation de Linux. Nous extrayons la puissance brute des noyaux haute performance, la précision de l'écosystème gaming et la pureté d'Arch pour forger le système définitif.",
                "pillars": [
                    ("I. Liberté Absolue", "Pureté d'Arch Linux sans aucun PPA ni lien d'entreprise, avec 99 % des paquets système intacts. Combiné à l'AUR et à des outils graphiques modernes pour une liberté totale.", (
                        "Base Arch Linux Rolling Release pure sans correctifs intrusifs.",
                        "Garantit un accès immédiat aux dépôts Arch, à l'AUR et à Flatpak sans blocages artificiels.",
                        "Actif en permanence comme fondation de votre système."
                    )),
                    ("II. Optimisation Chirurgicale", "Noyau Linux-CachyOS avec ordonnanceurs dynamiques sched_ext (scx_lavd / BORE), affinité CPU FalconD, ananicy-cpp et ZRAM pure sans fermetures forcées de systemd-oomd.", (
                        "Pile de performance à ultra-basse latence dans l'espace noyau (eBPF / BORE) et utilisateur.",
                        "Maximise les FPS minimums (1% Low) et protège vos jeux lors de la compilation des shaders Vulkan grâce à ZRAM zstd.",
                        "Actif par défaut et réglable en direct dans l'onglet CPU & Performance."
                    )),
                    ("III. Écosystème Multi-Environnements & Silent Boot", "Démarrage fluide Silent Handover (Plymouth → SDDM sans scintillement) et 8 environnements officiels (KDE Plasma 6, GNOME, COSMIC, Niri, Cinnamon, Xfce, Hyprland, Serveur).", (
                        "Architecture graphique Wayland/X11 avec transition KMS continue et 8 bureaux officiels.",
                        "Supprime les textes de console au démarrage et livre votre bureau préconfiguré aux couleurs X64.",
                        "Sélectionnable lors de l'installation Calamares et actif à chaque démarrage."
                    )),
                    ("IV. Dépôts Souverains", "Hiérarchie souveraine de dépôts en cascade. [x64-lios] détient la priorité #1 sur CachyOS et Arch, livrant des paquets sur mesure et des optimisations via SSL.", (
                        "Infrastructure dédiée (repo.x64lios.com) placée au sommet de /etc/pacman.conf.",
                        "Distribue instantanément les mises à jour des outils X64 LIOS et thèmes officiels.",
                        "Consulté automatiquement à chaque exécution de X64 Update ou pacman."
                    )),
                    ("V. Mutation Matérielle (v3 / v4)", "Pendant l'installation, le système audite votre CPU : les processeurs modernes reçoivent les dépôts AVX2/AVX-512 (v3/v4) et chwd détecte automatiquement les GPU NVIDIA, AMD et Intel.", (
                        "Détection matérielle intelligente qui adapte les binaires aux instructions exactes de votre CPU et GPU.",
                        "Exploite les instructions AVX2 et AVX-512 et configure les pilotes graphiques optimaux sans intervention manuelle.",
                        "Configuré automatiquement à l'installation et vérifiable dans l'onglet Accueil."
                    )),
                    ("VI. Architecture Modulaire Sans Bloatware", "Système de base chirurgical ne consommant que ~600–800 Mo de RAM au repos. Les plateformes de jeu lourdes s'installent en 1 clic dans X64 Gaming Center.", (
                        "Séparation stricte entre le cœur du système d'exploitation et les applications lourdes optionnelles.",
                        "Garde le système ultra-léger au démarrage tout en permettant d'installer Steam ou Lutris en 1 clic.",
                        "Disponible à la demande dans l'onglet Gaming Center."
                    )),
                    ("VII. Bouclier Btrfs & 4 Bootloaders Officiels", "Immutabilité temporelle avec Btrfs + Snapper intégrée sur Limine, GRUB, systemd-boot et rEFInd, avec détection Dual-Boot Windows sécurisée.", (
                        "Système de snapshots automatiques amorçables avant chaque mise à jour du système.",
                        "Permet d'annuler une mise à jour défaillante en quelques secondes depuis le menu de démarrage.",
                        "Les snapshots sont créés automatiquement avant chaque mise à jour."
                    )),
                    ("VIII. Philosophie GUI-First & Terminal Hacker", "Contrôle quotidien intuitif via des outils graphiques natifs PyQt6, couplé au terminal d'élite Kitty avec Fish, Fastfetch et Starship.", (
                        "Synergie entre panneaux de contrôle graphiques en 1 clic et terminal préconfiguré de haut vol.",
                        "Permet de tout gérer visuellement sans ligne de commande tout en offrant un terminal d'élite aux experts.",
                        "Disponible à tout moment dans les applications X64 et le terminal Kitty."
                    )),
                    ("IX. Rolling Release d'Avant-Garde", "Évolution continue basée sur Arch Linux. Votre système intègre les derniers noyaux, pilotes Mesa/NVIDIA et avancées Proton sans réinstallation via X64 Update.", (
                        "Modèle de mise à jour continue où votre système d'exploitation ne devient jamais obsolète.",
                        "Apporte immédiatement le support du nouveau matériel et les gains de FPS Vulkan/Proton.",
                        "Appliqué à chaque mise à jour via X64 Update."
                    )),
                    ("X. Pile Réseau Compétitive", "Contrôle de congestion Google TCP BBR + FQ anti-bufferbloat, Wi-Fi Low-Jitter sans économie d'énergie, benchmark DNS chiffré (DoT) et pare-feu UFW.", (
                        "Optimisation profonde de la pile TCP/IP du noyau Linux associée au chiffrement DNS-over-TLS.",
                        "Élimine les pics de ping Wi-Fi en jeu et protège votre réseau contre les connexions entrantes non autorisées.",
                        "TCP BBR et Wi-Fi Low-Jitter sont actifs par défaut ; DNS et UFW se règlent dans Réseau & Sécurité."
                    )),
                    ("XI. L'Esthétique comme Fonction", "Interface panoramique Widescreen, charte Carmin & Anthracite (#b31b1b / #0b0b0d), info-bulles éducatives et iconographie vectorielle.", (
                        "Identité visuelle cohérente à fort contraste et sans distraction sur tout l'écosystème X64 LIOS.",
                        "Réduit la fatigue visuelle et présente la télémétrie matérielle avec une clarté immédiate.",
                        "Présente du bootloader et de l'écran SDDM jusqu'au bureau et aux outils X64."
                    )),
                    ("XII. Confidentialité Dès la Conception", "Zéro collecte de métriques, diagnostic ou suivi caché. X64 LIOS ne surveille jamais votre activité : votre matériel vous appartient exclusivement.", (
                        "Engagement architectural absolu envers zéro télémétrie et zéro espionnage en arrière-plan.",
                        "Garantit une souveraineté numérique totale sur vos fichiers, processus et connexions réseau.",
                        "Garanti par conception sur 100 % des paquets X64 LIOS."
                    )),
                ]
            },
            "de": {
                "cat": "// ARCHITEKTUR-FUNDAMENTE & MANIFEST",
                "title": "X64 Architektur-Manifest",
                "intro": "X64 LIOS wurde als ultimative Antwort auf die Linux-Fragmentierung entwickelt. Wir vereinen Hochleistungs-Kernel, präzises Gaming-Tuning und die Reinheit von Arch Linux zum definitiven Betriebssystem.",
                "pillars": [
                    ("I. Absolute Freiheit", "Reines Arch Linux ohne PPAs oder Konzernbindung mit 99 % unveränderten Systempaketen, kombiniert mit dem AUR und modernen GUI-Werkzeugen.", (
                        "Reine Arch Linux Rolling-Release-Basis ohne invasive Patches.",
                        "Garantiert sofortigen Zugriff auf alle offiziellen Arch-Pakete, das AUR und Flatpak ohne künstliche Sperren.",
                        "Dauerhaft aktiv als Fundament Ihres Betriebssystems."
                    )),
                    ("II. Chirurgische Optimierung", "Linux-CachyOS-Kernel mit Live-sched_ext-Schedulern (scx_lavd / BORE), FalconD-Gaming-Affinität, ananicy-cpp und reinem ZRAM ohne falsche systemd-oomd-Abbrüche.", (
                        "Ultra-niedriglatenter Performance-Stack im Kernel- (eBPF / BORE) und Userspace.",
                        "Maximiert die 1%-Low-FPS und schützt Spiele während massiver Vulkan-Shader-Kompilierungen durch ZRAM.",
                        "Standardmäßig aktiv und im Tab CPU & Leistung in Echtzeit anpassbar."
                    )),
                    ("III. Multi-Desktop & Silent Boot", "Flackerfreier Silent Handover (Plymouth → SDDM) sowie 8 offizielle Desktop-Umgebungen (KDE Plasma 6, GNOME, COSMIC, Niri, Cinnamon, Xfce, Hyprland und Server).", (
                        "Wayland/X11-Grafikarchitektur mit nahtlosem KMS-Framebuffer-Übergang und 8 offiziellen Desktops.",
                        "Beseitigt Konsolentext und Flackern beim Systemstart und liefert Ihren Wunsch-Desktop im X64-Design.",
                        "Bei der Calamares-Installation wählbar und bei jedem Start aktiv."
                    )),
                    ("IV. Souveräne Paketquellen", "Souveräne Repository-Hierarchie: [x64-lios] steht auf Priorität #1 über CachyOS und Arch und liefert eigene Pakete und Optimierungen direkt per SSL.", (
                        "Eigene Paket-Infrastruktur (repo.x64lios.com) an oberster Stelle in /etc/pacman.conf.",
                        "Liefert sofortige Updates für native X64-Tools, Bootloader-Themes und System-Skripte.",
                        "Wird bei jedem Aufruf von X64 Update oder pacman automatisch genutzt."
                    )),
                    ("V. Hardware-Mutation (v3 / v4)", "Automatische CPU-Prüfung bei der Installation: Moderne CPUs erhalten AVX2/AVX-512-Pakete (v3/v4), während chwd NVIDIA-, AMD- und Intel-GPUs automatisch einrichtet.", (
                        "Intelligente Hardware-Erkennung, die Binärpakete exakt auf Ihre CPU-Mikroarchitektur abstimmt.",
                        "Nutzt AVX2- und AVX-512-Befehlssätze und installiert automatisch die optimalen GPU-Treiber.",
                        "Wird bei der Installation konfiguriert und im Start-Tab angezeigt."
                    )),
                    ("VI. Modulare Zero-Bloat-Architektur", "Ultraschlankes Basissystem mit nur ~600–800 MB RAM-Verbrauch im Leerlauf. Große Gaming-Suiten werden modular per 1-Klick im X64 Gaming Center installiert.", (
                        "Strikte Trennung zwischen schlankem Betriebssystemkern und optionalen Großanwendungen.",
                        "Hält das System extrem ressourcenschonend und erlaubt die 1-Klick-Installation von Steam, Heroic oder Lutris.",
                        "Jederzeit bei Bedarf im Tab Gaming Center verfügbar."
                    )),
                    ("VII. Btrfs-Schutzschild & 4 Offizielle Bootloader", "Zeitsichere Btrfs-Snapshots mit Snapper für Limine, GRUB, systemd-boot und rEFInd, inklusive sicherer Windows-Dual-Boot-Erkennung.", (
                        "Automatisiertes, bootfähiges Snapshot-System vor jeder Systemaktualisierung.",
                        "Ermöglicht das Zurückrollen fehlerhafter Updates in Sekunden direkt über das Bootmenü.",
                        "Snapshots laufen automatisch vor jedem System-Update."
                    )),
                    ("VIII. GUI-First & Hacker-Terminal", "Mühelose Steuerung über native PyQt6-Apps, kombiniert mit einem erstklassigen Hacker-Terminal in Kitty, Fish-Shell, Fastfetch und Starship-Pills.", (
                        "Synergie aus visuellen 1-Klick-Kontrollzentren und einer vorkonfigurierten Profi-Kommandozeile.",
                        "Erlaubt komfortable Systemverwaltung ohne Terminalzwang und bietet Power-Usern zugleich eine Elite-Shell.",
                        "Jederzeit in den X64-Apps und im Kitty-Terminal verfügbar."
                    )),
                    ("IX. Spitzenklasse Rolling Release", "Kontinuierliche Evolution auf Arch-Basis: Neueste Kernel, Mesa/NVIDIA-Treiber und Proton-Updates ohne Neuinstallation über X64 Update.", (
                        "Kontinuierliches Update-Modell, bei dem Ihr Betriebssystem niemals veraltet.",
                        "Liefert sofortige Unterstützung für neue Hardware sowie Vulkan/Proton-Verbesserungen, abgesichert durch Snapper.",
                        "Wird bei jeder Aktualisierung über X64 Update angewendet."
                    )),
                    ("X. Kompetitiver Netzwerk-Stack", "Google TCP BBR + FQ gegen Bufferbloat, Wi-Fi Low-Jitter (ohne Energiespar-Lags), Live-DNS-Benchmark mit DNS-over-TLS und UFW-Firewall.", (
                        "Tiefgreifende Optimierung des Linux-TCP/IP-Stacks gepaart mit verschlüsselter DNS-Auflösung.",
                        "Verhindert WLAN-Ping-Spitzen in Online-Spielen und blockiert unautorisierte eingehende Verbindungen.",
                        "TCP BBR und Wi-Fi Low-Jitter sind ab Werk aktiv; DNS und Firewall werden unter Netzwerk & Sicherheit gesteuert."
                    )),
                    ("XI. Ästhetik als Funktion", "Breitbild-Panorama-UI, Farbgebung in Karminrot & Anthrazit (#b31b1b / #0b0b0d), erklärende Tooltips und gestochen scharfe Vektor-Icons.", (
                        "Durchgängige, kontrastreiche und ablenkungsfreie visuelle Identität im gesamten X64 LIOS.",
                        "Schont die Augen bei langen Sitzungen und stellt Live-Telemetrie übersichtlich dar.",
                        "Präsent vom Bootloader und SDDM bis zum Desktop und allen X64-Werkzeugen."
                    )),
                    ("XII. Privacy by Design", "Null Telemetrie, null Diagnosedaten und kein verstecktes Tracking im Hintergrund. X64 LIOS überwacht Sie niemals – Ihre Hardware gehört allein Ihnen.", (
                        "Kompromisslose Architektur ohne Telemetrie, Datensammlung oder Hintergrund-Tracker.",
                        "Garantiert volle digitale Souveränität über Ihre Dateien, Prozesse und Netzwerkverbindungen.",
                        "Konstruktionsbedingt in 100 % aller X64-LIOS-Pakete garantiert."
                    )),
                ]
            },
            "it": {
                "cat": "// FONDAMENTA ARCHITETTONICHE E MANIFESTO",
                "title": "Manifesto Architettonico X64",
                "intro": "X64 LIOS nasce come risposta definitiva alla frammentazione di Linux. Estraiamo la potenza bruta dei kernel ad alte prestazioni, la precisione del gaming e la purezza di Arch per forgiare il sistema definitivo.",
                "pillars": [
                    ("I. Libertà Assoluta", "Purezza di Arch Linux con zero PPA, zero vincoli aziendali e il 99% dei pacchetti intatti, unito ad AUR e strumenti grafici moderni.", (
                        "Base Arch Linux Rolling Release pura senza patch invasive.",
                        "Garantisce accesso immediato al catalogo ufficiale Arch, AUR e Flatpak senza blocchi artificiali.",
                        "Attivo permanentemente come fondamento del sistema operativo."
                    )),
                    ("II. Ottimizzazione Chirurgica", "Kernel Linux-CachyOS con scheduler dinamici sched_ext (scx_lavd / BORE), affinità gaming FalconD, ananicy-cpp e ZRAM pura senza chiusure anomale di systemd-oomd.", (
                        "Stack ad altissime prestazioni e bassa latenza nello spazio kernel (eBPF / BORE) e utente.",
                        "Massimizza gli FPS minimi (1% Low) e protegge i giochi durante la compilazione shader Vulkan tramite ZRAM.",
                        "Attivo di serie e personalizzabile in tempo reale nella scheda CPU e Prestazioni."
                    )),
                    ("III. Ecosistema Multi-Ambiente & Silent Boot", "Avvio fluido Silent Handover (Plymouth → SDDM senza sfarfallio) e 8 ambienti desktop ufficiali (KDE Plasma 6, GNOME, COSMIC, Niri, Cinnamon, Xfce, Hyprland e Server).", (
                        "Architettura grafica Wayland/X11 con transizione framebuffer KMS continua e 8 desktop ufficiali.",
                        "Elimina scritte di console e sfarfallii all'avvio, offrendo il tuo desktop preferito già rifinito in stile X64.",
                        "Selezionabile durante l'installazione Calamares e attivo a ogni avvio."
                    )),
                    ("IV. Repository Sovrani", "Gerarchia sovrana di repository a cascata: [x64-lios] detiene la priorità #1 su CachyOS e Arch, distribuendo pacchetti e ottimizzazioni via SSL.", (
                        "Infrastruttura dedicata (repo.x64lios.com) posizionata al primo posto in /etc/pacman.conf.",
                        "Fornisce aggiornamenti istantanei per le app native X64 LIOS, i temi e gli script di sistema.",
                        "Interrogato automaticamente a ogni esecuzione di X64 Update o pacman."
                    )),
                    ("V. Mutazione Hardware (v3 / v4)", "Durante l'installazione il sistema analizza la CPU: i processori moderni ricevono i repository AVX2/AVX-512 (v3/v4) e chwd configura le GPU NVIDIA, AMD e Intel.", (
                        "Rilevamento hardware intelligente che adatta i binari alle istruzioni esatte della tua CPU e GPU.",
                        "Sfrutta le istruzioni AVX2 e AVX-512 e installa automaticamente i driver grafici ottimali.",
                        "Configurato automaticamente durante l'installazione e visibile nella scheda Home."
                    )),
                    ("VI. Architettura Modulare Zero-Bloat", "Sistema base ultraleggero (~600–800 MB di RAM a riposo). Le piattaforme di gioco pesanti si installano con 1 clic in X64 Gaming Center.", (
                        "Separazione netta tra il cuore del sistema operativo e le suite pesanti opzionali.",
                        "Mantiene il sistema scattante e leggero, consentendo di installare Steam, Heroic o Lutris con 1 clic.",
                        "Disponibile su richiesta nella scheda Gaming Center."
                    )),
                    ("VII. Scudo Btrfs & 4 Bootloader Ufficiali", "Immutabilità temporale con Btrfs + Snapper integrata su Limine, GRUB, systemd-boot e rEFInd, con rilevamento sicuro Dual-Boot Windows.", (
                        "Sistema automatico di snapshot avviabili prima di ogni aggiornamento di sistema.",
                        "Permette di annullare qualsiasi aggiornamento difettoso in pochi secondi direttamente dal menu di avvio.",
                        "Gli snapshot vengono creati automaticamente prima di ogni aggiornamento."
                    )),
                    ("VIII. Filosofia GUI-First & Terminale Hacker", "Controllo quotidiano intuitivo tramite app grafiche native PyQt6, affiancato dal terminale d'élite Kitty con Fish, Fastfetch e Starship.", (
                        "Sinergia tra pannelli di controllo grafici a 1 clic e un terminale preconfigurato d'élite.",
                        "Consente a chiunque di gestire kernel, rete e driver senza usare la CLI, offrendo al contempo una shell avanzata.",
                        "Disponibile in qualsiasi momento nelle app X64 e nel terminale Kitty."
                    )),
                    ("IX. Rolling Release d'Avanguardia", "Evoluzione continua basata su Arch Linux: ultimi kernel, driver Mesa/NVIDIA e ottimizzazioni Proton senza reinstallazioni tramite X64 Update.", (
                        "Modello a rilascio continuo in cui il sistema operativo non diventa mai obsoleto.",
                        "Porta supporto immediato per nuovo hardware e miglioramenti FPS Vulkan/Proton in totale sicurezza.",
                        "Applicato a ogni aggiornamento tramite X64 Update."
                    )),
                    ("X. Stack di Rete Competitivo", "Controllo congestione Google TCP BBR + FQ anti-bufferbloat, Wi-Fi Low-Jitter, benchmark DNS in tempo reale con DNS-over-TLS e firewall UFW.", (
                        "Ottimizzazione profonda dello stack TCP/IP del kernel Linux abbinata a DNS crittografato.",
                        "Elimina i picchi di ping Wi-Fi nei giochi online e blocca il traffico in entrata non autorizzato.",
                        "TCP BBR e Wi-Fi Low-Jitter sono attivi di default; DNS e Firewall si regolano in Rete e Sicurezza."
                    )),
                    ("XI. L'Estetica come Funzione", "Interfaccia panoramica Widescreen, palette Cremisi & Carbone (#b31b1b / #0b0b0d), tooltip educativi a 3 punti e iconografia vettoriale.", (
                        "Identità visiva coerente, ad alto contrasto e priva di distrazioni in tutto l'ecosistema X64 LIOS.",
                        "Riduce l'affaticamento visivo e presenta telemetria e controlli tecnici con chiarezza immediata.",
                        "Presente dal bootloader e SDDM fino al desktop e alle applicazioni X64."
                    )),
                    ("XII. Privacy fin dalla Progettazione", "Zero raccolta di metriche, diagnostica o tracciamento nascosto. X64 LIOS non monitora mai la tua attività: il tuo hardware appartiene solo a te.", (
                        "Impegno architetturale assoluto per zero telemetria e zero tracciamento in background.",
                        "Garantisce totale sovranità digitale sui tuoi file, processi e connessioni di rete.",
                        "Garantito fin dalla progettazione sul 100% dei pacchetti X64 LIOS."
                    )),
                ]
            },
            "pt": {
                "cat": "// FUNDAMENTOS E MANIFESTO ARQUITETÔNICO",
                "title": "Manifesto Arquitetônico X64",
                "intro": "O X64 LIOS nasceu como a resposta definitiva para a fragmentação do Linux. Extraímos a potência bruta dos kernels de alto desempenho, a precisão do ecossistema gamer e a pureza do Arch para forjar o sistema definitivo.",
                "pillars": [
                    ("I. Liberdade Absoluta", "Pureza do Arch Linux sem PPAs e sem amarras corporativas, com 99% dos pacotes intactos, aliado ao AUR e ferramentas gráficas modernas.", (
                        "Base pura Arch Linux Rolling Release sem patches invasivos.",
                        "Garante acesso imediato a todo o catálogo oficial do Arch, AUR e Flatpak sem bloqueios artificiais.",
                        "Ativo permanentemente como alicerce do seu sistema operacional."
                    )),
                    ("II. Otimização Cirúrgica", "Kernel Linux-CachyOS com schedulers dinâmicos sched_ext (scx_lavd / BORE), afinidade FalconD para jogos, ananicy-cpp e ZRAM pura sem fechamentos falsos do systemd-oomd.", (
                        "Pilha de desempenho de ultrabaixa latência no espaço do kernel (eBPF / BORE) e do usuário.",
                        "Maximiza os FPS mínimos (1% Low) e protege seus jogos durante compilações de shaders Vulkan via ZRAM.",
                        "Ativo de fábrica e ajustável em tempo real na aba CPU e Desempenho."
                    )),
                    ("III. Ecossistema Multi-Ambiente & Silent Boot", "Inicialização contínua Silent Handover (Plymouth → SDDM sem piscar) e 8 ambientes oficiais (KDE Plasma 6, GNOME, COSMIC, Niri, Cinnamon, Xfce, Hyprland e Servidor).", (
                        "Arquitetura gráfica Wayland/X11 com transição contínua de framebuffer KMS e 8 desktops oficiais.",
                        "Elimina textos de console e piscadas ao ligar o PC, entregando seu ambiente favorito com identidade X64.",
                        "Escolhido durante a instalação no Calamares e ativo em cada inicialização."
                    )),
                    ("IV. Repositórios Soberanos", "Hierarquia soberana de repositórios em cascata: [x64-lios] tem prioridade #1 sobre CachyOS e Arch, entregando pacotes próprios e otimizações via SSL.", (
                        "Infraestrutura própria de pacotes (repo.x64lios.com) posicionada no topo do /etc/pacman.conf.",
                        "Entrega atualizações imediatas dos utilitários X64 LIOS, temas e scripts de sistema sem atrasos.",
                        "Consultado automaticamente sempre que você usa o X64 Update ou pacman."
                    )),
                    ("V. Mutação de Hardware (v3 / v4)", "Na instalação o sistema analisa sua CPU: processadores modernos ativam repositórios AVX2/AVX-512 (v3/v4) e o chwd detecta GPUs NVIDIA, AMD e Intel.", (
                        "Detecção inteligente de silício que adapta os binários às instruções exatas da sua CPU e GPU.",
                        "Aproveita instruções AVX2 e AVX-512 e instala automaticamente os drivers gráficos ideais.",
                        "Configurado automaticamente na instalação e visível na aba Início."
                    )),
                    ("VI. Arquitetura Modular Sem Bloatware", "Sistema base cirúrgico consumindo apenas ~600–800 MB de RAM em repouso. Plataformas pesadas de jogos são instaladas em 1 clique no X64 Gaming Center.", (
                        "Separação estrita entre o núcleo enxuto do sistema e suítes pesadas opcionais.",
                        "Mantém o sistema ultraleve na inicialização e permite instalar Steam, Heroic ou Lutris em 1 clique.",
                        "Disponível sob demanda na aba Centro Gaming."
                    )),
                    ("VII. Escudo Btrfs & 4 Bootloaders Oficiais", "Imutabilidade temporal com Btrfs + Snapper integrada no Limine, GRUB, systemd-boot e rEFInd, com detecção segura de Dual-Boot com Windows.", (
                        "Sistema automático de snapshots inicializáveis antes de cada atualização do sistema.",
                        "Permite reverter qualquer atualização problemática em segundos diretamente no menu de boot.",
                        "Snapshots rodam automaticamente antes de cada atualização."
                    )),
                    ("VIII. Filosofia GUI-First & Terminal Hacker", "Controle diário intuitivo via aplicativos nativos PyQt6, combinado com o terminal hacker de elite no Kitty com Fish, Fastfetch e Starship.", (
                        "Sinergia entre painéis visuais de 1 clique e um ambiente de linha de comando pré-configurado de elite.",
                        "Permite gerenciar kernels, rede e drivers sem tocar no terminal, oferecendo ao mesmo tempo uma shell avançada.",
                        "Disponível a qualquer momento nos apps X64 e no terminal Kitty."
                    )),
                    ("IX. Rolling Release de Vanguarda", "Evolução contínua baseada no Arch Linux: receba os últimos kernels, drivers Mesa/NVIDIA e avanços do Proton sem reinstalações pelo X64 Update.", (
                        "Modelo de entrega contínua em que seu sistema operacional nunca fica obsoleto.",
                        "Traz suporte imediato a novos hardwares e ganhos de FPS no Vulkan/Proton com segurança.",
                        "Aplicado sempre que você atualiza o sistema pelo X64 Update."
                    )),
                    ("X. Pilha de Rede Competitiva", "Controle de congestionamento Google TCP BBR + FQ anti-bufferbloat, Wi-Fi Low-Jitter, benchmark DNS em tempo real com DNS-over-TLS e firewall UFW.", (
                        "Otimização profunda da pilha TCP/IP do kernel Linux combinada com resolução DNS criptografada.",
                        "Elimina picos de ping no Wi-Fi em jogos online e bloqueia conexões de entrada não autorizadas.",
                        "TCP BBR e Wi-Fi Low-Jitter vêm ativos por padrão; DNS e Firewall são ajustados em Rede e Segurança."
                    )),
                    ("XI. A Estética como Função", "Interface panorâmica Widescreen, direção de arte Carmim & Carvão (#b31b1b / #0b0b0d), tooltips educativos e iconografia vetorial refinada.", (
                        "Identidade visual coesa, de alto contraste e livre de distrações em todo o ecossistema X64 LIOS.",
                        "Reduz o cansaço visual e apresenta telemetria em vivo e controles técnicos com clareza imediata.",
                        "Presente desde o bootloader e tela SDDM até a área de trabalho e aplicativos X64."
                    )),
                    ("XII. Privacidade por Design", "Zero coleta de métricas, diagnósticos ou rastreamento oculto. O X64 LIOS jamais monitora sua atividade: seu hardware pertence exclusivamente a você.", (
                        "Compromisso arquitetônico absoluto com zero telemetria e zero rastreamento em segundo plano.",
                        "Garante soberania digital total sobre seus arquivos, processos e rede.",
                        "Garantido por design em 100% dos pacotes do X64 LIOS."
                    )),
                ]
            },
            "ru": {
                "cat": "// АРХИТЕКТУРНЫЕ ОСНОВЫ И МАНИФЕСТ",
                "title": "Архитектурный Манифест X64",
                "intro": "X64 LIOS создан как окончательный ответ на фрагментацию Linux. Мы объединили мощь высокопроизводительных ядер, точность игровой экосистемы и чистоту Arch для создания идеальной ОС.",
                "pillars": [
                    ("I. Абсолютная Свобода", "Чистота Arch Linux без PPA и корпоративных ограничений, 99% системных пакетов нетронуты, плюс доступ к AUR и современным графическим утилитам.", (
                        "Чистая база Arch Linux Rolling Release без инвазивных патчей.",
                        "Гарантирует мгновенный доступ ко всем пакетам Arch, AUR и Flatpak без искусственных ограничений.",
                        "Постоянно активно как фундамент вашей операционной системы."
                    )),
                    ("II. Хирургическая Оптимизация", "Ядро Linux-CachyOS с динамическими планировщиками sched_ext (scx_lavd / BORE), игровым демоном FalconD, ananicy-cpp и чистым ZRAM без ложных срабатываний systemd-oomd.", (
                        "Стек сверхнизкой задержки на уровне ядра (eBPF / BORE) и пространства пользователя.",
                        "Максимизирует минимальный FPS (1% Low) и защищает игры при компиляции шейдеров Vulkan через ZRAM.",
                        "Активно по умолчанию и настраивается в реальном времени во вкладке Процессор и Производительность."
                    )),
                    ("III. Мульти-Среда и Бесшовная Загрузка", "Плавный переход Silent Handover (Plymouth → SDDM без мерцания) и 8 официальных окружений (KDE Plasma 6, GNOME, COSMIC, Niri, Cinnamon, Xfce, Hyprland и Сервер).", (
                        "Графическая архитектура Wayland/X11 с бесшовной передачей кадрового буфера KMS и 8 окружениями.",
                        "Убирает консольный текст и мерцание при включении ПК, предоставляя готовый рабочий стол в стиле X64.",
                        "Выбирается при установке в Calamares и работает при каждом запуске."
                    )),
                    ("IV. Суверенные Репозитории", "Каскадная иерархия репозиториев: [x64-lios] имеет приоритет №1 над CachyOS и Arch, доставляя фирменные пакеты и оптимизации по SSL.", (
                        "Собственная инфраструктура репозиториев (repo.x64lios.com) с наивысшим приоритетом в /etc/pacman.conf.",
                        "Мгновенно доставляет обновления фирменных утилит X64 LIOS, тем загрузчиков и системных скриптов.",
                        "Автоматически используется при каждом запуске X64 Update или pacman."
                    )),
                    ("V. Адаптация Оборудования (v3 / v4)", "При установке система проверяет процессор: современные CPU получают репозитории AVX2/AVX-512 (v3/v4), а chwd автоматически настраивает GPU NVIDIA, AMD и Intel.", (
                        "Интеллектуальное определение оборудования, подбирающее бинарные пакеты под инструкции вашего CPU и GPU.",
                        "Раскрывает потенциал инструкций AVX2 и AVX-512 и автоматически устанавливает оптимальные видеодрайверы.",
                        "Настраивается автоматически при установке и отображается во вкладке Главная."
                    )),
                    ("VI. Модульная Архитектура Без Мусора", "Чистая базовая система потребляет всего ~600–800 МБ ОЗУ в простое. Игровые лаунчеры устанавливаются в 1 клик через X64 Gaming Center.", (
                        "Строгое разделение между легким базовым ядром ОС и дополнительными тяжелыми приложениями.",
                        "Сохраняет минимальное потребление ОЗУ и позволяет установить Steam, Heroic или Lutris в 1 клик.",
                        "Доступно по запросу во вкладке Игровой Центр."
                    )),
                    ("VII. Защита Btrfs и 4 Официальных Загрузчика", "Мгновенные снимки Btrfs + Snapper для Limine, GRUB, systemd-boot и rEFInd с безопасным обнаружением Dual-Boot с Windows.", (
                        "Система автоматических загружаемых снимков перед каждым обновлением системы.",
                        "Позволяет откатить любое обновление за секунды прямо из меню загрузчика.",
                        "Снимки создаются автоматически перед каждым обновлением."
                    )),
                    ("VIII. Принцип GUI-First и Терминал Хакера", "Удобное управление через нативные приложения PyQt6 в сочетании с терминалом Kitty, оболочкой Fish, Fastfetch и приглашением Starship.", (
                        "Синергия удобных графических панелей управления в 1 клик и преднастроенного терминала.",
                        "Позволяет управлять ядрами, сетью и драйверами без командной строки, сохраняя мощный терминал для профи.",
                        "Доступно в любое время в приложениях X64 и терминале Kitty."
                    )),
                    ("IX. Передовой Rolling Release", "Непрерывное обновление на базе Arch Linux: свежие ядра, драйверы Mesa/NVIDIA и улучшения Proton без переустановки системы через X64 Update.", (
                        "Модель непрерывных обновлений, при которой ваша ОС никогда не устаревает.",
                        "Обеспечивает мгновенную поддержку нового оборудования и прирост FPS в Vulkan/Proton под защитой Snapper.",
                        "Применяется при каждом обновлении системы через X64 Update."
                    )),
                    ("X. Игровой Сетевой Стек", "Алгоритм Google TCP BBR + FQ против буферблоата, отключение энергосбережения Wi-Fi (Low-Jitter), тест пинга DNS с шифрованием DoT и межсетевой экран UFW.", (
                        "Глубокая оптимизация стека TCP/IP ядра Linux в сочетании с зашифрованным DNS-over-TLS.",
                        "Устраняет скачки пинга по Wi-Fi в онлайн-играх и блокирует несанкционированные входящие подключения.",
                        "TCP BBR и Wi-Fi Low-Jitter активны по умолчанию; DNS и UFW настраиваются в разделе Сеть и Безопасность."
                    )),
                    ("XI. Эстетика как Функция", "Широкоформатный интерфейс, палитра Багровый и Угольный (#b31b1b / #0b0b0d), подробные всплывающие подсказки и векторная иконографика.", (
                        "Единый высококонтрастный визуальный стиль без отвлекающих элементов во всей экосистеме X64 LIOS.",
                        "Снижает нагрузку на зрение и наглядно отображает телеметрию оборудования и переключатели.",
                        "Присутствует от загрузчика и экрана SDDM до рабочего стола и утилит X64."
                    )),
                    ("XII. Приватность по Умолчанию", "Ноль телеметрии, скрытых отчетов и фоновой слежки. В отличие от коммерческих ОС, X64 LIOS никогда не следит за вами — ваш ПК принадлежит только вам.", (
                        "Бескомпромиссный архитектурный принцип полного отсутствия телеметрии и фоновой слежки.",
                        "Гарантирует полный цифровой суверенитет над вашими файлами, процессами и сетевым трафиком.",
                        "Гарантировано архитектурой в 100% пакетов X64 LIOS."
                    )),
                ]
            }
        }

        cur_data = philo_i18n.get(_lang_code, philo_i18n["en"])
        en_pillars = philo_i18n["en"]["pillars"]

        cat_lbl = QLabel(cur_data["cat"])
        cat_lbl.setStyleSheet("color: #ef4444; font-size: 11px; font-weight: bold; letter-spacing: 1.5px; background: transparent;")
        layout.addWidget(cat_lbl)

        title = QLabel(cur_data["title"])
        title.setStyleSheet("color: #ffffff; font-size: 24px; font-weight: bold; background: transparent;")
        layout.addWidget(title)

        intro = QLabel(cur_data["intro"])
        intro.setStyleSheet("color: #a8a8b2; font-size: 12px; font-style: italic; background: transparent;")
        intro.setWordWrap(True)
        layout.addWidget(intro)
        layout.addSpacing(4)

        scroll_area = QScrollArea()
        scroll_area.setWidgetResizable(True)
        scroll_area.setStyleSheet(SCROLLBAR_STYLE)

        content_widget = QWidget()
        content_widget.setStyleSheet("background: transparent;")
        grid = QGridLayout()
        grid.setContentsMargins(0, 0, 8, 6)
        grid.setHorizontalSpacing(14)
        grid.setVerticalSpacing(8)
        grid.setColumnStretch(0, 1)
        grid.setColumnStretch(1, 1)

        for idx, (p_title, p_desc, *_) in enumerate(cur_data["pillars"]):
            row = idx // 2
            col = idx % 2

            frame = QFrame()
            frame.setObjectName("FiloCard")
            frame.setAttribute(Qt.WidgetAttribute.WA_Hover, True)
            frame.setAttribute(Qt.WidgetAttribute.WA_StyledBackground, True)
            frame.setMinimumWidth(0)
            frame.setSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Preferred)
            frame.setStyleSheet("""
                QFrame#FiloCard {
                    background-color: rgba(255, 255, 255, 0.025);
                    border: 1px solid rgba(255, 255, 255, 0.065);
                    border-radius: 10px;
                    border-left: 2px solid rgba(220, 38, 38, 0.55);
                }
                QFrame#FiloCard:hover {
                    background-color: rgba(255, 255, 255, 0.05);
                    border: 1px solid rgba(255, 255, 255, 0.12);
                    border-left: 2px solid #dc2626;
                }
            """)
            flayout = QVBoxLayout()
            flayout.setContentsMargins(15, 9, 15, 9)
            flayout.setSpacing(3)

            lbl_t = FitLabel(p_title)
            lbl_t.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
            lbl_t.setStyleSheet("color: #ffffff; font-weight: bold; font-size: 13.2px; border: none; background: transparent;")

            lbl_d = QLabel(p_desc)
            lbl_d.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
            lbl_d.setStyleSheet("color: #a4a4ae; font-size: 11.2px; line-height: 1.32; border: none; background: transparent;")
            lbl_d.setWordWrap(True)
            _hfw = lbl_d.sizePolicy()
            _hfw.setHeightForWidth(True)
            lbl_d.setSizePolicy(_hfw)

            flayout.addWidget(lbl_t)
            flayout.addWidget(lbl_d)
            frame.setLayout(flayout)
            grid.addWidget(frame, row, col)

        content_widget.setLayout(grid)
        scroll_area.setWidget(content_widget)

        layout.addWidget(scroll_area)
        return page

    def change_language(self, lang_id):
        if lang_id != _lang_code:
            QTimer.singleShot(0, lambda: self._apply_language(lang_id))

    def _apply_language(self, lang_id):
        global _lang_code
        _lang_code = lang_id
        os.environ["X64_LANG"] = lang_id
        try:
            os.makedirs(os.path.dirname(LANG_CONF_PATH), exist_ok=True)
            with open(LANG_CONF_PATH, "w") as f:
                f.write(lang_id + "\n")
        except Exception:
            pass
        current_idx = self.stacked_widget.currentIndex() if hasattr(self, "stacked_widget") else 0
        self._svc_worker = None
        self.build_ui(initial_page=current_idx)
        self.update_hardware_telemetry(force=True)
        self.refresh_services_async()

    def change_page(self, index):
        for i, btn in enumerate(self.nav_buttons):
            if i == index:
                btn.set_active_style()
            else:
                btn.set_inactive_style()
        self.stacked_widget.setCurrentIndex(index)
        if index == 0:
            self.update_hardware_telemetry(force=True)
            self.refresh_services_async()
        elif index == 1:
            if hasattr(self, "scx_panel"):
                self.scx_panel.refresh_runtime_state(select_active=True)
            self.refresh_services_async()
        elif index == 2:
            if hasattr(self, "dns_panel"):
                self.dns_panel.populate_connections()
                if not self.dns_panel._has_benchmarked:
                    QTimer.singleShot(120, self.dns_panel.run_ping_benchmark)
            self.refresh_services_async()
        elif index == 3:
            self.refresh_services_async()


if __name__ == '__main__':
    # Single-instance lock to prevent duplicate windows on boot / shortcuts
    _lock_path = f"/run/user/{os.getuid()}/x64-hello.lock"
    try:
        os.makedirs(os.path.dirname(_lock_path), exist_ok=True)
        _lock_fd = open(_lock_path, "w")
        fcntl.flock(_lock_fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
    except (IOError, BlockingIOError, OSError):
        try:
            subprocess.run(["hyprctl", "dispatch", "focuswindow", "class:x64-hello"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
        except Exception:
            pass
        sys.exit(0)

    app = QApplication(sys.argv)
    app.setDesktopFileName("x64-hello")
    icon = QIcon(LOGO_PATH)
    app.setWindowIcon(icon)
    QIcon.setThemeName("breeze-dark")
    app.setStyle("Fusion")
    _pal = app.palette()
    _pal.setColor(QPalette.ColorRole.Window, QColor("#121217"))
    _pal.setColor(QPalette.ColorRole.WindowText, QColor("#f2f2f2"))
    _pal.setColor(QPalette.ColorRole.Base, QColor("#0d0d11"))
    _pal.setColor(QPalette.ColorRole.AlternateBase, QColor("#16161c"))
    _pal.setColor(QPalette.ColorRole.Text, QColor("#f2f2f2"))
    _pal.setColor(QPalette.ColorRole.Button, QColor("#18181f"))
    _pal.setColor(QPalette.ColorRole.ButtonText, QColor("#f2f2f2"))
    _pal.setColor(QPalette.ColorRole.Highlight, QColor("#cc0000"))
    _pal.setColor(QPalette.ColorRole.HighlightedText, QColor("#ffffff"))
    app.setPalette(_pal)
    app.setStyleSheet("""
        QToolTip {
            background-color: #121217;
            color: #f2f2f2;
            border: 1px solid #cc0000;
            border-radius: 7px;
            padding: 8px 12px;
            font-size: 12px;
        }
    """)
    hello = X64Hello()
    hello.setWindowIcon(icon)
    hello.show()
    if "--scheduler" in sys.argv:
        hello.change_page(1)
    elif "--dns" in sys.argv or "--security" in sys.argv:
        hello.change_page(2)
    elif "--gaming" in sys.argv:
        hello.change_page(4)
    sys.exit(app.exec())
