/* ============================================================
   MERCWAR EV.4 — MODERN FUTURISTIC / LLM HUD DESIGN SYSTEM
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;600;800&family=Orbitron:wght@500;700;900&display=swap');

        :root {
            --bg-color: #04060a;
            --panel-bg: rgba(10, 15, 24, 0.88);
            --sidebar-bg: rgba(5, 8, 14, 0.96);
            --border-color: #00f0ff;
            --border-subtle: rgba(0, 240, 255, 0.2);
            --text-primary: #e0f7fc;
            --text-accent: #00f0ff;
            --text-muted: #5a738e;
            --hover-color: rgba(0, 240, 255, 0.15);
            --active-color: rgba(0, 240, 255, 0.3);
            --glow-color: rgba(0, 240, 255, 0.25);
            --glow-intense: rgba(0, 240, 255, 0.6);
            --terminal-green: #00ff66;
            --warning-amber: #ffb700;
            --error-red: #ff3366;
        }

        /* ============================================================
           CUSTOM CYBERPUNK WEBKIT SCROLLBAR STYLING
           ============================================================ */
        ::-webkit-scrollbar {
            width: 8px;
            height: 8px;
            background-color: #04060a;
        }

        ::-webkit-scrollbar-track {
            background: rgba(5, 8, 14, 0.9);
            border-left: 1px solid rgba(0, 240, 255, 0.15);
            box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.8);
        }

        ::-webkit-scrollbar-thumb {
            background: linear-gradient(180deg, #00f0ff 0%, #005577 100%);
            border-radius: 2px;
            border: 1px solid #00f0ff;
            box-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
        }

        ::-webkit-scrollbar-thumb:hover {
            background: linear-gradient(180deg, #70f8ff 0%, #0088bb 100%);
            box-shadow: 0 0 12px rgba(0, 240, 255, 0.9);
        }

        ::-webkit-scrollbar-corner {
            background: #04060a;
        }

        /* Firefox Standard Fallback */
        * {
            scrollbar-width: thin;
            scrollbar-color: #00f0ff #04060a;
            box-sizing: border-box;
        }

        body {
            background-color: var(--bg-color);
            color: var(--text-primary);
            font-family: 'Consolas', 'Courier New', monospace;
            margin: 0;
            padding: 0;
            display: flex;
            height: 100vh;
            overflow: hidden;
            background-image: 
                radial-gradient(circle at 50% 50%, rgba(0, 240, 255, 0.03) 0%, transparent 80%),
                linear-gradient(rgba(0, 240, 255, 0.02) 1px, transparent 1px),
                linear-gradient(90deg, rgba(0, 240, 255, 0.02) 1px, transparent 1px);
            background-size: 100% 100%, 20px 20px, 20px 20px;
        }

        /* ============================================================
           SIDEBAR STYLING
           ============================================================ */
        #sidebar {
            width: 240px;
            background: var(--sidebar-bg);
            border-right: 1px solid var(--border-color);
            display: flex;
            flex-direction: column;
            box-shadow: 2px 0 15px var(--glow-color);
            z-index: 10;
        }

        .sidebar-header {
            padding: 15px;
            border-bottom: 1px solid var(--border-color);
            background: rgba(0, 240, 255, 0.05);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .sidebar-title {
            margin: 0;
            font-size: 0.85rem;
            color: var(--text-accent);
            text-transform: uppercase;
            letter-spacing: 1px;
            text-shadow: 0 0 5px var(--glow-color);
        }

        .refresh-btn {
            background: transparent;
            border: 1px solid var(--border-color);
            color: var(--text-accent);
            cursor: pointer;
            padding: 4px 8px;
            font-family: inherit;
            font-size: 0.75rem;
            border-radius: 2px;
            transition: all 0.2s ease;
        }

        .refresh-btn:hover {
            background: var(--hover-color);
            box-shadow: 0 0 8px var(--glow-color);
        }

        .file-tree {
            flex: 1;
            overflow-y: auto;
            padding: 10px;
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 6px;
            align-content: start;
        }

        .tree-item {
            padding: 10px 0;
            font-size: 0.95rem;
            color: var(--text-primary);
            cursor: pointer;
            border-radius: 3px;
            border: 1px solid var(--border-subtle);
            background: rgba(0, 0, 0, 0.5);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
            user-select: none;
        }

        .tree-item:hover {
            background: var(--hover-color);
            border-color: var(--text-accent);
            box-shadow: 0 0 6px var(--glow-color);
        }

        .tree-item.active {
            background: var(--active-color);
            border-color: var(--border-color);
            color: #ffffff;
            font-weight: bold;
            box-shadow: 0 0 10px var(--glow-color);
        }

        .item-label {
            font-size: 0.65rem;
            color: var(--text-muted);
            text-transform: uppercase;
            margin-bottom: 2px;
        }

        .item-number {
            font-size: 1.1rem;
            color: var(--text-accent);
            font-weight: bold;
        }

        /* ============================================================
           WORKSPACE & DISPLAY INTERFACE
           ============================================================ */
        #workspace {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
        }

        .container {
            max-width: 1100px;
            margin: 0 auto;
            border: 1px solid var(--border-color);
            background: var(--panel-bg);
            box-shadow: 0 0 20px var(--glow-color);
            border-radius: 4px;
            padding: 25px;
            position: relative;
        }

        .container::before {
            content: '';
            position: absolute;
            top: -1px;
            left: -1px;
            width: 10px;
            height: 10px;
            border-top: 2px solid var(--text-accent);
            border-left: 2px solid var(--text-accent);
        }

        .container::after {
            content: '';
            position: absolute;
            bottom: -1px;
            right: -1px;
            width: 10px;
            height: 10px;
            border-bottom: 2px solid var(--text-accent);
            border-right: 2px solid var(--text-accent);
        }

        header {
            border-bottom: 1px solid var(--border-color);
            padding-bottom: 12px;
            margin-bottom: 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        h1 {
            margin: 0;
            font-size: 1.3rem;
            color: var(--text-accent);
            text-transform: uppercase;
            letter-spacing: 2px;
            text-shadow: 0 0 8px var(--glow-color);
        }

        .meta-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 12px;
            background: rgba(0, 0, 0, 0.5);
            padding: 15px;
            border-left: 3px solid var(--text-accent);
            margin-bottom: 20px;
            border-radius: 0 3px 3px 0;
        }

        .meta-item {
            font-size: 0.85rem;
        }

        .meta-label {
            color: var(--text-muted);
            font-weight: bold;
        }

        .translation-block {
            border: 1px solid var(--border-subtle);
            margin-bottom: 15px;
            background: rgba(5, 10, 18, 0.7);
            border-radius: 3px;
            transition: border-color 0.2s ease;
        }

        .translation-block:hover {
            border-color: rgba(0, 240, 255, 0.4);
        }

        .section-header {
            background: rgba(0, 240, 255, 0.1);
            color: var(--text-accent);
            padding: 8px 12px;
            font-size: 0.85rem;
            font-weight: bold;
            border-bottom: 1px solid var(--border-subtle);
            letter-spacing: 1px;
        }

        .section-body {
            padding: 12px;
            font-size: 0.9rem;
            line-height: 1.5;
        }

        .code-block {
            background: #020408;
            color: var(--terminal-green);
            padding: 12px;
            border-radius: 3px;
            font-family: 'Consolas', monospace;
            overflow-x: auto;
            border: 1px solid rgba(0, 255, 102, 0.2);
            box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.9);
        }

        .telemetry-corridor {
            background: rgba(0, 0, 0, 0.7);
            border: 1px solid var(--border-subtle);
            padding: 12px;
            font-size: 0.8rem;
            max-height: 200px;
            overflow-y: auto;
            color: var(--text-muted);
            border-radius: 3px;
        }

        .node-index {
            color: var(--warning-amber);
            margin-bottom: 5px;
        }

        .status-bar {
            margin-top: 15px;
            font-size: 0.8rem;
            color: var(--text-muted);
            text-align: right;
            letter-spacing: 1px;
        }

        .error-msg {
            color: var(--error-red);
            background: rgba(255, 51, 102, 0.1);
            padding: 12px;
            border: 1px solid var(--error-red);
            margin-top: 10px;
            border-radius: 3px;
        }

