/* --- AAI Enterprise Premium Theme (Chime Mobile Bank Edition) --- */

/* 1. Core Color Variables */
:root {
    --corp-primary: #1D1D1F; 
    --corp-accent: #25C870;  /* Chime Signature Green */
    --bg-color: #F2F2F7;     
    --card-bg: rgba(255, 255, 255, 0.75); /* Translucent White for Glass Effect */
    --text-main: #1D1D1F;
    --text-muted: #86868B;
    --border-color: rgba(0, 0, 0, 0.08);
    
    /* System Status Colors */
    --status-success: #25C870; /* Matched to Chime Green */
    --status-warning: #FFBA00; /* Warm Orange/Yellow */
    --status-danger: #F04438;  /* Crisp Red */   

    /* Premium Shadows & Radiuses */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12);
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 999px;
    --avatar-border: #FFFFFF;
}

/* Custom Scrollbar (macOS Style) */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Navigation (Frosted Glass Top Bar) --- */
.top-nav { 
    background-color: rgba(255, 255, 255, 0.75); 
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-main); 
    padding: 16px 24px; 
    border-bottom: 1px solid var(--border-color);
    position: sticky; 
    top: 0; 
    z-index: 100; 
}
.nav-content { max-width: 1000px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.nav-brand { font-size: 18px; font-weight: 800; letter-spacing: 0.5px; color: var(--text-main); }
.nav-brand span { color: var(--text-muted); font-weight: 500; }
.nav-date { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

#themeToggleBtn { color: var(--text-muted) !important; transition: color 0.2s; }
#themeToggleBtn:hover { color: var(--text-main) !important; }

.main-content { padding: 24px 16px; max-width: 1000px; margin: 0 auto; }

/* --- Native iOS/macOS Bottom Tab Bar --- */
.vertical-nav { 
    position: fixed; bottom: 0; left: 0; width: 100%; 
    flex-direction: row; justify-content: space-around; align-items: center; gap: 0;
    background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(30px) saturate(200%); -webkit-backdrop-filter: blur(30px) saturate(200%); 
    padding: 10px 8px max(16px, env(safe-area-inset-bottom)); 
    border-top: 1px solid rgba(0,0,0,0.08); border-radius: 0; box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05); 
    margin: 0; z-index: 9900; box-sizing: border-box;
}

.nav-item { 
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; 
    padding: 4px 8px; background: transparent; border: none; border-radius: 12px; 
    color: var(--text-muted); font-size: 10px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; width: 64px; text-align: center;
}

.nav-item svg { width: 24px; height: 24px; opacity: 1; transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
.nav-item:hover { background: rgba(0,0,0,0.04); color: var(--text-main); }

/* The Active State (Icon pops up and turns Chime Green) */
.nav-item.active { background: transparent; color: var(--corp-accent); box-shadow: none; }
.nav-item.active svg { transform: scale(1.15) translateY(-2px); filter: drop-shadow(0 4px 6px rgba(37, 200, 112, 0.4)); }

/* Badge overlays for the Inbox icon */
.tab-icon-wrapper { position: relative; display: flex; justify-content: center; align-items: center; }
.tab-badge { position: absolute; top: -6px; right: -8px; color: white; border-radius: 10px; padding: 2px 5px; font-size: 10px; font-weight: 800; min-width: 14px; text-align: center; border: 2px solid var(--card-bg); box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.team-badge { right: -18px; top: 8px; }

/* Dark Mode Overrides */
body.dark-theme .vertical-nav { background: rgba(28, 28, 30, 0.85); border-top-color: rgba(255,255,255,0.1); }
body.dark-theme .nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
body.dark-theme .tab-badge { border-color: rgba(28, 28, 30, 1); }

/* --- Apple Micro-Interactions --- */

/* 1. macOS Text Selection Highlight */
::selection {
    background: rgba(0, 122, 255, 0.3); /* Soft Apple Blue */
    color: inherit;
}
body.dark-theme ::selection {
    background: rgba(0, 122, 255, 0.5);
}

/* 2. Remove Android/Web blue tap flash on mobile */
* {
    -webkit-tap-highlight-color: transparent;
}

/* 3. True iOS/macOS Floating Scrollbar */
::-webkit-scrollbar { 
    width: 14px; /* Wider hit area, visual part is smaller */
    height: 14px; 
}
::-webkit-scrollbar-track { 
    background: transparent; 
}
::-webkit-scrollbar-thumb { 
    background-color: rgba(0, 0, 0, 0.2); 
    border-radius: 10px; 
    border: 4px solid transparent; /* Creates padding so it "floats" */
    background-clip: padding-box; 
}
::-webkit-scrollbar-thumb:hover { 
    background-color: rgba(0, 0, 0, 0.4); 
}
body.dark-theme ::-webkit-scrollbar-thumb { 
    background-color: rgba(255, 255, 255, 0.2); 
}
body.dark-theme ::-webkit-scrollbar-thumb:hover { 
    background-color: rgba(255, 255, 255, 0.4); 
}


/* --- PREMIUM MODAL (macOS Style) --- */
.premium-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Slightly darker overlay for focus */
    backdrop-filter: blur(10px) saturate(180%); /* macOS-style glass effect */
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000000; /* Ensure it is on top of everything */
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.premium-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.premium-modal-box {
    background-color: var(--card-bg);
    width: 100%;
    max-width: 440px; /* Optimal size for macOS dialog on mobile */
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.premium-modal-overlay.active .premium-modal-box {
    transform: scale(1);
}

.premium-modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.premium-modal-icon-edit {
    background: linear-gradient(135deg, var(--corp-accent) 0%, #17A356 100%); 
    color: white;
}

.premium-modal-icon-delete {
    background: linear-gradient(135deg, #FF453A 0%, #FF3B30 100%); /* macOS Danger Red */
    color: white;
}

/* Redefining Premium Textarea for Modal Context */
.premium-textarea {
    width: 100%;
    height: 120px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px;
    font-family: inherit;
    font-size: 15px;
    color: var(--text-main);
    line-height: 1.5;
    resize: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.premium-textarea:focus {
    outline: none;
    border-color: rgba(37, 200, 112, 0.5); /* Green focus border */
    background-color: rgba(255, 255, 255, 0.08);
}

/* Premium Modal Buttons */
.premium-btn {
    background: var(--corp-accent);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-full); /* Creates the Chime Pill Shape */
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(37, 200, 112, 0.2);
}
.premium-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(37, 200, 112, 0.3);
}
.premium-btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
    box-shadow: none;
}
.premium-btn-secondary:hover {
    background: rgba(0, 0, 0, 0.08);
    box-shadow: none;
}
.premium-btn-danger {
    background: var(--status-danger);
    box-shadow: 0 4px 10px rgba(255, 59, 48, 0.2);
}
.premium-btn-danger:hover {
    box-shadow: 0 6px 14px rgba(255, 59, 48, 0.3);
}
body.dark-theme .premium-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}
body.dark-theme .premium-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}


/* --- Login Portal (Premium Overlay) --- */
.login-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background-color: rgba(242, 242, 247, 0.8); backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px); display: flex; justify-content: center; align-items: center; z-index: 9999; }
.login-box { background: rgba(255, 255, 255, 0.85); padding: 48px 36px; border-radius: 24px; box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,0.5); width: 100%; max-width: 400px; box-sizing: border-box; }
.corp-logo { font-size: 28px; font-weight: 800; color: var(--corp-accent); margin-bottom: 8px; text-align: center; letter-spacing: -0.5px; }
.login-title { font-size: 24px; font-weight: 700; text-align: center; margin: 0 0 8px 0; color: var(--text-main); letter-spacing: -0.5px; }
.login-subtitle { color: var(--text-muted); font-size: 14px; text-align: center; margin-bottom: 32px; font-weight: 400; }
.input-group { margin-bottom: 20px; text-align: left; }
.input-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
/* Ultra-Premium macOS Inputs */
.corp-input { 
    width: 100%; padding: 12px 16px; font-size: 15px; font-weight: 500;
    border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 14px; box-sizing: border-box; outline: none; 
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1); font-family: inherit; 
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-main); box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}
.corp-input:focus { 
    border-color: var(--corp-accent); background: #ffffff; 
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15), inset 0 1px 2px rgba(0,0,0,0.02); 
}

/* Ultra-Premium macOS Primary Buttons */
.corp-btn { 
    width: 100%; background: linear-gradient(180deg, var(--corp-accent) 0%, #0062cc 100%); 
    color: white; border: 1px solid rgba(0,0,0,0.1); padding: 14px; font-size: 15px; font-weight: 600; 
    border-radius: 14px; cursor: pointer; transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1); margin-top: 8px; 
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.2); 
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
}
.corp-btn:hover { transform: translateY(-1px) scale(0.99); box-shadow: 0 6px 16px rgba(0, 122, 255, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.3); }
.corp-btn:active { transform: scale(0.97); }

.error-text { color: var(--status-danger); font-size: 13px; margin: 4px 0 16px 0; min-height: 18px; font-weight: 500; text-align: center; }

/* --- Premium macOS Highlight Button (For Quick Login) --- */
.mac-highlight-btn {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.1) 0%, rgba(255, 149, 0, 0.04) 100%);
    color: var(--status-warning);
    border: 1px solid rgba(255, 149, 0, 0.25);
    padding: 14px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 10px rgba(255, 149, 0, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.mac-highlight-btn:hover {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.15) 0%, rgba(255, 149, 0, 0.08) 100%);
    border-color: rgba(255, 149, 0, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(255, 149, 0, 0.15);
}

.mac-highlight-btn:active {
    transform: scale(0.96);
}

/* Dark Mode Support for Highlight Button */
body.dark-theme .mac-highlight-btn {
    background: linear-gradient(135deg, rgba(255, 159, 10, 0.15) 0%, rgba(255, 159, 10, 0.05) 100%);
    color: #FF9F0A; /* macOS Dark Mode Orange */
    border-color: rgba(255, 159, 10, 0.3);
}

