/* ==========================================================
           MASTER SYSTEM DEFAULT THEME 
           ========================================================== */
        :root {
            /* LIGHT MODE (DEFAULT) */
            --bg-body: #f8fafc;
            --bg-surface: #ffffff;
            --bg-card: #ffffff;
            --border-color: rgba(0, 0, 0, 0.08);
            --border-hover: rgba(139, 92, 246, 0.3);
            --text-main: #0f172a;
            --text-muted: #64748b;
            --text-body: #334155;
            
            --primary: #6366f1; 
            --primary-soft: #e0e7ff;
            --primary-glow: rgba(99, 102, 241, 0.3);
            --primary-grad: linear-gradient(135deg, #6366f1, #8b5cf6);
            --secondary: #3B82F6; 
            --accent: #F43F5E; 
            --success: #10B981; 
            --warning: #F59E0B;
            
            --nav-bg: rgba(255, 255, 255, 0.95);
            --sc-hover: #f1f5f9;
            --gradient-text: linear-gradient(90deg, #6366f1, #8b5cf6);
            
            --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
            --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
            --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
            --glass-blur: blur(16px);
        }

        @media (prefers-color-scheme: dark) {
            :root {
                /* DARK MODE */
                --bg-body: #050507;
                --bg-surface: #0e0e12;
                --bg-card: #14141a;
                --border-color: rgba(255, 255, 255, 0.08);
                --border-hover: rgba(255, 255, 255, 0.15);
                --text-main: #ffffff;
                --text-muted: #9ca3af;
                --text-body: #cbd5e1;
                
                --primary: #8B5CF6; 
                --primary-soft: rgba(139, 92, 246, 0.15);
                --primary-glow: rgba(139, 92, 246, 0.3);
                --primary-grad: linear-gradient(135deg, #8B5CF6, #3B82F6);
                --secondary: #3B82F6; 
                
                --nav-bg: rgba(5, 5, 7, 0.95);
                --sc-hover: rgba(255, 255, 255, 0.05);
                --gradient-text: linear-gradient(90deg, #8B5CF6, #3B82F6);
                
                --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
                --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
                --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
            }
        }

        * { margin: 0; padding: 0; box-sizing: border-box; -ms-overflow-style: none; scrollbar-width: none; }
        *::-webkit-scrollbar { display: none; }
        html { scroll-behavior: smooth; }

        body {
            font-family: 'Outfit', sans-serif;
            background-color: var(--bg-body);
            color: var(--text-main);
            overflow-x: hidden;
            display: flex; flex-direction: column; min-height: 100vh;
            transition: background-color 0.3s ease, color 0.3s ease;
            background-image: linear-gradient(rgba(139, 92, 246, 0.02) 1px, transparent 1px),
            linear-gradient(90deg, rgba(139, 92, 246, 0.02) 1px, transparent 1px);
            background-size: 50px 50px;
            position: relative;
        }

        body::before, body::after { content: ''; position: fixed; border-radius: 50%; z-index: -1; filter: blur(120px); opacity: 0.3; pointer-events: none; }
        body::before { top: -10%; left: -10%; width: 50vw; height: 50vw; background: radial-gradient(circle, var(--primary-glow), transparent 60%); }
        body::after { bottom: -10%; right: -10%; width: 40vw; height: 40vw; background: radial-gradient(circle, rgba(59, 130, 246, 0.15), transparent 60%); }

        /* --- THE MASTER RIPPLE LOADER --- */
        #linkedin-loader-wrapper { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: var(--bg-body); z-index: 999999; display: flex; flex-direction: column; justify-content: center; align-items: center; transition: opacity 0.6s ease, visibility 0.6s ease; }
        .ripple-container { position: relative; width: 100px; height: 100px; display: flex; justify-content: center; align-items: center; margin-bottom: 30px; }
        .ripple-ring { position: absolute; width: 60px; height: 60px; border-radius: 50%; border: 2px solid var(--primary); opacity: 0; animation: ripple-effect 2s cubic-bezier(0.16, 1, 0.3, 1) infinite; }
        .ripple-ring:nth-child(2) { animation-delay: 0.6s; }
        .ripple-ring:nth-child(3) { animation-delay: 1.2s; }
        .loader-text { font-family: 'Space Grotesk', sans-serif; font-size: 1.3rem; font-weight: 700; color: var(--text-main); letter-spacing: 2px; animation: pulse-text 1.5s ease-in-out infinite; }
        @keyframes ripple-effect { 0% { transform: scale(1); opacity: 0.8; border-width: 3px; } 100% { transform: scale(2.5); opacity: 0; border-width: 0px; } }
        @keyframes pulse-text { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }

        .container { max-width: 1500px; width: 96%; margin: 0 auto; padding: 0 15px; flex-grow: 1; }

        /* --- MASTER NAVBAR --- */
        .nav-wrapper { position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; padding: 15px 0; transition: 0.3s; }
        .navbar { background: var(--nav-bg); backdrop-filter: blur(15px); border: 1px solid var(--border-color); border-radius: 100px; padding: 0.6rem 1.5rem; display: flex; justify-content: space-between; align-items: center; max-width: 1100px; margin: 0 auto; box-shadow: var(--shadow-sm); }
        
        .logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text-main); }
        .logo-img { height: 38px; width: auto; border-radius: 8px; object-fit: contain; }
        .logo span { font-family: 'Space Grotesk'; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.5px; white-space: nowrap; }
        
        .nav-links { display: flex; gap: 1.8rem; list-style: none; align-items: center; }
        .nav-link { color: var(--text-muted); text-decoration: none; font-weight: 600; transition: 0.3s; font-size: 0.95rem; }
        .nav-link:hover, .nav-link.active { color: var(--primary); }
        
        .nav-actions { display: flex; align-items: center; gap: 15px; }
        .menu-toggle { display: none; color: var(--text-main); font-size: 1.5rem; cursor: pointer; }

        /* NAV DROPDOWNS */
        .nav-item-dropdown { position: relative; }
        .nav-dropdown-menu { position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(10px); background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 12px; padding: 10px; min-width: 180px; display: flex; flex-direction: column; gap: 5px; opacity: 0; visibility: hidden; transition: 0.3s; box-shadow: var(--shadow-lg); z-index: 1002; }
        @media(min-width: 769px) {
            .nav-item-dropdown:hover .nav-dropdown-menu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
        }
        .nav-dropdown-menu a { display: block; padding: 10px 15px; color: var(--text-muted); text-decoration: none; font-size: 0.95rem; border-radius: 8px; transition: 0.3s; font-weight: 500;}
        .nav-dropdown-menu a:hover { color: var(--primary); background: var(--sc-hover); }

        /* GOOGLE STYLE PROFILE ICON */
        .user-profile { display: none; align-items: center; justify-content: center; cursor: pointer; position: relative; }
        .user-avatar { width: 42px; height: 42px; background: var(--primary-grad); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 1.2rem; font-family: 'Space Grotesk'; overflow: hidden; border: 2px solid transparent; transition: 0.3s; }
        .user-avatar i { font-size: 1.2rem; }
        .user-profile:hover .user-avatar { border-color: var(--primary); transform: scale(1.05); }
        .user-avatar img { width: 100%; height: 100%; object-fit: cover; }
        
        .user-dropdown { position: absolute; top: 130%; right: 0; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 16px; width: 240px; padding: 10px 0; opacity: 0; visibility: hidden; transform: translateY(10px); transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: var(--shadow-lg); z-index: 1001; }
        .user-profile:hover .user-dropdown, .user-profile.active-dropdown .user-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
        
        .dropdown-item { padding: 12px 20px; border-bottom: 1px solid var(--border-color); margin-bottom: 5px; }
        .dropdown-item .label { display: block; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 3px; text-transform: uppercase; letter-spacing: 1px;}
        .dropdown-item strong { display: block; font-size: 1rem; color: var(--text-main); font-family: 'Space Grotesk'; }
        
        .dropdown-action-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: var(--text-main); text-decoration: none; font-size: 0.95rem; font-weight: 500; transition: 0.2s; cursor: pointer; font-family: 'Outfit'; }
        .dropdown-action-item:hover { background: var(--sc-hover); color: var(--primary); }
        .dropdown-action-item i { font-size: 1.1rem; color: var(--text-muted); width: 20px; text-align: center; transition: 0.2s; }
        .dropdown-action-item:hover i { color: var(--primary); }
        
        .logout-btn { color: var(--accent); margin-top: 5px; border-top: 1px solid var(--border-color); border-radius: 0 0 16px 16px;}
        .logout-btn i { color: var(--accent); }
        .logout-btn:hover { background: rgba(244, 63, 94, 0.05); color: var(--accent); }
        .logout-btn:hover i { color: var(--accent); }

        .btn-login { background: var(--primary-grad); color: white; padding: 10px 28px; border-radius: 50px; text-decoration: none; font-weight: 600; font-size: 0.95rem; transition: 0.3s; border: none; display: none; cursor: pointer; box-shadow: var(--shadow-sm); }
        .btn-login:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
        
        .mobile-nav-item { display: none; }

        /* --- LAYOUTS --- */
        .page-content { padding-top: 100px; min-height: 100vh; padding-bottom: 40px; max-width: 1300px;}

        /* --- BROWSER VIEW --- */
        .browser-hero { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 40px; flex-wrap: wrap; gap: 20px;}
        .hero-text h1 { font-family: 'Space Grotesk'; font-size: clamp(2.5rem, 5vw, 3.5rem); font-weight: 800; color: var(--text-main); letter-spacing: -1px; margin-bottom: 8px; line-height: 1.1;}
        .hero-text h1 span { background: var(--primary-grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
        .hero-text p { color: var(--text-muted); font-size: 1.1rem; max-width: 500px; line-height: 1.5;}
        
        .browser-controls { display: flex; gap: 15px; align-items: center; flex-wrap: wrap; }
        
        .premium-tabs { display: flex; background: var(--bg-surface); backdrop-filter: var(--glass-blur); border: 1px solid var(--border-color); border-radius: 100px; padding: 5px; }
        .premium-tabs button { padding: 10px 24px; border-radius: 100px; border: none; background: transparent; color: var(--text-muted); font-family: 'Outfit'; font-weight: 600; cursor: pointer; transition: 0.3s; font-size: 0.95rem;}
        .premium-tabs button.active { background: var(--bg-card); color: var(--text-main); border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); }

        .btn-glow-primary { background: var(--primary-grad); color: white; border: none; padding: 12px 28px; border-radius: 100px; font-family: 'Outfit'; font-weight: 600; font-size: 1rem; cursor: pointer; transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-shadow: var(--shadow-sm);}
        .btn-glow-primary:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); opacity: 0.95;}
        .btn-glow-primary:active { transform: scale(0.95) !important; }
        .btn-glow-primary i { transform: translateY(1.5px); }

        .room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 24px; }
        
        .room-card-v2 { 
            background: var(--bg-surface); 
            backdrop-filter: var(--glass-blur);
            border: 1px solid var(--border-color); 
            border-radius: 20px; 
            padding: 24px; 
            transition: all 0.3s ease; 
            display: flex; flex-direction: column;
            position: relative; overflow: hidden;
        }
        .room-card-v2:hover { transform: translateY(-4px); border-color: var(--primary-soft); box-shadow: var(--shadow-md); }
        
        .rc-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;}
        .rc-cat { font-size: 0.75rem; font-weight: 700; color: var(--primary); background: var(--primary-soft); padding: 4px 10px; border-radius: 6px; text-transform: uppercase; letter-spacing: 1px;}
        .rc-badge { font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: 6px; display: flex; align-items: center; gap: 5px; text-transform: uppercase;}
        .rc-badge.public { color: var(--success); background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.2); }
        .rc-badge.private { color: var(--accent); background: rgba(244, 63, 94, 0.1); border: 1px solid rgba(244, 63, 94, 0.2); }
        
        .rc-title { font-family: 'Space Grotesk'; font-size: 1.4rem; font-weight: 700; color: var(--text-main); margin-bottom: 8px; line-height: 1.2; letter-spacing: -0.5px;}
        
        .rc-stats { display: flex; gap: 15px; margin-bottom: 25px; padding: 12px 15px; background: var(--sc-hover); border-radius: 10px; border: 1px solid var(--border-color);}
        .rc-stat { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 500; color: var(--text-main);}
        .rc-stat i { color: var(--text-muted); }
        
        .rc-footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto;}
        .rc-live-pill { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 600; color: var(--text-main);}
        .rc-live-pill .dot { width: 8px; height: 8px; background: var(--success); border-radius: 50%; box-shadow: 0 0 10px var(--success); animation: pulse 1.5s infinite;}
        
        .btn-portal { background: var(--bg-card); border: 1px solid var(--border-color); color: var(--text-main); padding: 10px 20px; border-radius: 10px; font-family: 'Outfit'; font-weight: 600; cursor: pointer; transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); font-size: 0.9rem;}
        .btn-portal:hover { background: var(--sc-hover); border-color: var(--primary);}
        .btn-portal:active { transform: scale(0.95); }
        .btn-portal.enter { background: var(--primary); border-color: var(--primary); color: white;}
        .btn-portal.enter:hover { background: var(--secondary); border-color: var(--secondary); }
        .btn-portal.disabled { opacity: 0.5; cursor: not-allowed; }

        @keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.8); } }

        /* --- VIEW 2: INSIDE THE LIVE Room (PERFECTED & SLEEK) --- */
        #activeRoomView { display: none; }
        
        .Room-top-bar { 
            background: var(--bg-surface); 
            border: 1px solid var(--border-color); 
            border-radius: 16px; 
            padding: 16px 24px; 
            margin-bottom: 20px; 
            display: flex; justify-content: space-between; align-items: center; 
            box-shadow: var(--shadow-sm);
        }
        
        .Room-title-wrap { display: flex; align-items: center; gap: 15px; }
        .btn-exit { background: transparent; border: 1px solid var(--border-color); color: var(--text-main); width: 40px; height: 40px; border-radius: 10px; display: flex; justify-content: center; align-items: center; cursor: pointer; font-size: 1.1rem; transition: 0.2s;}
        .btn-exit:hover { background: var(--sc-hover); color: var(--accent); border-color: var(--border-hover);}
        .btn-exit:active { transform: scale(0.9); }
        
        .at-title { font-family: 'Space Grotesk'; font-size: 1.5rem; font-weight: 700; color: var(--text-main); line-height: 1; margin-bottom: 4px; letter-spacing: -0.5px;}
        .at-meta { font-size: 0.85rem; color: var(--text-muted); display: flex; align-items: center; gap: 12px; font-weight: 500;}
        .at-meta span { display: flex; align-items: center; gap: 5px; }
        .at-meta i { color: var(--primary); font-size: 0.9rem;}
        
        .Room-actions { display: flex; gap: 10px; }
        .btn-action-glass { width: 40px; height: 40px; border-radius: 10px; background: transparent; border: 1px solid var(--border-color); color: var(--text-main); display: flex; justify-content: center; align-items: center; font-size: 1rem; cursor: pointer; transition: 0.2s; }
        .btn-action-glass:hover { border-color: var(--primary); color: var(--primary); background: var(--sc-hover); }

        /* FIXED SIZED SPLIT WORKSPACE */
        .Room-workspace { 
            display: flex; 
            gap: 24px; 
            height: calc(100vh - 220px); 
            min-height: 500px; 
        }
        
        /* 🟢 NEW: VIRTUAL LIBRARY PANEL (Left Side) */
        .library-panel { 
            flex: 1; 
            background: transparent; 
            overflow-y: auto; 
            display: flex; 
            flex-direction: column; 
            padding-right: 5px;
        }
        
        /* 🟢 NEW: DESK GRID SYSTEM */
        .library-environment {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            gap: 20px;
            align-items: start;
            width: 100%;
            padding-bottom: 20px;
        }

        /* 🟢 NEW: INDIVIDUAL DESK CARD */
        .desk-card {
            background: var(--bg-surface);
            border: 1px solid var(--border-color);
            border-radius: 16px;
            padding: 24px 15px 20px 15px;
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            position: relative;
            transition: 0.3s ease;
            box-shadow: var(--shadow-sm);
            overflow: hidden;
            z-index: 1;
        }
        .desk-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary-soft); }
        
        .desk-card.is-me { border-color: var(--primary); background: linear-gradient(180deg, var(--primary-soft) 0%, var(--bg-surface) 100%); }
        .desk-card[data-rank="1"] { border: 2px solid rgba(251, 191, 36, 0.5); }

        /* THE DESK LIGHT (GLOW) */
        .desk-glow {
            position: absolute;
            top: -20px;
            left: 50%;
            transform: translateX(-50%);
            width: 120px;
            height: 60px;
            background: radial-gradient(ellipse at center, rgba(16, 185, 129, 0.4), transparent 70%);
            filter: blur(15px);
            opacity: 0;
            transition: opacity 0.5s ease;
            z-index: -1;
            pointer-events: none;
        }
        .desk-card.live .desk-glow { opacity: 1; }
        
        .desk-card.offline { opacity: 0.65; filter: grayscale(0.3); }

        /* DESK AVATAR */
        .desk-avatar-wrap { position: relative; margin-bottom: 12px; }
        .desk-avatar { width: 65px; height: 65px; border-radius: 50%; background: var(--sc-hover); display: flex; justify-content: center; align-items: center; font-family: 'Space Grotesk'; font-size: 1.5rem; font-weight: 700; color: var(--text-main); overflow: hidden; border: 2px solid var(--border-color); box-shadow: var(--shadow-sm);}
        .desk-avatar img { width: 100%; height: 100%; object-fit: cover; }
        .desk-card.live .desk-avatar { border-color: var(--success); box-shadow: 0 0 15px rgba(16, 185, 129, 0.3); }
        
        /* CROWN FOR TOP ACHIEVERS */
        .achiever-crown { position: absolute; top: -8px; right: -5px; background: linear-gradient(135deg, #FBBF24, #F59E0B); color: #fff; width: 24px; height: 24px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 0.75rem; border: 2px solid var(--bg-surface); box-shadow: 0 2px 4px rgba(0,0,0,0.2); z-index: 10; animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
        @keyframes popIn { 0% {transform: scale(0);} 100% {transform: scale(1);} }

        /* DESK INFO */
        .desk-name { font-weight: 600; font-size: 1rem; color: var(--text-main); margin-bottom: 4px; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .desk-card.is-me .desk-name { color: var(--primary); }
        .you-badge { font-size: 0.6rem; color: var(--primary); background: var(--primary-soft); padding: 2px 6px; border-radius: 4px; font-weight: 800; border: 1px solid rgba(139, 92, 246, 0.3); vertical-align: middle; margin-left: 5px;}
        
        .desk-time { font-family: 'Space Grotesk'; font-size: 1.4rem; font-weight: 700; color: var(--text-main); font-variant-numeric: tabular-nums; margin-bottom: 8px;}
        .desk-card[data-rank="1"] .desk-time { color: #F59E0B; }

        .desk-status { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 50px; background: var(--sc-hover);}
        .desk-card.live .desk-status { color: var(--success); background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.2); }
        .desk-card.offline .desk-status { color: var(--text-muted); border: 1px solid var(--border-color); }
        .desk-card.live .status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 6px var(--success); animation: pulse 1.5s infinite; }
        .desk-card.offline .status-dot { background: var(--text-muted); }


        /* Right: TOOLBOX PANEL */
        .toolbox-panel { width: 380px; flex-shrink: 0; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 16px; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-sm); height: 100%;}
        
        .toolbox-tabs { display: flex; border-bottom: 1px solid var(--border-color); background: var(--bg-body); }
        .toolbox-tabs button { flex: 1; padding: 15px 0; border: none; background: transparent; font-family: 'Outfit'; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: 0.2s; font-size: 0.95rem; border-bottom: 2px solid transparent;}
        .toolbox-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--bg-surface); }
        
        .toolbox-view { display: none; flex-direction: column; height: 100%; flex: 1; overflow: hidden; background: var(--bg-body);}
        .toolbox-view.active { display: flex; }

        /* Toolbox -> Chat */
        .chat-header { padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0;}
        .chat-messages { flex: 1; padding: 16px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; scroll-behavior: smooth;}
        .msg-wrap { display: flex; flex-direction: column; max-width: 85%; animation: slideUp 0.2s ease-out;}
        @keyframes slideUp { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
        .msg-wrap.me { align-self: flex-end; align-items: flex-end;}
        .msg-wrap.them { align-self: flex-start; align-items: flex-start;}
        .msg-sender { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 2px; padding: 0 4px; font-weight: 500;}
        .msg-bubble { padding: 8px 14px; border-radius: 16px; font-size: 0.95rem; line-height: 1.4; word-break: break-word; box-shadow: 0 1px 2px rgba(0,0,0,0.05);}
        .msg-wrap.me .msg-bubble { background: var(--primary); color: white; border-bottom-right-radius: 4px; box-shadow: 0 1px 2px rgba(99, 102, 241, 0.2);}
        .msg-wrap.them .msg-bubble { background: var(--bg-surface); border: 1px solid var(--border-color); color: var(--text-main); border-bottom-left-radius: 4px; }
        .msg-img { max-width: 100%; border-radius: 12px; margin-top: 4px; cursor: pointer; border: 1px solid var(--border-color);}
        .msg-file { display: flex; align-items: center; gap: 8px; background: var(--bg-surface); border: 1px solid var(--border-color); padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--text-main); margin-top: 4px; transition: 0.2s;}
        .msg-file:hover { border-color: var(--primary); }
        .msg-file i { font-size: 1.2rem; color: var(--primary); }
        .msg-file-name { font-size: 0.85rem; font-weight: 500;}
        
        .msg-wrap.me .chat-link { color: #e0e7ff; text-decoration: underline; font-weight: 600; word-break: break-all; }
        .msg-wrap.them .chat-link { color: var(--primary); text-decoration: underline; font-weight: 600; word-break: break-all; }
        .chat-link:hover { opacity: 0.8; }

        .chat-input-area { padding: 16px 20px; background: var(--bg-surface); border-top: 1px solid var(--border-color); flex-shrink: 0;}
        .chat-input-glass { display: flex; align-items: flex-end; gap: 10px; background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 20px; padding: 8px 12px; transition: 0.3s;}
        .chat-input-glass:focus-within { border-color: var(--border-hover); box-shadow: 0 0 0 3px var(--primary-soft); }
        .chat-attach-btn { background: transparent; border: none; color: var(--text-muted); font-size: 1.3rem; cursor: pointer; padding: 8px; border-radius: 50%; transition: 0.2s; display: flex; align-items: center; margin-bottom: 2px;}
        .chat-attach-btn:hover { color: var(--text-main); background: var(--sc-hover); }
        .chat-input { flex: 1; border: none; background: transparent; color: var(--text-main); padding: 10px 8px; outline: none; font-family: 'Outfit'; font-size: 1rem; min-height: 40px; max-height: 120px; resize: none; line-height: 1.4; overflow-y: auto;}
        .chat-send-btn { background: var(--primary); color: white; border: none; width: 40px; height: 40px; border-radius: 12px; display: flex; justify-content: center; align-items: center; cursor: pointer; transition: 0.2s; font-size: 1.1rem; flex-shrink: 0; margin-bottom: 2px;}
        .chat-disabled-overlay { display: none; padding: 15px; text-align: center; color: var(--text-muted); font-size: 0.85rem; font-weight: 500; background: var(--bg-surface); border-top: 1px solid var(--border-color);}

        /* Toolbox -> Timer */
        .tb-timer-container { padding: 20px; display: flex; flex-direction: column; align-items: center; overflow-y: auto; height:100%; width: 100%;}
        .timer-toggle { display: flex; width: 100%; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 50px; padding: 5px; margin-bottom: 25px; box-sizing: border-box;}
        .timer-toggle button { flex: 1; padding: 8px 0; border-radius: 50px; border: none; background: transparent; color: var(--text-muted); font-family: 'Outfit'; font-weight: 600; cursor: pointer; transition: 0.3s; font-size: 0.9rem; }
        .timer-toggle button.active { background: var(--primary); color: white; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4); }
        
        .svg-timer-container { position: relative; width: 100%; max-width: 220px; aspect-ratio: 1/1; margin: 0 auto 25px; display: flex; justify-content: center; align-items: center; }
        .svg-timer-container svg { width: 100%; height: 100%; transform: rotate(-90deg); position: absolute; top: 0; left: 0; }
        .timer-bg { fill: none; stroke: var(--primary-soft); stroke-width: 8; }
        .timer-prog { fill: none; stroke: var(--primary); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 880; stroke-dashoffset: 0; transition: stroke-dashoffset 0.2s linear; }
        .timer-text-overlay { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; z-index: 10; pointer-events: none;}
        
        /* 🟢 TIMER TEXT FIX (Prevents Overflow) */
        .time-display-wrapper { width: 75%; display: flex; justify-content: center; overflow: hidden; }
        .time-display { font-family: 'Space Grotesk'; font-size: clamp(1.6rem, 5vw, 2.2rem); font-weight: 700; color: var(--text-main); line-height: 1; margin-bottom: 5px; white-space: nowrap; letter-spacing: -1px;}
        
        .time-label { font-size: 0.8rem; color: var(--primary); font-weight: 700; text-transform: uppercase; letter-spacing: 2px; }
        .time-setter { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--bg-surface); padding: 10px 20px; border-radius: 50px; border: 1px solid var(--border-color); flex-wrap: wrap; margin-bottom: 25px;}
        .time-setter input { background: transparent; border: none; color: var(--text-main); font-family: 'Space Grotesk'; font-size: 1.3rem; font-weight: 700; width: 45px; text-align: center; outline: none; }
        .controls-row { display: flex; gap: 20px; justify-content: center; width: 100%; }
        .btn-play { background: var(--primary-grad); color: white; border: none; width: 60px; height: 60px; border-radius: 50%; font-size: 1.5rem; cursor: pointer; transition: 0.3s; box-shadow: var(--shadow-md); display: flex; justify-content: center; align-items: center;}
        .btn-stop { background: var(--bg-surface); color: var(--accent); border: 1px solid var(--border-color); width: 60px; height: 60px; border-radius: 50%; font-size: 1.3rem; cursor: pointer; transition: 0.3s; display: flex; justify-content: center; align-items: center;}

        /* Toolbox -> Tasks */
        .tb-todo-container { padding: 20px; display: flex; flex-direction: column; overflow-y: auto; height:100%; gap: 15px; width: 100%;}
        .task-input-box { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 12px; padding: 12px; width: 100%; display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }
        .task-input-box input[type="text"] { width: 100%; background: transparent; border: none; border-bottom: 1px solid var(--border-color); color: var(--text-main); font-family: 'Outfit'; padding: 8px 0; outline: none; font-size: 0.95rem;}
        .task-row-2 { display: flex; gap: 10px; width: 100%; flex-wrap: wrap; align-items: center; }
        .task-row-2 select, .task-row-2 input[type="date"] { flex: 1; background: var(--bg-card); border: 1px solid var(--border-color); color: var(--text-main); padding: 10px; border-radius: 8px; font-family: 'Outfit'; font-size: 0.9rem; outline: none; cursor: pointer; min-width: 110px;}
        .btn-add-task { background: var(--primary-grad); color: white; border: none; padding: 10px; border-radius: 8px; font-weight: 600; cursor: pointer; font-family: 'Outfit'; width: 100%;}
        .task-filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 5px; flex-shrink: 0; -webkit-overflow-scrolling: touch; }
        .filter-btn { flex-shrink: 0; background: var(--bg-surface); border: 1px solid var(--border-color); color: var(--text-muted); padding: 6px 14px; border-radius: 50px; font-size: 0.85rem; font-weight: 600; cursor: pointer;}
        .filter-btn.active { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
        .task-list { display: flex; flex-direction: column; gap: 10px; width: 100%; padding-bottom: 20px;}
        .task-item { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px;}
        .task-item.active-focus { border-color: var(--primary); background: var(--primary-soft); }
        .task-item.completed { opacity: 0.6; }
        .task-item.completed .t-title { text-decoration: line-through; color: var(--text-muted); }
        
        .task-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 5px;}
        .t-subj { font-size: 0.75rem; background: var(--sc-hover); color: var(--primary); padding: 4px 8px; border-radius: 6px; font-weight: 700; text-transform: uppercase; }
        .t-date { font-size: 0.8rem; color: var(--warning); display: flex; align-items: center; gap: 5px; font-weight: 500;}
        .t-title { font-size: 1rem; color: var(--text-main); font-weight: 500; word-break: break-word;}
        .task-actions { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border-color); padding-top: 10px;}
        .action-icon-btns { display: flex; gap: 10px; align-items: center;}
        .btn-link-timer { background: var(--primary-soft); color: var(--primary); border: 1px solid var(--border-color); padding: 4px 10px; border-radius: 6px; font-size: 0.8rem; cursor: pointer; font-family: 'Outfit'; font-weight: 600;}
        
        .custom-checkbox { width: 24px; height: 24px; border: 2px solid var(--text-muted); border-radius: 6px; display: flex; align-items: center; justify-content: center; cursor: pointer; background: transparent; }
        .custom-checkbox i { opacity: 0; font-size: 0.75rem; color: white; transform: scale(0.5); transition: 0.2s;}
        .custom-checkbox.checked { background: var(--success); border-color: var(--success); }
        .custom-checkbox.checked i { opacity: 1; transform: scale(1); }

        .btn-star-task, .btn-del-task { background: transparent; border: none; color: var(--text-muted); font-size: 1.1rem; cursor: pointer; }
        .btn-star-task.active { color: #F59E0B; }

        /* Mobile Segmented Control */
        .mobile-room-tabs { display: none; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 10px; padding: 4px; margin-bottom: 15px;}
        .mobile-room-tabs button { flex: 1; padding: 10px; border-radius: 6px; border: none; background: transparent; color: var(--text-muted); font-weight: 600; font-size: 0.9rem; transition: 0.2s;}
        .mobile-room-tabs button.active { background: var(--bg-body); color: var(--primary); box-shadow: var(--shadow-sm); }

        /* --- CUSTOM MODALS --- */
        .modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); z-index: 9999; display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: 0.3s; padding: 20px;}
        .modal.active { opacity: 1; pointer-events: auto; }
        .modal-box { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 20px; width: 100%; max-width: 420px; padding: 30px; transform: scale(0.95) translateY(10px); transition: 0.3s; position: relative; box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto;}
        .modal.active .modal-box { transform: scale(1) translateY(0); }
        
        .modal-box h2 { font-family: 'Space Grotesk'; font-size: 1.4rem; margin-bottom: 20px; color: var(--text-main); display: flex; align-items: center; gap: 10px;}
        .btn-close { position: absolute; top: 15px; right: 15px; background: transparent; border: none; color: var(--text-muted); width: 30px; height: 30px; border-radius: 8px; display: flex; justify-content: center; align-items: center; cursor: pointer; transition: 0.2s; font-size: 1.1rem;}
        .btn-close:hover { background: var(--sc-hover); color: var(--accent); }
        
        .form-group { margin-bottom: 15px; }
        .form-label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;}
        .form-input, .form-select { width: 100%; padding: 12px 15px; background: var(--bg-body); border: 1px solid var(--border-color); color: var(--text-main); border-radius: 10px; font-family: 'Outfit'; outline: none; font-size: 0.95rem; transition: 0.2s;}
        
        .form-row { display: flex; gap: 15px; }
        .form-row .form-group { flex: 1; }

        .toggle-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding: 15px; background: var(--bg-body); border-radius: 10px; border: 1px solid var(--border-color);}
        .toggle-text { flex: 1; padding-right: 15px;}
        .toggle-title { font-weight: 600; color: var(--text-main); margin-bottom: 2px; font-size: 0.95rem;}
        .toggle-sub { font-size: 0.8rem; color: var(--text-muted); line-height: 1.3;}
        
        .toggle-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0;}
        .toggle-switch input { opacity: 0; width: 0; height: 0; }
        .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--border-color); transition: .3s; border-radius: 30px; }
        .slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; box-shadow: var(--shadow-sm);}
        input:checked + .slider { background-color: var(--success); }
        input:checked + .slider:before { transform: translateX(20px); }

        .btn-solid-sc { background: var(--primary-grad); color: white; border: none; width: 100%; padding: 14px; border-radius: 10px; font-family: 'Outfit'; font-weight: 600; font-size: 1rem; cursor: pointer; transition: 0.2s;}
        .btn-outline-sc { background: transparent; border: 1px solid var(--border-color); color: var(--text-main); width: 100%; padding: 14px; border-radius: 10px; font-family: 'Outfit'; font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: 0.2s; margin-top: 10px;}
        .btn-danger-glass { background: rgba(244, 63, 94, 0.1); color: var(--accent); border: 1px solid rgba(244, 63, 94, 0.3); width: 100%; padding: 14px; border-radius: 10px; font-family: 'Outfit'; font-weight: 600; font-size: 0.95rem; cursor: pointer; margin-top: 10px; transition: 0.2s;}

        .modal-settings-box { max-width: 800px; } 
        .settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 10px; }
        .setting-row { display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; padding: 20px; background: var(--sc-hover); border-radius: 16px; border: 1px solid var(--border-color); gap: 15px;}
        .setting-label { font-size: 1.05rem; color: var(--text-main); font-weight: 600;}
        .setting-sub { font-size: 0.85rem; color: var(--text-muted); display: block; margin-top: 4px;}
        .setting-input { background: var(--bg-surface); border: 1px solid var(--border-color); color: var(--text-main); padding: 10px 15px; border-radius: 8px; font-family: 'Outfit'; outline: none; text-align: center; width: 100%; font-size: 0.95rem; box-sizing: border-box;}

        /* --- MASTER FOOTER --- */
        footer { background: var(--bg-surface); border-top: 1px solid var(--border-color); padding: 60px 0 30px; margin-top: 60px; width: 100%;}
        .footer-content { display: grid; grid-template-columns: 1.5fr 0.8fr 0.8fr 0.8fr; gap: 40px; margin-bottom: 40px; max-width: 1400px; margin: 0 auto; padding: 0 20px;}
        .footer-brand { display: flex; flex-direction: column; gap: 15px; }
        .footer-brand p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; }
        .f-links h4, .footer-brand h4 { margin-bottom: 20px; font-family: 'Space Grotesk'; font-size: 1.1rem; color: var(--text-main); font-weight: 700;}
        .f-links a { display: block; color: var(--text-muted); text-decoration: none; margin-bottom: 12px; font-size: 0.95rem; font-weight: 500;}
        .copyright { text-align: center; border-top: 1px solid var(--border-color); padding-top: 30px; color: var(--text-muted); font-size: 0.9rem; }

        /* ==========================================================
           📱 100% BULLETPROOF MOBILE RESPONSIVENESS
           ========================================================== */
        @media (max-width: 1024px) {
            .footer-content { grid-template-columns: 1fr 1fr; }
            .Room-workspace { min-height: 600px; }
            .toolbox-panel { width: 340px; } 
            .settings-grid { grid-template-columns: 1fr 1fr; }
            
            /* Responsive LB Grid Fix */
            .library-environment { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
        }
        
        @media (max-width: 768px) {
            .container { width: 100%; padding: 0 15px; }
            .nav-wrapper { padding: 10px 15px; }
            .navbar { padding: 0.8rem 1.2rem; border-radius: 16px; width: 100%; max-width: 100%; }
            
            .logo { gap: 8px; }
            .logo-img { height: 32px; }
            .logo span { font-size: 1.05rem; letter-spacing: -0.3px; }

            .nav-links { display: none; position: absolute; top: 100%; left: 0; width: 100%; background: var(--bg-surface); flex-direction: column; padding: 20px; border-radius: 16px; border: 1px solid var(--border-color); box-shadow: var(--shadow-lg); z-index: 1005; box-sizing: border-box; margin-top: 10px; max-height: 85vh; overflow-y: auto; }
            .nav-links.active { display: flex; align-items: stretch; }
            .nav-link { display: block; padding: 12px 15px; border-radius: 8px; width: 100%; }
            .menu-toggle { display: block; }
            
            .nav-item-dropdown { width: 100%; }
            .nav-dropdown-menu { position: static; opacity: 1; visibility: visible; transform: none !important; box-shadow: none; border: none; padding: 5px 0 5px 20px; background: transparent; display: none; width: 100%; margin-top: 0;}
            .nav-dropdown-menu.active-drop { display: flex !important; flex-direction: column; }
            .nav-item-dropdown:hover .nav-dropdown-menu { display: none; }
            
            .nav-actions { gap: 10px; } 
            .user-avatar { width: 34px; height: 34px; font-size: 1rem; }
            .user-dropdown { right: -5px; width: 230px;} 
            .mobile-nav-item { display: block; border-top: 1px solid var(--border-color); padding-top: 12px; margin-top: 10px; width: 100%; }

            .page-content { padding-top: 90px; padding-bottom: 20px; }
            
            .browser-hero { flex-direction: column; align-items: flex-start; gap: 15px;}
            .hero-text h1 { font-size: 2.2rem; }
            .browser-controls { width: 100%; justify-content: space-between; gap: 15px;}
            .premium-tabs { width: 100%; display: flex; }
            .premium-tabs button { flex: 1; text-align: center; padding: 10px;}
            .btn-glow-primary { width: 100%; justify-content: center;}
            
            .room-grid { grid-template-columns: 1fr; gap: 15px;}
            
            .Room-top-bar { flex-direction: column; align-items: flex-start; padding: 15px; gap: 12px; border-radius: 14px; margin-bottom: 15px;}
            .Room-title-wrap { align-items: flex-start; gap: 12px; width: 100%;}
            .at-title { font-size: 1.3rem; }
            .Room-actions { justify-content: flex-end; width: 100%; border-top: 1px solid var(--border-color); padding-top: 12px;}
            
            .mobile-room-tabs { display: flex; }
            
            .Room-workspace { height: calc(100vh - 280px); min-height: 450px; gap: 0;}
            
            /* Virtual Library Mobile Adjustment */
            .library-panel { display: flex; height: 100%; padding: 15px 0; width: 100%; border-radius: 14px;}
            .toolbox-panel { display: none; height: 100%; border-radius: 14px; width: 100%; max-width: 100%;}
            .Room-workspace.show-toolbox .library-panel { display: none; }
            .Room-workspace.show-toolbox .toolbox-panel { display: flex; }
            
            .library-environment { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 15px; width: 100%; }
            .desk-card { padding: 15px 10px; }
            .desk-avatar { width: 50px; height: 50px; font-size: 1.2rem;}
            .desk-time { font-size: 1.15rem; }
            .desk-glow { width: 80px; height: 40px; }

            .chat-input-area { padding: 12px 15px; }
            .chat-input-glass { padding: 6px 8px; border-radius: 20px;}
            .chat-input { font-size: 0.95rem; min-height: 38px; padding: 8px 6px;}
            .chat-attach-btn { font-size: 1.2rem; padding: 8px; margin-bottom: 0;}
            .chat-send-btn { width: 36px; height: 36px; border-radius: 10px; margin-bottom: 0;}
            .form-row { flex-direction: column; gap: 0; }
            
            /* Timer Mobile */
            .time-display { font-size: clamp(2rem, 10vw, 2.8rem); } 

            .footer-content { text-align: left; gap: 30px; grid-template-columns: 1fr; padding: 0 15px;}
            .modal { align-items: flex-end; padding: 0; }
            .modal-box { border-radius: 20px 20px 0 0; margin: 0; max-width: 100%; transform: translateY(100%); padding: 25px 20px;}
            
            .settings-grid { grid-template-columns: 1fr; gap: 15px; }
            .setting-row { flex-direction: row; justify-content: space-between; align-items: center; padding: 15px;}
            .setting-input, .toggle-switch { width: auto; text-align: right; }
        }