:root {
    /* Color Palette */
    --bg-deep: #020408;
    --panel-bg: rgba(8, 12, 20, 0.75);
    --panel-bg-solid: #090e17;
    --sidebar-bg: rgba(4, 7, 12, 0.85);
    
    /* Neon Accents & Glows */
    --border-cyan: #00f0ff;
    --border-subtle: rgba(0, 240, 255, 0.18);
    --glow-cyan: rgba(0, 240, 255, 0.4);
    --glow-intense: rgba(0, 240, 255, 0.85);
    
    /* Typography Colors */
    --text-main: #d1f4ff;
    --text-accent: #00f0ff;
    --text-muted: #486581;
    --text-bright: #ffffff;
    
    /* State Indicators */
    --terminal-green: #00ff88;
    --warning-amber: #ffaa00;
    --error-red: #ff2a5f;
    
    /* FX Elements */
    --glass-blur: blur(16px);
    --scanline-opacity: 0.04;
}

/* Base Body & Layout Defaults */
* {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--border-cyan) var(--bg-deep);
}

body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
    margin: 0;
    padding: 0;
    display: flex;
    height: 100vh;
    overflow: hidden;
    position: relative;
    /* Grid Background Overlay */
    background-image: 
        radial-gradient(circle at 50% 30%, rgba(0, 240, 255, 0.08) 0%, transparent 70%),
        linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
    background-size: 100% 100%, 30px 30px, 30px 30px;
}