body.dark-theme .mac-highlight-btn:hover {
    background: linear-gradient(135deg, rgba(255, 159, 10, 0.25) 0%, rgba(255, 159, 10, 0.1) 100%);
    border-color: rgba(255, 159, 10, 0.5);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

/* --- Premium macOS Unlock Button (Welcome Back Screen) --- */
.mac-unlock-btn {
    background: linear-gradient(135deg, rgba(37, 200, 112, 0.1) 0%, rgba(37, 200, 112, 0.04) 100%);
    color: var(--corp-accent);
    border: 1px solid rgba(37, 200, 112, 0.25);
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 10px rgba(37, 200, 112, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}
.mac-unlock-btn:hover {
    background: linear-gradient(135deg, rgba(37, 200, 112, 0.15) 0%, rgba(37, 200, 112, 0.08) 100%);
    border-color: rgba(37, 200, 112, 0.4);
    box-shadow: 0 6px 14px rgba(37, 200, 112, 0.15);
}

/* Tool Selection Modal */

.tool-select-btn { display: flex; align-items: center; gap: 16px; width: 100%; padding: 16px; background: rgba(255,255,255,0.6); border: 1px solid var(--border-color); border-radius: 16px; cursor: pointer; transition: all 0.2s ease; text-align: left; }
.tool-select-btn:hover { border-color: var(--corp-accent); background: rgba(255,255,255,0.9); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.tool-icon { font-size: 24px; background: rgba(37, 200, 112, 0.1); color: var(--corp-accent); padding: 12px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.tool-select-btn:last-child .tool-icon { background: rgba(52,199,89,0.1); color: var(--status-success); }
.tool-info { display: flex; flex-direction: column; gap: 4px; }
.tool-name { font-size: 15px; font-weight: 600; color: var(--text-main); }
.tool-desc { font-size: 12px; color: var(--text-muted); }

/* --- ULTRA-PREMIUM LIVE SHOUTOUT TICKER --- */
.shoutout-wrapper { position: sticky; top: 54px; z-index: 90; background-color: transparent; padding: 10px 0 14px 0; margin-top: -10px; margin-bottom: 32px; animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.shoutout-bar { 
    display: flex; background: rgba(255, 255, 255, 0.95); 
    border: 1px solid rgba(0,0,0,0.06); 
    border-radius: 20px; overflow: hidden; 
    box-shadow: 0 8px 24px rgba(0,0,0,0.04), inset 0 1px 1px rgba(255,255,255,1); 
}
.shoutout-label { 
    background: transparent; color: var(--corp-accent); padding: 14px 18px; 
    font-weight: 800; font-size: 11px; letter-spacing: 1px; z-index: 2; 
    display: flex; align-items: center; white-space: nowrap; 
    border-right: 1px solid rgba(0,0,0,0.06); 
    box-shadow: 4px 0 10px rgba(0,0,0,0.02);
}
.shoutout-marquee { flex: 1; overflow: hidden; position: relative; display: flex; align-items: center; }
.marquee-content { display: flex; white-space: nowrap; animation: marquee 60s linear infinite; padding-left: 30vw; align-items: center; }
.marquee-content:hover { animation-play-state: paused; }
.shoutout-item { font-size: 14px; font-weight: 500; color: var(--text-main); }
.shoutout-item strong { color: var(--corp-accent); font-weight: 700; margin-right: 4px; }
.shoutout-dot { margin: 0 24px; color: var(--border-color); font-weight: 800; font-size: 18px; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

.shoutout-input-group { display: flex; gap: 8px; margin-top: 12px; }
.shoutout-input-group input { flex: 1; border-radius: 12px; font-size: 14px; box-shadow: inset 0 1px 2px rgba(0,0,0,0.02); }
.post-btn { background: var(--corp-accent); color: white; border: none; padding: 0 24px; border-radius: 12px; font-weight: 600; font-size: 14px; cursor: pointer; transition: all 0.2s; }
.post-btn:hover { background: #17A356; transform: scale(0.98); }

/* --- Search Bar --- */
.search-container { 
    display: none !important; 
}
.search-icon { position: absolute; left: 16px; top: 14px; width: 18px; height: 18px; color: var(--text-muted); }
#agentSearch { width: 100%; padding: 14px 16px 14px 44px; font-size: 15px; border: 1px solid rgba(255,255,255,0.6); border-radius: 14px; outline: none; background: var(--card-bg); backdrop-filter: blur(10px); box-shadow: var(--shadow-sm); font-family: inherit; transition: all 0.2s; color: var(--text-main); }
#agentSearch:focus { border-color: var(--corp-accent); box-shadow: 0 0 0 4px rgba(37, 200, 112, 0.15); background: #fff; }

/* --- Layout & Ultra-Premium Glass Cards --- */
.container { display: flex; flex-direction: column; gap: 24px; }
.card { 
    background: rgba(255, 255, 255, 0.85); 
    border-radius: 24px; 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05), inset 0 1px 1px rgba(255, 255, 255, 0.8); 
    border: 1px solid rgba(0,0,0,0.06); 
    overflow: hidden; transition: box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); 
}
.card:hover { box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.9); transform: translateY(-2px); }
.overall-card { } /* Borders removed in favor of glassmorphism */
.team-card { } 

/* --- ULTRA-PREMIUM macOS Welcome Banner --- */
.mac-premium-welcome {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(40px) saturate(200%); -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.8); border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 28px; padding: 32px; margin-top: 16px; margin-bottom: 24px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.06), inset 0 1px 1px rgba(255,255,255,1); 
    flex-wrap: wrap; gap: 24px;
    animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.mac-welcome-left { display: flex; align-items: center; gap: 24px; }
.mac-welcome-avatar {
    width: 84px; height: 84px; border-radius: 50%; object-fit: cover;
    border: 4px solid var(--avatar-border); 
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12), inset 0 2px 4px rgba(0,0,0,0.1);
    background-color: var(--corp-accent); flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.mac-welcome-avatar:hover { transform: scale(1.05); }

.mac-welcome-text { display: flex; flex-direction: column; gap: 4px; }
.mac-greeting { font-size: 30px; font-weight: 800; color: var(--text-main); letter-spacing: -0.8px; }
.mac-subtext { font-size: 15px; color: var(--text-muted); font-weight: 600; letter-spacing: -0.2px; }

.mac-welcome-right { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); /* Fluid wrapping for different screen sizes */
    gap: 8px; 
    flex: 1; 
    width: 100%; 
}
.mac-stat-card {
    background: rgba(255, 255, 255, 0.65); 
    backdrop-filter: blur(30px) saturate(200%); -webkit-backdrop-filter: blur(30px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 20px; 
    padding: 16px 8px; /* Reduced side padding so it fits on mobile */
    display: flex; flex-direction: column;
    justify-content: center; align-items: center; text-align: center;
    min-width: 0; /* Removed min-width so they can shrink side-by-side */
    box-shadow: 0 8px 20px rgba(0,0,0,0.04), inset 0 1px 1px rgba(255,255,255,1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.mac-stat-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,0.06), inset 0 1px 2px rgba(255,255,255,1); }
.mac-stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; font-weight: 700; margin-bottom: 8px; letter-spacing: 0.5px; }
.mac-stat-value { font-size: 28px; font-weight: 800; letter-spacing: -1px; margin-bottom: 6px; }
.mac-trend-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 8px; width: max-content; }

.target-card { flex: 2; min-width: 200px; }
.target-card.passing { background: rgba(52, 199, 89, 0.05); border-color: rgba(52, 199, 89, 0.1); }
.target-card.failing { background: rgba(255, 59, 48, 0.05); border-color: rgba(255, 59, 48, 0.1); }
.mac-stat-msg { font-size: 14px; font-weight: 600; color: var(--text-main); line-height: 1.4; }

/* Dark Mode Overrides */
body.dark-theme .mac-premium-welcome { background: rgba(28, 28, 30, 0.7); }
body.dark-theme .mac-stat-card { background: rgba(0, 0, 0, 0.2); border-color: rgba(255,255,255,0.05); box-shadow: none; }
body.dark-theme .mac-welcome-avatar { border-color: #1C1C1E; }

/* --- Header & Badges --- */
.card-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; border-bottom: 1px solid var(--border-color); background-color: transparent; }
.team-name { font-size: 17px; font-weight: 600; margin: 0; color: var(--text-main); letter-spacing: -0.3px; display: flex; align-items: center; gap: 8px;}
.rank { font-size: 11px; font-weight: 700; color: var(--corp-accent); background: rgba(37, 200, 112, 0.1); padding: 4px 12px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.5px; }

/* --- Expandable Panels --- */
.collapsible-header { cursor: pointer; user-select: none; transition: background-color 0.2s; }
.collapsible-header:hover { background-color: rgba(0,0,0,0.02); }
.header-right-group { display: flex; align-items: center; gap: 12px; }
.chevron-icon { width: 20px; height: 20px; color: var(--text-muted); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.collapsed .chevron-icon { transform: rotate(-90deg); }
.card-collapsible-area { display: block; animation: slideDown 0.3s ease-out; }
.collapsed .card-collapsible-area { display: none; }

/* --- Ultra-Premium Score Summary Grid --- */
.score-summary { 
    display: flex; background: rgba(255, 255, 255, 0.4); 
    padding: 18px 20px; border-bottom: 1px solid rgba(0,0,0,0.05); 
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}
.score-box { flex: 1; text-align: center; border-right: 1px solid rgba(0,0,0,0.05); }
.score-box:last-child { border-right: none; }
.score-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; font-weight: 700; margin-bottom: 6px; letter-spacing: 0.8px; }
.score-value { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; color: var(--text-main); }

/* --- Ultra-Premium macOS Enterprise Tables --- */
.table-container { 
    overflow-x: auto; 
    background: rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.03);
    margin: 8px 16px 16px 16px; /* Let it breathe inside the card */
}

.corp-table { 
    width: 100%; border-collapse: collapse; font-size: 14px; white-space: nowrap; 
}

.corp-table th, .corp-table td { 
    padding: 16px 24px; 
    border-bottom: 1px solid rgba(0, 0, 0, 0.04); 
}

.corp-table th { 
    font-weight: 700; color: var(--text-muted); background-color: transparent; 
    text-transform: uppercase; font-size: 11px; letter-spacing: 0.8px; 
}

.corp-table tbody tr { 
    transition: background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1); 
}

/* Beautiful glass hover effect for rows */
.corp-table tbody tr:hover { 
    background-color: rgba(255, 255, 255, 0.7); 
}

.corp-table tbody tr:last-child td { border-bottom: none; }

.corp-table th { text-align: right; }
.corp-table td { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.corp-table th:first-child, .corp-table td:first-child { text-align: left; }

/* Make the Agent's Name pop nicely */
.corp-table td:first-child { font-weight: 700; color: var(--text-main); letter-spacing: -0.2px; }

.divider { border-left: 1px dashed var(--border-color); }
.score-perfect { color: var(--status-success); font-weight: 600; }
.score-danger  { color: var(--status-danger); font-weight: 600; }
.score-warning { color: var(--status-warning); font-weight: 600; }
.score-neutral { color: var(--text-muted); font-weight: 500; }
.count-bold { font-weight: 600; color: var(--text-main); }
.small-sub { font-size: 10px; font-weight: 500; color: var(--text-muted); display: inline-block; margin-left: 4px; }

/* --- Buttons & Utilities --- */
.action-btn { 
    background: rgba(255,255,255,0.75); color: var(--text-main); 
    border: 1px solid rgba(0,0,0,0.06); padding: 8px 16px; font-size: 13px; font-weight: 600; 
    border-radius: 12px; cursor: pointer; transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1); 
    box-shadow: 0 2px 8px rgba(0,0,0,0.04), inset 0 1px 1px rgba(255,255,255,0.8); 
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.action-btn:hover { background: #ffffff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.08), inset 0 1px 1px rgba(255,255,255,1); }

.watermark { text-align: center; font-size: 11px; font-weight: 500; color: var(--text-muted); margin-top: 40px; padding-bottom: 24px; letter-spacing: 1px; text-transform: uppercase; }

/* --- TOOLS UI (Calculators) Premium Apple Style --- */
.tool-card { max-width: 600px; margin: 0 auto; }
.calc-body { padding: 24px; }

/* Frosted Widget Style for Score */
.hero-score-card { text-align: center; margin-bottom: 32px; padding: 32px; background: rgba(255, 255, 255, 0.5); backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px); border-radius: 24px; border: 1px solid rgba(255, 255, 255, 0.8); box-shadow: var(--shadow-md); }
.hero-score-card .score-value { font-size: 64px; font-weight: 800; letter-spacing: -2px; line-height: 1; color: var(--text-main); margin: 12px 0; text-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.passing-status { font-size: 13px; font-weight: 600; display: inline-block; padding: 6px 16px; border-radius: 20px; background: rgba(255,255,255,0.9); border: 1px solid rgba(0,0,0,0.05); box-shadow: var(--shadow-sm); backdrop-filter: blur(10px); }

/* Calculator Inputs & Pill Buttons */
.calc-body .corp-input { border-radius: 16px; background: rgba(255,255,255,0.7); box-shadow: inset 0 2px 4px rgba(0,0,0,0.02); border: 1px solid rgba(0,0,0,0.08); font-size: 15px; font-weight: 500; padding: 14px 16px; }
.calc-body .corp-input:focus { background: #fff; border-color: var(--corp-accent); box-shadow: 0 0 0 4px rgba(37, 200, 112, 0.15); }
.calc-btn { border-radius: 24px; height: 50px; font-size: 15px; margin-top: 16px; box-shadow: 0 4px 14px rgba(37, 200, 112, 0.3); }

/* Groupings */
.section-header { background: transparent; color: var(--text-main); padding: 0 4px; border-radius: 0; font-weight: 700; font-size: 13px; margin: 24px 0 16px 0; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border-color); padding-bottom: 8px; display: flex; justify-content: space-between; align-items: baseline; }
.section-header small { font-weight: 500; color: var(--text-muted); text-transform: none; font-size: 11px; }

.flex-row { display: flex; gap: 16px; flex-wrap: wrap; }
.flex-col { flex: 1; min-width: 280px; }

/* Frosted Sub-panels */
.highlight-box { background: rgba(255,255,255,0.4); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); padding: 24px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.6); margin-bottom: 20px; box-shadow: var(--shadow-sm); }

.results-panel { background: rgba(255,255,255,0.7); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); border: 1px solid rgba(255,255,255,0.8); border-radius: 24px; padding: 28px; margin-top: 24px; animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: var(--shadow-md); }
.result-row { display: flex; justify-content: space-between; margin-bottom: 14px; font-size: 14px; border-bottom: 1px solid rgba(0,0,0,0.04); padding-bottom: 14px; font-weight: 500;}
.result-row:last-child { border-bottom: none; }
.result-row.total { font-weight: 800; font-size: 18px; color: var(--text-main); border-top: 2px solid rgba(0,0,0,0.08); border-bottom: none; padding-top: 18px; margin-top: 8px; }

