/* programmer.css — extracted verbatim from programmer.html's original inline <style>; logic/behavior unchanged, only relocated */
/* ==========================================================================
           1. DESIGN SYSTEM & VARIABLES (Synced with Dashboard & Unit Converter)
           ========================================================================== */
        :root {
            --font-main: 'Plus Jakarta Sans', sans-serif;
            --font-mono: 'Fira Code', monospace;
            --transition-speed: 0.4s;
            --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
            
            --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
            --calc-bg: #ffffff;
            --calc-border: rgba(15, 23, 42, 0.06);
            --calc-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.04);
            --text-main: #0f172a;
            --text-secondary: #64748b;
            
            --input-bg: rgba(241, 245, 249, 0.8);
            --accent-color: #059669; /* Programmer Green Accent theme */
            --accent-hover: #047857;
            --panel-bg: #ffffff;
            --scrollbar-thumb: rgba(15, 23, 42, 0.15);

            /* Button Variations - Light */
            --btn-num-bg: rgba(241, 245, 249, 0.8);
            --btn-num-text: #0f172a;
            --btn-op-bg: rgba(5, 150, 105, 0.08);
            --btn-op-text: #059669;
            --btn-fn-bg: rgba(241, 245, 249, 0.5);
            --btn-fn-text: #64748b;
            --btn-sci-bg: rgba(241, 245, 249, 0.6);
            --btn-sci-text: #334155;
        }

        body.dark-mode {
            --bg-gradient: linear-gradient(135deg, #020617 0%, #0f172a 100%);
            --calc-bg: rgba(15, 23, 42, 0.6);
            --calc-border: rgba(255, 255, 255, 0.06);
            --calc-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
            --text-main: #f8fafc;
            --text-secondary: #94a3b8;
            
            --input-bg: rgba(30, 41, 59, 0.5);
            --accent-color: #34d399;
            --accent-hover: #059669;
            --panel-bg: rgba(15, 23, 42, 0.95);
            --scrollbar-thumb: rgba(255, 255, 255, 0.1);

            /* Button Variations - Dark */
            --btn-num-bg: rgba(255, 255, 255, 0.03);
            --btn-num-text: #f8fafc;
            --btn-op-bg: rgba(52, 211, 153, 0.1);
            --btn-op-text: #34d399;
            --btn-fn-bg: rgba(255, 255, 255, 0.02);
            --btn-fn-text: #94a3b8;
            --btn-sci-bg: rgba(255, 255, 255, 0.04);
            --btn-sci-text: #cbd5e1;
        }

        /* ==========================================================================
           2. GLOBAL STYLES & RESET
           ========================================================================== */
        * { box-sizing: border-box; margin: 0; padding: 0; user-select: none; -webkit-user-select: none; }
        body {
            font-family: var(--font-main); background: var(--bg-gradient); min-height: 100vh;
            display: flex; justify-content: center; align-items: center; padding: 40px 20px;
            color: var(--text-main); transition: background var(--transition-speed) ease, color var(--transition-speed) ease;
            overflow-x: hidden; position: relative;
        }
        body::before {
            content: ''; position: absolute; width: 400px; height: 400px; border-radius: 50%;
            filter: blur(150px); opacity: 0.12; z-index: -1; top: -10%; left: -10%; background: #059669;
        }

        /* ==========================================================================
           3. APPLICATION CONTAINER & HEADER (Unit Style Dynamic Desktop Scroll)
           ========================================================================== */
        .calc-container {
            position: relative; width: 100%; max-width: 540px; 
            max-height: calc(100vh - 80px); /* Desktop Scroll Constraint Layout */
            background: var(--calc-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
            border: 1px solid var(--calc-border); border-radius: 28px; box-shadow: var(--calc-shadow);
            display: flex; flex-direction: column; overflow: hidden; transition: var(--transition-smooth);
        }
        .calc-header {
            display: flex; justify-content: space-between; align-items: center;
            padding: 20px 24px 10px 24px; z-index: 10; flex-shrink: 0;
        }
        .calc-title { font-family: 'Space Grotesk', sans-serif; font-size: 1.2rem; font-weight: 700; letter-spacing: -0.5px; }
        .header-controls { display: flex; gap: 10px; align-items: center; }
        
        .icon-btn {
            background: var(--input-bg); border: 1px solid var(--calc-border);
            width: 38px; height: 38px; border-radius: 12px; cursor: pointer;
            display: flex; justify-content: center; align-items: center;
            color: var(--text-main); transition: var(--transition-smooth);
        }
        .icon-btn:hover { transform: scale(1.05); border-color: var(--accent-color); }
        .icon-btn:active { transform: scale(0.95); }
        .icon-btn svg { width: 18px; height: 18px; fill: currentColor; }

        .theme-btn .sun-icon, body.dark-mode .theme-btn .moon-icon { display: none; }
        body.dark-mode .theme-btn .sun-icon { display: block; }

        /* ==========================================================================
           4. WORKSPACE SCROLLER MODULE
           ========================================================================== */
        .calc-body-workspace {
            padding: 0 24px 24px 24px; flex-grow: 1; display: flex;
            flex-direction: column; gap: 14px; overflow-y: auto;
        }
        .calc-body-workspace::-webkit-scrollbar { width: 5px; }
        .calc-body-workspace::-webkit-scrollbar-track { background: transparent; }
        .calc-body-workspace::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 10px; }

        /* Displays Box Card */
        .calc-screen { text-align: right; padding: 10px 4px; flex-shrink: 0; }
        .screen-history { font-size: 1rem; color: var(--text-secondary); min-height: 24px; margin-bottom: 4px; overflow-x: auto; white-space: nowrap; }
        .screen-current { font-family: 'Space Grotesk', sans-serif; font-size: 2.6rem; font-weight: 700; overflow-x: auto; white-space: nowrap; }

        /* Radix Radrad Base Channels Stack */
        .radix-channels { display: flex; flex-direction: column; gap: 6px; background: var(--input-bg); padding: 12px; border-radius: 16px; border: 1px solid var(--calc-border); }
        .radix-row { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 10px; cursor: pointer; transition: var(--transition-smooth); }
        .radix-row.active { background: rgba(5, 150, 105, 0.12); color: var(--accent-color); font-weight: 700; }
        body.dark-mode .radix-row.active { background: rgba(52, 211, 153, 0.15); }
        .radix-lbl { font-family: 'Space Grotesk', sans-serif; font-size: 0.85rem; width: 40px; color: var(--text-secondary); }
        .radix-row.active .radix-lbl { color: var(--accent-color); }
        .radix-val { font-family: var(--font-mono); font-size: 0.95rem; word-break: break-all; text-align: left; flex-grow: 1; }

        /* Architecture Configuration Control Bar */
        .control-strip { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
        .pill-select {
            background: var(--input-bg); border: 1px solid var(--calc-border); padding: 8px 14px;
            border-radius: 10px; color: var(--text-main); font-family: var(--font-main); font-size: 0.8rem;
            font-weight: 700; cursor: pointer; outline: none; transition: var(--transition-smooth);
        }
        .pill-select:focus { border-color: var(--accent-color); }

        /* ==========================================================================
           5. INTERACTIVE BINARY BIT MAP VIEWER MODULE
           ========================================================================== */
        .bit-viewer-container {
            background: var(--input-bg); border: 1px solid var(--calc-border); padding: 12px;
            border-radius: 16px; display: flex; flex-direction: column; gap: 8px;
        }
        .bit-row { display: flex; flex-wrap: wrap; justify-content: space-between; row-gap: 6px; direction: rtl; }
        .bit-group { display: flex; gap: 3px; margin: 0 4px; }
        .bit-node {
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            width: 18px; height: 32px; cursor: pointer; transition: var(--transition-smooth);
        }
        .bit-val { font-family: var(--font-mono); font-size: 0.95rem; font-weight: 700; color: var(--text-secondary); }
        .bit-node.on .bit-val { color: var(--accent-color); text-shadow: 0 0 8px rgba(5, 150, 105, 0.4); }
        .bit-idx { font-size: 0.65rem; color: var(--text-secondary); opacity: 0.6; margin-top: -2px; }

        /* ==========================================================================
           6. COMPACT UNIFORM OPERATIONAL MATRIX KEYPAD
           ========================================================================== */
        .calc-keypad { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 4px; }
        .btn {
            border: 1px solid var(--calc-border); outline: none; font-family: var(--font-main);
            font-size: 0.95rem; font-weight: 600; border-radius: 12px; cursor: pointer;
            display: flex; justify-content: center; align-items: center; min-height: 44px;
            transition: var(--transition-smooth); position: relative; overflow: hidden;
        }
        .btn-num { background: var(--btn-num-bg); color: var(--btn-num-text); font-weight: 700; font-family: var(--font-mono); }
        .btn-op { background: var(--btn-op-bg); color: var(--btn-op-text); font-weight: 700; }
        .btn-fn { background: var(--btn-fn-bg); color: var(--btn-fn-text); }
        .btn-sci { background: var(--btn-sci-bg); color: var(--btn-sci-text); font-size: 0.85rem; }
        .btn-eq { background: var(--accent-color); color: #ffffff; font-size: 1.2rem; border: none; }
        
        .btn:hover, .btn.keyboard-active { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05); background: var(--btn-hover-bg); }
        .btn-eq:hover { background: var(--accent-hover); }
        .btn:disabled { opacity: 0.15; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

        /* Ripple Component */
        .ripple { position: absolute; background: rgba(255, 255, 255, 0.35); border-radius: 50%; transform: scale(0); animation: ripple-animation 0.45s linear; pointer-events: none; }
        body:not(.dark-mode) .btn:not(.btn-eq) .ripple { background: rgba(0, 0, 0, 0.06); }
        @keyframes ripple-animation { to { transform: scale(4); opacity: 0; } }

        /* ==========================================================================
           7. SLIDEOUT HISTORY PANEL
           ========================================================================== */
        .history-panel {
            position: absolute; top: 0; right: -100%; width: 100%; height: 100%;
            background: var(--panel-bg); backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
            z-index: 100; transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1); display: flex; flex-direction: column;
        }
        .history-panel.open { right: 0; }
        .history-header { display: flex; justify-content: space-between; align-items: center; padding: 24px; border-bottom: 1px solid var(--calc-border); }
        .history-title { font-family: 'Space Grotesk', sans-serif; font-size: 1.3rem; font-weight: 700; }
        .history-list { flex-grow: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; }
        .history-list::-webkit-scrollbar { width: 4px; }
        .history-list::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }
        
        .history-item { text-align: right; padding: 12px; border-radius: 12px; background: var(--btn-fn-bg); border: 1px solid var(--calc-border); cursor: pointer; transition: var(--transition-smooth); }
        .history-item:hover { border-color: var(--accent-color); transform: translateY(-1px); }
        .history-item-expr { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 4px; }
        .history-item-res { font-size: 1.15rem; font-weight: 700; font-family: var(--font-mono); }
        .history-footer { padding: 20px 24px; border-top: 1px solid var(--calc-border); display: flex; justify-content: flex-end; }
        .clear-hist-btn { background: transparent; border: none; color: var(--accent-color); font-size: 0.9rem; font-weight: 700; cursor: pointer; }

        .toast {
            position: absolute; bottom: 35px; left: 50%; transform: translate(-50%, 20px);
            background: #0f172a; color: #fff; padding: 10px 20px; border-radius: 50px;
            font-size: 0.85rem; font-weight: 600; opacity: 0; pointer-events: none;
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); z-index: 200;
        }
        body.dark-mode .toast { background: #f8fafc; color: #0f172a; }
        .toast.show { transform: translate(-50%, 0); opacity: 1; }

        @media (max-width: 480px) {
            body { padding: 0; }
            .calc-container { max-width: 100%; height: 100vh; max-height: 100vh; border-radius: 0; border: none; }
        }