/* CRT Scanline Effect Overlay */
body::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    z-index: 100;
    background-size: 100% 3px, 6px 100%;
    pointer-events: none;
    opacity: var(--scanline-opacity);
}

/* ============================================================
   NEON WEBKIT SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
    background-color: var(--bg-deep);
}

::-webkit-scrollbar-track {
    background: rgba(4, 7, 12, 0.9);
    border-left: 1px solid rgba(0, 240, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--border-cyan) 0%, #005577 100%);
    border-radius: 1px;
    box-shadow: 0 0 10px var(--glow-cyan);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-cyan);
    box-shadow: 0 0 15px var(--glow-intense);
}

/* ============================================================
   GLASSMORPHIC FUTURISTIC SIDEBAR
   ============================================================ */
#sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.8), inset -1px 0 0 var(--border-subtle);
    z-index: 10;
}

.sidebar-header {
    padding: 18px 15px;
    border-bottom: 1px solid var(--border-subtle);
    background: linear-gradient(90deg, rgba(0, 240, 255, 0.08) 0%, transparent 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-title {
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-bright);
    letter-spacing: 2px;
    text-shadow: 0 0 8px var(--glow-cyan);
}

.refresh-btn {
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid var(--border-cyan);
    color: var(--text-accent);
    cursor: pointer;
    padding: 5px 10px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 2px;
    letter-spacing: 1px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.refresh-btn:hover {
    background: var(--border-cyan);
    color: var(--bg-deep);
    box-shadow: 0 0 12px var(--glow-intense);
    transform: translateY(-1px);
}

.file-tree {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    align-content: start;
}

.tree-item {
    padding: 12px 0;
    font-size: 0.9rem;
    color: var(--text-main);
    cursor: pointer;
    border-radius: 3px;
    border: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.tree-item::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

.tree-item:hover::before {
    left: 100%;
}

.tree-item:hover {
    background: rgba(0, 240, 255, 0.08);
    border-color: var(--border-cyan);
    box-shadow: 0 0 12px var(--glow-cyan);
    transform: translateY(-2px);
}

.tree-item.active {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.25) 0%, rgba(0, 85, 119, 0.4) 100%);
    border-color: var(--border-cyan);
    color: var(--text-bright);
    box-shadow: 0 0 15px var(--glow-cyan), inset 0 0 8px var(--glow-cyan);
}

.item-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    margin-bottom: 2px;
}

.item-number {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.15rem;
    color: var(--text-accent);
    font-weight: 700;
}

/* ============================================================
   WORKSPACE DISPLAY INTERFACE & LLM HUD
   ============================================================ */
#workspace {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
}

.container {
    max-width: 1150px;
    margin: 0 auto;
    border: 1px solid var(--border-subtle);
    background: var(--panel-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.9), 0 0 15px var(--glow-cyan);
    border-radius: 4px;
    padding: 30px;
    position: relative;
}

/* Futuristic Tech Corners */
.container::before {
    content: '';
    position: absolute;
    top: -1px; left: -1px;
    width: 14px; height: 14px;
    border-top: 2px solid var(--border-cyan);
    border-left: 2px solid var(--border-cyan);
    box-shadow: -2px -2px 8px var(--glow-cyan);
}

.container::after {
    content: '';
    position: absolute;
    bottom: -1px; right: -1px;
    width: 14px; height: 14px;
    border-bottom: 2px solid var(--border-cyan);
    border-right: 2px solid var(--border-cyan);
    box-shadow: 2px 2px 8px var(--glow-cyan);
}