/* Apple Wallet Style Net Pay Card */
.net-pay-box { background: linear-gradient(135deg, #1C1C1E 0%, #2C2C2E 100%); color: white; padding: 28px; border-radius: 20px; text-align: center; margin-top: 28px; box-shadow: 0 12px 30px rgba(0,0,0,0.2); position: relative; overflow: hidden; }
.net-pay-box::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: rgba(255,255,255,0.2); }
.net-pay-value { font-size: 42px; font-weight: 800; letter-spacing: -1.5px; margin-top: 8px; text-shadow: 0 2px 10px rgba(0,0,0,0.3); }

/* SNPS Result Specifics */
.result-card { background: rgba(255,255,255,0.7); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); border-radius: 24px; border: 1px solid rgba(255,255,255,0.8); padding: 28px; margin-top: 24px; text-align: center; box-shadow: var(--shadow-md); animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.result-title { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin: 0 0 8px 0; }
.needed-count { font-size: 36px; font-weight: 800; color: var(--corp-accent); margin: 0 0 4px 0; letter-spacing: -1px; }
.needed-subtext { font-size: 14px; color: var(--text-main); font-weight: 500; margin: 0 0 24px 0; }

.result-details { display: flex; gap: 16px; background: rgba(0,0,0,0.03); padding: 16px; border-radius: 16px; }
.detail-box { flex: 1; text-align: center; }
.detail-box:first-child { border-right: 1px solid var(--border-color); }
.detail-label { display: block; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.detail-value { display: block; font-size: 20px; font-weight: 700; color: var(--text-main); }

/* Dark Mode Tool Overrides */
body.dark-theme .hero-score-card, body.dark-theme .results-panel, body.dark-theme .result-card { background: rgba(28,28,30,0.6); border-color: rgba(255,255,255,0.1); }
body.dark-theme .calc-body .corp-input { background: rgba(0,0,0,0.3); border-color: rgba(255,255,255,0.1); }
body.dark-theme .calc-body .corp-input:focus { background: rgba(0,0,0,0.5); }
body.dark-theme .highlight-box { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.05); }
body.dark-theme .result-details { background: rgba(0,0,0,0.2); }
body.dark-theme .net-pay-box { background: linear-gradient(135deg, #000000 0%, #1C1C1E 100%); }

@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }


/* --- Mobile Responsiveness --- */
@media (max-width: 600px) {
    /* Allow score summary to wrap gracefully instead of squishing */
    .score-summary { flex-direction: row; padding: 12px 8px; flex-wrap: wrap; gap: 8px; justify-content: center; }
    .score-box { padding: 8px 2px; flex: 1 1 30%; min-width: 85px; }
    .score-label { font-size: 9px; letter-spacing: 0; }
    .score-value { font-size: 17px; }
    
    /* Stack the Avatar and Welcome Text vertically on small phones */
    .mac-welcome-left { flex-direction: column; text-align: center; width: 100%; gap: 12px; }
    .mac-premium-welcome { padding: 24px 16px; flex-direction: column; }
    
    /* Make the welcome stat numbers scale down smoothly on small screens */
    .mac-stat-label { font-size: 9px; letter-spacing: 0; }
    .mac-stat-value { font-size: 20px; margin-bottom: 2px; }
    .mac-trend-badge { font-size: 10px; padding: 2px 6px; }
    .corp-table th, .corp-table td { padding: 12px; font-size: 13px; }
    .hero-score-card .score-value { font-size: 48px; }
    
    /* Reverts the login box to a floating card with nice rounded corners on mobile */
    .login-box { 
        border-radius: 24px; 
        height: auto; 
        margin: 24px; 
        padding: 36px 24px; 
        display: block;
    }

    /* 1. Scale down the Top Nav elements to perfectly fit the Date/Time on small phones */
    .top-nav { padding: 12px 14px; }
    .nav-brand { font-size: 16px; }
    .nav-date { display: block; font-size: 10px; letter-spacing: 0; white-space: nowrap; }
    
    /* Shrinks the gap between your Color/Theme icons and the Date */
    .nav-content > div:last-child { gap: 10px !important; }

    /* 2. Add padding to the bottom of the app so users can scroll past the music player */
    .main-content { padding-bottom: 100px; }

    /* 3. Force the Profile 'Hobbies/Location' grid to stack vertically on small screens */
    .profile-widget > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* 4. Ensure long names in the profile viewers list don't push buttons off-screen */
    .mac-viewer-item {
        padding: 10px;
        gap: 10px;
    }
    .mac-viewer-action {
        width: 28px;
        height: 28px;
    }
}


/* --- CUSTOM TOAST NOTIFICATIONS (Fixed for Mobile Camera Notch) --- */
#customToast {
    position: fixed;
    top: 80px; /* Pushed down to clear the camera notch and nav bar */
    bottom: auto; 
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--card-bg); /* Adapts to light/dark mode */
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    padding: 12px 24px;
    border-radius: 30px; 
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    width: max-content;
    max-width: calc(100vw - 32px);
    border: 1px solid var(--border-color);
}
#customToast.toast-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
#toastMessage {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main); /* Now adapts to the theme instead of being forced white */
}
#toastIcon { display: flex; align-items: center; justify-content: center; }
#toastIcon svg { width: 20px; height: 20px; }

.toast-success #toastIcon { color: var(--status-success); }
.toast-error #toastIcon { color: var(--status-danger); }

/* --- DARK MODE THEME OVERRIDES (Chime Dark Mode) --- */
body.dark-theme {
    --corp-primary: #FFFFFF;
    --corp-accent: #2CE982; /* Slightly brighter Chime Green for dark mode contrast */
    --bg-color: #000000;
    --card-bg: rgba(28, 28, 30, 0.75);
    --text-main: #FFFFFF;
    --text-muted: #98989D;
    --border-color: rgba(255, 255, 255, 0.1);
    --avatar-border: #1C1C1E;
}

body.dark-theme .login-overlay { background-color: rgba(0, 0, 0, 0.8); }
body.dark-theme .login-box { background: rgba(28, 28, 30, 0.85); border-color: rgba(255,255,255,0.1); }
body.dark-theme .top-nav { background-color: rgba(28, 28, 30, 0.75); }
body.dark-theme .card-header { background-color: transparent; }
body.dark-theme .corp-table th { background-color: transparent; }

/* Fix Dark Mode Elements */
body.dark-theme .card { 
    background: rgba(30, 30, 32, 0.65); 
    border: 1px solid rgba(255,255,255,0.1); border-top: 1px solid rgba(255,255,255,0.15); 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.05);
}
body.dark-theme .corp-input { background: rgba(0, 0, 0, 0.3); border-color: rgba(255,255,255,0.1); color: #fff; box-shadow: inset 0 1px 2px rgba(0,0,0,0.2); }
body.dark-theme .corp-input:focus { background: rgba(0, 0, 0, 0.5); }
body.dark-theme .action-btn { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.1); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.3); }
body.dark-theme .action-btn:hover { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.2); }
body.dark-theme .score-summary, body.dark-theme .highlight-box { background: rgba(255,255,255,0.03); }
body.dark-theme .table-container { background: rgba(0, 0, 0, 0.2); box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3); }
body.dark-theme .corp-table th, body.dark-theme .corp-table td { border-bottom-color: rgba(255, 255, 255, 0.05); }
body.dark-theme .corp-table tbody tr:hover { background-color: rgba(255, 255, 255, 0.06); }
body.dark-theme .collapsible-header:hover { background-color: rgba(255,255,255,0.05); }
body.dark-theme .tool-select-btn { background: rgba(255,255,255,0.05); }
body.dark-theme .tool-select-btn:hover { background: rgba(255,255,255,0.1); }

body.dark-theme .personal-card { background: linear-gradient(135deg, rgba(44,44,46,0.9) 0%, rgba(28,28,30,0.6) 100%); }

