:root {
    /* Premium Dark Theme Palette */
    --bg-dark: #09090b;
    --bg-surface: #18181b;
    --bg-surface-hover: #27272a;
    --primary: #3b82f6;
    --primary-gradient: linear-gradient(135deg, #3b82f6, #06b6d4);
    --secondary: #8b5cf6;
    --border: #27272a;
    --text-main: #f8fafc;
    --text-muted: #a1a1aa;
    
    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 15px rgba(59, 130, 246, 0.5);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

/* =============================================
   ROLE-BASED VISIBILITY (CSS fallback)
   body.role-admin / role-site etc set by login()
   ============================================= */

/* Hide quick-actions-nav before login and for guests */
#quick-actions-nav { display: none; }

/* Show for any logged-in non-guest role */
body.role-admin #quick-actions-nav,
body.role-site #quick-actions-nav,
body.role-client #quick-actions-nav,
body.role-consultant #quick-actions-nav,
body.role-driver #quick-actions-nav,
body.role-investor #quick-actions-nav {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
}

/* Hide guest nav after login */
body.role-admin #guest-actions-nav,
body.role-site #guest-actions-nav,
body.role-client #guest-actions-nav,
body.role-consultant #guest-actions-nav,
body.role-driver #guest-actions-nav,
body.role-investor #guest-actions-nav {
    display: none !important;
}

/* Strictly hide Live VIP Portals & Subdomain tabs from clients and non-admin logged-in roles */
body.role-admin #live-portals-nav,
body.role-client #live-portals-nav,
body.role-site #live-portals-nav,
body.role-worker #live-portals-nav,
body.role-driver #live-portals-nav,
body.role-consultant #live-portals-nav,
body.role-investor #live-portals-nav {
    display: none !important;
}

body.role-admin .app-subdomains-tabs,
body.role-client .app-subdomains-tabs,
body.role-site .app-subdomains-tabs,
body.role-worker .app-subdomains-tabs,
body.role-driver .app-subdomains-tabs,
body.role-consultant .app-subdomains-tabs,
body.role-investor .app-subdomains-tabs {
    display: none !important;
}

body.role-client #integrations-nav {
    display: none !important;
}

body.role-client #saas-tenant-selector {
    display: none !important;
}

/* Show role-group[data-role] sections by role */
body.role-admin [data-role="admin"] { display: flex !important; flex-direction: column; gap: 4px; }
body.role-admin .nav-btn[data-role="admin"] { display: flex !important; flex-direction: row; }

/* Integrations nav */
body.role-admin #integrations-nav,
body.role-site #integrations-nav,
body.role-consultant #integrations-nav {
    display: flex !important;
    flex-direction: column;
}

/* ============================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    padding-top: 45px;
    box-sizing: border-box;
}

.app-container {
    display: flex;
    height: 100%;
    width: 100vw;
    box-sizing: border-box;
}

/* --- Sidebar --- */
.sidebar {
    width: 280px; background-color: rgba(10, 10, 15, 0.95); backdrop-filter: blur(20px); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 24px; z-index: 50;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-header {
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-gradient);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-glow);
}

.logo h2 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    text-align: left;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-btn:hover { background-color: rgba(255, 255, 255, 0.05); color: var(--text-main); transform: translateX(6px); }

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background-color: var(--bg-surface-hover);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- Main Content Area --- */
.main-content {
    flex: 1;
    display: flex;
    background-color: var(--bg-surface);
    position: relative;
    overflow: hidden;
}

/* --- Avatar Stage --- */
.avatar-stage {
    display: none !important;
    width: 35%;
    min-width: 280px;
    max-width: 450px;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    position: relative;
    
    /* Futuristic Cyber Background */
    background-color: #030610; background-image: radial-gradient(circle at center, rgba(37, 99, 235, 0.1) 0%, transparent 60%), url('assets/cyber_bg.png?v=2');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    
    border-right: 1px solid var(--border);
    overflow: hidden;
}



#full-body-avatar {
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 0;
    box-shadow: none;
    border: none;
    z-index: 2;
    transition: opacity 0.5s ease;
    margin-bottom: 0;
}