header {
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 15px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--text-bright);
    letter-spacing: 3px;
    text-shadow: 0 0 12px var(--glow-cyan);
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
    background: rgba(0, 0, 0, 0.6);
    padding: 16px;
    border-left: 3px solid var(--border-cyan);
    border-radius: 0 4px 4px 0;
    margin-bottom: 25px;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8);
}

.meta-item {
    font-size: 0.82rem;
    letter-spacing: 0.5px;
}

.meta-label {
    color: var(--text-muted);
    font-weight: 600;
}

/* Code & Translation Blocks (LLM Response Style) */
.translation-block {
    border: 1px solid var(--border-subtle);
    margin-bottom: 18px;
    background: rgba(4, 8, 15, 0.8);
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.translation-block:hover {
    border-color: rgba(0, 240, 255, 0.4);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.1);
}

.section-header {
    background: linear-gradient(90deg, rgba(0, 240, 255, 0.12) 0%, transparent 100%);
    color: var(--text-accent);
    padding: 10px 15px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border-subtle);
    letter-spacing: 2px;
}

.section-body {
    padding: 15px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.code-block {
    background: #010204;
    color: var(--terminal-green);
    padding: 14px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    overflow-x: auto;
    border: 1px solid rgba(0, 255, 136, 0.2);
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.9);
}

/* Telemetry Log Window */
.telemetry-corridor {
    background: rgba(1, 3, 6, 0.85);
    border: 1px solid var(--border-subtle);
    padding: 14px;
    font-size: 0.8rem;
    max-height: 200px;
    overflow-y: auto;
    color: var(--text-muted);
    border-radius: 3px;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.9);
}

.node-index {
    color: var(--warning-amber);
    margin-bottom: 6px;
}

.status-bar {
    margin-top: 20px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: right;
    letter-spacing: 2px;
}

.error-msg {
    color: var(--error-red);
    background: rgba(255, 42, 95, 0.08);
    padding: 14px;
    border: 1px solid var(--error-red);
    border-radius: 3px;
    box-shadow: 0 0 12px rgba(255, 42, 95, 0.2);
}
/* Container */
.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr; /* Force every row to stretch equally */
  align-items: stretch; /* Ensures buttons fill vertical cell space */
}

/* Button override */
.keypad-grid button {
  height: 100%; /* Spans full height of the row track */
}
/* Container */
.button-row {
  display: flex;
  align-items: stretch; /* Default behavior, but ensures cross-axis stretching */
}