/* Dark mode target boxes */
body.dark-theme .target-success { background: rgba(52,199,89,0.1); border-color: rgba(52,199,89,0.2); }
body.dark-theme .target-box:not(.target-success) { background: rgba(255,59,48,0.1); border-color: rgba(255,59,48,0.2); }
body.dark-theme .target-box:not(.target-success) .target-text { color: #FFD6D6; }



/* --- MESSAGING UI BASE (Restored) --- */
.messages-layout { display: flex; gap: 24px; height: calc(100vh - 160px); min-height: 500px; max-height: 700px; }
.inbox-panel { width: 100%; max-width: 380px; display: flex; flex-direction: column; flex-shrink: 0; margin: 0 auto; }

/* Messenger-Style Floating Chat Popup */
.chat-panel {
    position: fixed; bottom: 24px; right: 24px; width: 380px; height: 550px; max-height: calc(100vh - 100px);
    z-index: 9999; box-shadow: var(--shadow-lg); display: none; flex-direction: column;
    background: var(--card-bg); backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    border-radius: var(--radius-lg); border: 1px solid rgba(255,255,255,0.5);
    animation: slideUpFade 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.chat-header-flex { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.close-chat-btn { background: rgba(0,0,0,0.05); border: none; color: var(--text-muted); cursor: pointer; padding: 6px; border-radius: 50%; display: flex; align-items: center; transition: all 0.2s; }
.close-chat-btn:hover { background: rgba(255,59,48,0.1); color: var(--status-danger); }


/* --- MESSAGING INTERNAL COMPONENTS (iMessage Premium Style) --- */
.inbox-list { overflow-y: auto; flex-grow: 1; }
.inbox-item { padding: 16px 20px; border-bottom: 1px solid var(--border-color); cursor: pointer; transition: background 0.2s; }
.inbox-item:hover { background: rgba(0,0,0,0.03); }
.inbox-item.unread { background: rgba(37, 200, 112, 0.05); border-left: 3px solid var(--corp-accent); padding-left: 17px; }
.inbox-item.unread .inbox-name { font-weight: 700; color: var(--corp-accent); }

.chat-history { flex-grow: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }

/* Premium Frosted Glass Input Bar */
.chat-input-area { 
    display: flex; gap: 12px; padding: 16px 20px; 
    background: rgba(255, 255, 255, 0.65); 
    backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    border-top: 1px solid var(--border-color); 
    align-items: center;
}

/* Pill-shaped input and button */
.chat-input-area .corp-input { 
    border-radius: 24px; 
    padding: 12px 20px; 
    background: rgba(255,255,255,0.8);
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
}
.chat-input-area .corp-input:focus { background: #fff; box-shadow: 0 0 0 4px rgba(37, 200, 112, 0.15); }
.chat-input-area .corp-btn { 
    border-radius: 24px; 
    padding: 0 24px; 
    height: 44px; /* Matches input height perfectly */
    margin: 0;
}

/* Ultra-Premium iMessage Style Chat Bubbles */
.chat-bubble { max-width: 75%; padding: 10px 16px; font-size: 15px; line-height: 1.4; letter-spacing: -0.2px; font-weight: 500; }

.chat-bubble.sent { 
    background: linear-gradient(180deg, #32ADE6 0%, #007AFF 100%); /* Signature Apple Blue Gradient */
    color: white; 
    align-self: flex-end; 
    border-radius: 20px 20px 4px 20px; 
    box-shadow: 0 4px 10px rgba(0, 122, 255, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.chat-bubble.received { 
    background: rgba(255, 255, 255, 0.95); 
    color: var(--text-main); 
    align-self: flex-start; 
    border-radius: 20px 20px 20px 4px; 
    border: 1px solid rgba(0, 0, 0, 0.05); 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04), inset 0 1px 1px rgba(255, 255, 255, 0.9);
}

.autocomplete-dropdown { position: absolute; top: calc(100% - 4px); left: 16px; right: 16px; background: var(--card-bg); backdrop-filter: blur(20px); border: 1px solid var(--border-color); border-radius: 16px; box-shadow: var(--shadow-lg); max-height: 250px; overflow-y: auto; z-index: 100; }
.ac-item { padding: 14px 18px; cursor: pointer; font-size: 14px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; transition: background 0.2s; }
.ac-item:last-child { border-bottom: none; }
.ac-item:hover { background: rgba(0,0,0,0.05); }

/* Dark Mode Messaging Tweaks */
body.dark-theme .chat-bubble.received { background: #2C2C2E; border-color: rgba(255,255,255,0.1); color: #F5F5F7; }
body.dark-theme .chat-input-area { background: rgba(28, 28, 30, 0.65); border-color: rgba(255,255,255,0.1); }
body.dark-theme .chat-input-area .corp-input { background: rgba(0,0,0,0.4); border-color: rgba(255,255,255,0.1); }
body.dark-theme .chat-input-area .corp-input:focus { background: rgba(0,0,0,0.6); }
body.dark-theme .ac-item:hover, body.dark-theme .inbox-item:hover { background: rgba(255,255,255,0.05); }

@keyframes slideUpFade { from { opacity: 0; transform: translateY(20px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }


/* --- Mobile Fixes for Messaging UI (Corrected with !important tags) --- */
@media (max-width: 768px) {
    /* Change from flex to block on mobile to prevent trapping the popup */
    .messages-layout { display: block; height: auto; max-height: none; }
    .inbox-panel { width: 100%; max-width: none; height: calc(100vh - 160px); flex-shrink: 0; }
    
    /* Premium iOS-style Bottom Sheet Mobile Popup */
    .chat-panel { 
        position: fixed !important; 
        top: 24px !important; /* Leaves a slight gap at the top so it looks like a floating sheet */
        bottom: 0 !important; 
        left: 0 !important; 
        right: 0 !important; 
        width: 100% !important; 
        height: calc(100% - 24px) !important; 
        max-height: none !important; 
        border-radius: 32px 32px 0 0 !important; /* Soft, premium rounded Apple top corners */
        border: 1px solid rgba(255, 255, 255, 0.3) !important; 
        border-bottom: none !important;
        z-index: 99999 !important; 
        background: var(--bg-color) !important;
        margin: 0 !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15) !important;
    }
    
            /* Fix team chat and AI chat height so they don't clip */
        #view-teamchat .card, #view-ask-admin .card { 
            height: calc(100vh - 120px) !important; 
            max-height: none !important;
            border-radius: 24px !important;
        }
    
    /* Add safe-area padding to push the input box ABOVE the mini music player */
    .chat-input-area { 
        padding-bottom: 96px !important; 
        padding-left: 16px !important; 
        padding-right: 16px !important; 
        border-radius: 0 !important; /* Keeps it perfectly flat against the bottom of the phone screen */
    }

    /* Pushes the "Send Message" compose button ABOVE the mini music player */
    #chatComposeState > div:last-child {
        padding-bottom: 96px !important;
    }
}


/* --- Agent Tools Bottom Sheet (Premium iOS/macOS Style) --- */
#toolModal {
    align-items: flex-end; /* Pushes the menu to the very bottom of the screen */
}

#toolModal .login-box {
    margin: 0 !important; /* Removes the floating margin we added for the login box */
    max-width: 600px;
    width: 100%;
    height: auto !important;
    border-radius: 32px 32px 0 0 !important; /* Smooth, Apple-style rounded top corners only */
    border-bottom: none;
    padding: 36px 24px 48px 24px !important; /* Extra padding at the bottom for comfortable tapping */
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15); /* Soft shadow casting upwards */
    animation: slideUpSheet 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Fluid slide-up animation */
@keyframes slideUpSheet {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* --- SMOOTH PAGE TRANSITIONS --- */
.view-section {
    animation: viewFadeSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    /* This ensures that any scrolling inside a view is also smooth */
    scroll-behavior: smooth; 
    padding-bottom: 120px; /* Protects content from being hidden by the floating music player */
}

@keyframes viewFadeSlide {
    from { 
        opacity: 0; 
        transform: translateY(15px) scale(0.99); 
    }
    to { 
        opacity: 1; 
        transform: none; 
    }
}

/* Custom Dropdown Hover Effects */
.status-option { transition: background-color 0.2s ease; }
.status-option:hover { background: rgba(0,0,0,0.05); }
body.dark-theme .status-option:hover { background: rgba(255,255,255,0.08); }

/* --- ULTRA-PREMIUM MAC-OS PROFILE WIDGETS --- */
.profile-widget {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 28px;
    padding: 28px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.04), inset 0 1px 1px rgba(255,255,255,1);
    margin-bottom: 24px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.profile-widget:hover {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.06), inset 0 1px 1px rgba(255,255,255,1);
    transform: translateY(-2px);
}

.profile-widget .section-header {
    border-bottom: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    margin: 0 0 16px 0;
    padding: 0 4px;
}

.profile-widget .result-row {
    padding: 12px 4px;
    margin: 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    align-items: center;
}
.profile-widget .result-row:last-child { border-bottom: none; }

/* Native-style Pill Inputs for Profile */
.profile-widget .corp-input {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid transparent;
    border-radius: 12px;
    box-shadow: none;
    padding: 8px 12px;
    font-weight: 600;
    color: var(--text-main);
}
.profile-widget .corp-input:focus {
    background: #fff;
    border-color: var(--corp-accent);
    box-shadow: 0 0 0 4px rgba(37, 200, 112, 0.15);
}

/* Dark Mode Support for Premium Widgets */
body.dark-theme .profile-widget {
    background: rgba(28, 28, 30, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255,255,255,0.05);
}
body.dark-theme .profile-widget .result-row { border-bottom-color: rgba(255,255,255,0.05); }
body.dark-theme .profile-widget .corp-input { background: rgba(0,0,0,0.2); }
body.dark-theme .profile-widget .corp-input:focus { background: rgba(0,0,0,0.5); border-color: var(--corp-accent); }


/* --- PREMIUM STATUS MESSAGE & DROPDOWN PILLS --- */
.status-pill-btn {
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    padding: 6px 14px; 
    background: rgba(255, 255, 255, 0.85); /* Upgraded to bright frosted glass */
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.05); 
    border-radius: 20px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.03); /* Added widget shadow */
    transition: all 0.2s ease;
}
.status-pill-btn:hover { background: #FFFFFF; box-shadow: 0 4px 14px rgba(0,0,0,0.06); transform: translateY(-1px); }

.premium-status-msg {
    width: 100%;
    padding: 10px 16px 10px 36px; /* Perfected padding */
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.85); /* Upgraded to bright frosted glass */
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 20px; /* Made it a perfect pill to match the button above */
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    transition: all 0.2s ease;
    box-sizing: border-box;
}
.premium-status-msg:focus {
    background: #fff;
    border-color: var(--corp-accent);
    box-shadow: 0 0 0 4px rgba(37, 200, 112, 0.15);
    outline: none;
}
.premium-status-msg::placeholder { color: var(--text-muted); opacity: 0.8; font-weight: 500; }

.status-msg-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    width: 14px; height: 14px; color: var(--text-muted);
    pointer-events: none; transition: color 0.2s ease;
}
.premium-status-msg:focus ~ .status-msg-icon,
.premium-status-msg:not(:placeholder-shown) ~ .status-msg-icon { color: var(--corp-accent); }

/* Dark Mode Support for New Pills */
body.dark-theme .status-pill-btn, body.dark-theme .premium-status-msg { 
    background: rgba(28, 28, 30, 0.8); 
    border-color: rgba(255, 255, 255, 0.1); 
    box-shadow: 0 4px 12px rgba(0,0,0,0.2); 
    color: #fff; 
}
body.dark-theme .status-pill-btn:hover, body.dark-theme .premium-status-msg:focus { 
    background: rgba(44, 44, 46, 0.95); 
}

/* --- PROFILE BANNER EDIT BUTTON --- */
.edit-cover-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.edit-cover-btn:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.5);
}

/* --- ULTRA-PREMIUM SPOTLIGHT SEARCH BAR --- */
.spotlight-search {
    display: flex; align-items: center; gap: 14px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(40px) saturate(200%); -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 24px; padding: 16px 24px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.05), inset 0 1px 1px rgba(255, 255, 255, 1);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.spotlight-search:focus-within {
    box-shadow: 0 16px 40px rgba(0, 122, 255, 0.15), inset 0 1px 1px rgba(255, 255, 255, 1);
    border-color: rgba(0, 122, 255, 0.4); transform: translateY(-2px); background: rgba(255, 255, 255, 0.85);
}
.spotlight-search svg { width: 22px; height: 22px; color: var(--text-muted); }
.spotlight-search input { flex: 1; border: none; background: transparent; font-size: 17px; font-weight: 600; color: var(--text-main); outline: none; letter-spacing: -0.3px; }
.spotlight-search input::placeholder { color: var(--text-muted); font-weight: 500; }

body.dark-theme .spotlight-search {
    background: rgba(30, 30, 32, 0.65); border: 1px solid rgba(255, 255, 255, 0.1); border-top: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 32px rgba(0,0,0,0.4), inset 0 1px 1px rgba(255,255,255,0.05);
}
body.dark-theme .spotlight-search:focus-within { background: rgba(40, 40, 42, 0.85); box-shadow: 0 16px 40px rgba(0, 122, 255, 0.25), inset 0 1px 1px rgba(255,255,255,0.05); border-color: var(--corp-accent); }

#spMessageBtn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(37, 200, 112, 0.4); }