.avatar-stage-floor {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 15%;
    background: linear-gradient(to top, var(--bg-dark), transparent);
    z-index: 1;
}

/* --- Chat Container --- */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: transparent;
    position: relative;
}

/* Header */
.chat-header {
    height: 70px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: rgba(10, 10, 15, 0.6); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); z-index: 10; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.agent-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.agent-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.agent-details h1 {
    font-size: 1.1rem;
    font-weight: 600;
}

.agent-status {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px var(--success);
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.icon-btn:hover {
    color: var(--text-main);
}

/* Messages Area */
.messages-area {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    scroll-behavior: smooth;
    min-height: 0;
}
.messages-area::after {
    content: "";
    display: block;
    height: 60px;
    flex-shrink: 0;
}

.message {
    display: flex;
    gap: 16px;
    max-width: 85%;
    animation: fadeIn 0.4s ease forwards;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.message.user .msg-avatar {
    background-color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.msg-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message.user .msg-content {
    align-items: flex-end;
}

.msg-bubble {
    background-color: var(--bg-dark);
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    border-top-left-radius: 4px;
    font-size: 0.95rem;
    line-height: 1.5;
    border: 1px solid var(--border);
}

.message.user .msg-bubble {
    background: var(--primary-gradient);
    border: none;
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: 4px;
    color: white;
}

.msg-bubble p {
    margin-bottom: 8px;
}

.msg-bubble p:last-child {
    margin-bottom: 0;
}

/* Input Area */
.input-container { padding: 24px 28px; background: linear-gradient(to top, rgba(10, 10, 15, 0.95), rgba(10, 10, 15, 0.7)); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid var(--border); }

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background-color: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 10px 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.attach-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    margin-bottom: 2px;
}

.attach-btn:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-main);
}

#chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    resize: none;
    padding: 10px 0;
    max-height: 150px;
    outline: none;
    overflow-y: hidden;
}

#chat-input::placeholder {
    color: var(--text-muted);
}

.mic-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.mic-btn:hover {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.mic-btn.recording {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.send-btn {
    background: var(--primary-gradient);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 4px;
}

.send-btn svg {
    width: 18px;
    height: 18px;
    margin-left: -2px; /* slight visual center tweak */
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.input-footer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 10px;
}

/* --- Interactive Cards --- */
.interactive-card { background-color: rgba(20, 20, 25, 0.6); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: var(--radius-lg); width: 350px; overflow: hidden; margin-top: 8px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4); animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

.card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.02);
}

.card-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
}

.badge {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 12px;
    background: var(--primary);
    color: white;
    font-weight: 500;
}

.badge.warning { background: var(--warning); }
.badge.success { background: var(--success); }

.card-body {
    padding: 18px;
}

/* Task List styles */
.task-list {
    list-style: none;
}
.task-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.task-item:last-child { border-bottom: none; }
.task-item input {
    accent-color: var(--primary);
    width: 16px; height: 16px;
    cursor: pointer;
}
.task-item label {
    flex: 1;
    font-size: 0.9rem;
    cursor: pointer;
}
.tag {
    font-size: 0.65rem; padding: 2px 6px; border-radius: 4px;
}
.tag.high { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.tag.urgent { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.tag.normal { background: rgba(59, 130, 246, 0.2); color: var(--primary); }

/* Buttons */
.action-btn {
    background: var(--bg-surface-hover);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}
.action-btn:hover { background: var(--primary); border-color: var(--primary); }
.action-btn.secondary { background: transparent; }
.action-btn.secondary:hover { background: var(--bg-surface-hover); border-color: var(--text-muted); }
.w-full { width: 100%; }
.mt-10 { margin-top: 10px; }

/* Progress Stats */
.progress-stats { display: flex; gap: 15px; margin-bottom: 15px; }
.stat-box {
    flex: 1; background: var(--bg-surface-hover); padding: 12px;
    border-radius: var(--radius-sm); display: flex; flex-direction: column;
}
.stat-value { font-size: 1.2rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; margin-top: 4px;}
.progress-bar-container { height: 8px; background: var(--bg-surface-hover); border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary-gradient); border-radius: 4px; }

/* Photos */
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.photo-grid .photo-placeholder:first-child { grid-column: span 2; height: 100px; }
.photo-placeholder {
    height: 70px; border-radius: var(--radius-sm); display: flex;
    align-items: center; justify-content: center; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Billing */
.billing-summary { display: flex; flex-direction: column; gap: 12px; }
.bill-row { display: flex; justify-content: space-between; font-size: 0.9rem; }
.bill-row.highlight { color: var(--warning); padding-top: 8px; border-top: 1px solid var(--border); }

/* Button Groups */
.button-group { display: flex; gap: 10px; margin-top: 15px;}
.button-group button { flex: 1; }

/* Typing indicator */
.typing-indicator {
    display: flex; gap: 4px; padding: 10px 15px; background: var(--bg-dark);
    border-radius: var(--radius-lg); width: fit-content; border: 1px solid var(--border);
}
.typing-dot {
    width: 6px; height: 6px; background: var(--text-muted); border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes typing {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.5); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar { position: absolute; transform: translateX(-100%); z-index: 2000 !important; height: 100%; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: none; }
    .sidebar.active { transform: translateX(0); box-shadow: 20px 0 50px rgba(0,0,0,0.8); }
    .message { max-width: 95%; }
}

/* Login Overlay Styles */
.login-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--bg-dark);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 60px 20px;
    overflow-y: auto;
}