/* Button */
.button-row button {
  flex: 1; /* Stretch horizontally across the row */
  height: 100%; /* Stretch vertically to match container height */
}
        :root {
            --bg-color: #04060a;
            --panel-bg: rgba(10, 15, 24, 0.88);
            --sidebar-bg: rgba(5, 8, 14, 0.96);
            --border-color: #00f0ff;
            --border-subtle: rgba(0, 240, 255, 0.2);
            --text-primary: #e0f7fc;
            --text-accent: #00f0ff;
            --text-muted: #5a738e;
            --hover-color: rgba(0, 240, 255, 0.15);
            --active-color: rgba(0, 240, 255, 0.3);
            --glow-color: rgba(0, 240, 255, 0.25);
            --glow-intense: rgba(0, 240, 255, 0.6);
            --terminal-green: #00ff66;
            --warning-amber: #ffb700;
            --error-red: #ff3366;
        }

        /* ============================================================
           CUSTOM CYBERPUNK WEBKIT SCROLLBAR STYLING
           ============================================================ */
        ::-webkit-scrollbar {
            width: 8px;
            height: 8px;
            background-color: #04060a;
        }

        ::-webkit-scrollbar-track {
            background: rgba(5, 8, 14, 0.9);
            border-left: 1px solid rgba(0, 240, 255, 0.15);
            box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.8);
        }

        ::-webkit-scrollbar-thumb {
            background: linear-gradient(180deg, #00f0ff 0%, #005577 100%);
            border-radius: 2px;
            border: 1px solid #00f0ff;
            box-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
        }

        ::-webkit-scrollbar-thumb:hover {
            background: linear-gradient(180deg, #70f8ff 0%, #0088bb 100%);
            box-shadow: 0 0 12px rgba(0, 240, 255, 0.9);
        }

        ::-webkit-scrollbar-corner {
            background: #04060a;
        }

        /* Firefox Standard Fallback */
        * {
            scrollbar-width: thin;
            scrollbar-color: #00f0ff #04060a;
            box-sizing: border-box;
        }

        body {
            background-color: var(--bg-color);
            color: var(--text-primary);
            font-family: 'Consolas', 'Courier New', monospace;
            margin: 0;
            padding: 0;
            display: flex;
            height: 100vh;
            overflow: hidden;
            background-image: 
                radial-gradient(circle at 50% 50%, rgba(0, 240, 255, 0.03) 0%, transparent 80%),
                linear-gradient(rgba(0, 240, 255, 0.02) 1px, transparent 1px),
                linear-gradient(90deg, rgba(0, 240, 255, 0.02) 1px, transparent 1px);
            background-size: 100% 100%, 20px 20px, 20px 20px;
        }

        /* ============================================================
           SIDEBAR STYLING
           ============================================================ */
        #sidebar {
            width: 240px;
            background: var(--sidebar-bg);
            border-right: 1px solid var(--border-color);
            display: flex;
            flex-direction: column;
            box-shadow: 2px 0 15px var(--glow-color);
            z-index: 10;
        }

        .sidebar-header {
            padding: 15px;
            border-bottom: 1px solid var(--border-color);
            background: rgba(0, 240, 255, 0.05);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .sidebar-title {
            margin: 0;
            font-size: 0.85rem;
            color: var(--text-accent);
            text-transform: uppercase;
            letter-spacing: 1px;
            text-shadow: 0 0 5px var(--glow-color);
        }

        .refresh-btn {
            background: transparent;
            border: 1px solid var(--border-color);
            color: var(--text-accent);
            cursor: pointer;
            padding: 4px 8px;
            font-family: inherit;
            font-size: 0.75rem;
            border-radius: 2px;
            transition: all 0.2s ease;
        }

        .refresh-btn:hover {
            background: var(--hover-color);
            box-shadow: 0 0 8px var(--glow-color);
        }

        .file-tree {
            flex: 1;
            overflow-y: auto;
            padding: 10px;
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 6px;
            align-content: start;
        }

        .tree-item {
            padding: 10px 0;
            font-size: 0.95rem;
            color: var(--text-primary);
            cursor: pointer;
            border-radius: 3px;
            border: 1px solid var(--border-subtle);
            background: rgba(0, 0, 0, 0.5);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
            user-select: none;
        }

        .tree-item:hover {
            background: var(--hover-color);
            border-color: var(--text-accent);
            box-shadow: 0 0 6px var(--glow-color);
        }

        .tree-item.active {
            background: var(--active-color);
            border-color: var(--border-color);
            color: #ffffff;
            font-weight: bold;
            box-shadow: 0 0 10px var(--glow-color);
        }

        .item-label {
            font-size: 0.65rem;
            color: var(--text-muted);
            text-transform: uppercase;
            margin-bottom: 2px;
        }

        .item-number {
            font-size: 1.1rem;
            color: var(--text-accent);
            font-weight: bold;
        }

        /* ============================================================
           WORKSPACE & DISPLAY INTERFACE
           ============================================================ */
        #workspace {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
        }

        .container {
            max-width: 1100px;
            margin: 0 auto;
            border: 1px solid var(--border-color);
            background: var(--panel-bg);
            box-shadow: 0 0 20px var(--glow-color);
            border-radius: 4px;
            padding: 25px;
            position: relative;
        }

        .container::before {
            content: '';
            position: absolute;
            top: -1px;
            left: -1px;
            width: 10px;
            height: 10px;
            border-top: 2px solid var(--text-accent);
            border-left: 2px solid var(--text-accent);
        }

        .container::after {
            content: '';
            position: absolute;
            bottom: -1px;
            right: -1px;
            width: 10px;
            height: 10px;
            border-bottom: 2px solid var(--text-accent);
            border-right: 2px solid var(--text-accent);
        }

        header {
            border-bottom: 1px solid var(--border-color);
            padding-bottom: 12px;
            margin-bottom: 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        h1 {
            margin: 0;
            font-size: 1.3rem;
            color: var(--text-accent);
            text-transform: uppercase;
            letter-spacing: 2px;
            text-shadow: 0 0 8px var(--glow-color);
        }

        .meta-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 12px;
            background: rgba(0, 0, 0, 0.5);
            padding: 15px;
            border-left: 3px solid var(--text-accent);
            margin-bottom: 20px;
            border-radius: 0 3px 3px 0;
        }

        .meta-item {
            font-size: 0.85rem;
        }

        .meta-label {
            color: var(--text-muted);
            font-weight: bold;
        }

        .translation-block {
            border: 1px solid var(--border-subtle);
            margin-bottom: 15px;
            background: rgba(5, 10, 18, 0.7);
            border-radius: 3px;
            transition: border-color 0.2s ease;
        }

        .translation-block:hover {
            border-color: rgba(0, 240, 255, 0.4);
        }

        .section-header {
            background: rgba(0, 240, 255, 0.1);
            color: var(--text-accent);
            padding: 8px 12px;
            font-size: 0.85rem;
            font-weight: bold;
            border-bottom: 1px solid var(--border-subtle);
            letter-spacing: 1px;
        }

        .section-body {
            padding: 12px;
            font-size: 0.9rem;
            line-height: 1.5;
        }

        .code-block {
            background: #020408;
            color: var(--terminal-green);
            padding: 12px;
            border-radius: 3px;
            font-family: 'Consolas', monospace;
            overflow-x: auto;
            border: 1px solid rgba(0, 255, 102, 0.2);
            box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.9);
        }

        .telemetry-corridor {
            background: rgba(0, 0, 0, 0.7);
            border: 1px solid var(--border-subtle);
            padding: 12px;
            font-size: 0.8rem;
            max-height: 200px;
            overflow-y: auto;
            color: var(--text-muted);
            border-radius: 3px;
        }

        .node-index {
            color: var(--warning-amber);
            margin-bottom: 5px;
        }

        .status-bar {
            margin-top: 15px;
            font-size: 0.8rem;
            color: var(--text-muted);
            text-align: right;
            letter-spacing: 1px;
        }

        .error-msg {
            color: var(--error-red);
            background: rgba(255, 51, 102, 0.1);
            padding: 12px;
            border: 1px solid var(--error-red);
            margin-top: 10px;
            border-radius: 3px;
        }
		
		.number-btn {
  width: 100%;
  height: 100px; /* Fill parent row/cell */
  min-height: 60px; /* Optional fallback height if container has no fixed height */
  box-sizing: border-box;
}