/* --- macOS Premium Quick Login Screen --- */
.mac-avatar-container {
    width: 100px; 
    height: 100px; 
    background: linear-gradient(135deg, rgba(37,200,112,0.05) 0%, rgba(37,200,112,0.15) 100%); 
    color: var(--corp-accent); 
    border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; 
    margin: 0 auto 20px auto; 
    box-shadow: 0 12px 28px rgba(0,0,0,0.08), inset 0 2px 6px rgba(255,255,255,0.6); 
    border: 3px solid rgba(255,255,255,0.9); 
    overflow: hidden; 
    background-size: cover; 
    background-position: center; 
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.mac-avatar-container:hover { 
    transform: scale(1.05) translateY(-2px); 
    box-shadow: 0 16px 32px rgba(0,0,0,0.12), inset 0 2px 6px rgba(255,255,255,0.6); 
}

.mac-unlock-btn {
    width: 100%; 
    display: flex; align-items: center; justify-content: center; gap: 8px; 
    font-size: 15px; font-weight: 600; 
    padding: 14px; 
    border-radius: 14px; 
    background: linear-gradient(180deg, var(--corp-accent) 0%, #17A356 100%); 
    color: white; 
    border: 1px solid rgba(0,0,0,0.1); 
    box-shadow: 0 4px 14px rgba(37, 200, 112, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.3); 
    cursor: pointer; 
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.mac-unlock-btn:hover { 
    box-shadow: 0 2px 8px rgba(37, 200, 112, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.3); 
}

.mac-switch-link {
    display: inline-block; 
    color: var(--text-muted); 
    font-size: 13px; font-weight: 600; 
    text-decoration: none; 
    padding: 8px 16px; 
    border-radius: 20px; 
    background: rgba(0,0,0,0.04); 
    transition: all 0.2s ease;
}

.mac-switch-link:hover { 
    background: rgba(0,0,0,0.08); 
    color: var(--text-main); 
}

/* --- Dark Mode Overrides for Quick Login --- */
body.dark-theme .mac-avatar-container {
    border-color: rgba(255,255,255,0.1);
    box-shadow: 0 12px 28px rgba(0,0,0,0.4), inset 0 2px 4px rgba(255,255,255,0.05);
}
body.dark-theme .mac-unlock-btn {
    background: linear-gradient(180deg, var(--corp-accent) 0%, #148043 100%);
    border-color: rgba(255,255,255,0.1);
}
body.dark-theme .mac-switch-link { 
    background: rgba(255,255,255,0.05); 
}
body.dark-theme .mac-switch-link:hover { 
    background: rgba(255,255,255,0.1); 
}

/* 1. The Maintenance Overlay */
.maintenance-overlay {
  position: fixed;
  inset: 0; 
  height: 100vh;
  height: 100dvh; 
  width: 100vw;
  z-index: 9999; 
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: #0b0c10; 
}

/* 2. The Body Lock (Prevents the content underneath from scrolling) */
body.maintenance-active {
  overflow: hidden !important;
  position: fixed; /* Extra strict lock for iOS Safari quirks */
  width: 100%;
  height: 100%;
}

/* --- macOS Premium Custom Dropdown --- */
.mac-select-wrapper { position: relative; width: 100%; }

.mac-select-trigger { 
    display: flex; justify-content: space-between; align-items: center;
    width: 100%; padding: 12px 16px; font-size: 15px; font-weight: 500;
    
    /* This line forces the padding to stay inside the 100% width */
    box-sizing: border-box; 
    
    background: rgba(255, 255, 255, 0.7); 
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color); border-radius: 12px;
    cursor: pointer; transition: all 0.2s; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}


.mac-select-trigger:hover { background: rgba(255, 255, 255, 0.9); }
.mac-select-trigger svg { width: 16px; height: 16px; color: var(--text-muted); transition: transform 0.3s ease; }
.mac-select-trigger.active { border-color: var(--corp-accent); box-shadow: 0 0 0 4px rgba(37, 200, 112, 0.15); background: #fff; }
.mac-select-trigger.active svg { transform: rotate(180deg); color: var(--corp-accent); }

.mac-select-options {
    display: none; position: absolute; top: calc(100% + 8px); left: 0; width: 100%;
    background: rgba(255, 255, 255, 0.85); 
    backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15); z-index: 9999;
    max-height: 250px; overflow-y: auto; padding: 8px;
    animation: slideDownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.mac-select-option {
    padding: 12px 16px; font-size: 14px; font-weight: 600; color: var(--text-main);
    border-radius: 10px; cursor: pointer; transition: all 0.2s ease;
}

.mac-select-option:hover { background: var(--corp-accent); color: white; }

@keyframes slideDownFade {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dark Mode Support */
body.dark-theme .mac-select-trigger { background: rgba(0, 0, 0, 0.3); border-color: rgba(255,255,255,0.1); }
body.dark-theme .mac-select-trigger:hover { background: rgba(0, 0, 0, 0.5); }
body.dark-theme .mac-select-trigger.active { background: rgba(0, 0, 0, 0.7); }
body.dark-theme .mac-select-options { background: rgba(40, 40, 42, 0.85); border-color: rgba(255, 255, 255, 0.15); }
body.dark-theme .mac-select-option:hover { background: var(--corp-accent); }

/* --- macOS Premium News Feed --- */
.news-post-card { 
    background: var(--card-bg); 
    backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    border-radius: 24px; 
    padding: 24px; 
    box-shadow: var(--shadow-sm); 
    border: 1px solid rgba(255,255,255,0.4); 
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.news-post-card:hover { box-shadow: var(--shadow-md); }

.news-post-header { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.news-post-avatar { 
    width: 42px; height: 42px; 
    border-radius: 50%; 
    background: linear-gradient(135deg, var(--corp-accent), #17A356); 
    color: white; 
    display: flex; align-items: center; justify-content: center; 
    font-size: 16px; font-weight: 800; 
    box-shadow: 0 4px 10px rgba(37, 200, 112, 0.3);
    /* --- Add these two lines --- */
    background-size: cover;
    background-position: center;
}

.news-comment-avatar { 
    width: 28px; height: 28px; 
    border-radius: 50%; 
    background: rgba(0,0,0,0.1); 
    color: var(--text-muted); 
    display: flex; align-items: center; justify-content: center; 
    font-size: 11px; font-weight: 700; flex-shrink: 0;
    /* --- Add these two lines --- */
    background-size: cover;
    background-position: center;
}

.news-post-meta { display: flex; flex-direction: column; }
.news-post-meta h4 { margin: 0 0 2px 0; font-size: 15px; font-weight: 700; color: var(--text-main); letter-spacing: -0.3px; display: flex; align-items: center; gap: 6px; }
.news-post-meta span { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

.news-post-content { font-size: 15px; color: var(--text-main); line-height: 1.6; margin-bottom: 20px; font-weight: 500; white-space: pre-wrap; }

.news-comments-section { border-top: 1px solid var(--border-color); padding-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.news-comment { display: flex; gap: 12px; align-items: flex-start; }
.news-comment-avatar { 
    width: 28px; height: 28px; 
    border-radius: 50%; 
    background: rgba(0,0,0,0.1); 
    color: var(--text-muted); 
    display: flex; align-items: center; justify-content: center; 
    font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.news-comment-bubble { 
    background: rgba(0,0,0,0.03); 
    border-radius: 4px 16px 16px 16px; 
    padding: 10px 14px; 
    flex: 1; 
    border: 1px solid rgba(0,0,0,0.02); 
}
.news-comment-author { font-size: 12px; font-weight: 700; color: var(--text-main); margin-bottom: 4px; display: flex; justify-content: space-between; }
.news-comment-text { font-size: 13px; color: var(--text-main); line-height: 1.4; }

.news-comment-input-area { display: flex; gap: 10px; margin-top: 8px; align-items: center; }
.news-comment-input-area .corp-input { 
    border-radius: 20px; 
    padding: 10px 16px; 
    font-size: 13px; 
    background: rgba(255,255,255,0.7);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
}

/* Dark Mode Overrides for News Feed */
body.dark-theme .news-post-card { background: rgba(28, 28, 30, 0.7); border-color: rgba(255,255,255,0.1); }
body.dark-theme .news-comment-bubble { background: rgba(0,0,0,0.3); border-color: rgba(255,255,255,0.05); }
body.dark-theme .news-comment-avatar { background: rgba(255,255,255,0.1); color: #FFF; }
body.dark-theme .news-comment-input-area .corp-input { background: rgba(0,0,0,0.3); }

/* --- Premium Profile Avatars (Anti-Stretch) --- */
.premium-profile-avatar {
    width: 110px !important;
    height: 110px !important;
    min-width: 110px !important; 
    min-height: 110px !important;
    border-radius: 36px; /* Smooth Apple-style squircle */
    border: 4px solid var(--avatar-border);
    background-color: var(--bg-color);
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    flex-shrink: 0 !important; /* Forces it to never squish */
    aspect-ratio: 1 / 1; 
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.premium-profile-avatar:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-lg);
}

.premium-avatar-badge {
    position: absolute; 
    bottom: -2px; 
    right: -2px; 
    background: var(--corp-accent); 
    color: white; 
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%; 
    border: 4px solid var(--avatar-border); 
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: transform 0.2s ease;
}

/* Also protect the news feed avatars from squishing */
.news-post-avatar, .mac-avatar-container {
    flex-shrink: 0 !important;
    background-repeat: no-repeat !important;
}

/* --- Pending Data Gray-Out State --- */
.gray-out-mode {
    filter: grayscale(100%) opacity(0.65);
    pointer-events: auto; /* Ensures they can still click to open teams */
    transition: all 0.3s ease;
}

.gray-out-banner {
    background: rgba(255, 59, 48, 0.1);
    color: var(--status-danger);
    padding: 14px 20px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 13px;
    text-align: center;
    border: 1px solid rgba(255, 59, 48, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    animation: slideDown 0.3s ease;
}

body.dark-theme .gray-out-banner {
    background: rgba(255, 59, 48, 0.15);
    border-color: rgba(255, 59, 48, 0.3);
}

/* --- Community Feed & Compact Comments --- */
.feed-toggle-comments {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
    margin-top: 12px;
}
.feed-toggle-comments:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--corp-accent);
}
.compact-comments-section {
    display: none; /* Hidden by default to save space */
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    animation: slideDownFade 0.3s ease;
}
.comment-input-row {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}
.comment-input-row input {
    flex: 1;
    border-radius: 20px;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.5);
    font-family: inherit;
    outline: none;
}
.comment-input-row input:focus { border-color: var(--corp-accent); }

/* --- Floating Character Counter --- */
.char-counter {
    position: absolute;
    bottom: 12px;
    right: 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    pointer-events: none;
    transition: all 0.3s ease;
}

.char-counter.limit-reached {
    color: var(--status-danger);
    border-color: rgba(255, 59, 48, 0.3);
    background: rgba(255, 59, 48, 0.05);
    transform: scale(1.05);
}

/* --- Premium macOS Profile Viewers List --- */
.mac-viewer-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.mac-viewer-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 16px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.mac-viewer-item:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.08);
}

.mac-viewer-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(37,200,112,0.1) 0%, rgba(37,200,112,0.2) 100%);
    color: var(--corp-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    border: 1px solid rgba(37,200,112,0.15);
    flex-shrink: 0;
}

.mac-viewer-details {
    flex: 1;
    overflow: hidden;
}

.mac-viewer-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.3px;
}

.mac-viewer-time {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 2px;
}

.mac-viewer-action {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-muted);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mac-viewer-item:hover .mac-viewer-action {
    background: var(--corp-accent);
    color: white;
    box-shadow: 0 4px 10px rgba(37, 200, 112, 0.3);
    transform: scale(1.05);
}

/* Dark Mode Support for Viewers List */
body.dark-theme .mac-viewer-item {
    background: rgba(28, 28, 30, 0.5);
    border-color: rgba(255, 255, 255, 0.05);
}
body.dark-theme .mac-viewer-item:hover {
    background: rgba(44, 44, 46, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}
body.dark-theme .mac-viewer-action {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

/* --- Theme Color Selector Styles --- */
#colorToggleBtn:hover svg { color: var(--text-main); }
.color-option { transition: background-color 0.2s ease; }
.color-option:hover { background: rgba(0,0,0,0.05); }
body.dark-theme .color-option:hover { background: rgba(255,255,255,0.08); }

/* --- iMessage-Style Quick Reactions --- */
.reaction-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.reaction-pill {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 30px;
    padding: 6px 10px;
    display: flex;
    gap: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.9);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
}

/* Show the pill when hovering over the reaction container */
.reaction-container:hover .reaction-pill {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.reaction-emoji-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 4px;
    border-radius: 50%;
}

.reaction-emoji-btn:hover {
    transform: scale(1.3) translateY(-4px);
}

.reaction-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.reaction-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.04);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
}

.reaction-badge:hover {
    background: rgba(0, 0, 0, 0.08);
}

.reaction-badge.user-reacted {
    background: rgba(37, 200, 112, 0.1);
    border-color: rgba(37, 200, 112, 0.2);
    color: var(--corp-accent);
}

body.dark-theme .reaction-pill {
    background: rgba(44, 44, 46, 0.85);
    border-color: rgba(255, 255, 255, 0.1);
}
body.dark-theme .reaction-badge {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.05);
}
body.dark-theme .reaction-badge.user-reacted {
    background: rgba(37, 200, 112, 0.2);
    border-color: rgba(37, 200, 112, 0.3);
}

/* ==========================================
   --- macOS Premium Boot Loader (Ultra High-Quality) ---
   ========================================== */
.mac-boot-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* macOS Premium Ambient Mesh Gradient */
    background: radial-gradient(circle at 15% 50%, rgba(20, 80, 50, 0.8), transparent 50%),
                radial-gradient(circle at 85% 30%, rgba(10, 100, 60, 0.7), transparent 50%),
                radial-gradient(circle at 50% 80%, rgba(10, 50, 40, 0.8), transparent 50%);
    background-color: #0a0a0c; /* Deep rich dark base */
    background-size: 150% 150%;
    animation: macAmbientShift 6s ease-in-out infinite alternate;

    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.8s;
}

/* Subtle background shifting effect */
@keyframes macAmbientShift {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}

.mac-boot-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 48px; 
    width: 100%;
}

.mac-boot-logo {
    width: 96px; 
    height: 96px;
    border-radius: 22px; /* Authentic Apple squircle radius */
    
    /* Premium glass border and deep shadow */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 
                0 0 40px rgba(37, 200, 112, 0.15),
                inset 0 1px 1px rgba(255, 255, 255, 0.2);
    
    /* Elegant floating animation instead of pulsing */
    animation: macFloat 3s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

@keyframes macFloat {
    0% { transform: translateY(0px); box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 40px rgba(37, 200, 112, 0.15), inset 0 1px 1px rgba(255,255,255,0.2); }
    100% { transform: translateY(-8px); box-shadow: 0 30px 50px rgba(0,0,0,0.5), 0 0 60px rgba(37, 200, 112, 0.25), inset 0 1px 1px rgba(255,255,255,0.2); }
}

.mac-boot-progress-container {
    width: 180px;
    height: 4px;
    
    /* Authentic Apple Frosted Glass Track */
    background: rgba(255, 255, 255, 0.1); 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.mac-boot-progress-bar {
    height: 100%;
    width: 0%;
    
    /* Premium brilliant white fill */
    background: linear-gradient(90deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,1) 100%);
    box-shadow: 2px 0 8px rgba(255, 255, 255, 0.5); /* Glowing leading edge */
    
    border-radius: 4px;
    animation: macBootLoad 2.5s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes macBootLoad {
    0% { width: 0%; }
    30% { width: 35%; }
    70% { width: 85%; }
    100% { width: 100%; }
}

.mac-boot-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(1.08); /* Cinematic zoom-through effect */
    filter: blur(10px); /* Blurs out as it fades */
}

/* --- Shoutout Premium Badge Update --- */
.shoutout-label {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: var(--corp-accent) !important; /* Matches user theme palette */
    color: white !important;
    padding: 6px 14px !important;
    border-radius: 12px 0 0 12px !important; /* Rounded on the left, pointed square on the right */
    font-weight: 800 !important;
    font-size: 11px !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15) !important;
}

.shoutout-label span {
    color: white !important;
}

.shoutout-icon {
    width: 14px !important;
    height: 14px !important;
}

/* --- MUSIC LOUNGE STYLES --- */
.music-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 24px; }
.station-card { 
    background: rgba(255, 255, 255, 0.5); 
    border: 1px solid rgba(0, 0, 0, 0.05); 
    border-radius: 20px; 
    padding: 16px; 
    display: flex; 
    align-items: center; 
    gap: 16px; 
    cursor: pointer; 
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.station-card:hover { background: #fff; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.06); }
.station-card.active-station { border-color: var(--corp-accent); background: rgba(37, 200, 112, 0.05); box-shadow: 0 0 0 2px rgba(37, 200, 112, 0.2); }
.station-icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.station-icon svg { width: 24px; height: 24px; }
.station-info h3 { margin: 0 0 4px 0; font-size: 15px; font-weight: 700; color: var(--text-main); letter-spacing: -0.3px; }
.station-info p { margin: 0; font-size: 12px; color: var(--text-muted); font-weight: 500; }

body.dark-theme .station-card { background: rgba(28, 28, 30, 0.6); border-color: rgba(255, 255, 255, 0.05); }
body.dark-theme .station-card:hover { background: rgba(44, 44, 46, 0.9); border-color: rgba(255,255,255,0.1); }
body.dark-theme .station-card.active-station { background: rgba(37, 200, 112, 0.15); border-color: var(--corp-accent); }




/* ==========================================
   --- ULTRA-PREMIUM macOS MUSIC PLAYER ---
   ========================================== */
.mac-music-player {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    
    /* Ultra-Premium Glass Effect */
    background: rgba(255, 255, 255, 0.4); 
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    
    /* 3D Lighting Borders */
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 50px; 
    padding: 6px 12px 6px 6px; /* Lessened padding for a snug fit */
    display: flex;
    align-items: center;
    gap: 10px; /* Tighter gap between the record, text, and buttons */
    
    /* Multi-layered Depth Shadows */
    box-shadow: 
        0 24px 48px rgba(0, 0, 0, 0.12), 
        0 8px 16px rgba(0, 0, 0, 0.08),
        inset 0 1px 1px rgba(255, 255, 255, 0.8);
    z-index: 1000;
    width: 360px; /* Locks the player size so it NEVER shifts */
    max-width: calc(100vw - 24px); /* Prevents overflow off the screen on small phones */
    animation: slideUpFadeCenter 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.mac-music-player:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.15), 
        0 12px 24px rgba(0,0,0,0.1), 
        inset 0 1px 1px rgba(255, 255, 255, 0.9);
}

@keyframes slideUpFadeCenter {
    from { opacity: 0; transform: translate(-50%, 30px) scale(0.95); }
    to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* Vinyl Record Cover Art */
.mac-music-cover {
    width: 42px; /* Scaled down slightly */
    height: 42px;
    border-radius: 50%; 
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2), inset 0 0 0 1px rgba(255,255,255,0.2);
    background: var(--corp-accent);
    position: relative;
}

/* The inner hole of the vinyl record */
.mac-music-cover::after {
    content: ''; 
    position: absolute; top: 50%; left: 50%; 
    width: 10px; height: 10px; /* Scaled down hole */
    background: rgba(255,255,255,0.8); border-radius: 50%; 
    transform: translate(-50%, -50%);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3); border: 1px solid rgba(0,0,0,0.1);
}