.login-header {
    text-align: center;
    margin-bottom: 50px;
}

.login-header h2 {
    font-size: 2.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.role-cards {
    display: flex;
    gap: 30px;
    max-width: 900px;
    width: 100%;
}

.role-card {
    flex: 1;
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.role-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.role-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.role-card h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.role-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Passcode Modal */
.passcode-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(9, 9, 11, 0.85);
    backdrop-filter: blur(5px);
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.passcode-content {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px;
    width: 350px;
    text-align: center;
    box-shadow: var(--shadow-glow);
    animation: slideUp 0.3s ease forwards;
}

.passcode-inputs {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.passcode-char {
    width: 50px;
    height: 60px;
    background-color: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    text-align: center;
    color: var(--text-main);
    transition: all 0.2s;
}

.passcode-char:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* --- Dashboard Widgets Panel --- */
.dashboard-widgets {
    width: 250px;
    background-color: var(--bg-surface);
    border-left: 1px solid var(--border);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.widget-card {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.widget-card h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.widget-card h2 {
    font-size: 2rem;
    color: var(--primary);
    margin: 5px 0;
}

.widget-sub {
    font-size: 0.75rem;
    color: var(--success);
}

.progress-ring-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.progress-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: conic-gradient(var(--primary) 45%, var(--bg-surface) 0);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    position: relative;
}

.progress-circle::before {
    content: "";
    position: absolute;
    width: 60px;
    height: 60px;
    background-color: var(--bg-dark);
    border-radius: 50%;
}

.progress-circle span {
    position: relative;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
}

/* --- GUEST LANDING PAGE OVERRIDES --- */
.guest-hero {
    position: relative;
    flex: 1;
    background-image: url('assets/herobg.jpeg?v=2');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

body.role-guest .main-content {
    flex-direction: row;
    justify-content: flex-start;
    background: #0b0f19;
}

body.role-guest .chat-container {
    width: 420px;
    flex: none;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: -10px 10px 40px rgba(0,0,0,0.5);
    z-index: 1;
    margin: 20px;
    border-radius: 16px;
    height: calc(100% - 40px);
}

body.role-guest .chat-header {
    background: transparent;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

@media (max-width: 992px) {
    /* Main content area stacks vertically on mobile */
    .main-content { 
        flex-direction: column !important; 
        width: 100% !important; 
        height: 100vh !important;
        height: 100dvh !important; /* dynamic viewport height for mobile browsers */
        flex: none !important; 
        overflow: hidden !important; 
    }
    body.role-guest .main-content {
        flex-direction: column !important;
        width: 100% !important;
        height: auto !important;
        min-height: 100dvh !important;
        flex: none !important;
        overflow-y: auto !important;
        display: flex !important;
        padding-bottom: 20px !important;
    }
    /* Guest hero (orbital avatars) - compact on mobile */
    .guest-hero { 
        width: 100% !important; 
        height: auto !important; 
        min-height: 380px !important;
        max-height: none !important;
        flex: none !important; 
        padding: 10px 15px 5px 15px !important; 
        box-sizing: border-box !important; 
        overflow: visible !important;
        gap: 12px !important;
    }
    /* Shrink the entire orbit hub on mobile to prevent overlapping */
    .network-hub-wrapper {
        max-width: 240px !important;
        margin: 0 auto !important;
    }
    /* Center the orbit track on mobile */
    .guest-hero .orbit-track {
        width: 100% !important;
        height: 100% !important;
        top: 0 !important;
        left: 0 !important;
    }
    /* Scale down the central hub content on mobile */
    .guest-hero .central-hub-content {
        width: 50% !important;
    }
    /* Shrink orbit avatars on mobile */
    .guest-hero .premium-avatar-icon {
        width: 32px !important;
        height: 32px !important;
    }
    .guest-hero .premium-avatar-icon.ai-featured {
        width: 40px !important;
        height: 40px !important;
    }
    .guest-hero .orbit-center-logo {
        width: 80px !important;
        height: 80px !important;
    }
    .avatar-stage { width: 100% !important; height: 40vh !important; min-height: 300px !important; flex: none !important; }
    /* Chat container fills remaining space below the hero */
    .chat-container { 
        width: 100% !important; 
        margin: 0 !important; 
        border-radius: 0 !important; 
        flex: 1 1 0 !important;
        min-height: 0 !important;
        height: 0 !important;
        box-sizing: border-box !important; 
        display: flex !important;
        flex-direction: column !important;
    }
    body.role-guest .chat-container {
        width: 100% !important;
        margin: 15px 0 !important;
        border-radius: 12px !important;
        flex: none !important;
        height: 600px !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
    }
    /* Ensure chat header is opaque on mobile guest portal so messages hide behind it cleanly */
    body.role-guest .chat-header {
        background: rgba(10, 10, 15, 0.95) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
    }
    /* Messages area scrolls, input stays at bottom */
    .messages-area {
        flex: 1 !important;
        overflow-y: auto !important;
        min-height: 0 !important;
        padding: 16px !important;
        gap: 16px !important;
    }
    .messages-area::after {
        height: 20px !important;
    }
    /* Input container sticks to bottom with reduced padding */
    .input-container {
        flex-shrink: 0 !important;
        padding: 12px 16px !important;
        padding-bottom: env(safe-area-inset-bottom, 12px) !important;
    }
    /* Compact input footer on mobile */
    .input-footer {
        font-size: 0.62rem !important;
        padding: 2px 4px !important;
        margin-top: 6px !important;
    }
    #analytics-dashboard { width: 100% !important; position: relative !important; height: auto !important; padding: 20px !important; }
    .site-grid { grid-template-columns: 1fr !important; gap: 15px !important; }
    .mobile-menu-toggle { display: block !important; }
}


body.role-guest .avatar-stage { display: none !important; }
body.role-guest .guest-hero { display: flex !important; }

/* Premium Avatar Orbit Network Styling */
@keyframes network-spin {
    100% { transform: rotate(360deg); }
}
@keyframes network-counter-spin {
    100% { transform: rotate(-360deg); }
}
.orbit-anchor {
    position: absolute;
    width: 0; height: 0;
    z-index: 10;
}
.orbit-counter-spinner {
    position: absolute;
    width: 0; height: 0;
    animation: network-counter-spin 50s linear infinite;
}
.premium-avatar-icon {
    position: absolute;
    width: 60px; 
    height: 60px; 
    border-radius: 50%; 
    object-fit: cover; 
    border: 1px solid rgba(255, 255, 255, 0.15); 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 0 10px rgba(0,0,0,0.5); 
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    background: #09090b;
    transform: translate(-50%, -50%);
    backdrop-filter: blur(5px);
}
.premium-avatar-icon.ai-featured {
    width: 75px;
    height: 75px;
    transform: translate(-50%, -50%) scale(1.05);
    border: 1px solid rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}
.premium-avatar-icon:hover {
    transform: translate(-50%, -50%) scale(1.2) !important;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
    z-index: 30;
}

/* Navigating State - Expand chat area when user begins using the system */
body.navigating .guest-hero, 
body.navigating .avatar-stage {
    display: none !important;
}

body.navigating .home-btn {
    display: inline-flex !important;
}

@media (max-width: 992px) {
    body.navigating .chat-container {
        height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        border: none !important;
    }
}

body.navigating .input-footer {
    display: none !important;
}

@keyframes aiChargeGlow {
    0%, 80%, 100% {
        box-shadow: 0 15px 40px rgba(0, 195, 255, 0.5), 0 0 0 2px rgba(0, 195, 255, 0.3);
    }
    85% {
        box-shadow: 0 0 80px rgba(0, 195, 255, 0.9), 0 0 20px rgba(0, 195, 255, 0.8), 0 0 0 4px rgba(0, 195, 255, 0.5);
    }
    90% {
        box-shadow: 0 0 120px rgba(0, 195, 255, 1), 0 0 40px rgba(255, 255, 255, 0.8), 0 0 0 6px rgba(0, 195, 255, 0.8);
    }
    95% {
        box-shadow: 0 0 80px rgba(0, 195, 255, 0.9), 0 0 20px rgba(0, 195, 255, 0.8), 0 0 0 4px rgba(0, 195, 255, 0.5);
    }
}
.ai-charge-glow {
    animation: aiChargeGlow 24s ease-in-out infinite !important;
}

/* ==========================================
   ENTERPRISE DIGITAL COMMAND CENTER (ECC)
   ========================================== */
.ecc-stage {
    width: 100%;
    height: 100%;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 20px 0;
    overflow: hidden;
}

.ecc-header {
    text-align: center;
    margin-bottom: 40px;
    z-index: 10;
}

.ecc-header h1 {
    font-size: 1.5rem;
    letter-spacing: 4px;
    margin-bottom: 5px;
    color: white;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
    font-weight: 800;
}

.ecc-header h3 {
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--primary);
    text-shadow: 0 0 8px rgba(0, 195, 255, 0.3);
    margin: 0;
    font-weight: 600;
}

.ecc-orbit-wrapper {
    position: relative;
    width: 450px;
    height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: all 0.3s ease;
}

.ecc-orbit-system {
    position: relative;
    width: 450px;
    height: 450px;
    border: 1px solid rgba(0, 195, 255, 0.15);
    border-radius: 50%;
    animation: ecc-rotate-system 120s linear infinite;
}

@keyframes ecc-rotate-system {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ecc-center-hub {
    position: absolute;
    top: 50%; left: 50%;
    width: 220px; height: 220px;
    margin: -110px 0 0 -110px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(10,25,47,0.95) 0%, rgba(0,0,0,0.95) 100%);
    border: 2px solid rgba(0, 195, 255, 0.3);
    box-shadow: inset 0 0 30px rgba(0, 195, 255, 0.2), 0 0 30px rgba(0, 195, 255, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Counter rotate so the center doesn't spin and apply premium glow */
    animation: ecc-counter-rotate 120s linear infinite, central-glow 6s ease-in-out infinite;
}

.ecc-center-hub img, .ecc-center-hub video {
    width: 140px;
    max-height: 140px;
    object-fit: contain;
    border-radius: 8px;
}

.ecc-center-hub p {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.6);
    letter-spacing: 3px;
    margin-top: 10px;
}

.ecc-slot {
    position: absolute;
    top: 50%; left: 50%;
    width: 60px; height: 60px;
    margin: -30px 0 0 -30px;
}

.ecc-avatar {
    width: 100%; height: 100%;
    border-radius: 50%;
    border: 2px solid var(--primary);
    box-shadow: 0 0 15px rgba(0, 195, 255, 0.4);
    object-fit: cover;
    background: #0a192f;
    animation: ecc-counter-rotate 120s linear infinite, avatar-glow 6s ease-in-out infinite;
}

@keyframes ecc-counter-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-360deg); }
}

@keyframes central-glow {
    0%, 100%, 70% {
        border-color: rgba(0, 195, 255, 0.3);
        box-shadow: inset 0 0 30px rgba(0, 195, 255, 0.2), 0 0 20px rgba(0, 195, 255, 0.3);
    }
    20%, 50% {
        border-color: rgba(0, 255, 170, 0.8);
        box-shadow: inset 0 0 50px rgba(0, 255, 170, 0.4), 0 0 45px rgba(0, 255, 170, 0.8), 0 0 80px rgba(0, 255, 170, 0.5);
    }
}

@keyframes avatar-glow {
    0%, 100%, 10%, 60% {
        border-color: var(--primary);
        box-shadow: 0 0 10px rgba(0, 195, 255, 0.3);
    }
    70%, 95% {
        border-color: #a855f7;
        box-shadow: 0 0 25px rgba(168, 85, 247, 0.9), 0 0 35px rgba(168, 85, 247, 0.5);
    }
}

.ecc-controls {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 380px;
    gap: 15px;
    margin-top: 50px;
    padding: 0 20px;
    transform: translateX(20px);
    z-index: 10;
}

.ecc-btn {
    flex: 1;
    text-align: center;
    padding: 14px 10px;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: white;
    backdrop-filter: blur(5px);
}

.ecc-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
}

.ecc-btn.primary {
    background: rgba(37, 99, 235, 0.4);
    border: 1px solid rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
}

.ecc-btn.primary:hover {
    background: rgba(37, 99, 235, 0.6);
    box-shadow: 0 0 30px rgba(37, 99, 235, 0.5);
}

@media (max-width: 768px) {
    .ecc-orbit-wrapper { transform: scale(0.68); height: 260px; margin-top: -30px; margin-bottom: -30px; }
    .ecc-orbit-system { width: 300px; height: 300px; }
    .ecc-center-hub { width: 180px; height: 180px; margin: -90px 0 0 -90px; }
    .ecc-center-hub img { width: 100px; }
}

@media (max-width: 480px) {
    .ecc-orbit-wrapper { transform: scale(0.60); height: 220px; margin-top: -45px; margin-bottom: -45px; }
}




/* ==========================================================================
   UNIFIED PROJECT WORKSPACE & SYNCHRONIZED 4K GALLERY HUB
   ========================================================================== */
.dashboard-widgets {
    width: 440px;
    background: #070a13;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(0, 210, 255, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(0, 230, 118, 0.04) 0%, transparent 40%);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow-y: auto;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 210, 255, 0.3) transparent;
}

/* Workspace Identity Header */
.workspace-header-card {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.85), rgba(7, 10, 19, 0.95));
    border: 1px solid rgba(0, 210, 255, 0.25);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(0, 210, 255, 0.05);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.workspace-site-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.workspace-site-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(0, 210, 255, 0.1);
    border: 1px solid #00d2ff;
    color: #00d2ff;
    width: fit-content;
}
.workspace-site-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    margin: 2px 0 0 0;
    letter-spacing: -0.3px;
    line-height: 1.25;
}
.workspace-site-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 2px;
}
.sync-live-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #00e676;
    font-weight: 600;
}
.gallery-launch-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(0, 210, 255, 0.2), rgba(0, 114, 255, 0.3));
    border: 1px solid rgba(0, 210, 255, 0.5);
    color: #ffffff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.2);
}
.gallery-launch-btn:hover {
    background: linear-gradient(135deg, rgba(0, 210, 255, 0.35), rgba(0, 114, 255, 0.45));
    border-color: #00d2ff;
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.4);
    transform: translateY(-1px);
}