.number-btn {
width:100%;
height:100px;
min-height:60px;
box-sizing:border-box
}

/* ============================================================
   UPDATED FILE-TREE GRID & BUTTON TALLness
   ============================================================ */
.file-tree {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* Set explicit track heights so buttons stretch vertically */
    grid-auto-rows: minmax(75px, auto); 
    gap: 10px;
    align-content: start;
}

.tree-item {
    /* Set explicit height to fill the grid cell or force minimum size */
    height: 100%;
    min-height: 75px; 
    padding: 12px 8px;
    font-size: 0.9rem;
    color: var(--text-main);
    cursor: pointer;
    border-radius: 3px;
    border: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    user-select: none;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

/* ============================================================
   MERCWAR EV.4 — FINAL FULL-OF-LIFE HUD & ANIMATION PATCH
   ============================================================ */

/* 1. Pulsing HUD Border & Ambient Glow */
.container {
    animation: hud-pulse 8s ease-in-out infinite alternate;
}

@keyframes hud-pulse {
    0% {
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.9), 0 0 10px var(--glow-cyan);
        border-color: var(--border-subtle);
    }
    50% {
        box-shadow: 0 0 45px rgba(0, 0, 0, 0.95), 0 0 22px rgba(0, 240, 255, 0.35);
        border-color: rgba(0, 240, 255, 0.4);
    }
    100% {
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.9), 0 0 10px var(--glow-cyan);
        border-color: var(--border-subtle);
    }
}

/* 2. Interactive Reactive Number Buttons */
.tree-item {
    will-change: transform, box-shadow;
}

.tree-item:active {
    transform: scale(0.96) translateY(0px) !important;
    background: rgba(0, 240, 255, 0.25) !important;
    box-shadow: 0 0 20px var(--glow-intense), inset 0 0 12px var(--border-cyan) !important;
}

/* Pulsing accent ring on active grid selection */
.tree-item.active .item-number {
    text-shadow: 0 0 10px var(--border-cyan), 0 0 20px var(--glow-intense);
    animation: number-glow 2s ease-in-out infinite alternate;
}

@keyframes number-glow {
    0% { opacity: 0.85; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.08); }
}

/* 3. Live Animated CRT Scanline Sweep */
body::before {
    animation: scanline-sweep 12s linear infinite;
}

@keyframes scanline-sweep {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 0 100%, 0 0; }
}