.mac-music-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }

.mac-music-player:not(.paused) .mac-music-cover img {
    animation: spinRecord 8s linear infinite;
    transform: scale(1.05);
}
@keyframes spinRecord { 100% { transform: scale(1.05) rotate(360deg); } }

.mac-music-info { 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    flex: 1; /* Automatically takes up available space */
    min-width: 0; /* CRITICAL: Forces the ... cut-off to work */
    overflow: hidden;
}
.mac-music-title { font-size: 13px; font-weight: 800; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; letter-spacing: -0.3px; text-shadow: 0 1px 1px rgba(255,255,255,0.5); }
.mac-music-artist { font-size: 11px; font-weight: 700; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; letter-spacing: 0.5px; }

/* Lessened button gaps so the layout sits tighter */
.mac-music-controls { display: flex; align-items: center; gap: 2px; margin-left: 0; flex-shrink: 1; flex-wrap: wrap; justify-content: center; }
.mac-music-btn {
    background: transparent; border: none; color: var(--text-main);
    width: 30px; height: 30px; /* Slightly smaller hitboxes for mobile compatibility */
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.mac-music-btn:hover { background: rgba(0,0,0,0.06); transform: scale(1.1); }
.play-pause-btn { background: var(--text-main); color: var(--bg-color); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.play-pause-btn:hover { background: var(--corp-accent); color: white; transform: scale(1.1); box-shadow: 0 6px 14px rgba(37,200,112,0.3); }

.mac-music-playlist-selector {
    position: relative; margin-left: 8px; padding-left: 16px; border-left: 1px solid rgba(0,0,0,0.1);
    color: var(--text-muted); cursor: pointer; transition: color 0.2s ease; display: flex; align-items: center; height: 36px;
}
.mac-music-playlist-selector:hover { color: var(--corp-accent); }

/* Animated Spring-Pop Menu */
.mac-playlist-menu {
    position: absolute; bottom: calc(100% + 28px); left: 50%; transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(40px) saturate(200%); -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.5); border-top: 1px solid rgba(255,255,255,0.9); border-radius: 20px; padding: 10px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2), inset 0 1px 1px rgba(255,255,255,0.8); min-width: 200px; display: flex; flex-direction: column; gap: 4px; z-index: 1001;
    transform-origin: bottom center; animation: popUpMenu 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popUpMenu { 
    from { opacity: 0; transform: translateX(-50%) scale(0.9) translateY(10px); } 
    to { opacity: 1; transform: translateX(-50%) scale(1) translateY(0); } 
}

.mac-playlist-item {
    padding: 10px 14px; border-radius: 12px; font-size: 13px; font-weight: 600; color: var(--text-main);
    cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; white-space: nowrap;
}
.mac-playlist-item:hover { background: rgba(0,0,0,0.06); transform: translateX(4px); }
.mac-playlist-item.active { background: var(--corp-accent); color: white; box-shadow: 0 4px 12px rgba(37,200,112,0.25); }

/* Dark Mode Deep OLED Glass */
body.dark-theme .mac-music-player { 
    background: rgba(30, 30, 30, 0.5); 
    border: 1px solid rgba(255, 255, 255, 0.1); border-top: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.15);
}
body.dark-theme .mac-playlist-menu {
    background: rgba(30, 30, 30, 0.65); 
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: 1px solid rgba(0, 0, 0, 0.5);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.1);
}
body.dark-theme .play-pause-btn { background: white; color: black; }
body.dark-theme .play-pause-btn:hover { background: var(--corp-accent); color: white; }
body.dark-theme .mac-playlist-item:hover { background: rgba(255,255,255,0.1); }

/* Chime-Style Pill Buttons */
.corp-btn, .premium-btn {
    border-radius: var(--radius-full); 
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================
   --- FINAL BOTTOM PADDING FIXES ---
   ========================================== */

/* 1. Forces the main dashboard and ALL tools (Salary, SNPS) to have empty space at the bottom */
.view-section, .main-content {
    padding-bottom: 160px !important; 
}

/* 2. Forces the Mobile Chat input and New Message buttons up */
@media (max-width: 768px) {
    #chatComposeState > div:last-child {
        padding-bottom: 180px !important; /* Increased to clear music player */
    }
    
    .chat-input-area {
        padding-bottom: 180px !important; /* Increased to clear music player */
    }
}

/* --- Fix Overlap: Tools Modal & Music Player --- */
#toolModal {
    padding-bottom: 110px !important; /* Pushes the modal up so it clears the music player */
    z-index: 9999 !important; /* Ensures the modal always sits on top */
}

/* Ensure the Music Player clears the new Bottom Tab Bar */
.mac-music-player {
    bottom: max(96px, calc(env(safe-area-inset-bottom) + 80px)) !important;
    z-index: 9890 !important; 
}

/* --- Force Native iOS/macOS Bottom Tab Bar --- */
.vertical-nav { 
    flex-direction: row !important; 
    justify-content: space-around !important; 
    align-items: center !important; 
    position: fixed !important; 
    bottom: 0 !important; 
    left: 0 !important; 
    width: 100% !important; 
    height: 70px !important;
    background: rgba(255, 255, 255, 0.9) !important; 
    backdrop-filter: blur(30px) saturate(200%) !important; 
    -webkit-backdrop-filter: blur(30px) saturate(200%) !important; 
    padding: 0px 8px env(safe-area-inset-bottom) 8px !important; 
    border-top: 1px solid rgba(0,0,0,0.08) !important; 
    border-radius: 0 !important; 
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05) !important; 
    margin: 0 !important; 
    z-index: 9999 !important; 
    box-sizing: border-box !important;
}

.nav-item { 
    display: flex !important; 
    flex-direction: column !important; 
    align-items: center !important; 
    justify-content: center !important; 
    gap: 4px !important; 
    padding: 6px !important; 
    background: transparent !important; 
    border: none !important; 
    color: var(--text-muted) !important; 
    font-size: 10px !important; 
    font-weight: 600 !important; 
    cursor: pointer !important; 
    transition: all 0.2s ease !important; 
    width: 65px !important; 
    height: 100% !important;
}

.nav-item svg { width: 24px !important; height: 24px !important; opacity: 1 !important; transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important; }
.nav-item:hover { background: rgba(0,0,0,0.04) !important; color: var(--text-main) !important; border-radius: 12px !important; }

/* The Active State */
.nav-item.active { background: transparent !important; color: var(--corp-accent) !important; box-shadow: none !important; }
.nav-item.active svg { transform: scale(1.15) translateY(-2px) !important; filter: drop-shadow(0 4px 6px rgba(37, 200, 112, 0.4)) !important; }

/* Badges */
.tab-icon-wrapper { position: relative !important; display: flex !important; justify-content: center !important; align-items: center !important; }
.tab-badge { position: absolute !important; top: -6px !important; right: -8px !important; color: white !important; border-radius: 10px !important; padding: 2px 5px !important; font-size: 10px !important; font-weight: 800 !important; min-width: 14px !important; text-align: center !important; border: 2px solid var(--card-bg) !important; box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important; }
.team-badge { right: -18px !important; top: 8px !important; }

/* --- Premium Flexbox Data Rows --- */
.flex-list-container {
    display: flex;
    flex-direction: column;
    padding: 0 8px 12px 8px;
}
.flex-data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.4);
    margin-bottom: 8px;
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.03);
    transition: transform 0.2s ease, background 0.2s ease;
}
.flex-data-row:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}
.flex-row-left { display: flex; align-items: center; gap: 12px; }
.flex-row-right { display: flex; gap: 16px; text-align: right; }
.flex-stat-group { display: flex; flex-direction: column; justify-content: center; text-align: center; }
.flex-stat-label { font-size: 10px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }
.flex-stat-value { font-size: 14px; font-weight: 800; color: var(--text-main); }
.flex-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--corp-accent), #17A356); color: white; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; flex-shrink: 0; box-shadow: 0 2px 8px rgba(37,200,112,0.3); }

body.dark-theme .flex-data-row { background: rgba(0, 0, 0, 0.2); border-color: rgba(255,255,255,0.05); }
body.dark-theme .flex-data-row:hover { background: rgba(0, 0, 0, 0.4); }

/* --- PROFESSIONAL BOOT LOADER --- */
.pro-boot-loader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: #000000; /* Pure AMOLED Black */
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.5s;
}

.pro-boot-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.pro-loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: fadeIn 0.8s ease forwards;
}

.pro-logo {
    width: 42px;
    height: 42px;
    color: var(--corp-accent); /* Uses your custom theme color */
    margin-bottom: 20px;
    animation: pulseLogo 2s infinite alternate ease-in-out;
}

.pro-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 6px;
    color: var(--text-main);
    margin-bottom: 8px;
    margin-right: -6px; /* Offsets the letter-spacing for perfect centering */
}

.pro-subtitle {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 32px;
}

.pro-progress-container {
    width: 180px;
    height: 2px;
    background: #1F1F22;
    border-radius: 4px;
    overflow: hidden;
}

.pro-progress-bar {
    width: 0%;
    height: 100%;
    background: var(--text-main);
    border-radius: 4px;
    /* Matches the 2.7s delay in your script.js */
    animation: loadProgress 2.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; 
}

@keyframes loadProgress {
    0% { width: 0%; }
    40% { width: 60%; }
    100% { width: 100%; }
}

