        :root {
            --primary: #2563eb;
            --primary-light: #eff6ff;
            --secondary: #1e40af;
            --accent: #f59e0b;
            --text-dark: #0f172a;
            --text-grey: #64748b;
            --bg-light: #f8fafc;
            --white: #ffffff;
            --border: #e2e8f0;
            --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
            --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
        }

        .user-is-logged-in #authHeaderArea { visibility: hidden; opacity: 0; }

        body.dark-mode {
            --text-dark: #f1f5f9;
            --text-grey: #94a3b8;
            --bg-light: #0f172a;
            --white: #1e293b;
            --border: #334155;
            background-color: #020617 !important;
            color: var(--text-dark);
        }

        body {
            margin: 0;
            font-family: 'Inter', sans-serif;
            background: var(--bg-light);
            color: var(--text-dark);
            transition: background 0.3s ease;
            -webkit-tap-highlight-color: transparent;
        }

        /* --- APP TOP BAR (now a column: top row + optional switch row) --- */
        .app-header {
            background: var(--white);
            padding: 12px 20px 0;
            display: flex;
            flex-direction: column;
            position: sticky;
            top: 0;
            z-index: 1000;
            box-shadow: var(--shadow-sm);
            border-bottom: 1px solid var(--border);
        }
        .app-header__toprow {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding-bottom: 12px;
        }

        .brand-logo {
            font-family: 'Poppins', sans-serif;
            font-weight: 800;
            font-size: 1.1rem;
            color: var(--primary);
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .brand-logo img { width: 32px; height: 32px; border-radius: 8px; border: 1.5px solid var(--primary); }

        /* --- SIDEBAR --- */
        .sidebar-overlay {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.5); z-index: 1040; display: none;
            backdrop-filter: blur(3px);
        }
        .sidebar {
            position: fixed; top: 0; left: -280px; width: 280px; height: 100%;
            background: var(--white); z-index: 1050;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
            display: flex; flex-direction: column;
            border-right: 1px solid var(--border);
        }
        .sidebar.show { left: 0; }
        .sidebar-header {
            background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
            padding: 35px 20px; color: white;
        }
        .user-avatar-circle {
            width: 55px; height: 55px; background: white; border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            color: var(--primary); font-size: 1.5rem; border: 3px solid rgba(255,255,255,0.3);
        }
        .menu-item {
            display: flex; align-items: center; padding: 14px 25px;
            color: var(--text-dark); text-decoration: none; font-weight: 500;
            position: relative;
            transition: background 0.2s ease, color 0.2s ease, transform 0.12s ease, padding-left 0.2s ease;
        }
        .menu-item::before {
            content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
            background: var(--primary); transform: scaleY(0); transform-origin: center;
            transition: transform 0.2s ease;
        }
        .menu-item i { width: 35px; font-size: 1.1rem; color: var(--text-grey); transition: color 0.2s ease, transform 0.2s ease; }
        .menu-item:hover { background: var(--primary-light); color: var(--primary); padding-left: 29px; }
        .menu-item:hover::before { transform: scaleY(1); }
        .menu-item:hover i { color: var(--primary); }
        .menu-item:active { background: var(--primary-light); transform: scale(0.97); transition-duration: 0.08s; }
        .menu-item:active i { transform: scale(0.9); }
        .menu-item.pro-btn { background: #fff7ed; color: #9a3412; font-weight: 700; }
        .menu-item.admin-btn { background: #f0fdf4; color: #166534; font-weight: 700; }

        /* --- GREETING --- */
        .greeting-section { padding: 20px 20px 10px; }
        .greeting-text {
            font-family: 'Poppins', sans-serif;
            font-weight: 800;
            font-size: 1.4rem;
            background: linear-gradient(135deg, #1e3a8a, #2563eb, #f59e0b);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }
/* --- IMAGE-BASED BANNER (ONE IMAGE ONLY) --- */
        .banner-container {
            width: 100%;
            padding: 0 45px;
            margin-bottom: 25px;
            position: relative;
            height: 360px;
        }
        .banner-wrapper {
            position: relative;
            width: 100%;
            height: 100%;
            border-radius: 24px;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
            background: #000;
        }
        .banner-slide {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.6s ease-in-out;
            z-index: 1;
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
            align-items: center;
            padding-bottom: 20px;
            /* Force exactly one image, centered */
            background-size: contain; 
            background-position: center;
            background-repeat: no-repeat;
        }
        .banner-slide.active {
            opacity: 1;
            visibility: visible;
            z-index: 2;
        }

        /* Loading Spinner */
        .banner-loader {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 40px;
            height: 40px;
            border: 4px solid rgba(255, 255, 255, 0.3);
            border-radius: 50%;
            border-top-color: #fff;
            animation: spin 1s linear infinite;
            z-index: 5;
        }
        @keyframes spin {
            to { transform: translate(-50%, -50%) rotate(360deg); }
        }

        .banner-slide .banner-btn { display: none; }
        .banner-slide.loaded .banner-btn { display: block; }
        .banner-slide.loaded .banner-loader { display: none; }

        .banner-btn {
            position: relative;
            z-index: 3;
            background: #991b1b;
            color: white !important;
            padding: 10px 30px;
            border-radius: 10px;
            font-weight: 800;
            text-decoration: none;
            box-shadow: 0 4px 15px rgba(0,0,0,0.5);
            border: 1px solid rgba(255,255,255,0.3);
        }

        .banner-nav {
            position: absolute;
            top: 50%;
            left: 0;
            width: 100%;
            display: flex;
            justify-content: space-between;
            transform: translateY(-50%);
            z-index: 10;
            pointer-events: none;
            padding: 0 10px;
        }
        .nav-arrow {
            width: 32px;
            height: 32px;
            background: var(--white);
            box-shadow: var(--shadow-sm);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--primary);
            cursor: pointer;
            pointer-events: auto;
            border: 1px solid var(--border);
        }

        .banner-dots {
            display: flex;
            justify-content: center;
            gap: 6px;
            margin-top: 10px;
        }
        .dot { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; transition: 0.3s; }
        .dot.active { width: 20px; background: var(--primary); border-radius: 10px; }

        /* --- ACTION BOXES (Full Width Rows with Right Arrows) --- */
        .action-container { padding: 0 20px; display: flex; flex-direction: column; gap: 15px; }
        .action-row { display: flex; flex-direction: column; gap: 15px; }
        
        .box-style {
            border-radius: 20px;
            padding: 22px 25px;
            display: flex;
            align-items: center;
            justify-content: space-between; /* Arrow to right, text to left */
            text-decoration: none;
            color: inherit;
            border: 1px solid var(--border);
            box-shadow: var(--shadow-sm);
            min-height: 100px;
        }
        .box-content { display: flex; align-items: center; gap: 15px; }

        .box-1 { background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%); }
        .box-2 { background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%); }
        .box-3 { background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%); }

        .box-style i { font-size: 1.6rem; color: var(--primary); }
        .box-2 i { color: var(--accent); }
        .box-3 i { color: #16a34a; }
        .box-style h4 { font-size: 0.95rem; font-weight: 800; margin: 0; }
        .box-arrow { font-size: 1.2rem; color: var(--text-grey); opacity: 0.5; }
        .free-badge-green { background: #22c55e; color: white; font-size: 9px; padding: 2px 6px; border-radius: 4px; margin-left: 5px; font-weight: 800; }

        /* --- WHAT'S NEW MARQUEE BOX (heading above, 3-line right-to-left ticker like Sarkari-Result style) --- */
        .whats-new-section { padding: 0 20px; margin: 5px 0 15px; }
        .whats-new-heading {
            display: flex; align-items: center; gap: 8px;
            font-size: 0.95rem; font-weight: 800; color: var(--text-dark);
            margin-bottom: 8px;
        }
        .whats-new-heading i { color: var(--primary); font-size: 1rem; }
        .whats-new-card {
            background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
            border: 1px solid var(--border);
            border-radius: 18px;
            padding: 10px 16px;
            box-shadow: var(--shadow-sm);
            display: flex;
            flex-direction: column;
        }
        .whats-new-row {
            height: 34px;
            position: relative;
            overflow: hidden;
        }
        .whats-new-row + .whats-new-row { border-top: 1px dashed var(--border); }
        .whats-new-track {
            position: absolute;
            top: 0; left: 0; width: 100%; height: 100%;
            display: flex; align-items: center; gap: 10px;
            white-space: nowrap;
            will-change: transform;
        }
        .whats-new-link { color: #2563eb; text-decoration: underline; font-size: 0.85rem; font-weight: 700; }
        .whats-new-date { font-size: 0.72rem; color: var(--text-grey); }

        @keyframes whatsNewMarquee {
            from { transform: translateX(var(--wn-start, 100%)); }
            to   { transform: translateX(var(--wn-end, -100%)); }
        }

        body.dark-mode .whats-new-heading { color: #f8fafc; }
        body.dark-mode .whats-new-card { background: #1e293b !important; border-color: #334155 !important; box-shadow: 0 4px 12px rgba(0,0,0,0.5); }
        body.dark-mode .whats-new-row + .whats-new-row { border-top-color: #334155; }
        body.dark-mode .whats-new-link { color: #60a5fa; }
        body.dark-mode .whats-new-date { color: #94a3b8; }


        /* --- RECOMMENDATIONS (Full Width Rows with Right Arrows) --- */
        .rec-section { padding: 25px 20px; }
        .section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
        .section-header h3 { font-size: 1rem; font-weight: 800; margin: 0; }
        .view-all-btn { font-size: 0.75rem; font-weight: 700; color: var(--primary); text-decoration: none; }
        
        .rec-grid { display: flex; flex-direction: column; gap: 12px; }
        .rec-card {
            background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
            border-radius: 18px;
            padding: 15px 25px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border: 1px solid var(--border);
            text-decoration: none;
            color: inherit;
            box-shadow: var(--shadow-sm);
        }
        .rec-left { display: flex; align-items: center; gap: 15px; }
        .rec-card img { width: 55px; height: 55px; border-radius: 12px; }
        .rec-card h4 { font-size: 0.9rem; font-weight: 800; margin: 0; }
        .rec-card p { font-size: 0.75rem; color: var(--text-grey); margin: 3px 0 0; }

        /* --- BEAUTIFUL ANIMATED TAGLINE --- */
        .tagline {
            text-align: center;
            padding: 30px 20px;
            font-weight: 800;
            font-size: 0.9rem;
            letter-spacing: 3px;
            text-transform: uppercase;
            background: linear-gradient(to right, #64748b 20%, #1e293b 40%, #1e293b 60%, #64748b 80%);
            background-size: 200% auto;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            animation: shine 4s linear infinite;
            opacity: 0.8;
        }
        @keyframes shine { to { background-position: 200% center; } }

       /* --- DESKTOP SPECIFIC HEIGHT --- */
@media (min-width: 992px) {
    .banner-container {
        height: 400px !important;
    }
}
 /* --- Desktop Image Switch Logic --- */
@media (min-width: 992px) {
    /* 1. Set Desktop Height */
    .banner-container {
        height: 300px !important; 
    }

    /* 2. Swap to Horizontal Images */
    #slide0 { 
        background-image: url('https://raw.githubusercontent.com/sscjourneytest/sscjourneytest/main/MMH_Pass_Desktop.jpg') !important; 
    }
    #slide1 { 
        background-image: url('https://raw.githubusercontent.com/sscjourneytest/sscjourneytest/main/MMH_Partner_Desktop.jpg') !important; 
    }
}

/* --- Mobile Image Switch Logic --- */
@media (max-width: 991px) {
    /* Ensure Mobile uses the Square images */
    #slide0 { 
        background-image: url('https://raw.githubusercontent.com/sscjourneytest/sscjourneytest/main/MMH_Pass_Banner.jpg') !important; 
    }
    #slide1 { 
        background-image: url('https://raw.githubusercontent.com/sscjourneytest/sscjourneytest/main/MMH_Partner_Banner.jpg') !important; 
    }
}      
        /* --- FLOATING ICONS (ORIGINAL) --- */
        .fab-container { position: fixed; bottom: 85px; right: 20px; display: flex; flex-direction: column; gap: 12px; z-index: 999; }
        .fab {
            width: 55px; height: 55px; border-radius: 50%; display: flex;
            align-items: center; justify-content: center; color: white;
            font-size: 1.6rem; box-shadow: 0 6px 20px rgba(0,0,0,0.15);
            text-decoration: none; transition: transform 0.2s;
        }
        .fab-tg { background: #0088cc; animation: pulse-tg 2s infinite; }
        .fab-wa { background: #25d366; }
        @keyframes pulse-tg {
            0% { box-shadow: 0 0 0 0 rgba(0, 136, 204, 0.6); }
            70% { box-shadow: 0 0 0 15px rgba(0, 136, 204, 0); }
            100% { box-shadow: 0 0 0 0 rgba(0, 136, 204, 0); }
        }

        /* --- BOTTOM NAV --- */
        .bottom-nav {
            position: fixed; bottom: 0; left: 0; width: 100%;
            background: var(--white); display: flex; justify-content: space-around;
            padding: 12px 0; border-top: 1px solid var(--border); z-index: 1000;
            box-shadow: 0 -5px 15px rgba(0,0,0,0.03);
        }
        .nav-item {
            text-align: center; color: var(--text-grey); text-decoration: none;
            font-size: 0.7rem; font-weight: 700; flex: 1; transition: 0.2s;
        }
        .nav-item i { display: block; font-size: 1.3rem; margin-bottom: 4px; }
        .nav-item.active { color: var(--primary); }

        .badge-pro { background: #f59e0b; color: white; font-size: 10px; padding: 2px 8px; border-radius: 50px; }
        .hidden { display: none !important; }
  /* --- DARK MODE ADJUSTMENTS FOR ACTION & REC CARDS --- */
body.dark-mode .box-style, 
body.dark-mode .rec-card {
    background: #1e293b !important; /* Solid dark blue-grey */
    border-color: #334155 !important; /* Subtle border */
    color: #f1f5f9 !important; /* Off-white text */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* Fix specific Action Box Icon & Arrow colors for visibility */
body.dark-mode .box-style h4,
body.dark-mode .rec-card h4 {
    color: #f8fafc;
}

body.dark-mode .box-arrow {
    color: #94a3b8;
    opacity: 0.8;
}

/* Ensure the text descriptions in Rec Cards are readable */
body.dark-mode .rec-card p {
    color: #94a3b8 !important;
}

/* Hover states for Dark Mode */
body.dark-mode .box-style:hover,
body.dark-mode .rec-card:hover {
    background: #2d3748 !important; /* Slightly lighter on hover */
    border-color: var(--primary) !important;
}
.new-badge-blink {
    background: #ef4444;
    color: white;
    font-size: 8px;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 900;
    margin-left: 8px;
    animation: blink-animation 1s steps(5, start) infinite;
}

@keyframes blink-animation {
    to { visibility: hidden; }
}
        
/* Maintain Icon Colors in Dark Mode */
body.dark-mode .box-1 i { color: #60a5fa; } /* Brighter Blue */
body.dark-mode .box-2 i { color: #fbbf24; } /* Brighter Gold/Orange */
body.dark-mode .box-3 i { color: #4ade80; } /* Brighter Green */

        /* Custom Install Modal */
.install-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}
.install-content {
  background: #fff;
  width: 100%;
  max-width: 350px;
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  position: relative;
  animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalPop {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.install-app-icon {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  margin-bottom: 15px;
  box-shadow: 0 10px 20px rgba(11, 94, 215, 0.2);
}
.install-content h3 { margin: 0 0 10px; color: #333; font-size: 20px; }
.install-content p { color: #666; font-size: 14px; margin-bottom: 25px; }

.install-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-install-now {
  background: #0b5ed7;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}
.btn-install-cancel {
  background: #f1f3f5;
  color: #666;
  border: none;
  padding: 10px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

/* Sidebar Install Button */
#sidebarInstallBtn {
  display: none; /* Hidden if already installed */
  background: linear-gradient(135deg, #0b5ed7, #00d2ff);
  color: white;
  margin: 10px 15px;
  padding: 12px;
  border-radius: 12px;
  text-align: center;
  font-weight: 700;
  cursor: pointer;
  border: none;
}

        /* --- FIXED TOP BAR OVERFLOW & TOGGLE BOX --- */
.brand-logo span {
    white-space: nowrap;
}

#darkModeToggle {
    background: var(--white) !important;
    color: var(--text-dark);
    border: 1px solid var(--border) !important;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.2s, border-color 0.2s;
}

body.dark-mode #darkModeToggle {
    background: #2a2a2a !important; /* Matches template background for toggle */
}

/* Mobile responsive tight-fit safety net */
@media (max-width: 480px) {
    .app-header__toprow {
        padding-left: 0; padding-right: 0;
    }
    .app-header {
        padding: 12px 10px 0 !important; /* Extra horizontal room */
    }
    .brand-logo {
        font-size: 0.85rem !important; /* Slightly scale text down */
        gap: 6px !important;
    }
    .brand-logo span {
        letter-spacing: -0.2px;
    }
    .brand-logo img {
        width: 26px !important;
        height: 26px !important;
    }
    .app-header .gap-3 {
        gap: 0.4rem !important; /* Tighten gap between menu and logo */
    }
    .app-header .gap-2 {
        gap: 0.35rem !important; /* Tighten gap between toggle, bell, auth area */
    }
}

/* Extra-narrow phones (e.g. older/small Android) — shrink brand text further
   but keep icons full size so they stay easily tappable */
@media (max-width: 360px) {
    .brand-logo {
        font-size: 0.75rem !important;
    }
}
.notif-bell-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    color: var(--text-dark);
    font-size: 1.1rem;
}
.notif-bell-wrap:hover { background: var(--primary-light); color: var(--primary); }

.notif-badge-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 50px;
    display: none; /* shown via JS when unreadCount > 0 */
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 1.5px solid var(--white);
    line-height: 1;
}

/* Bottom nav bell badge sits slightly differently since icons are stacked (icon above label) */
.nav-item .notif-badge-dot {
    top: -4px;
    right: 18%;
}

/* --- App switcher toggle (Rank Master / Mock Matrix) — widened,
   sits as a second row inside the sticky header, APK webview only --- */
.app-switch {
  display: flex; align-items: center; gap: 2px;
  background: #f1f1ef; border: 1px solid #e5e5e5;
  border-radius: 999px; padding: 4px;
  max-width: 320px; width: calc(100% - 8px);
  margin: 0 auto 12px;
}
.app-switch__btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px; border: none; background: transparent;
  font-size: 0.78rem; font-weight: 700; color: #888; cursor: pointer;
}
.app-switch__btn img { width: 17px; height: 17px; border-radius: 4px; object-fit: cover; }
.app-switch__btn--active { background: #fff; color: #000; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }

body.dark-mode .app-switch { background: #1e293b; border-color: #334155; }
body.dark-mode .app-switch__btn { color: #94a3b8; }
body.dark-mode .app-switch__btn--active { background: #2d3748; color: #f1f5f9; }

/* --- RESPONSIVE 2-PER-ROW GRID (buttons / recommendations) --- */
@media (min-width: 700px) {
    .action-row,
    .rec-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
    /* If item count is odd, the last card stays in its own column
       instead of stretching full width, leaving the second slot empty */
    .action-row > *:last-child:nth-child(odd),
    .rec-grid > *:last-child:nth-child(odd) {
        grid-column: span 1;
    }
}

/* --- SKELETON LOADING (buttons / recommendations / banners) --- */
.skeleton-box {
    background: var(--white);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 60px;
}
.skeleton-box .skeleton-line {
    background: var(--border);
    border-radius: 6px;
    animation: skeleton-blink 1.2s ease-in-out infinite;
}
.skeleton-box .skeleton-icon { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; }
.skeleton-box .skeleton-title { height: 14px; width: 60%; }
@keyframes skeleton-blink {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}