/* 4. Live Terminal Blinking Cursor Indicator */
.status-bar::after {
    content: ' █';
    color: var(--border-cyan);
    font-weight: bold;
    animation: cursor-blink 1s step-start infinite;
}

@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* 5. Glowing Cyber Code Highlights & Hover Feedback */
.code-block {
    position: relative;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.code-block:hover {
    border-color: rgba(0, 255, 136, 0.5);
    box-shadow: inset 0 0 15px rgba(0, 255, 136, 0.15), 0 0 12px rgba(0, 255, 136, 0.2);
}

.refresh-btn {
    position: relative;
    overflow: hidden;
}

.refresh-btn:active {
    transform: scale(0.93);
}

/* ============================================================================
   MERCWAR EV.4 SOVEREIGN GLOW MATRIX OVERLAY — FUTURISTIC INTERFACE PATCH
   ============================================================================ */

@import url('https://googleapis.com');

:root {
    --bg-main: #020205;
    --bg-sidebar: #05070f;
    --bg-panel: rgba(10, 14, 26, 0.75);
    --border-color: #2ea043;
    --text-main: #d1d9e3;
    --text-muted: #627284;
    --text-accent: #38ef7d;
    --text-telemetry: #00f0ff;
    --text-alert: #ff4a4a;
    --glow-color: rgba(56, 239, 125, 0.25);
    --font-stack: 'Orbitron', monospace;
}

/* 1. Holographic Workspace Shell */
body {
    background: radial-gradient(circle at 50% 50%, #0d1326 0%, #020205 100%) !important;
    font-family: var(--font-stack) !important;
}

#sidebar, #workspace {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* 2. Tactical Scanning Borders & Title Enhancements */
#app-title {
    font-weight: 900 !important;
    letter-spacing: 2px !important;
    color: #ffffff !important;
    text-shadow: 0 0 12px var(--glow-color), 0 0 2px var(--text-accent) !important;
}

.sidebar-header {
    background: linear-gradient(90deg, rgba(46, 160, 67, 0.1) 0%, transparent 100%);
    border-bottom: 2px solid var(--border-color) !important;
}

/* 3. High-Velocity Cybernetic Sidebar Tree Toggles */
.tree-item {
    font-weight: 700;
    letter-spacing: 1px;
    border-left: 3px solid rgba(255, 255, 255, 0.1) !important;
    background: linear-gradient(90deg, rgba(255,255,255,0.01) 0%, transparent 100%) !important;
    text-shadow: 0 0 4px rgba(0,0,0,0.5);
}

.tree-item:hover {
    border-left-color: var(--text-telemetry) !important;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.15) !important;
}

.tree-item.active {
    border-left-color: var(--text-accent) !important;
    color: var(--text-accent) !important;
    text-shadow: 0 0 8px var(--text-accent) !important;
    background: linear-gradient(90deg, rgba(56, 239, 125, 0.08) 0%, transparent 100%) !important;
    animation: horizonPulse 2s infinite ease-in-out;
}

/* 4. Glass-Glass Console Configuration Modules */
.meta-item {
    background: var(--bg-panel) !important;
    border: 1px solid rgba(46, 160, 67, 0.3) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), inset 0 0 12px rgba(56, 239, 125, 0.05) !important;
}

/* 5. Telemetry Corridor CRT Simulation HUD */
.telemetry-corridor {
    border: 1px solid rgba(0, 240, 255, 0.3) !important;
    background: rgba(0, 3, 10, 0.9) !important;
    box-shadow: inset 0 0 15px rgba(0, 240, 255, 0.1), 0 0 10px rgba(0, 0, 0, 0.8) !important;
    position: relative;
}

/* Subtle diagnostic scanlines running through logging panel */
.telemetry-corridor::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 2;
    background-size: 100% 3px, 3px 100%;
    pointer-events: none;
}

.status-bar {
    border-top: 1px solid rgba(46, 160, 67, 0.4) !important;
    color: #ffffff !important;
    text-shadow: 0 0 5px var(--text-accent);
}