@keyframes pulseLogo {
    0% { opacity: 0.5; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

/* ==========================================
   PREMIUM SALARY CALCULATOR (FINTECH STYLE)
   ========================================== */

/* 1. Structure & Headers */
#view-salary {
    padding: 0 8px 40px 8px;
}

#view-salary .section-header {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--corp-accent);
    margin-top: 32px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* 2. Premium Labels */
#view-salary label {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted) !important;
    margin-bottom: 8px;
    margin-left: 4px;
    display: block;
}

/* 3. The Calculate Button */
#view-salary button[onclick="calculateSalary()"] {
    background: var(--corp-accent) !important;
    color: #000 !important; /* Dark text on bright accent */
    font-weight: 800 !important;
    font-size: 15px !important;
    padding: 16px !important;
    border-radius: 16px !important;
    width: 100%;
    border: none !important;
    margin-top: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important; 
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#view-salary button[onclick="calculateSalary()"]:active {
    transform: scale(0.96);
}

/* 4. The Digital Receipt (Results Box) */
#results {
    background: #09090B !important; /* Extremely deep gray */
    border: 1px solid rgba(255,255,255,0.08) !important;
    border-radius: 24px !important;
    padding: 24px !important;
    margin-top: 32px !important;
    box-shadow: 0 24px 48px rgba(0,0,0,0.8), inset 0 2px 4px rgba(255,255,255,0.03) !important;
    position: relative;
    overflow: hidden;
}

/* A sleek glowing accent line at the top of the receipt */
#results::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--corp-accent), transparent);
    opacity: 0.8;
}

/* Style every row inside the results box */
#results > div {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 12px 0 !important;
    border-bottom: 1px dashed rgba(255,255,255,0.05) !important;
    font-size: 13px !important;
    color: var(--text-muted) !important;
    font-weight: 500 !important;
}

/* Style the numbers (values) */
#results span[id^="txt"] {
    color: var(--text-main) !important;
    font-weight: 700 !important;
    font-family: 'Courier New', Courier, monospace !important; /* Finance ticker look */
    font-size: 15px !important;
}

/* Highlight the Final Net Pay Row */
#results > div:last-child {
    border-bottom: none !important;
    border-top: 1px solid rgba(255,255,255,0.1) !important;
    margin-top: 16px !important;
    padding-top: 24px !important;
    color: var(--text-main) !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#txtNet {
    color: var(--corp-accent) !important;
    font-size: 26px !important;
    font-weight: 900 !important;
    letter-spacing: -0.5px;
}

/* ==========================================
   --- RESPONSIVE DEVICE SCALING (DESKTOP FIX) ---
   ========================================== */
@media (min-width: 769px) {
    /* Restrict main content to a sleek, centered column on large screens */
    .main-content, .nav-content {
        max-width: 500px !important;
        margin: 0 auto !important;
    }

    /* Center the top navigation */
    .top-nav {
        max-width: 500px !important;
        margin: 0 auto !important;
        left: 0; right: 0;
        border-bottom-left-radius: 24px;
        border-bottom-right-radius: 24px;
        border-left: 1px solid var(--border-color);
        border-right: 1px solid var(--border-color);
    }

    /* Center the bottom tab bar */
    .vertical-nav {
        max-width: 500px !important;
        margin: 0 auto !important;
        left: 0 !important; right: 0 !important;
        border-top-left-radius: 24px !important;
        border-top-right-radius: 24px !important;
        border-left: 1px solid var(--border-color) !important;
        border-right: 1px solid var(--border-color) !important;
    }

    /* Center the Agent Tools Modal vertically */
    #toolModal {
        align-items: center !important; 
        padding-bottom: 0 !important; 
    }

    /* Center the Agent Tools / Chat Sheet AND prevent Cut-Off */
    #toolModal .login-box, .chat-panel {
        max-width: 500px !important;
        margin: 0 auto !important;
        left: 0 !important; right: 0 !important;
        border-radius: 32px !important; 
        border-bottom: 1px solid var(--border-color) !important; 
        max-height: 80vh !important; /* Forces it to fit on screen */
        overflow-y: auto !important; /* Makes it scrollable if squeezed */
    }
}

/* ==========================================
   --- FORCE CENTER AGENT TOOLS MODAL ---
   ========================================== */
#toolModal {
    justify-content: center !important; 
    align-items: center !important;     
    padding: 24px !important;
    box-sizing: border-box !important; /* Fixes the wrapper width */
}

#toolModal .login-box {
    margin: auto !important;
    max-width: 380px !important;
    width: 100% !important;
    height: auto !important;
    max-height: 85vh !important; 
    border-radius: 32px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 32px 24px !important;
    box-sizing: border-box !important; /* FIX: Forces padding inside the box so it perfectly centers! */
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6) !important;
    
    /* Sleek center pop-in animation */
    animation: popInCenter 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes popInCenter {
    0% { opacity: 0; transform: scale(0.92); }
    100% { opacity: 1; transform: scale(1); }
}

/* ==========================================
   --- FIX TOP HEADER OVERLAP & SEARCH MENU ---
   ========================================== */
#view-profile, #view-messages, #view-snps, #view-salary {
    padding-top: 85px !important; 
    padding-bottom: 150px !important; /* FIX: Increased to 150px to clear BOTH the nav bar and the music player! */
    box-sizing: border-box !important;
}

/* Forces the Colleague Search Dropdown to appear ON TOP of everything */
#profileSearchDropdown {
    position: absolute !important;
    z-index: 99999 !important;
    top: calc(100% + 8px) !important;
    left: 0 !important;
    right: 0 !important;
    background: #09090B !important; /* Matches your dark OLED theme */
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8) !important;
    overflow: hidden !important;
}

/* ==========================================
   --- PREMIUM OLED DARK THEME OVERRIDE ---
   ========================================== */
body.dark-theme, .dark-theme {
    --bg-color: #000000 !important;         /* Pure OLED Black Background */
    --card-bg: #09090B !important;          /* Extremely deep gray for cards */
    --text-main: #FFFFFF !important;        /* Crisp white text */
    --text-muted: #9CA3AF !important;       /* Slate gray for secondary text */
    --border-color: rgba(255, 255, 255, 0.08) !important; /* Faint, clean borders */
    --corp-primary: #000000 !important;
    
    /* Deep Shadows for OLED */
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.8) !important;
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.9) !important;
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.95) !important;
}

/* 1. Force Cards to OLED Style */
.dark-theme .card, 
.dark-theme .mac-stat-card, 
.dark-theme .overall-card,
.dark-theme .login-box,
.dark-theme .chat-panel,
.dark-theme #dataPendingPlaceholder,
.dark-theme .gray-out-banner {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-sm) !important;
    backdrop-filter: none !important; /* Removes the milky light-mode glass */
    -webkit-backdrop-filter: none !important;
}

/* 2. Sleek Navigation Bars (Smoked Glass) */
.dark-theme .top-nav, 
.dark-theme .vertical-nav {
    background: rgba(9, 9, 11, 0.85) !important;
    backdrop-filter: blur(24px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(150%) !important;
    border-color: var(--border-color) !important;
}

/* 3. Fix Data Rows & Inbox Items to match */
.dark-theme .flex-data-row, 
.dark-theme .inbox-item {
    background: transparent !important;
    border: 1px solid var(--border-color) !important;
}

.dark-theme .flex-data-row:hover, 
.dark-theme .inbox-item:hover {
    background: rgba(255, 255, 255, 0.03) !important; /* Subtle hover highlight */
}

/* ==========================================
   --- ULTIMATE OLED DARK THEME OVERRIDE ---
   ========================================== */
body.dark-theme, .dark-theme, :root {
    --bg-color: #000000 !important;         /* Pure OLED Black */
    --card-bg: #09090B !important;          /* Deepest Gray for depth */
    --text-main: #FFFFFF !important;        
    --text-muted: #9CA3AF !important;       
    --border-color: rgba(255, 255, 255, 0.08) !important; 
    
    /* Adjusted Shadows for OLED */
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.8) !important;
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.9) !important;
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.95) !important;
}

/* 1. Kill Glassmorphism on ALL Cards, Modals, and Placeholders */
.dark-theme .card, 
.dark-theme .mac-stat-card, 
.dark-theme .overall-card,
.dark-theme .login-box,
.dark-theme .chat-panel,
.dark-theme #dataPendingPlaceholder,
.dark-theme .gray-out-banner,
.dark-theme #resultBox,
.dark-theme #results,
.dark-theme .profile-widget {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-sm) !important;
    backdrop-filter: none !important; 
    -webkit-backdrop-filter: none !important;
}

/* 2. Solid OLED Navigation Bars (No Blur) */
.dark-theme .top-nav, 
.dark-theme .vertical-nav {
    background: #09090B !important; /* Solid deep gray instead of smoked glass */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-color: var(--border-color) !important;
}

/* 3. Solid Dropdowns & Tool Menus */
.dark-theme .mac-select-options,
.dark-theme #profileSearchDropdown,
.dark-theme .chat-react-menu,
.dark-theme #statusDropdownOptions,
.dark-theme #playlistDropdownMenu {
    background: #09090B !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid var(--border-color) !important;
}

/* 4. Fix Data Rows & Inbox Items to match */
.dark-theme .flex-data-row, 
.dark-theme .inbox-item {
    background: transparent !important;
    border: 1px solid var(--border-color) !important;
}

.dark-theme .flex-data-row:hover, 
.dark-theme .inbox-item:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}

/* 5. Pure Black App Background Overrides */
html, body, .main-content {
    background-color: #000000 !important;
}

/* ==========================================
   --- OLED DARK THEME FIXES (SHOUTOUT & PENDING DATA) ---
   ========================================== */

/* 1. Remove Glass & Gray Background from Shoutout Bar */
.dark-theme .shoutout-bar {
    background: #09090B !important; /* Deep OLED gray */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8) !important; /* Flat dark shadow, no 3D inner glow */
}

/* Remove 3D highlight from the label inside the shoutout */
.dark-theme .shoutout-label {
    box-shadow: none !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* 2. Fix the "Data Pending" Container to Pure OLED */
.dark-theme #dataPendingPlaceholder {
    background: #09090B !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.9) !important;
}

/* 3. Override the inline styles on the "View Pending Data Anyway" button */
.dark-theme #dataPendingPlaceholder .mac-unlock-btn {
    background: #1C1C1E !important; /* Sleek dark gray button */
    color: #FFFFFF !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6) !important; /* Removes the 3D white inset shadow */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    text-shadow: none !important;
}

/* Add a sleek hover state for the OLED button */
.dark-theme #dataPendingPlaceholder .mac-unlock-btn:hover {
    background: #2C2C2E !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    transform: translateY(-1px) !important;
}

/* ==========================================
   --- FIX DATA SYNC CARD SPACING ---
   ========================================== */
#dataPendingPlaceholder {
    margin-top: 32px !important; /* Pushes the card down away from the shoutout bar */
}

/* ==========================================
   --- FIX GRAY-OUT BANNER SPACING ---
   ========================================== */
.gray-out-banner {
    margin-top: 24px !important; /* Pushes the warning banner down away from the shoutouts */
    margin-bottom: 24px !important; /* Ensures it has breathing room below it too */
}

/* ==========================================
   --- FIX TOP GAP SPACING ---
   ========================================== */
#view-profile, #view-messages, #view-snps, #view-salary {
    padding-top: 16px !important; /* Removes the massive empty space under the header */
}

/* ==========================================
   --- SINGLE PLAYLIST MUSIC PLAYER FIXES ---
   ========================================== */

/* 1. Hide the playlist dropdown elements just in case they weren't removed from HTML */
#playlistDropdownBtn, #playlistDropdownMenu, .playlist-selector {
    display: none !important;
}

/* 2. Update the Spinning Disc to AAI Image */
#currentTrackImage {
    /* Replace the URL below with your actual AAI logo path (e.g., images/aai-logo.png) */
    background-image: url('https://firebasestorage.googleapis.com/v0/b/aai-portal-v2.appspot.com/o/portal-assets%2Fapp-icon.png?alt=media&token=8679f291-5807-422a-8998-6e5a6f23f662') !important;
    background-size: cover; /* or 'contain' depending on your logo */
    background-color: #000 !important; /* Pure black background behind logo */
    border: 2px solid var(--corp-accent) !important; /* Glowing accent border */
    box-shadow: 0 0 20px rgba(0, 255, 127, 0.4) !important; /* Glow shadow */
}

/* 3. Layout adjustment: Center the track info now that playlist selector is gone */
.mac-player-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1; 
    min-width: 0; /* CRITICAL: Stops long text from pushing the buttons */
}

.mac-player-track-info {
    text-align: left;
}