/* Metrics Grid (2x2) */
.workspace-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.metric-card {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}
.metric-card:hover {
    border-color: rgba(0, 210, 255, 0.35);
    background: rgba(20, 30, 55, 0.85);
    transform: translateY(-2px);
}
.metric-header {
    display: flex;
    align-items: center;
    gap: 7px;
}
.metric-icon {
    font-size: 0.9rem;
}
.progress-icon { color: #00d2ff; }
.workforce-icon { color: #ffb300; }
.weather-icon { color: #38bdf8; }
.photo-icon { color: #a855f7; }

.metric-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.metric-value-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 2px 0;
}
.metric-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    margin: 0;
    letter-spacing: -0.5px;
}
.metric-unit {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
}
.metric-card .widget-sub {
    font-size: 0.7rem;
    color: #00e676;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}
.text-cyan {
    color: #00d2ff !important;
}

/* Gallery Strip Section */
.workspace-gallery-section, .workspace-operations-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}
.section-heading {
    font-size: 0.92rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}
.section-subheading {
    font-size: 0.7rem;
    color: #64748b;
    margin: 2px 0 0 0;
}
.view-all-gallery-btn {
    background: none;
    border: none;
    color: #00d2ff;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px;
    transition: color 0.2s;
}
.view-all-gallery-btn:hover {
    color: #38bdf8;
    text-decoration: underline;
}

.synced-gallery-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 210, 255, 0.2) transparent;
}
.synced-photo-card {
    flex: 0 0 190px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
}
.synced-photo-card:hover {
    transform: translateY(-3px);
    border-color: #00d2ff;
    box-shadow: 0 8px 20px rgba(0, 210, 255, 0.2);
}
.synced-photo-img-wrap {
    position: relative;
    width: 100%;
    height: 110px;
    background: #000;
    overflow: hidden;
}
.synced-photo-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.synced-photo-card:hover .synced-photo-img-wrap img {
    transform: scale(1.08);
}
.synced-photo-tag {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(7, 10, 19, 0.85);
    border: 1px solid rgba(0, 210, 255, 0.4);
    color: #00d2ff;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    backdrop-filter: blur(6px);
}
.synced-photo-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}
.synced-photo-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.synced-photo-sub {
    font-size: 0.68rem;
    color: #94a3b8;
    margin: 0;
}