/* 6. Mechanical System Pulse Signatures */
@keyframes horizonPulse {
    0% { box-shadow: inset 0 0 8px rgba(56, 239, 125, 0.05); }
    50% { box-shadow: inset 0 0 16px rgba(56, 239, 125, 0.2), 0 0 8px rgba(56, 239, 125, 0.1); }
    100% { box-shadow: inset 0 0 8px rgba(56, 239, 125, 0.05); }
}

        /* Sovereign Framework Theme Presets */
        :root {
            --bg-main: #020205;
            --bg-sidebar: #070913;
            --bg-panel: #0d1117;
            --border-color: #2ea043;
            --text-main: #c9d1d9;
            --text-muted: #8b949e;
            --text-accent: #52f87a;
            --text-alert: #f85149;
            --text-telemetry: #38bdf8;
            --font-stack: 'Orbitron', 'Courier New', monospace;
        }

        body {
            margin: 0;
            padding: 0;
            background-color: var(--bg-main);
            color: var(--text-main);
            font-family: var(--font-stack);
            display: flex;
            height: 100vh;
            overflow: hidden;
        }

        /* Sidebar Matrix */
        #sidebar {
            width: 300px;
            background-color: var(--bg-sidebar);
            border-right: 1px solid var(--border-color);
            display: flex;
            flex-direction: column;
            box-sizing: border-box;
        }

        .sidebar-header {
            padding: 16px;
            border-bottom: 1px solid rgba(46, 160, 67, 0.4);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .sidebar-title {
            margin: 0;
            font-size: 1rem;
            color: #ffffff;
            letter-spacing: 1px;
            text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
        }

        .refresh-btn {
            background: rgba(46, 160, 67, 0.1);
            color: var(--text-accent);
            border: 1px solid var(--border-color);
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 0.75rem;
            cursor: pointer;
            font-family: var(--font-stack);
            transition: all 0.2s ease;
        }

        .refresh-btn:hover {
            background: var(--border-color);
            color: #000000;
            box-shadow: 0 0 10px var(--text-accent);
        }

        .file-tree {
            flex: 1;
            padding: 12px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .tree-item {
            background: rgba(255, 255, 255, 0.02);
            border: 1px solid rgba(255, 255, 255, 0.05);
            padding: 10px 14px;
            border-radius: 4px;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .tree-item:hover {
            border-color: var(--text-telemetry);
            background: rgba(56, 189, 248, 0.05);
            color: #ffffff;
        }

        .tree-item.active {
            border-color: var(--text-accent);
            background: rgba(46, 160, 67, 0.1);
            color: var(--text-accent);
            box-shadow: inset 0 0 8px rgba(82, 248, 122, 0.1);
        }

        /* Main Workspace Content */
        #workspace {
            flex: 1;
            display: flex;
            flex-direction: column;
            box-sizing: border-box;
            background: radial-gradient(circle at top right, rgba(7, 9, 19, 0.5), transparent);
        }

        .container {
            flex: 1;
            padding: 24px;
            display: flex;
            flex-direction: column;
            overflow-y: auto;
            box-sizing: border-box;
        }

        header {
            margin-bottom: 20px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            padding-bottom: 12px;
        }

        #app-title {
            margin: 0;
            font-size: 1.4rem;
            color: #ffffff;
            letter-spacing: 1px;
        }

        /* Telemetry Dashboard Metadata Grid */
        .meta-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 12px;
            margin-bottom: 20px;
        }

        .meta-item {
            background: var(--bg-panel);
            border: 1px solid rgba(255, 255, 255, 0.08);
            padding: 12px;
            border-radius: 6px;
            font-size: 0.8rem;
            line-height: 1.4;
        }

        .meta-label {
            color: var(--text-muted);
            margin-right: 6px;
        }

        /* Action/Translation Output Areas */
        #translation-container {
            flex: 1;
            min-height: 200px;
            display: flex;
            flex-direction: column;
            margin-bottom: 20px;
        }

        .telemetry-corridor {
            background: #000000;
            border: 1px solid rgba(56, 189, 248, 0.2);
            padding: 12px;
            border-radius: 4px;
            font-family: monospace;
            font-size: 0.8rem;
            line-height: 1.5;
            color: var(--text-muted);
            min-height: 60px;
            max-height: 120px;
            overflow-y: auto;
        }

        /* System Status Output Bar */
        .status-bar {
            background: var(--bg-sidebar);
            border: 1px solid rgba(255, 255, 255, 0.05);
            padding: 8px 14px;
            border-radius: 4px;
            font-size: 0.75rem;
            color: var(--text-muted);
            letter-spacing: 0.5px;
        }

        /* WebKit Scrollbar Overrides */
        ::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }
        ::-webkit-scrollbar-track {
            background: var(--bg-main);
        }
        ::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.1);
            border-radius: 3px;
        }
        ::-webkit-scrollbar-thumb:hover {
            background: var(--border-color);
        }