/* ==========================================
   --- ANIMATED EQUALIZER (MUSIC PLAYER) ---
   ========================================== */
   
/* The circle holding the bars */
.mac-music-visualizer {
    width: 44px;
    height: 44px;
    border-radius: 50%; /* Changed from 12px to 50% to make it a perfect circle */
    background: linear-gradient(135deg, rgba(37, 200, 112, 0.1) 0%, rgba(37, 200, 112, 0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid rgba(37, 200, 112, 0.2);
}

/* Dark mode support for the box */
body.dark-theme .mac-music-visualizer {
    background: rgba(37, 200, 112, 0.15);
    border-color: rgba(37, 200, 112, 0.3);
}

.player-wave {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 16px;
}

/* Individual bouncing bars */
.player-wave span {
    display: block;
    width: 3px;
    background: var(--corp-accent);
    border-radius: 3px;
    animation: wave 1.2s ease-in-out infinite;
    transform-origin: center;
    transition: all 0.3s ease;
}

/* Stagger the animations so they bounce randomly */
.player-wave span:nth-child(1) { height: 60%; animation-delay: 0.0s; }
.player-wave span:nth-child(2) { height: 100%; animation-delay: 0.1s; }
.player-wave span:nth-child(3) { height: 40%; animation-delay: 0.2s; }
.player-wave span:nth-child(4) { height: 80%; animation-delay: 0.3s; }

/* Stop animation and shrink to flat dots when paused */
.mac-music-player.paused .player-wave span {
    animation-play-state: paused;
    opacity: 0.4;
    transform: scaleY(0.2) !important;
}

/* Keyframe for the bounce effect */
@keyframes wave {
    0%, 100% { transform: scaleY(0.4); }
    50% { transform: scaleY(1); }
}

/* Force hide the old spinning disc if it tries to render */
.mac-music-cover { display: none !important; }

/* ==========================================
   --- EDITABLE WELCOME BACK AVATAR ---
   ========================================== */
.editable-avatar {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 50%; /* This line makes the box a circle */
}

.editable-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 28px rgba(0,0,0,0.3), inset 0 2px 4px rgba(255,255,255,0.1);
}

.editable-avatar .avatar-edit-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 35%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.editable-avatar:hover .avatar-edit-overlay {
    opacity: 1;
}

/* Editable Avatar Hover Effects (Inside App) */
.editable-welcome-avatar:hover .avatar-edit-overlay {
    opacity: 1 !important;
}
.editable-welcome-avatar {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.editable-welcome-avatar:hover {
    transform: scale(1.05);
}

/* ==========================================
   --- SPINNING VINYL RECORD STYLES ---
   ========================================== */
.mac-music-cover-container {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    margin-right: 12px;
    border-radius: 50%;
    background: #1D1D1F; /* Dark vinyl edge */
    padding: 2px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinning-disc {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    animation: spinDisc 4s linear infinite;
    animation-play-state: paused; /* Paused by default */
}

/* When the player does NOT have the .paused class, spin the disc */
.mac-music-player:not(.paused) .spinning-disc {
    animation-play-state: running;
}

/* The hole in the middle of the vinyl record */
.disc-hole {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--card-bg); /* Matches the glassmorphism background */
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
    z-index: 2;
}

@keyframes spinDisc {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================
   --- PREMIUM COZY MUSIC MODE (STUDIO EDITION) ---
   ========================================== */

/* 1. The Dark, Blurred Ambient Background */
body.cozy-music-mode::after {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at top center, rgba(30, 30, 35, 0.9) 0%, rgba(5, 5, 8, 0.98) 100%);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    z-index: 99990;
    animation: fadeCozyIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    pointer-events: auto;
}

@keyframes fadeCozyIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 2. Morph the Player into a Vertical Card */
body.cozy-music-mode #miniMusicPlayer {
    z-index: 99999 !important;
    position: fixed !important;
    bottom: 50% !important;
    left: 50% !important;
    transform: translate(-50%, 50%) !important;
    
    flex-direction: column !important; 
    width: 320px !important; /* Slightly narrower to prevent horizontal stretching */
    max-width: 90vw !important;
    padding: 32px 20px 24px 20px !important; /* Tighter padding around the edges */
    border-radius: 36px !important;
    
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 40px 80px rgba(0,0,0,0.8), inset 0 1px 1px rgba(255,255,255,0.1) !important;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* 3. Make the Vinyl Massive and Centered */
body.cozy-music-mode .mac-music-cover-container {
    width: 180px !important; /* Slightly smaller vinyl so it doesn't push text down */
    height: 180px !important;
    margin: 0 auto 20px auto !important; /* Reduced the huge gap below the vinyl */
    box-shadow: 0 20px 40px rgba(0,0,0,0.5) !important;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* 4. Center the Text & Make it Pop */
body.cozy-music-mode .mac-music-info {
    text-align: center !important;
    align-items: center !important;
    margin: 0 0 20px 0 !important; /* Reduced the gap between text and buttons */
    width: 100% !important;
}
body.cozy-music-mode #musicTrackTitle {
    font-size: 20px !important; 
    color: #ffffff !important;
    margin-bottom: 4px !important; /* Pulled the artist name closer to the title */
    white-space: normal !important; 
}
body.cozy-music-mode #musicTrackArtist {
    font-size: 14px !important;
    color: var(--corp-accent) !important;
    opacity: 0.9 !important;
}

/* 5. Spread Out the Controls */
body.cozy-music-mode .mac-music-controls {
    width: 100% !important;
    justify-content: space-between !important;
    padding: 0 12px !important;
}
body.cozy-music-mode .mac-music-btn {
    color: #ffffff !important;
    opacity: 0.7;
    transform: scale(1.1) !important;
}
body.cozy-music-mode .mac-music-btn:hover {
    opacity: 1;
    color: var(--corp-accent) !important;
}
body.cozy-music-mode .play-pause-btn {
    transform: scale(1.6) !important;
    color: var(--corp-accent) !important;
    opacity: 1;
}

/* ==========================================================================
   ADVANCED GLASSMORPHISM & DEPTH OVERRIDES
   ========================================================================== */

/* 1. Deepen the main canvas to make the glass pop */
body.dark-theme {
    background-color: #0A0A0C !important; /* Extremely dark, rich background */
}

/* 2. Top Navigation - Sleek Frost Effect */
body.dark-theme .top-nav {
    background: rgba(10, 10, 12, 0.65) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4) !important;
}

/* 3. Floating Elements & Modals (Music Player, Login, Playlists) */
body.dark-theme .login-box,
body.dark-theme #miniMusicPlayer {
    background: rgba(30, 30, 32, 0.55) !important; /* More transparent for better blur */
    backdrop-filter: blur(32px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(32px) saturate(200%) !important;
    
    /* Premium inner and outer borders */
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.2) !important; /* Light source hitting the top edge */
    
    /* Multi-layered depth shadows */
    box-shadow: 
        0 24px 48px rgba(0, 0, 0, 0.6), 
        0 8px 16px rgba(0, 0, 0, 0.4), 
        inset 0 1px 1px rgba(255, 255, 255, 0.15) !important;
}

/* 4. Agent & Team Cards - Subtle Depth Hierarchy */
body.dark-theme .agent-card, 
body.dark-theme .team-card,
body.dark-theme .metric-card {
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Add a clean hover lift to the cards */
body.dark-theme .agent-card:hover, 
body.dark-theme .team-card:hover {
    background: rgba(255, 255, 255, 0.07) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4) !important;
    transform: translateY(-3px) !important;
}

/* 5. Inputs & Search Bars - Deep Embedded Glass */
body.dark-theme .corp-input {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3) !important;
    color: #FFFFFF !important;
    transition: border 0.2s ease, box-shadow 0.2s ease !important;
}

body.dark-theme .corp-input:focus {
    border: 1px solid var(--corp-accent) !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(37, 200, 112, 0.15) !important; /* Chime Green glow */
}

/* ==========================================================================
   MUSIC PLAYER AMBILIGHT EFFECT (COZY MODE)
   ========================================================================== */
:root {
    --ambilight-color: rgba(37, 200, 112, 0.4); /* Default Chime Green Glow */
}

/* Override the standard shadow with the massive glowing Ambilight */
body.cozy-music-mode #musicCoverArt {
    box-shadow: 0 10px 40px var(--ambilight-color), 0 0 100px var(--ambilight-color) !important;
    transition: box-shadow 1.5s ease-in-out, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* ==========================================================================
   GAMIFIED LEADERBOARD & RANK BADGES
   ========================================================================== */

/* 1. The "#1 MTD" Golden Glow for Top Cards */
body.dark-theme .rank-one-glow {
    position: relative !important;
    border: 1px solid rgba(255, 215, 0, 0.4) !important; /* Metallic Gold Border */
    box-shadow: 
        0 8px 24px rgba(255, 215, 0, 0.15), 
        inset 0 1px 4px rgba(255, 215, 0, 0.2) !important;
    z-index: 2; /* Lift above other cards */
}

/* Add a subtle pulsing background glow for the #1 card */
body.dark-theme .rank-one-glow::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: inherit;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.1);
    pointer-events: none;
    z-index: -1;
    animation: goldPulse 3s infinite alternate ease-in-out;
}

@keyframes goldPulse {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* 2. Premium Metallic Glassmorphism Rank Badges */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-left: 10px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    vertical-align: middle;
}

/* Gold Badge for #1 */
.rank-badge.gold {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(218, 165, 32, 0.05));
    border: 1px solid rgba(255, 215, 0, 0.5);
    color: #FFD700;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.2);
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

/* ==========================================================================
   VISUAL DATA PROGRESS RINGS (CSAT/NPS)
   ========================================================================== */
.stat-ring-container {
    position: relative;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* The actual ring with a cutout center so your glassmorphism shows through */
.stat-ring-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    /* The variable --percent and --ring-color will be injected by JavaScript! */
    background: conic-gradient(var(--ring-color) var(--percent), rgba(255,255,255,0.08) 0);
    -webkit-mask-image: radial-gradient(closest-side, transparent 76%, black 78%);
    mask-image: radial-gradient(closest-side, transparent 76%, black 78%);
    transition: background 1s ease;
}

/* The percentage text floating perfectly in the middle */
.stat-ring-value {
    position: relative;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-main);
    z-index: 2;
    letter-spacing: -0.5px;
}

/* ==========================================================================
   CLUSTER RANKING CHART INTERACTION
   ========================================================================== */
.cluster-team-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 20px; border-bottom: 1px solid var(--border-color);
    cursor: pointer; transition: background 0.2s ease;
}
.cluster-team-row:hover {
    background: rgba(255, 255, 255, 0.06);
}
.cluster-team-row:last-child { border-bottom: none; }

/* Prevents Music Player from covering the last inbox item */
#inboxList {
    padding-bottom: 120px !important;
}

/* ==========================================
   --- STRICT PORTRAIT ENFORCER ---
   ========================================== */
#landscape-blocker {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-color); /* Matches your light/dark theme perfectly */
    z-index: 999999999; /* On top of absolutely everything */
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
}

/* If the device is a mobile phone (height is less than 600px when turned sideways) 
  AND it is in landscape mode, show the blocker and hide the main scrollbar.
*/
@media screen and (max-height: 600px) and (orientation: landscape) {
    #landscape-blocker {
        display: flex !important;
    }
    body {
        overflow: hidden !important; /* Stops them from scrolling the app underneath */
    }
}

/* Clean UI: Hide music player text for disc-only look (Regular Mode) */
.mac-music-info {
    display: none !important;
}

/* Show the text again ONLY when Cozy Mode is active */
body.cozy-music-mode .mac-music-info {
    display: flex !important;
}

/* ==========================================
   --- GPU HARDWARE ACCELERATION ENGINE ---
   ========================================== */

/* Forces the mobile GPU to render the intense background blurring.
  This eliminates micro-stutters when scrolling past multiple frosted layers. 
*/
.top-nav, 
.vertical-nav, 
.mac-premium-welcome, 
.mac-stat-card, 
.login-overlay, 
.chat-panel, 
.chat-input-area,
.card {
    will-change: transform, backdrop-filter;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Mobile Memory Saver: Flattens deeply nested blurs to prevent compound lag 
  where two heavy glass panels overlap (e.g., Nav bar sliding over a Card) 
*/
@media (max-width: 768px) {
    .mac-stat-card {
        /* Replaces the deep blur with a high-quality semi-transparent solid */
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(255, 255, 255, 0.9) !important;
    }
    
    body.dark-theme .mac-stat-card {
        background: rgba(44, 44, 46, 0.95) !important;
    }
}