/* Operations Grid (2x2) */
.workspace-ops-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.ops-card {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
}
.ops-card:hover {
    background: rgba(24, 34, 58, 0.85);
    border-color: rgba(0, 210, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.ops-icon-box {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    border: 1px solid;
    margin-bottom: 2px;
}
.ops-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.25;
}
.ops-desc {
    font-size: 0.68rem;
    color: #94a3b8;
    margin: 0;
    line-height: 1.35;
}
.ops-arrow {
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 0.8rem;
    opacity: 0.6;
    transition: transform 0.2s, opacity 0.2s;
}
.ops-card:hover .ops-arrow {
    transform: translateX(3px);
    opacity: 1;
}

/* Lightbox Modal */
.workspace-lightbox {
    position: fixed;
    inset: 0;
    z-index: 4000;
    background: rgba(4, 7, 14, 0.94);
    backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}
.lightbox-dialog {
    background: #0b1120;
    border: 1px solid rgba(0, 210, 255, 0.3);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
    border-radius: 16px;
    max-width: 650px;
    width: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}
.lightbox-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s;
}
.lightbox-close:hover {
    background: #ff1744;
    border-color: #ff1744;
}
.lightbox-img-wrap {
    width: 100%;
    max-height: 420px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.lightbox-img-wrap img {
    max-width: 100%;
    max-height: 420px;
    object-fit: contain;
}
.lightbox-info {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.lightbox-tag {
    display: inline-block;
    color: #00d2ff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Mobile Segmented View Switcher */
.workspace-view-switcher {
    display: flex;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 4px;
    margin: 8px 16px;
    gap: 6px;
}
.view-switch-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 20px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
}
.view-switch-btn.active {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(0, 210, 255, 0.4);
}

/* Responsive Overrides */
@media (min-width: 993px) {
    .workspace-view-switcher {
        display: none !important;
    }

    /* =========================================================================
       GUEST LANDING PAGE (DESKTOP):
       Orbiting Digital Project Managers are prominently featured and centered!
       The project dashboard widgets must NEVER appear on the landing page!
       ========================================================================= */
    body.role-guest .dashboard-widgets {
        display: none !important;
    }
    body.role-guest .guest-hero {
        display: flex !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        width: auto !important;
        height: 100% !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }
    body.role-guest .chat-container {
        width: 420px !important;
        max-width: 440px !important;
        flex: none !important;
        margin: 20px !important;
        border-radius: 16px !important;
        height: calc(100% - 40px) !important;
        background: rgba(15, 23, 42, 0.6) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        box-shadow: -10px 10px 40px rgba(0, 0, 0, 0.5) !important;
    }

    /* =========================================================================
       PROJECT WORKSPACE (DESKTOP - When logged into Client, Site, Consultant, Admin):
       Guest hero is hidden, Chat Concierge fills left/center, Workspace Hub on right
       ========================================================================= */
    body:not(.role-guest) .guest-hero {
        display: none !important;
    }
    body:not(.role-guest) .chat-container {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        width: auto !important;
        margin: 0 !important;
        border-radius: 0 !important;
        height: 100% !important;
        box-shadow: none !important;
    }
    body:not(.role-guest) .dashboard-widgets {
        display: flex !important;
        width: 440px !important;
        max-width: 440px !important;
        flex: none !important;
        height: 100% !important;
        box-sizing: border-box !important;
    }
    body:not(.role-guest) .messages-area {
        display: flex !important;
    }
    body:not(.role-guest) .input-container {
        display: flex !important;
    }
}

/* Always keep Orbiting Project Managers hero visible on the Main Brain guest landing page */
body.role-guest .guest-hero,
body.role-guest.navigating .guest-hero {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}
body.role-guest .guest-hero .orbit-track {
    display: block !important;
    visibility: visible !important;
}

@media (max-width: 992px) {
    /* Mobile Guest Landing Page */
    body.role-guest .dashboard-widgets {
        display: none !important;
    }
    body.role-guest .workspace-view-switcher {
        display: none !important;
    }
    body.role-guest .guest-hero,
    body.role-guest.navigating .guest-hero {
        width: 100% !important;
        min-height: 430px !important;
        max-height: none !important;
        height: auto !important;
        flex: none !important;
        display: flex !important;
        overflow: visible !important;
        padding: 16px 12px 12px 12px !important;
    }
    body.role-guest .network-hub-wrapper {
        width: 260px !important;
        height: 260px !important;
        max-width: 78vw !important;
        margin: 10px auto !important;
    }
    body.role-guest .guest-hero .premium-avatar-icon {
        width: 36px !important;
        height: 36px !important;
    }
    body.role-guest .guest-hero .premium-avatar-icon.ai-featured {
        width: 44px !important;
        height: 44px !important;
    }
    body.role-guest .chat-container,
    body.role-guest.navigating .chat-container {
        width: 100% !important;
        margin: 0 !important;
        flex: 1 1 auto !important;
        min-height: 450px !important;
        height: auto !important;
        border-radius: 0 !important;
    }

    /* Mobile Logged-in View */
    body:not(.role-guest) .guest-hero {
        display: none !important;
    }
    body:not(.role-guest) .workspace-view-switcher {
        display: flex !important;
    }

    .dashboard-widgets {
        width: 100% !important;
        max-width: 100% !important;
        border-left: none !important;
        padding: 14px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        overflow-y: auto !important;
    }
    .workspace-metrics-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    .workspace-ops-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    .mobile-hidden-view {
        display: none !important;
    }
    .workspace-header-card {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }
    .workspace-quick-actions-bar {
        width: 100% !important;
    }
    .gallery-launch-btn {
        width: 100% !important;
        justify-content: center !important;
    }

    /* Seamless View Switching on Mobile when logged in */
    body:not(.role-guest).workspace-view-hub .messages-area,
    body:not(.role-guest).workspace-view-hub .input-container {
        display: none !important;
    }
    body:not(.role-guest).workspace-view-hub .dashboard-widgets {
        display: flex !important;
        flex: 1 1 auto !important;
        height: auto !important;
        max-height: calc(100dvh - 120px) !important;
        overflow-y: auto !important;
    }

    body:not(.role-guest).workspace-view-chat .dashboard-widgets {
        display: none !important;
    }
    body:not(.role-guest).workspace-view-chat .messages-area {
        display: flex !important;
    }
    body:not(.role-guest).workspace-view-chat .input-container {
        display: flex !important;
    }
    #firebase-sync-indicator {
        display: none !important;
    }
    .home-btn, .reload-btn {
        display: inline-flex !important;
    }
}
