/* Newsfeed styles - extracted from newsfeed.html for browser caching */
    * {
        scroll-behavior: smooth;
    }

    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-gutter: stable both-edges;
    }

    :root {
        --hub-page-bg: #f5f8f5;
        --hub-surface-1: #ffffff;
        --hub-surface-2: #f7faf7;
        --hub-surface-3: #eef4ee;
        --hub-border-subtle: #dfe8df;
        --hub-border-default: #cddbcc;
        --hub-accent: #22c55e;
        --hub-accent-dim: rgba(34, 197, 94, 0.15);
        --hub-accent-border: rgba(34, 197, 94, 0.25);
        --hub-text-primary: #173326;
        --hub-text-secondary: #5e7765;
        --hub-text-muted: #8ca08f;
        --hub-card-shadow: 0 8px 24px rgba(25, 48, 31, 0.08), 0 0 0 1px rgba(25,48,31,0.04);
        --hub-card-hover: 0 14px 32px rgba(25,48,31,0.10), 0 0 0 1px rgba(34,197,94,0.15);
        --hub-shell-max-width: 1560px;
        --hub-shell-inline-padding: clamp(18px, 2.2vw, 44px);
        --hub-desktop-nav-gap: 18px;
    }

    body {
        background:
            radial-gradient(circle at top left, rgba(34, 197, 94, 0.06), transparent 24%),
            radial-gradient(circle at top right, rgba(34, 197, 94, 0.05), transparent 22%),
            linear-gradient(180deg, #f8fbf8 0%, #eff5ef 100%);
        color: var(--hub-text-primary);
        font-family: 'Inter', system-ui, sans-serif;
        overflow-x: hidden;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    .ilearnzed-navbar {
        background: rgba(255, 255, 255, 0.96) !important;
        border-bottom: 1px solid var(--hub-border-subtle);
        box-shadow: 0 12px 30px rgba(25, 48, 31, 0.06);
        backdrop-filter: blur(12px);
        z-index: 2147483647 !important;
        isolation: isolate;
        pointer-events: auto !important;
    }

    .ilearnzed-navbar .navbar-brand {
        color: #00A651 !important;
        font-weight: 800 !important;
        font-size: 20px !important;
        margin: 0 !important;
        position: static !important;
        left: auto !important;
        transform: none !important;
    }

    .ilearnzed-navbar .nav-link,
    .ilearnzed-navbar .dropdown-toggle,
    .ilearnzed-navbar .btn,
    .ilearnzed-navbar .bi,
    .ilearnzed-navbar .fas {
        color: #65676b !important;
    }

    .ilearnzed-navbar .nav-link.active,
    .ilearnzed-navbar .nav-link:hover,
    .ilearnzed-navbar .dropdown-toggle:hover {
        color: var(--hub-text-primary) !important;
    }

    .ilearnzed-navbar .container,
    .ilearnzed-navbar .desktop-nav,
    .ilearnzed-navbar .navbar-nav,
    .ilearnzed-navbar .nav-item,
    .ilearnzed-navbar .nav-link,
    .ilearnzed-navbar .dropdown-menu,
    .ilearnzed-navbar .dropdown-item {
        position: relative;
        z-index: 2147483647 !important;
        pointer-events: auto !important;
    }

    .main-container.feed-shell,
    .newsfeed-container,
    .latest-news-sidebar,
    .left-sidebar {
        position: relative;
        z-index: 1;
    }

    @media (max-width: 991.98px) {
        body:has(#newsfeed-feed-root) .ilearnzed-navbar {
            min-height: 72px !important;
            height: 72px !important;
            padding: 0 !important;
            position: absolute !important;
            top: 0 !important;
            left: auto !important;
            right: auto !important;
            width: 100% !important;
            z-index: 1050 !important;
            transform: translateY(0) !important;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
            will-change: transform;
        }

        body:has(#newsfeed-feed-root) {
            padding-top: 72px !important;
        }

        body:has(#newsfeed-feed-root) .ilearnzed-navbar:not(.navbar-hide-while-scrolling),
        body:not(.newsfeed-mobile-nav-hidden):has(#newsfeed-feed-root) .ilearnzed-navbar.navbar-hide-while-scrolling {
            transform: translateY(0) !important;
            pointer-events: auto !important;
        }

        body.newsfeed-mobile-nav-hidden:has(#newsfeed-feed-root) .ilearnzed-navbar {
            transform: translateY(-86px) !important;
            box-shadow: none !important;
            pointer-events: none !important;
        }

        body.newsfeed-mobile-nav-hidden:has(#newsfeed-feed-root) .ilearnzed-navbar #mobile-menu-toggle,
        body.newsfeed-mobile-nav-hidden:has(#newsfeed-feed-root) .ilearnzed-navbar .mobile-logo-link {
            pointer-events: none !important;
        }

        body:has(#newsfeed-feed-root) .ilearnzed-navbar > .container {
            width: 100% !important;
            max-width: 100% !important;
            height: 72px !important;
            min-height: 72px !important;
            max-height: 72px !important;
            padding: 0 16px !important;
            display: flex !important;
            align-items: center !important;
            justify-content: stretch !important;
            position: relative !important;
            overflow: visible !important;
        }

        body:has(#newsfeed-feed-root) .ilearnzed-navbar .mobile-header-nav {
            height: 72px !important;
            min-height: 72px !important;
            max-height: 72px !important;
            width: 100% !important;
            display: flex !important;
            align-items: center !important;
            justify-content: space-between !important;
            gap: 16px !important;
            flex-wrap: nowrap !important;
            position: relative !important;
            overflow: visible !important;
        }

        body:has(#newsfeed-feed-root) .ilearnzed-navbar .desktop-nav,
        body:has(#newsfeed-feed-root) .ilearnzed-navbar .navbar-brand:not(.mobile-logo-link),
        body:has(#newsfeed-feed-root) .ilearnzed-navbar .navbar-nav {
            display: none !important;
            visibility: hidden !important;
            pointer-events: none !important;
        }

        body:has(#newsfeed-feed-root) .ilearnzed-navbar .mobile-logo-link,
        body:has(#newsfeed-feed-root) .ilearnzed-navbar #mobile-menu-toggle {
            display: inline-flex !important;
            visibility: visible !important;
            pointer-events: auto !important;
        }

        body:has(#newsfeed-feed-root) .ilearnzed-navbar .mobile-logo-link {
            position: absolute !important;
            left: auto !important;
            right: auto !important;
            top: 14px !important;
            transform: none !important;
            margin: 0 !important;
            flex: 0 0 auto !important;
            min-width: 0 !important;
            align-items: center !important;
            justify-content: flex-start !important;
        }

        body:has(#newsfeed-feed-root) .ilearnzed-navbar .mobile-header-nav > .mobile-logo-link {
            left: 0 !important;
        }

        body:has(#newsfeed-feed-root) .ilearnzed-navbar .mobile-logo-image {
            width: auto !important;
            height: 44px !important;
            max-width: 82px !important;
            object-fit: contain !important;
        }

        body:has(#newsfeed-feed-root) .ilearnzed-navbar #mobile-menu-toggle {
            position: absolute !important;
            top: 12px !important;
            right: 0 !important;
            left: auto !important;
            bottom: auto !important;
            transform: none !important;
            margin: 0 !important;
            flex: 0 0 48px !important;
            width: 48px !important;
            height: 48px !important;
            min-width: 48px !important;
            min-height: 48px !important;
            border-radius: 13px !important;
        }

        @media (prefers-reduced-motion: reduce) {
            body:has(#newsfeed-feed-root) .ilearnzed-navbar {
                transition: none !important;
            }
        }
    }

    /* Main container with two columns */
    .main-container {
        display: flex;
        flex-wrap: nowrap; /* Prevent wrapping - sidebar should stay on right */
        gap: 16px;
        max-width: 1400px;
        margin: 0 auto;
        padding: 20px 16px;
        align-items: flex-start;
    }

    .main-container.feed-shell {
        width: min(100%, var(--hub-shell-max-width));
        max-width: var(--hub-shell-max-width);
        padding: 24px var(--hub-shell-inline-padding);
        display: grid;
        grid-template-columns: 240px minmax(0, 1fr) 280px;
        gap: 24px;
    }

    @media (min-width: 1400px) {
        .main-container.feed-shell {
            grid-template-columns: 260px minmax(0, 1fr) 320px;
            gap: 28px;
        }
    }

    @media (min-width: 1025px) {
        .ilearnzed-navbar > .container {
            width: min(100%, var(--hub-shell-max-width)) !important;
            max-width: var(--hub-shell-max-width) !important;
            padding-left: var(--hub-shell-inline-padding) !important;
            padding-right: var(--hub-shell-inline-padding) !important;
        }

        body .main-content.container-fluid,
        body .main-content {
            padding-left: 0 !important;
            padding-right: 0 !important;
        }
    }

    .left-sidebar {
        position: sticky;
        top: calc(var(--ilearnzed-navbar-offset, 72px) + 24px);
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .left-sidebar-card,
    .latest-news-section,
    .trending-card,
    .suggested-card,
    .post-card,
    .create-post,
    .quick-links-bar {
        background: var(--hub-surface-1);
        border: 1px solid var(--hub-border-subtle);
        border-radius: 12px;
        box-shadow: var(--hub-card-shadow);
    }

    /* Left side - Scrollable Newsfeed */
    .newsfeed-container {
        flex: 1 1 auto;
        max-width: none;
        min-width: 0;
        position: relative;
        overflow-y: visible;
    }

    .newsfeed-container > .container {
        width: 100%;
        max-width: none;
        margin: 0;
        padding-left: 0;
        padding-right: 0;
    }

    /* Right side - Desktop sidebar (in layout, non-floating) */
    .latest-news-sidebar {
        flex: 0 0 280px;
        width: 280px;
        max-height: calc(100vh - var(--ilearnzed-navbar-offset, 72px) - 32px);
        min-width: 280px;
        position: sticky;
        top: calc(var(--ilearnzed-navbar-offset, 72px) + 24px);
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 10;
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    /* Ensure sidebar only shows on larger desktop (screens wider than 1280px) */
    @media (min-width: 1281px) {
        .main-container {
            position: relative;
        }

        .main-container.feed-shell {
            grid-template-columns: 240px minmax(0, 1fr) 280px;
        }

        .newsfeed-container {
            flex: 1 1 auto;
            max-width: 100%;
        }

        .latest-news-sidebar {
            display: block !important;
        }

        /* Hide mobile modal on desktop - always hidden regardless of classes */
        .latest-news-modal,
        .latest-news-modal.show,
        .latest-news-modal-overlay,
        .latest-news-modal-overlay.show {
            display: none !important;
            visibility: hidden !important;
            opacity: 0 !important;
        }

        /* Hide mobile float button on desktop */
        .latest-news-float-btn {
            display: none !important;
        }
    }

    /* Mobile: Single column layout like Facebook */
    @media (max-width: 1024px) and (min-width: 769px) {
        .main-container.feed-shell {
            grid-template-columns: minmax(0, 1fr) 280px;
        }

        .left-sidebar {
            display: none;
        }
    }

    @media (max-width: 768px) {
        html, body {
            width: 100% !important;
            max-width: 100vw !important;
            overflow-x: hidden !important;
        }

        .main-container {
            display: block !important;
            padding: 12px !important;
            gap: 0 !important;
            max-width: 100% !important;
            width: 100% !important;
            margin: 0 !important;
        }

        .left-sidebar,
        .latest-news-sidebar {
            display: none !important;
        }

        .newsfeed-container {
            flex: 1 !important;
            width: 100% !important;
            max-width: 100% !important;
            padding: 0 !important;
            margin: 0 !important;
        }

        /* Legacy container for backward compatibility */
        .container {
            width: 100% !important;
            max-width: 100% !important;
            padding: 12px !important;
            margin: 0 !important;
            box-sizing: border-box !important;
        }

        /* Ensure all child elements respect container */
        .newsfeed-container .container > * {
            width: 100% !important;
            max-width: 100% !important;
            box-sizing: border-box !important;
        }

        /* Prevent any element from causing overflow */
        .newsfeed-container * {
            max-width: 100% !important;
            box-sizing: border-box !important;
        }
    }

    .post-card {
        background: var(--hub-surface-1);
        border-radius: 12px;
        padding: 20px;
        margin-bottom: 16px;
        border: 1px solid var(--hub-border-subtle);
        box-shadow: var(--hub-card-shadow);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        opacity: 0;
        animation: fadeInUp 0.4s ease forwards;
        will-change: transform;
    }

    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .post-card:hover {
        box-shadow: var(--hub-card-hover);
    }

    .post-header {
        display: flex;
        align-items: center;
        margin-bottom: 12px;
        gap: 0;
        position: relative;
    }

    .post-user-link {
        display: flex;
        align-items: center;
        flex: 1;
        min-width: 0;
        text-decoration: none;
        color: inherit;
    }

    .post-user-link:hover .post-author {
        color: #0a6a3c;
    }

    .composer-avatar-link {
        display: inline-flex;
        align-items: center;
        flex-shrink: 0;
        text-decoration: none;
    }

    .create-post-form .avatar-shell.composer-avatar {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
        border-radius: 50%;
        overflow: hidden;
        margin-right: 0;
        border: 2px solid #f0f0f0;
        background: #e8f5ee;
    }

    .create-post-form .avatar-shell.composer-avatar .avatar {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        border-radius: 50%;
        display: block;
    }

    /* Mobile: Facebook-like compact header - name next to profile picture */
    @media (max-width: 768px) {
        .post-header {
            margin-bottom: 10px !important;
            gap: 8px !important;
            display: flex !important;
            flex-direction: row !important;
            align-items: center !important;
        }
    }

    .avatar {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        display: block;
        flex-shrink: 0;
    }

    .avatar-shell {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        overflow: hidden;
        flex-shrink: 0;
        margin-right: 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: #0f9f6e;
        color: #ffffff;
        font-weight: 700;
        font-size: 0.9rem;
        line-height: 1;
    }

    .avatar-shell .avatar-fallback {
        display: none;
    }

    .avatar-shell.show-fallback .avatar {
        display: none;
    }

    .avatar-shell.show-fallback .avatar-fallback {
        display: inline-flex;
        width: 100%;
        height: 100%;
        align-items: center;
        justify-content: center;
    }

    /* Mobile: smaller avatar shells; img fills shell (do not shrink img to 32px) */
    @media (max-width: 768px) {
        .avatar-shell {
            width: 40px !important;
            height: 40px !important;
            margin-right: 8px !important;
            min-width: 40px !important;
            min-height: 40px !important;
        }

        .avatar-shell .avatar {
            width: 100% !important;
            height: 100% !important;
            min-width: 0 !important;
            min-height: 0 !important;
            max-width: none !important;
            max-height: none !important;
            display: block !important;
            opacity: 1 !important;
            visibility: visible !important;
            object-fit: cover !important;
        }

        .comment-avatar {
            width: 24px !important;
            height: 24px !important;
            min-width: 24px !important;
            min-height: 24px !important;
        }
    }

    .quick-links-bar {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
        padding: 14px;
        margin-bottom: 16px;
    }

    .quick-link-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        min-height: 58px;
        padding: 14px 18px;
        border-radius: 10px;
        background: var(--hub-surface-2);
        border: 1px solid var(--hub-border-subtle);
        color: var(--hub-text-primary);
        text-decoration: none;
        font-weight: 500;
        transition: 0.18s ease;
    }

    .quick-link-btn:hover {
        background: var(--hub-surface-3);
        border-color: var(--hub-accent-border);
        color: var(--hub-text-primary);
    }

    .quick-link-btn i {
        color: var(--hub-accent);
    }

    .create-post {
        padding: 20px;
        margin-bottom: 16px;
    }

    .create-post-form {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .create-post-form .composer-avatar-link {
        margin-top: 0;
    }

    .create-post-form [name="content"] {
        width: 100%;
        min-width: 0;
    }

    .comment-form .comment-avatar {
        background: var(--hub-surface-3);
        border: 1px solid var(--hub-border-default);
    }

    #post-form textarea,
    #post-form input[type="text"],
    #post-form .form-control,
    #post-form [name="content"],
    .comment-input {
        background: var(--hub-surface-2) !important;
        color: var(--hub-text-primary) !important;
        border: 1px solid var(--hub-border-subtle) !important;
        border-radius: 20px !important;
        padding: 12px 16px !important;
        width: 100% !important;
        min-height: 48px;
        box-shadow: none !important;
    }

    #post-form textarea::placeholder,
    #post-form input[type="text"]::placeholder,
    #post-form .form-control::placeholder,
    .comment-input::placeholder {
        color: var(--hub-text-muted) !important;
    }

    #post-form textarea:focus,
    #post-form input[type="text"]:focus,
    #post-form .form-control:focus,
    .comment-input:focus {
        border-color: var(--hub-accent) !important;
        box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12) !important;
        outline: none !important;
    }

    .create-post-btn {
        background: var(--hub-accent) !important;
        color: #ffffff !important;
        border: none !important;
        border-radius: 8px !important;
        font-weight: 600 !important;
        padding: 10px 20px !important;
        transition: 0.15s ease;
    }

    .create-post-btn:hover {
        box-shadow: 0 0 12px rgba(34, 197, 94, 0.3);
        transform: translateY(-1px);
    }

    .media-attachment-area {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--hub-border-subtle);
    }

    .media-attachment-bar {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .media-attachment-btn {
        flex: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 10px 16px;
        border-radius: 8px;
        color: var(--hub-text-secondary);
        background: transparent;
        border: 1px solid transparent;
        transition: 0.15s ease;
    }

    .media-attachment-btn:hover {
        background: var(--hub-surface-2);
        color: var(--hub-text-primary);
    }

    .media-attachment-btn i {
        color: var(--hub-accent);
    }

    .media-attachment-divider {
        display: none;
    }

    .composer-media-input {
        position: fixed !important;
        left: -10000px !important;
        top: auto !important;
        width: 1px !important;
        height: 1px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        opacity: 0 !important;
        overflow: hidden !important;
        clip: rect(0 0 0 0) !important;
        clip-path: inset(50%) !important;
        white-space: nowrap !important;
    }

    /* Social Action Icons */
    .social-action-btn {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 8px 12px;
        border-radius: 6px;
        font-size: 14px;
        font-weight: 500;
        color: var(--hub-text-secondary);
        transition: background 0.15s;
    }

    .social-action-btn:hover {
        background: var(--hub-surface-2);
    }

    .social-action-btn.photo i { color: #45bd62; }
    .social-action-btn.video i { color: #f02849; }

    /* Post Button visibility logic */
    #post-actions-row {
        display: none;
        width: 100%;
        margin-top: 12px;
    }

    .post-author,
    .comment-author,
    .news-title,
    .latest-news-title,
    .section-card-title,
    .hub-profile-name {
        color: var(--hub-text-primary);
    }

    .post-time,
    .comment-text,
    .news-summary,
    .news-meta,
    .hub-profile-role,
    .sidebar-stat-label,
    .section-meta,
    .suggested-role {
        color: var(--hub-text-secondary) !important;
    }

    .post-content {
        color: var(--hub-text-primary);
        font-size: 14px;
        line-height: 1.6;
    }

    .post-media,
    .post-video {
        border-radius: 10px;
        margin-top: 12px;
        background: #edf3ed;
    }

    .post-actions {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        border-top: 1px solid var(--hub-border-subtle);
        margin-top: 12px;
        padding: 4px 0;
    }

    .action-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 10px;
        border-radius: 6px;
        background: transparent;
        border: none;
        color: var(--hub-text-secondary);
        font-weight: 500;
        font-size: 14px;
        transition: background 0.2s;
    }

    .action-btn i {
        font-size: 18px;
    }

    .action-btn:hover {
        background: var(--hub-surface-2);
        color: var(--hub-text-primary);
    }

    .action-btn.liked {
        color: #00A651;
    }

    .comments {
        border-top: 1px solid var(--hub-border-subtle);
        margin-top: 12px;
        padding-top: 12px;
    }

    .comment {
        background: var(--hub-surface-2);
        border: 1px solid var(--hub-border-subtle);
        border-radius: 12px;
        padding: 10px 12px;
        margin-bottom: 10px;
    }

    .comment-form {
        display: grid;
        grid-template-columns: 32px minmax(0, 1fr) auto;
        gap: 10px;
        align-items: center;
    }

    .hub-sidebar-title {
        font-size: 15px;
        font-weight: 600;
        color: var(--hub-text-primary);
        margin: 0 0 12px;
    }

    .suggested-card .recommended-connections-title {
        display: inline-block;
        max-width: 100%;
        white-space: nowrap;
        overflow-wrap: normal;
        word-break: keep-all;
        line-height: 1.2;
        padding: 5px 10px;
        border-radius: 999px;
        border: 1px solid rgba(34, 197, 94, 0.28);
        background: rgba(34, 197, 94, 0.12);
        color: #179351;
        font-weight: 700;
        font-size: 12px;
        letter-spacing: 0.01em;
    }

    @media (max-width: 768px) {
        .suggested-card .recommended-connections-title {
            padding: 4px 9px;
            font-size: 11px;
        }
    }

    .hub-sidebar-card {
        padding: 20px 16px;
    }

    .hub-profile-card {
        text-align: center;
    }

    .hub-profile-avatar {
        width: 64px;
        height: 64px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid var(--hub-border-default);
        display: block;
        margin: 0 auto 12px;
        background: var(--hub-surface-3);
    }

    .hub-profile-name {
        font-size: 15px;
        font-weight: 700;
        margin-bottom: 4px;
    }

    .hub-profile-role {
        font-size: 12px;
    }

    .hub-sidebar-divider {
        border-top: 1px solid var(--hub-border-subtle);
        margin: 16px 0;
    }

    .hub-sidebar-stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        text-align: left;
    }

    .sidebar-stat-value {
        display: block;
        color: var(--hub-text-primary);
        font-size: 14px;
        font-weight: 700;
    }

    .sidebar-stat-label {
        font-size: 12px;
    }

    .hub-nav-list {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .hub-nav-link {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        border-radius: 8px;
        color: var(--hub-text-secondary);
        text-decoration: none;
        transition: 0.15s ease;
    }

    .hub-nav-link:hover {
        background: var(--hub-surface-2);
        color: var(--hub-text-primary);
    }

    .hub-nav-link.active {
        background: rgba(34,197,94,0.12);
        color: var(--hub-accent);
    }

    .hub-section-label {
        font-size: 11px;
        font-weight: 500;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--hub-text-muted);
        margin-bottom: 10px;
    }

    .subject-chip-row {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .subject-chip {
        padding: 3px 8px;
        border-radius: 20px;
        border: 1px solid var(--hub-border-default);
        background: var(--hub-surface-3);
        color: var(--hub-text-secondary);
        font-size: 11px;
    }

    .trending-card,
    .suggested-card,
    .latest-news-section {
        padding: 20px;
    }

    .section-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;
    }

    .section-card-link {
        color: var(--hub-accent);
        font-size: 12px;
        text-decoration: none;
    }

    .trending-item,
    .suggested-item,
    .news-item {
        padding: 10px 0;
        border-bottom: 1px solid var(--hub-border-subtle);
    }

    .trending-item:last-child,
    .suggested-item:last-child,
    .news-item:last-child {
        border-bottom: none;
    }

    .trending-tag {
        color: var(--hub-accent);
        font-size: 14px;
        font-weight: 500;
        text-decoration: none;
    }

    .suggested-item {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
    }

    .suggested-meta {
        flex: 1 1 auto;
        min-width: 0;
    }

    .suggested-avatar {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: var(--hub-surface-3);
        color: var(--hub-text-primary);
        font-weight: 700;
        flex-shrink: 0;
    }

    .suggested-name {
        font-size: 13px;
        font-weight: 600;
        color: var(--hub-text-primary);
        line-height: 1.25;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .suggested-role {
        font-size: 11px;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .suggested-follow-form {
        margin-left: auto;
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
    }

    .follow-btn {
        margin-left: 0;
        background: transparent;
        border: 1px solid var(--hub-border-default);
        color: var(--hub-text-secondary);
        border-radius: 20px;
        min-width: 84px;
        height: 34px;
        padding: 0 14px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        font-size: 12px;
        white-space: nowrap;
        transition: 0.15s ease;
    }

    .follow-btn:hover {
        border-color: var(--hub-accent);
        color: var(--hub-accent);
    }

    .empty-feed-card {
        border-style: dashed;
        border-color: var(--hub-border-default);
        text-align: center;
        padding: 48px 24px;
    }

    .empty-feed-card p {
        color: var(--hub-text-secondary) !important;
        margin-bottom: 8px;
        font-size: 14px;
    }

    .empty-feed-icon {
        font-size: 48px;
        color: var(--hub-text-muted);
        margin-bottom: 12px;
    }

    .latest-news-section .news-title {
        text-decoration: none;
        color: var(--hub-text-primary);
        font-size: 13px;
        font-weight: 600;
    }

    .latest-news-section .news-summary {
        font-size: 12px;
        margin-top: 6px;
    }

    .news-pin-icon {
        color: var(--hub-accent);
    }

    @media (max-width: 768px) {
        .quick-links-bar {
            grid-template-columns: 1fr;
        }

        .create-post-form {
            display: flex !important;
            align-items: center !important;
            gap: 10px !important;
        }

        .create-post-form .avatar-shell.composer-avatar {
            width: 40px !important;
            height: 40px !important;
            min-width: 40px !important;
            min-height: 40px !important;
        }

        .create-post-form [name="content"] {
            width: 100% !important;
            min-height: 44px !important;
        }

        .create-post-btn {
            grid-column: 1 / -1 !important;
            grid-row: 2 !important;
            width: 100% !important;
            height: 48px !important;
            margin-top: 4px !important;
        }

        .media-attachment-bar {
            display: flex !important;
            flex-direction: row !important;
            gap: 8px !important;
        }

        .media-attachment-btn {
            flex: 1 !important;
            padding: 12px 8px !important;
            font-size: 13px !important;
            background: var(--hub-surface-2) !important;
            border: 1px solid var(--hub-border-subtle) !important;
        }

        .media-attachment-divider {
            display: none !important;
        }

        .comment-form {
            grid-template-columns: 24px minmax(0, 1fr);
        }

        .comment-form .create-post-btn {
            grid-column: 1 / -1;
        }
    }

    .post-info {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
    }

    /* Mobile: Ensure post-info stays horizontal next to avatar */
    @media (max-width: 768px) {
        .post-info {
            flex: 1 !important;
            min-width: 0 !important;
            display: flex !important;
            flex-direction: column !important;
            align-items: flex-start !important;
            justify-content: center !important;
        }
    }

    .post-author {
        font-weight: 600;
        font-size: 15px;
        color: #050505;
        text-decoration: none;
        line-height: 1.2;
    }

    .post-time {
        font-size: 13px;
        color: #65676B;
        line-height: 1.2;
    }

    /* Post menu dropdown (3 dots) - Delete & Report */
    .post-menu-wrapper {
        position: relative;
        margin-left: auto;
    }

    .post-menu-trigger {
        background: none;
        border: none;
        cursor: pointer;
        padding: 6px 8px;
        border-radius: 50%;
        color: #65676B;
        font-size: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        transition: background 0.2s, color 0.2s;
    }

    .post-menu-trigger:hover {
        background: #F0F2F5;
        color: #050505;
    }

    .post-menu-dropdown {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        margin-top: 4px;
        min-width: 180px;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        border: 1px solid #E4E6EB;
        z-index: 100;
        overflow: hidden;
    }

    .post-menu-wrapper.open .post-menu-dropdown {
        display: block;
    }

    .post-menu-item {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        padding: 12px 14px;
        border: none;
        background: none;
        cursor: pointer;
        font-size: 14px;
        color: #050505;
        text-align: left;
        transition: background 0.2s;
    }

    .post-menu-item:hover {
        background: #F0F2F5;
    }

    .post-menu-item i {
        font-size: 16px;
        width: 20px;
        color: #65676B;
    }

    .post-menu-item.open-report-modal-btn i {
        color: #DC3545;
    }

    .post-menu-item.post-menu-delete i {
        color: #DC3545;
    }

    /* Mobile: larger touch targets, prevent clipping */
    @media (max-width: 768px) {
        .post-card {
            overflow: visible !important;
        }

        .post-header {
            overflow: visible !important;
        }

        .post-menu-wrapper {
            overflow: visible !important;
        }

        .post-menu-trigger {
            width: 44px;
            height: 44px;
            min-width: 44px;
            min-height: 44px;
            padding: 10px;
            -webkit-tap-highlight-color: rgba(0, 166, 81, 0.2);
            touch-action: manipulation;
        }

        /* Fixed positioning on mobile so dropdown is never clipped */
        .post-menu-wrapper.open .post-menu-dropdown {
            position: fixed !important;
            top: auto !important;
            bottom: 20px !important;
            left: 50% !important;
            right: auto !important;
            transform: translateX(-50%) !important;
            width: calc(100vw - 32px) !important;
            max-width: 300px !important;
            min-width: 0 !important;
            z-index: 9999 !important;
            box-shadow: 0 -4px 20px rgba(0,0,0,0.2) !important;
        }

        .post-menu-dropdown {
            min-width: 200px;
        }

        .post-menu-item {
            padding: 16px 18px;
            font-size: 15px;
            min-height: 48px;
        }
    }

    /* Mobile dropdown backdrop - dims background when dropdown open */
    .post-menu-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.3);
        z-index: 9998;
        pointer-events: none;
    }

    @media (max-width: 768px) {
        .post-menu-backdrop {
            pointer-events: auto;
        }
        .post-menu-wrapper.open .post-menu-backdrop {
            display: block;
        }
    }

    /* Mobile: Facebook-like name and time sizing */
    @media (max-width: 768px) {
        .post-author {
            font-size: 15px !important;
            font-weight: 600 !important;
            line-height: 1.2 !important;
        }

        .post-time {
            font-size: 12px !important;
            line-height: 1.2 !important;
        }

        .post-info {
            min-width: 0 !important;
            flex: 1 !important;
            overflow: hidden !important;
        }
    }

    .post-content {
        font-size: 15px;
        line-height: 1.5;
        color: #050505;
        margin-bottom: 12px;
        white-space: pre-wrap;
        word-wrap: break-word;
    }

    /* Mobile: Better text spacing */
    @media (max-width: 768px) {
        .post-card {
            padding: 12px !important;
            margin-bottom: 12px !important;
            border-radius: 8px !important;
            width: 100% !important;
            max-width: 100% !important;
            box-sizing: border-box !important;
            margin-left: 0 !important;
            margin-right: 0 !important;
        }

        .post-header {
            margin-bottom: 10px !important;
            width: 100% !important;
            max-width: 100% !important;
            display: flex !important;
            flex-direction: row !important;
            align-items: center !important;
            gap: 8px !important;
            flex-wrap: nowrap !important;
        }

        .post-content {
            font-size: 15px !important;
            line-height: 1.6 !important;
            margin-bottom: 10px !important;
            word-wrap: break-word !important;
            overflow-wrap: break-word !important;
            width: 100% !important;
            max-width: 100% !important;
        }

        .post-author {
            font-size: 15px !important;
            line-height: 1.4 !important;
            word-wrap: break-word !important;
        }

        .post-time {
            font-size: 12px !important;
        }

        .post-info {
            min-width: 0 !important;
            flex: 1 !important;
            max-width: 100% !important;
        }

        /* Post media */
        .post-media,
        .post-video {
            width: 100% !important;
            max-width: 100% !important;
            height: auto !important;
            border-radius: 8px !important;
        }

        /* Post actions */
        .post-actions {
            width: 100% !important;
            max-width: 100% !important;
            flex-wrap: nowrap !important;
            display: flex !important;
            gap: 4px !important;
        }

        .action-btn {
            flex: 1 !important;
            min-width: 0 !important;
            max-width: 50% !important;
            font-size: 12px !important;
            padding: 8px 2px !important;
            white-space: nowrap !important;
            overflow: hidden !important;
            text-overflow: ellipsis !important;
        }
    }

    .post-media {
        width: 100%;
        border-radius: 12px;
        margin-bottom: 12px;
        max-height: 600px;
        object-fit: contain;
        background: #000;
        cursor: pointer;
        transition: transform 0.3s ease;
        opacity: 0;
        animation: fadeIn 0.5s ease forwards;
    }

    .post-media.loading {
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
        background-size: 200% 100%;
        animation: loading 1.5s infinite;
    }

    @keyframes loading {
        0% { background-position: 200% 0; }
        100% { background-position: -200% 0; }
    }

    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    .post-media:hover {
        transform: scale(1.01);
    }

    .post-video {
        width: 100%;
        border-radius: 12px;
        margin-bottom: 12px;
        max-height: 600px;
        background: #000;
        cursor: pointer;
        transition: transform 0.3s ease;
    }


    .post-video:hover {
        transform: scale(1.01);
    }

    /* Lazy loading placeholder */
    .lazy-load-placeholder {
        width: 100%;
        aspect-ratio: 16/9;
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
        background-size: 200% 100%;
        animation: loading 1.5s infinite;
        border-radius: 12px;
        margin-bottom: 12px;
    }

    .post-actions {
        display: flex;
        border-top: 1px solid #E4E6EB;
        padding-top: 8px;
        margin-top: 8px;
    }

    .action-btn {
        flex: 1;
        background: none;
        border: none;
        padding: 8px;
        cursor: pointer;
        font-size: 14px;
        color: #65676B;
        font-weight: 600;
        border-radius: 4px;
    }

    .action-btn:hover {
        background: #F2F2F2;
    }

    .action-btn.liked {
        color: #00A651;
    }

    /* Report Modal Styles - z-index above post-menu (9999) so it always appears on top */
    .report-modal {
        display: none;
        position: fixed;
        z-index: 10002;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        animation: fadeIn 0.2s ease-in;
    }

    .report-modal.show {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .report-modal-content {
        background-color: white;
        border-radius: 12px;
        padding: 24px;
        max-width: 500px;
        width: 90%;
        max-height: 90vh;
        overflow-y: auto;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        animation: slideUp 0.3s ease-out;
    }

    .report-modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        padding-bottom: 16px;
        border-bottom: 1px solid #E4E6EB;
    }

    .report-modal-header h3 {
        margin: 0;
        color: #1C1E21;
        font-size: 20px;
        font-weight: 600;
    }

    .report-modal-close {
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        color: #65676B;
        padding: 0;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: background-color 0.2s;
    }

    .report-modal-close:hover {
        background-color: #F2F2F2;
    }

    .report-modal-body {
        margin-bottom: 20px;
    }

    .report-modal-footer {
        display: flex;
        gap: 12px;
        justify-content: flex-end;
        margin-top: 20px;
    }

    .report-modal-body .btn-primary {
        background-color: #00A651;
        border-color: #00A651;
    }

    .report-modal-body .btn-primary:hover {
        background-color: #008F47;
        border-color: #008F47;
    }

    .report-modal-body .alert-success {
        background-color: #D4EDDA;
        border-color: #C3E6CB;
        color: #155724;
    }

    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    @keyframes slideUp {
        from {
            transform: translateY(20px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    /* Mobile: Smooth scrolling like Facebook */
    @media (max-width: 768px) {
        .newsfeed-container {
            -webkit-overflow-scrolling: touch;
            scroll-behavior: smooth;
        }

        body {
            -webkit-overflow-scrolling: touch;
            scroll-behavior: smooth;
        }

        /* Facebook-like post spacing */
        .post-card {
            margin-bottom: 12px;
        }

        .post-card:last-child {
            margin-bottom: 0;
        }

        /* Better action buttons - keep all on same row */
        .post-actions {
            padding-top: 8px !important;
            margin-top: 8px !important;
            flex-wrap: nowrap !important;
            display: flex !important;
            gap: 4px !important;
        }

        .action-btn {
            font-size: 12px !important;
            padding: 8px 4px !important;
            flex: 1 !important;
            min-width: 0 !important;
            white-space: nowrap !important;
            overflow: hidden !important;
            text-overflow: ellipsis !important;
        }

        /* Comments section */
        .comments {
            padding-top: 12px;
            margin-top: 12px;
            border-top: 1px solid #E4E6EB;
        }

        .comment {
            padding: 8px 0;
        }

        .comment-form {
            margin-top: 12px;
            padding-top: 12px;
            border-top: 1px solid #E4E6EB;
        }

        /* Create post form */
        .create-post {
            padding: 12px !important;
            margin-bottom: 12px !important;
            width: 100% !important;
            max-width: 100% !important;
            box-sizing: border-box !important;
            margin-left: 0 !important;
            margin-right: 0 !important;
        }

        .create-post-form {
            gap: 8px !important;
            width: 100% !important;
            max-width: 100% !important;
            align-items: center !important;
        }

        .create-post-form .avatar-shell.composer-avatar {
            width: 40px !important;
            height: 40px !important;
            min-width: 40px !important;
            min-height: 40px !important;
            flex-shrink: 0 !important;
        }

        /* Media attachment area */
        .media-attachment-area {
            width: 100% !important;
            max-width: 100% !important;
            box-sizing: border-box !important;
        }

        /* Comments */
        .comments {
            width: 100% !important;
            max-width: 100% !important;
        }

        .comment {
            width: 100% !important;
            max-width: 100% !important;
            box-sizing: border-box !important;
        }

        .comment-form {
            width: 100% !important;
            max-width: 100% !important;
            box-sizing: border-box !important;
        }

        .comment-input {
            width: 100% !important;
            max-width: 100% !important;
            box-sizing: border-box !important;
        }

        /* Ensure no horizontal overflow */
        * {
            max-width: 100% !important;
            box-sizing: border-box !important;
        }

        img, video {
            max-width: 100% !important;
            height: auto !important;
        }
    }

    html.is-mobile-device .latest-news-sidebar,
    html.mobile-forced .latest-news-sidebar,
    body.is-mobile-device .latest-news-sidebar,
    body.mobile-forced .latest-news-sidebar {
        display: block !important;
        visibility: visible !important;
        position: fixed !important;
        top: 72px !important;
        right: 8px !important;
        left: 8px !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
        max-height: 38vh !important;
        overflow-y: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        z-index: 2147482000 !important;
    }

    /* Latest News Modal base state (mobile trigger can be forced by JS classes, not only width media queries) */
    .latest-news-modal {
        display: none !important;
        visibility: hidden !important;
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        width: min(88vw, 360px) !important;
        height: 100vh !important;
        background: #fff !important;
        z-index: 2147483646 !important;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        transform: translateX(100%) !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transition: transform 0.25s ease, opacity 0.25s ease !important;
        border-left: 1px solid #dbe3ea !important;
    }

    .latest-news-modal.show {
        display: block !important;
        visibility: visible !important;
        transform: translateX(0) !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .latest-news-modal-overlay {
        display: none !important;
        visibility: hidden !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        background: rgba(0, 0, 0, 0.45) !important;
        z-index: 2147483645 !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transition: opacity 0.25s ease !important;
    }

    .latest-news-modal-overlay.show {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    @media (min-width: 769px) and (max-width: 1280px) {
        .latest-news-sidebar {
            display: block !important;
            visibility: visible !important;
            position: sticky !important;
            top: calc(var(--ilearnzed-navbar-offset, 72px) + 12px) !important;
            right: auto !important;
            width: clamp(280px, 30vw, 360px) !important;
            max-width: 360px !important;
            min-width: 280px !important;
            max-height: calc(100vh - var(--ilearnzed-navbar-offset, 72px) - 20px) !important;
            overflow-y: auto !important;
            margin: 0 !important;
            padding: 0 !important;
            z-index: 10 !important;
        }



        .newsfeed-container {
            flex: 1 1 auto !important;
            max-width: 100% !important;
            padding-right: 0 !important;
        }



        /* Latest News Modal/Sidebar */
        .latest-news-modal {
            display: none;
            position: fixed;
            top: 0;
            right: 0;
            width: 100%;
            max-width: 360px;
            height: 100vh;
            background: white;
            z-index: 1001;
            box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            transform: translateX(100%);
            transition: transform 0.3s ease;
        }

        .latest-news-modal.show {
            display: block;
            transform: translateX(0);
        }

        .latest-news-modal-header {
            position: sticky;
            top: 0;
            background: white;
            padding: 16px;
            border-bottom: 1px solid #E4E6EB;
            display: flex;
            align-items: center;
            justify-content: space-between;
            z-index: 10;
        }

        .latest-news-modal-title {
            font-size: 18px;
            font-weight: 700;
            color: #050505;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .latest-news-modal-close {
            background: none;
            border: none;
            font-size: 24px;
            color: #65676B;
            cursor: pointer;
            padding: 4px;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: background-color 0.2s;
        }

        .latest-news-modal-close:hover {
            background: #F0F2F5;
        }

        .latest-news-modal-body {
            padding: 16px;
        }

        .latest-news-modal-overlay {
            display: none !important; /* Hidden by default */
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100vh;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .latest-news-modal-overlay.show {
            display: block !important; /* Only show when .show class is added on mobile */
            opacity: 1;
        }
    }

    /* Final mobile Latest News behavior:
       - Remove sidebar from feed layout
       - Show compact right-side button
       - Open drawer/modal from that button
    */
    @media (max-width: 1280px) {
        .latest-news-sidebar,
        .main-container > .latest-news-sidebar,
        html.is-mobile-device .latest-news-sidebar,
        html.mobile-forced .latest-news-sidebar,
        body.is-mobile-device .latest-news-sidebar,
        body.mobile-forced .latest-news-sidebar {
            display: none !important;
            visibility: hidden !important;
            pointer-events: none !important;
        }

        .newsfeed-container {
            padding-top: 0 !important;
        }

        .mobile-latest-news-btn,
        html.is-mobile-device .mobile-latest-news-btn,
        html.mobile-forced .mobile-latest-news-btn,
        body.is-mobile-device .mobile-latest-news-btn,
        body.mobile-forced .mobile-latest-news-btn {
            display: inline-flex !important;
            position: fixed !important;
            right: max(0px, env(safe-area-inset-right)) !important;
            top: calc(74px + env(safe-area-inset-top)) !important;
            bottom: auto !important;
            left: auto !important;
            transform: none !important;
            z-index: 2147483641 !important;
            width: auto !important;
            height: 48px !important;
            min-height: 48px !important;
            max-width: calc(100vw - 24px) !important;
            border-radius: 999px !important;
            padding: 0 16px !important;
            gap: 6px !important;
            align-items: center !important;
            justify-content: center !important;
            background: linear-gradient(135deg, #00A651 0%, #008F47 100%) !important;
            color: #fff !important;
            border: none !important;
            box-shadow: 0 6px 16px rgba(0, 166, 81, 0.4) !important;
            cursor: pointer !important;
        }

        .mobile-latest-news-btn i {
            display: inline-flex !important;
        }

        .mobile-latest-news-btn span {
            display: block !important;
            writing-mode: horizontal-tb !important;
            transform: none !important;
            text-orientation: mixed !important;
            font-size: 12px !important;
            font-weight: 700 !important;
            letter-spacing: 0.4px !important;
            line-height: 1 !important;
            white-space: nowrap !important;
        }

        .latest-news-modal {
            display: none !important;
            visibility: hidden !important;
            position: fixed !important;
            top: calc(68px + env(safe-area-inset-top)) !important;
            right: 0 !important;
            width: min(88vw, 360px) !important;
            height: calc(100vh - (68px + env(safe-area-inset-top))) !important;
            background: #fff !important;
            z-index: 2147483646 !important;
            box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2) !important;
            overflow-y: auto !important;
            -webkit-overflow-scrolling: touch !important;
            transform: translateX(100%) !important;
            opacity: 0 !important;
            pointer-events: none !important;
            transition: transform 0.25s ease, opacity 0.25s ease !important;
            border-left: 1px solid #dbe3ea !important;
            border-top-left-radius: 14px !important;
        }

        .latest-news-modal.show {
            display: block !important;
            visibility: visible !important;
            transform: translateX(0) !important;
            opacity: 1 !important;
            pointer-events: auto !important;
        }

        .latest-news-modal-overlay {
            display: none !important;
            visibility: hidden !important;
            position: fixed !important;
            top: 0 !important;
            left: 0 !important;
            width: 100% !important;
            height: 100vh !important;
            background: rgba(0, 0, 0, 0.45) !important;
            z-index: 2147483645 !important;
            opacity: 0 !important;
            pointer-events: none !important;
            transition: opacity 0.25s ease !important;
        }

        .latest-news-modal-overlay.show {
            display: block !important;
            visibility: visible !important;
            opacity: 1 !important;
            pointer-events: auto !important;
        }

        .latest-news-modal-header {
            position: sticky !important;
            top: 0 !important;
            z-index: 2 !important;
            display: flex !important;
            align-items: center !important;
            justify-content: space-between !important;
            gap: 10px !important;
            min-height: 64px !important;
            padding: 12px 14px !important;
            background: linear-gradient(135deg, #00A651 0%, #0288D1 100%) !important;
            border-bottom: none !important;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12) !important;
        }

        .latest-news-modal-title {
            display: inline-flex !important;
            align-items: center !important;
            gap: 8px !important;
            flex: 1 1 auto !important;
            min-width: 0 !important;
            margin: 0 !important;
            color: #fff !important;
            font-size: 16px !important;
            font-weight: 800 !important;
            letter-spacing: 0.2px !important;
            line-height: 1.25 !important;
            white-space: nowrap !important;
            overflow: hidden !important;
            text-overflow: ellipsis !important;
        }

        .latest-news-modal-title span:last-child {
            display: inline-block !important;
            transform: none !important;
        }

        .latest-news-modal-close {
            width: 34px !important;
            height: 34px !important;
            display: inline-flex !important;
            align-items: center !important;
            justify-content: center !important;
            flex-shrink: 0 !important;
            margin-left: auto !important;
            border-radius: 10px !important;
            background: rgba(255, 255, 255, 0.22) !important;
            color: #fff !important;
            border: 1px solid rgba(255, 255, 255, 0.3) !important;
            font-size: 20px !important;
            line-height: 1 !important;
        }

        .latest-news-modal-body {
            padding: 12px !important;
            background: #f2f5f8 !important;
            display: flex !important;
            flex-direction: column !important;
            gap: 10px !important;
        }

        .latest-news-modal-cta {
            margin-bottom: 2px !important;
        }

        .latest-news-view-all {
            display: inline-flex !important;
            align-items: center !important;
            gap: 6px !important;
            padding: 8px 12px !important;
            border-radius: 999px !important;
            background: #e8f6ee !important;
            color: #008f47 !important;
            font-size: 12px !important;
            font-weight: 700 !important;
            text-decoration: none !important;
            border: 1px solid #c9ead8 !important;
        }

        .latest-news-modal .news-item {
            margin-bottom: 0 !important;
            border: 1px solid #e3e9ef !important;
            border-radius: 14px !important;
            background: #fff !important;
            padding: 12px !important;
            box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06) !important;
        }

        .latest-news-modal .news-item:hover {
            background: #fff !important;
            transform: translateY(-1px) !important;
            box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1) !important;
            border-color: #d5dee8 !important;
        }

        .latest-news-modal .news-item-header {
            align-items: flex-start !important;
            margin-bottom: 8px !important;
            gap: 6px !important;
        }

        .latest-news-modal .news-title {
            font-size: 14px !important;
            line-height: 1.35 !important;
            font-weight: 700 !important;
            color: #0f172a !important;
        }

        .latest-news-modal .news-summary {
            margin-top: 0 !important;
            margin-bottom: 8px !important;
            font-size: 12px !important;
            line-height: 1.45 !important;
            color: #4b5563 !important;
            -webkit-line-clamp: 3 !important;
            line-clamp: 3 !important;
        }

        .latest-news-modal .news-meta {
            margin-top: 0 !important;
            gap: 6px !important;
            font-size: 11px !important;
            color: #64748b !important;
        }

        .latest-news-modal .news-date {
            gap: 5px !important;
            background: #eef8f3 !important;
            color: #008f47 !important;
            border: 1px solid #d6efe2 !important;
            border-radius: 999px !important;
            padding: 4px 8px !important;
            font-weight: 700 !important;
        }
    }

    .create-post {
        background: white;
        border-radius: 8px;
        padding: 12px;
        margin-bottom: 12px;
        box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    }

    .create-post-form {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .create-post textarea,
    .create-post #id_content {
        flex: 1;
        border: none !important;
        background: #F0F2F5 !important;
        border-radius: 20px !important;
        padding: 8px 16px !important;
        font-size: 15px !important;
        resize: none !important;
        min-height: 40px !important;
        font-family: inherit !important;
        width: 100% !important;
        box-shadow: none !important;
    }

    .create-post textarea:focus,
    .create-post #id_content:focus {
        outline: none !important;
        background: #E4E6EB !important;
        box-shadow: none !important;
    }

    .create-post input[type="text"] {
        flex: 1;
        border: none;
        background: #F0F2F5;
        border-radius: 20px;
        padding: 8px 16px;
        font-size: 15px;
        font-family: inherit;
    }

    .create-post input[type="text"]:focus {
        outline: none;
        background: #E4E6EB;
    }

    /* Media Attachment - Professional unified design */
    .media-attachment-area {
        margin-top: 12px;
        border-top: 1px solid #E4E6EB;
        padding-top: 12px;
    }

    .media-attachment-bar {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0;
        background: #F7F8FA;
        border-radius: 10px;
        overflow: hidden;
        border: 1px solid #E4E6EB;
    }

    .media-attachment-btn {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 12px 20px;
        cursor: pointer;
        color: #65676B;
        font-weight: 500;
        font-size: 14px;
        transition: all 0.2s ease;
        border: none;
        background: transparent;
        min-height: 44px;
    }

    .media-attachment-btn:hover {
        background: #E8F5E9;
        color: #00A651;
    }

    .media-attachment-btn i {
        font-size: 18px;
        opacity: 0.9;
    }

    .media-attachment-divider {
        width: 1px;
        height: 24px;
        background: #E4E6EB;
        flex-shrink: 0;
    }

    /* Drag and drop visual feedback */
    .media-attachment-area.dragover .media-attachment-bar {
        border-color: #00A651;
        background: #E8F5E9;
        box-shadow: 0 0 0 2px rgba(0, 166, 81, 0.2);
    }

    .media-attachment-area.dragover .media-attachment-btn {
        color: #00A651;
    }

    /* File Preview - Professional card layout */
    .file-preview-container {
        margin-top: 12px;
        position: relative;
        border-radius: 12px;
        overflow: hidden;
        background: #fff;
        border: 1px solid #E4E6EB;
        box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    }

    .file-preview-wrapper {
        display: flex;
        flex-direction: column;
    }

    .file-preview-img {
        width: 100%;
        max-height: 400px;
        object-fit: contain;
        background: #000;
        display: block;
    }

    #image-preview.composer-preview-hidden {
        display: none !important;
    }

    .gallery-preview-grid {
        display: none;
    }

    .gallery-preview-grid.post-gallery {
        width: 100% !important;
        display: block !important;
        margin: 0;
        border: 0;
        border-radius: 0 !important;
        box-shadow: none;
    }

    .create-post .gallery-preview-grid.post-gallery {
        max-width: none !important;
        margin: 0 !important;
    }

    .post-gallery {
        position: relative;
        overflow: hidden;
        border-radius: 8px;
        background: #0f172a;
        border: 1px solid #e5e7eb;
        aspect-ratio: 4 / 3;
        max-height: 640px;
    }

    .post-gallery-track {
        display: flex;
        height: 100%;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        scrollbar-width: none;
    }

    .post-gallery-track::-webkit-scrollbar {
        display: none;
    }

    .post-gallery-slide {
        min-width: 100%;
        height: 100%;
        scroll-snap-align: start;
        position: relative;
        background: #0f172a;
    }

    .post-gallery-slide::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(90deg, #111827 25%, #1f2937 50%, #111827 75%);
        background-size: 220% 100%;
        animation: gallery-shimmer 1.2s infinite;
        opacity: 0.52;
    }

    .post-gallery-slide.is-loaded::before,
    .post-gallery-slide.is-error::before {
        display: none;
    }

    .post-gallery-slide.is-error::after {
        content: "Image could not be displayed";
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 18px;
        color: #475569;
        font-size: 13px;
        font-weight: 700;
        text-align: center;
        background: #f8fafc;
    }

    @keyframes gallery-shimmer {
        0% { background-position: 220% 0; }
        100% { background-position: -220% 0; }
    }

    .post-gallery-slide img {
        position: relative;
        z-index: 1;
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
        margin: 0 auto;
        background: #0f172a;
        cursor: zoom-in;
    }

    .post-gallery-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 38px;
        height: 38px;
        border-radius: 999px;
        border: 1px solid rgba(255,255,255,0.36);
        background: rgba(15,23,42,0.72);
        color: #fff;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 2;
    }

    .post-gallery-nav.prev { left: 10px; }
    .post-gallery-nav.next { right: 10px; }

    .post-gallery-count {
        position: absolute;
        right: 12px;
        bottom: 12px;
        z-index: 2;
        border-radius: 999px;
        padding: 5px 10px;
        background: rgba(15,23,42,0.76);
        color: #fff;
        font-size: 12px;
        font-weight: 800;
    }

    .post-gallery-dots {
        position: absolute;
        left: 50%;
        bottom: 12px;
        transform: translateX(-50%);
        display: flex;
        align-items: center;
        gap: 5px;
        z-index: 2;
        padding: 4px 7px;
        border-radius: 999px;
        background: rgba(15,23,42,0.38);
    }

    .post-gallery-dots button.post-gallery-dot {
        all: unset;
        box-sizing: border-box;
        display: block;
        width: 5px !important;
        height: 5px !important;
        min-width: 5px !important;
        min-height: 5px !important;
        max-width: 5px !important;
        max-height: 5px !important;
        border-radius: 999px;
        border: 0;
        padding: 0 !important;
        margin: 0 !important;
        line-height: 0 !important;
        flex: 0 0 5px !important;
        background: rgba(255,255,255,0.56);
        cursor: pointer;
    }

    .post-gallery-dots button.post-gallery-dot.active {
        width: 13px !important;
        min-width: 13px !important;
        max-width: 13px !important;
        flex-basis: 13px !important;
        background: #fff;
    }

    .gallery-lightbox {
        position: fixed;
        inset: 0;
        z-index: 10050;
        display: none;
        background: rgba(2, 6, 23, 0.94);
        color: #fff;
    }

    .gallery-lightbox.open {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .gallery-lightbox-image {
        max-width: min(96vw, 1180px);
        max-height: 88vh;
        object-fit: contain;
        border-radius: 8px;
        box-shadow: 0 24px 80px rgba(0,0,0,0.35);
    }

    .gallery-lightbox-close,
    .gallery-lightbox-nav {
        position: absolute;
        border: 1px solid rgba(255,255,255,0.24);
        background: rgba(15,23,42,0.72);
        color: #fff;
        border-radius: 999px;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .gallery-lightbox-close {
        top: 18px;
        right: 18px;
        width: 42px;
        height: 42px;
    }

    .gallery-lightbox-nav {
        top: 50%;
        transform: translateY(-50%);
        width: 46px;
        height: 46px;
    }

    .gallery-lightbox-nav.prev { left: 18px; }
    .gallery-lightbox-nav.next { right: 18px; }

    .gallery-lightbox-count {
        position: absolute;
        left: 50%;
        bottom: 18px;
        transform: translateX(-50%);
        border-radius: 999px;
        padding: 7px 12px;
        background: rgba(15,23,42,0.76);
        color: #fff;
        font-size: 13px;
        font-weight: 800;
    }

    .file-preview-video {
        width: 100%;
        max-height: 400px;
        border-radius: 0;
        display: block;
        background: #000;
    }

    .file-preview-info {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 14px;
        background: #F7F8FA;
        border-top: 1px solid #E4E6EB;
        font-size: 13px;
        color: #65676B;
    }

    .file-preview-name {
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
    }

    .file-preview-remove {
        display: flex;
        align-items: center;
        justify-content: center;
        background: #fff;
        border: 1px solid #E4E6EB;
        color: #C62828;
        cursor: pointer;
        font-size: 14px;
        width: 32px;
        height: 32px;
        border-radius: 8px;
        flex-shrink: 0;
        transition: all 0.2s ease;
    }

    .file-preview-remove:hover {
        background: #FFEBEE;
        color: #A62323;
        border-color: #FFCDD2;
    }

    /* Mobile responsive - Media attachment */
    @media (max-width: 768px) {
        .media-attachment-area {
            margin-top: 10px;
            padding-top: 10px;
        }

        .media-attachment-bar {
            flex-direction: row;
            border-radius: 8px;
        }

        .media-attachment-btn {
            padding: 14px 16px;
            font-size: 13px;
            min-height: 48px;
        }

        .media-attachment-btn i {
            font-size: 20px;
        }

        .file-preview-container {
            margin-top: 10px;
            border-radius: 10px;
        }

        .file-preview-img,
        .file-preview-video {
            max-height: 280px;
        }

        .post-gallery-slide img {
            max-height: none;
            height: auto;
            min-height: 0;
            object-fit: contain;
            background: transparent;
        }

        .post-gallery {
            aspect-ratio: auto;
            height: auto;
            min-height: 0;
            background: transparent;
        }

        .post-gallery-nav {
            display: none;
        }

        .post-gallery-slide {
            height: auto;
            min-height: 0;
            background: transparent;
        }

        .post-gallery-slide::before {
            background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
            opacity: 0.42;
        }

        .post-gallery-dots {
            bottom: 9px;
            gap: 4px;
            padding: 3px 6px;
            background: rgba(15,23,42,0.28);
        }

        .gallery-lightbox-nav {
            width: 42px;
            height: 42px;
        }

        .file-preview-info {
            padding: 10px 12px;
            gap: 8px;
        }

        .file-preview-name {
            white-space: normal;
            word-wrap: break-word;
            text-overflow: clip;
            overflow: visible;
            font-size: 12px;
        }

        .file-preview-remove {
            width: 36px;
            height: 36px;
            min-width: 36px;
        }
    }

    .create-post-btn {
        background: #00A651;
        color: white;
        border: none;
        padding: 8px 16px;
        border-radius: 6px;
        cursor: pointer;
        font-weight: 600;
        transition: background-color 0.2s ease;
    }

    .create-post-btn:hover {
        background: #008F47;
    }

    .comments {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #E4E6EB;
    }

    .comment {
        display: flex;
        gap: 8px;
        margin-bottom: 8px;
    }

    .comment-avatar {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        object-fit: cover;
    }

    .comment-content {
        flex: 1;
        background: #F0F2F5;
        border-radius: 18px;
        padding: 8px 12px;
    }

    .comment-author {
        font-weight: 600;
        font-size: 13px;
        color: #050505;
        margin-right: 6px;
    }

    .comment-text {
        font-size: 14px;
        color: #050505;
    }

    .comment-form {
        display: flex;
        gap: 8px;
        margin-top: 8px;
    }

    .comment-input {
        flex: 1;
        border: none;
        background: #F0F2F5;
        border-radius: 20px;
        padding: 8px 12px;
        font-size: 14px;
    }

    .error {
        color: red;
        font-size: 14px;
        margin: 8px 0;
    }

    /* Loading indicator */
    .loading-indicator {
        text-align: center;
        padding: 20px;
        color: #65676B;
        font-size: 14px;
    }

    .loading-spinner {
        display: inline-block;
        width: 20px;
        height: 20px;
        border: 3px solid #E4E6EB;
        border-top-color: #00A651;
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
        margin-right: 8px;
    }

    @keyframes spin {
        to { transform: rotate(360deg); }
    }

    /* Infinite scroll trigger */
    .scroll-trigger {
        height: 72px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .scroll-trigger .skeleton-card,
    .scroll-trigger .feed-loading-status {
        display: none;
    }

    .scroll-trigger.is-loading {
        height: auto;
        min-height: 72px;
        display: block;
    }

    .scroll-trigger.is-loading .skeleton-card {
        display: block;
    }

    .scroll-trigger.is-loading .feed-loading-status {
        display: block;
    }

    .feed-loading-status {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .scroll-prefetch-trigger {
        height: 1px;
        width: 100%;
        pointer-events: none;
    }

    /* Smooth scrollbar */
    ::-webkit-scrollbar {
        width: 8px;
    }

    ::-webkit-scrollbar-track {
        background: #f1f1f1;
    }

    ::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 4px;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: #555;
    }

    /* Posts container */
    #posts-container {
        min-height: 100vh;
    }

    /* Latest News Section - Sidebar Version */
    .latest-news-section {
        background: white;
        border-radius: 12px;
        padding: 16px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        width: 100%;
    }

    /* Latest News in Sidebar */
    .latest-news-sidebar .latest-news-section {
        margin-bottom: 0;
        position: relative;
    }

    .latest-news-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 12px;
        padding-bottom: 12px;
        border-bottom: 1px solid #E4E6EB;
    }

    .latest-news-title {
        font-size: 18px;
        font-weight: 700;
        color: #050505;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .latest-news-title::before {
        content: "📰";
        font-size: 20px;
    }

    .view-all-news {
        color: #00A651;
        text-decoration: none;
        font-size: 14px;
        font-weight: 600;
    }

    .view-all-news:hover {
        color: #008F47;
        text-decoration: underline;
    }

    .news-item {
        padding: 12px;
        border-radius: 8px;
        margin-bottom: 8px;
        transition: background-color 0.2s ease;
        cursor: pointer;
        border: 1px solid transparent;
    }

    .news-item:hover {
        background-color: #F0F2F5;
        border-color: #E4E6EB;
    }

    .news-item:last-child {
        margin-bottom: 0;
    }

    .news-item-header {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 6px;
    }

    .news-pin-icon {
        color: #00A651;
        font-size: 12px;
    }

    .news-title {
        font-weight: 600;
        font-size: 14px;
        color: #050505;
        text-decoration: none;
        flex: 1;
        line-height: 1.3;
    }

    .news-title:hover {
        color: #00A651;
    }

    .news-summary {
        font-size: 12px;
        color: #65676B;
        line-height: 1.4;
        margin-top: 6px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .news-meta {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-top: 8px;
        font-size: 12px;
        color: #65676B;
    }

    .news-date {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    /* Quick Links Bar */
    .quick-links-bar {
        display: flex;
        gap: 12px;
        padding: 12px;
        background: white;
        border-radius: 12px;
        margin-bottom: 16px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.08);
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
    }

    .quick-link-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 16px;
        background: #F0F2F5;
        border: 1px solid #E4E6EB;
        border-radius: 8px;
        color: #050505;
        text-decoration: none;
        font-size: 14px;
        font-weight: 600;
        transition: all 0.2s ease;
        white-space: nowrap;
    }

    .quick-link-btn:hover {
        background: #E4E6EB;
        border-color: #00A651;
        color: #00A651;
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .quick-link-btn i {
        font-size: 16px;
        color: #00A651;
    }

    .quick-link-btn:hover i {
        color: #00A651;
    }

    /* Desktop: make the three quick links fill the full row evenly */
    @media (min-width: 769px) {
        .quick-links-bar {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 12px;
            align-items: stretch;
        }

        .quick-link-btn {
            width: 100%;
            justify-content: center;
            text-align: center;
            padding: 12px 14px;
            min-height: 48px;
        }
    }

    /* Mobile: Stack quick links */
    @media (max-width: 768px) {
        .quick-links-bar {
            padding: 10px !important;
            gap: 8px !important;
            margin-bottom: 12px !important;
            flex-wrap: wrap !important;
        }

        .quick-link-btn {
            flex: 1 !important;
            min-width: calc(50% - 4px) !important;
            padding: 10px 12px !important;
            font-size: 13px !important;
            justify-content: center !important;
        }

        .quick-link-btn span {
            white-space: normal !important;
            word-wrap: break-word !important;
        }
    }

    /* iPhone SE & small phones (≤414px) - Enhanced visibility */
    @media (max-width: 414px) {
        /* Post menu (3 dots) - More prominent, easier to tap */
        .post-menu-trigger {
            width: 48px !important;
            height: 48px !important;
            min-width: 48px !important;
            min-height: 48px !important;
            padding: 12px !important;
            font-size: 22px !important;
            color: #050505 !important;
            background: #E4E6EB !important;
            -webkit-tap-highlight-color: rgba(0, 166, 81, 0.2) !important;
        }

        .post-menu-trigger i {
            font-size: 22px !important;
        }

        /* Dropdown at bottom of screen - always visible on iPhone SE */
        .post-menu-wrapper.open .post-menu-dropdown {
            bottom: 24px !important;
            width: calc(100vw - 24px) !important;
            max-width: 340px !important;
        }

        .post-menu-item {
            padding: 18px 20px !important;
            font-size: 16px !important;
            min-height: 52px !important;
        }

        .post-menu-item i {
            font-size: 20px !important;
            width: 28px !important;
        }

        /* Media attachment - Add Photo/Video - More visible */
        .media-attachment-area {
            margin-top: 12px !important;
            padding-top: 12px !important;
            border-top-width: 2px !important;
        }

        .media-attachment-bar {
            border-width: 2px !important;
            border-color: #00A651 !important;
            background: linear-gradient(135deg, #F0F9F4 0%, #E8F5E9 100%) !important;
        }

        .media-attachment-btn {
            padding: 16px 12px !important;
            font-size: 15px !important;
            font-weight: 600 !important;
            min-height: 52px !important;
            color: #008F47 !important;
        }

        .media-attachment-btn i {
            font-size: 22px !important;
        }

        /* Action buttons - Like, Comment - Better tap targets */
        .post-actions {
            padding-top: 10px !important;
            margin-top: 10px !important;
            gap: 6px !important;
        }

        .action-btn {
            padding: 12px 8px !important;
            font-size: 14px !important;
            min-height: 44px !important;
        }

        /* Quick links - More prominent on small screens */
        .quick-links-bar {
            padding: 12px !important;
            gap: 10px !important;
        }

        .quick-link-btn {
            padding: 12px 14px !important;
            font-size: 14px !important;
            min-height: 48px !important;
        }
    }
    /* Mobile layout overrides */
    @media (max-width: 768px) {
        .feed-shell {
            display: flex !important;
            flex-direction: column !important;
            gap: 16px !important;
            padding: 12px !important;
        }

        .left-sidebar, .latest-news-sidebar {
            width: 100% !important;
            max-width: 100% !important;
            margin-bottom: 12px !important;
            position: relative !important;
            top: 0 !important;
            display: block !important;
            padding: 0 !important;
        }

        /* Profile Card Optimization */
        .hub-profile-card {
            padding: 24px 16px !important;
            display: flex !important;
            flex-direction: column !important;
            align-items: center !important;
            text-align: center !important;
        }

        .hub-profile-avatar {
            width: 88px !important;
            height: 88px !important;
            object-fit: cover !important;
            border-radius: 50% !important;
            margin: 0 auto 12px !important;
            border: 3px solid #fff !important;
            box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
        }

        .hub-sidebar-stats {
            justify-content: center !important;
            gap: 32px !important;
            width: 100% !important;
            border-top: 1px solid var(--hub-border-subtle) !important;
            padding-top: 16px !important;
            margin-top: 12px !important;
        }

        /* Responsive Sidebar Nav */
        .hub-nav-list {
            display: grid !important;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
            gap: 10px !important;
            padding: 12px !important;
        }

        .hub-nav-link {
            justify-content: center !important;
            padding: 12px 10px !important;
            background: #fff !important;
            border: 1px solid var(--hub-border-subtle) !important;
            border-radius: 12px !important;
            font-size: 14px !important;
        }


    }

    /* iPhone SE Specific Fixes */
    @media (max-width: 414px) {
        .hub-nav-list {
            grid-template-columns: 1fr !important;
        }
        .hub-profile-avatar {
            width: 72px !important;
            height: 72px !important;
        }
        .action-btn {
            padding: 10px 6px !important;
            font-size: 13px !important;
        }
        .post-menu-trigger {
            width: 44px !important;
            height: 44px !important;
        }
    }

    /* Final interaction polish: like/comment bar and comment thread */
    .post-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding-top: 10px;
        margin-top: 10px;
    }

    .action-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 42px;
        padding: 10px 12px;
        border-radius: 10px;
        border: 1px solid #dde7df;
        background: #ffffff;
        color: #4f6358;
        font-size: 13px;
        font-weight: 700;
        line-height: 1;
        white-space: nowrap;
        transition: 0.16s ease;
    }

    .action-btn i {
        font-size: 15px;
    }

    .action-btn .action-label {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .action-btn .action-count {
        min-width: 20px;
        height: 20px;
        padding: 0 5px;
        border-radius: 999px;
        background: #ecf4ee;
        color: #2f5b41;
        font-size: 11px;
        font-weight: 700;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }

    .action-btn:hover {
        background: #f5faf6;
        border-color: #cfe4d5;
        color: #274235;
    }

    .action-btn.liked {
        color: #008f47;
        border-color: #b8dfc8;
        background: #eff9f2;
    }

    .action-btn.liked .action-count,
    .action-btn.comments-open .action-count {
        background: rgba(0, 166, 81, 0.14);
        color: #006b35;
    }

    .toggle-like-btn .action-count {
        background: #00a651;
        color: #ffffff;
    }

    .toggle-like-btn.liked .action-count {
        background: #008f47;
        color: #ffffff;
    }

    .action-btn.comments-open {
        color: #0d6840;
        border-color: #badfc9;
        background: #f1faf4;
    }

    .comments {
        margin-top: 10px;
        padding: 10px;
        border: 1px solid #e3ece5;
        border-radius: 12px;
        background: #f8fbf8;
    }

    .comment {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 8px;
        padding: 8px;
        border: 1px solid #e6efe7;
        border-radius: 10px;
        background: #ffffff;
    }

    .comment-content {
        flex: 1;
        min-width: 0;
        background: transparent;
        border-radius: 0;
        padding: 0;
    }

    .comment-text {
        color: #2a3c31;
        word-break: break-word;
    }

    .comment-form {
        display: grid;
        grid-template-columns: 30px minmax(0, 1fr) auto;
        gap: 8px;
        align-items: center;
        margin-top: 8px;
    }

    .comment-input {
        min-height: 38px;
        padding: 9px 12px !important;
        border-radius: 999px !important;
        border: 1px solid #d3dfd6 !important;
        background: #ffffff !important;
    }

    .comment-form .create-post-btn {
        min-height: 38px;
        padding: 8px 14px !important;
        border-radius: 999px !important;
        font-size: 12px !important;
        white-space: nowrap;
    }

    .delete-comment-btn {
        background: none;
        border: none;
        color: #c62828;
        cursor: pointer;
        font-size: 12px;
        font-weight: 700;
        line-height: 1;
        padding: 4px 0;
        align-self: center;
    }

    .delete-comment-btn:hover {
        color: #9f1a1a;
        text-decoration: underline;
    }

    /* Final mobile feed rework: full-width, media-first, profile-free header */
    @media (max-width: 768px) {
        html,
        body {
            scroll-behavior: auto !important;
            overscroll-behavior-y: contain;
        }

        body .main-content.container-fluid,
        body .main-content {
            padding-left: 0 !important;
            padding-right: 0 !important;
            margin-left: 0 !important;
            margin-right: 0 !important;
        }

        .main-container.feed-shell {
            display: block !important;
            width: 100% !important;
            max-width: 100% !important;
            margin-left: 0 !important;
            margin-right: 0 !important;
            padding: 0 !important;
            gap: 0 !important;
        }

        .left-sidebar,
        .latest-news-sidebar,
        .mobile-latest-news-btn {
            display: none !important;
        }

        .newsfeed-container,
        .newsfeed-container > .container {
            width: 100% !important;
            max-width: 100% !important;
            margin-left: 0 !important;
            margin-right: 0 !important;
            padding: 0 !important;
        }

        .quick-links-bar {
            margin: 0 !important;
            padding: 10px 12px !important;
            border-radius: 0 !important;
            border-left: 0 !important;
            border-right: 0 !important;
            box-shadow: none !important;
        }

        .create-post,
        .post-card {
            border-radius: 0 !important;
            border-left: 0 !important;
            border-right: 0 !important;
            box-shadow: none !important;
        }

        .create-post {
            margin: 8px 0 !important;
            padding: 12px !important;
        }

        .post-card {
            margin: 0 0 8px !important;
            padding: 12px !important;
        }

        .post-content {
            font-size: 0.95rem !important;
            line-height: 1.48 !important;
        }

        .post-actions {
            display: grid !important;
            grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
            gap: 6px !important;
            padding-top: 8px !important;
            margin-top: 8px !important;
        }

        .action-btn {
            width: 100% !important;
            max-width: none !important;
            min-height: 44px !important;
            padding: 10px 6px !important;
            border-radius: 10px !important;
            gap: 6px !important;
        }

        .action-btn .action-label {
            font-size: 0.82rem !important;
        }

        .action-btn .action-count {
            min-width: 18px;
            height: 18px;
            padding: 0 4px;
            font-size: 0.7rem;
        }

        .comments {
            margin-top: 8px !important;
            padding: 8px !important;
            border-radius: 10px !important;
        }

        .comment {
            padding: 7px !important;
            border-radius: 9px !important;
        }

        .comment-form {
            grid-template-columns: 24px minmax(0, 1fr) auto !important;
            gap: 6px !important;
        }

        .comment-form .create-post-btn {
            min-height: 34px !important;
            padding: 7px 10px !important;
            font-size: 12px !important;
        }

        .post-media,
        .post-video {
            width: calc(100% + 24px) !important;
            max-width: none !important;
            margin-left: -12px !important;
            margin-right: -12px !important;
            margin-bottom: 10px !important;
            border-radius: 0 !important;
            max-height: none !important;
            aspect-ratio: 4 / 5;
            object-fit: cover !important;
            background: #0f1720 !important;
        }

        .scroll-trigger {
            height: 84px !important;
        }

        #end-of-feed {
            padding: 18px 12px !important;
        }
    }

    /* Feed media fit: keep the full frame visible instead of cropping images or videos. */
    #newsfeed-feed-root img.post-media,
    img.post-media {
        width: 100% !important;
        height: auto !important;
        max-height: min(78vh, 760px) !important;
        aspect-ratio: auto !important;
        object-fit: contain !important;
        object-position: center center !important;
        background: #000 !important;
    }

    #newsfeed-feed-root video.post-video,
    video.post-video {
        width: 100% !important;
        height: auto !important;
        max-height: min(78vh, 760px) !important;
        aspect-ratio: auto !important;
        object-fit: contain !important;
        object-position: center center !important;
        background: #000 !important;
    }

    @media (max-width: 768px) {
        #newsfeed-feed-root img.post-media,
        img.post-media,
        #newsfeed-feed-root video.post-video,
        video.post-video {
            width: calc(100% + 24px) !important;
            max-width: none !important;
            margin-left: -12px !important;
            margin-right: -12px !important;
            max-height: 78svh !important;
            border-radius: 0 !important;
        }
    }

    /* Premium fit consistency layer */
    .newsfeed-container > .container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto;
    }

    .newsfeed-container > .container > .quick-links-bar,
    .newsfeed-container > .container > .create-post,
    .newsfeed-container > .container > .post-card,
    .newsfeed-container > .container > .scroll-trigger,
    .newsfeed-container > .container > #end-of-feed {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
    }

    @media (min-width: 769px) {
        .newsfeed-container > .container {
            max-width: 100% !important;
        }
    }

    @media (max-width: 768px) {
        .newsfeed-container > .container {
            padding-bottom: max(12px, env(safe-area-inset-bottom));
        }
    }

    /* Premium composer media actions: Photo / Video */
    .create-post .media-attachment-area {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #e4ece6;
    }

    .create-post .media-attachment-bar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .create-post .social-action-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        min-height: 42px;
        margin: 0;
        padding: 10px 12px;
        border: 1px solid #dfe7e2;
        border-radius: 999px;
        background: #f9fbfa;
        color: #294636;
        font-size: 14px;
        font-weight: 700;
        letter-spacing: 0;
        white-space: nowrap;
        cursor: pointer;
        box-shadow: none;
        transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
    }

    .create-post .social-action-btn:hover {
        transform: translateY(-1px);
        border-color: #b9d5c3;
        background: #ffffff;
        box-shadow: 0 6px 14px rgba(17, 70, 40, 0.08);
    }

    .create-post .social-action-btn i {
        font-size: 16px;
    }

    .create-post .social-action-btn.photo {
        color: #166e3b;
        background: #f3fbf6;
    }

    .create-post .social-action-btn.video {
        color: #8f2438;
        background: #fff7f8;
    }

    @media (max-width: 768px) {
        .create-post .media-attachment-bar {
            gap: 8px;
        }

        .create-post .social-action-btn {
            min-height: 40px;
            padding: 9px 8px;
            font-size: 13px;
            gap: 6px;
        }
    }

    @media (max-width: 380px) {
        .create-post .social-action-btn {
            font-size: 12px;
            padding: 9px 6px;
        }
    }

    /* Mobile full-bleed feed: maximize viewport usage with clean alignment */
    @media (max-width: 768px) {
        html.is-mobile-device body .main-content.container-fluid,
        html.mobile-forced body .main-content.container-fluid,
        body .main-content.container-fluid,
        body .main-content {
            padding-left: 0 !important;
            padding-right: 0 !important;
            margin-left: 0 !important;
            margin-right: 0 !important;
        }

        #newsfeed-feed-root.main-container,
        #newsfeed-feed-root.main-container.feed-shell {
            width: 100% !important;
            max-width: 100% !important;
            margin: 0 !important;
            padding: 0 !important;
            gap: 0 !important;
            display: block !important;
        }

        #newsfeed-feed-root .newsfeed-container,
        #newsfeed-feed-root .newsfeed-container > .container {
            width: 100% !important;
            max-width: 100% !important;
            margin: 0 !important;
            padding: 0 !important;
            padding-inline: 0 !important;
        }

        #newsfeed-feed-root .quick-links-bar,
        #newsfeed-feed-root .create-post {
            width: 100% !important;
            margin: 0 0 8px 0 !important;
            border-left: 0 !important;
            border-right: 0 !important;
            border-radius: 0 !important;
            box-shadow: none !important;
            border-top: 0 !important;
            border-bottom: 1px solid #dfe8df !important;
        }

        #newsfeed-feed-root .post-card {
            width: 100% !important;
            margin: 0 !important;
            border-left: 0 !important;
            border-right: 0 !important;
            border-radius: 0 !important;
            box-shadow: none !important;
            border-top: 0 !important;
            border-bottom: 1px solid #dfe8df !important;
        }

        #newsfeed-feed-root .quick-links-bar,
        #newsfeed-feed-root .create-post,
        #newsfeed-feed-root .post-card {
            padding-left: 12px !important;
            padding-right: 12px !important;
        }

        #newsfeed-feed-root .post-card {
            padding-top: 12px !important;
            padding-bottom: 10px !important;
            overflow: hidden !important;
        }

        #newsfeed-feed-root .post-media,
        #newsfeed-feed-root .post-video {
            width: calc(100% + 24px) !important;
            max-width: none !important;
            margin: 0 -12px 10px -12px !important;
            border-radius: 0 !important;
            aspect-ratio: auto !important;
            height: auto !important;
            display: block !important;
        }

        #newsfeed-feed-root .post-gallery {
            width: calc(100% + 24px) !important;
            max-width: none !important;
            margin: 0 -12px 10px -12px !important;
            border-radius: 0 !important;
            aspect-ratio: auto !important;
            height: auto !important;
            min-height: 0 !important;
            background: transparent !important;
            overflow: hidden !important;
        }

        #newsfeed-feed-root .post-gallery-track,
        #newsfeed-feed-root .post-gallery-slide {
            height: auto !important;
            min-height: 0 !important;
            background: transparent !important;
        }

        #newsfeed-feed-root .post-gallery-slide img {
            display: block !important;
            opacity: 1 !important;
            visibility: visible !important;
            width: 100% !important;
            height: auto !important;
            max-width: none !important;
            max-height: 78svh !important;
            object-fit: contain !important;
            object-position: center center !important;
            background: transparent !important;
            transform: none !important;
            animation: none !important;
        }

        #newsfeed-feed-root .post-gallery-dots {
            bottom: 8px !important;
            gap: 4px !important;
            padding: 3px 6px !important;
            background: rgba(15,23,42,0.26) !important;
        }

        #newsfeed-feed-root .post-gallery-dots button.post-gallery-dot {
            width: 5px !important;
            height: 5px !important;
            min-width: 5px !important;
            min-height: 5px !important;
            max-width: 5px !important;
            max-height: 5px !important;
            flex: 0 0 5px !important;
            padding: 0 !important;
            margin: 0 !important;
        }

        #newsfeed-feed-root .post-gallery-dots button.post-gallery-dot.active {
            width: 12px !important;
            min-width: 12px !important;
            max-width: 12px !important;
            flex-basis: 12px !important;
        }

        #newsfeed-feed-root .post-video {
            max-height: min(78svh, 78vh) !important;
            object-fit: contain !important;
            background: #000 !important;
        }

        #newsfeed-feed-root .newsfeed-container > .container > .post-card + .post-card {
            margin-top: 1px !important;
        }
    }

    /* Desktop premium refinement layer */
    @media (min-width: 1200px) {
        #newsfeed-feed-root .left-sidebar {
            gap: 18px;
        }

        #newsfeed-feed-root .left-sidebar-card,
        #newsfeed-feed-root .trending-card,
        #newsfeed-feed-root .suggested-card,
        #newsfeed-feed-root .latest-news-section,
        #newsfeed-feed-root .quick-links-bar,
        #newsfeed-feed-root .create-post,
        #newsfeed-feed-root .post-card {
            border-radius: 16px;
            border-color: #d9e7dc;
            box-shadow: 0 10px 28px rgba(20, 59, 33, 0.08), 0 1px 0 rgba(255, 255, 255, 0.75) inset;
        }

        #newsfeed-feed-root .left-sidebar-card {
            background: linear-gradient(180deg, #ffffff 0%, #fbfefc 100%);
            padding: 22px 18px;
        }

        #newsfeed-feed-root .hub-profile-avatar {
            width: 92px;
            height: 92px;
            border: 3px solid rgba(255, 255, 255, 0.95);
            box-shadow: 0 12px 22px rgba(16, 55, 31, 0.18);
            margin-bottom: 14px;
        }

        #newsfeed-feed-root .hub-profile-name {
            font-size: 16px;
            font-weight: 800;
            letter-spacing: 0.01em;
            margin-bottom: 6px;
        }

        #newsfeed-feed-root .hub-profile-role {
            font-size: 13px;
            color: #5f7867;
        }

        #newsfeed-feed-root .hub-sidebar-stats {
            gap: 10px;
            text-align: center;
        }

        #newsfeed-feed-root .hub-sidebar-stats > div {
            border-radius: 12px;
            border: 1px solid #dce9df;
            background: #f5fbf7;
            padding: 10px 12px;
        }

        #newsfeed-feed-root .sidebar-stat-value {
            font-size: 20px;
            font-weight: 800;
            line-height: 1.1;
            margin-bottom: 4px;
        }

        #newsfeed-feed-root .sidebar-stat-label {
            font-size: 11px;
            letter-spacing: 0.04em;
            text-transform: uppercase;
            color: #6d8473;
        }

        #newsfeed-feed-root .hub-nav-list {
            gap: 10px;
        }

        #newsfeed-feed-root .hub-nav-link {
            border: 1px solid transparent;
            border-radius: 12px;
            background: #ffffff;
            padding: 12px 14px;
            font-weight: 600;
            transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
        }

        #newsfeed-feed-root .hub-nav-link:hover {
            transform: translateX(2px);
            border-color: rgba(34, 197, 94, 0.24);
            background: #f6fcf8;
            box-shadow: 0 8px 16px rgba(16, 55, 31, 0.08);
        }

        #newsfeed-feed-root .hub-nav-link.active {
            border-color: rgba(34, 197, 94, 0.34);
            background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(34, 197, 94, 0.07));
            color: #15924f;
            box-shadow: 0 6px 14px rgba(34, 197, 94, 0.16);
        }

        #newsfeed-feed-root .hub-section-label {
            letter-spacing: 0.11em;
            font-weight: 700;
            font-size: 10px;
        }

        #newsfeed-feed-root .subject-chip {
            border-radius: 999px;
            border-color: #d2e5d9;
            background: #f3faf5;
            color: #476554;
            padding: 4px 11px;
            font-size: 11px;
            font-weight: 600;
        }

        #newsfeed-feed-root .subject-chip:hover {
            border-color: #a6c9b5;
            background: #ecf8f0;
            color: #294636;
        }

        #newsfeed-feed-root .follow-btn {
            border-color: #c8ddcd;
            background: #ffffff;
            box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75) inset;
        }

        #newsfeed-feed-root .follow-btn:hover {
            background: #eef9f2;
            border-color: #8ec6a3;
            color: #157f47;
            box-shadow: 0 6px 14px rgba(21, 127, 71, 0.12);
        }
    }

    /* Desktop navbar/feed safety gap lock: keep permanent breathing room while scrolling */
    @media (min-width: 992px) {
        #newsfeed-feed-root.main-container.feed-shell {
            padding-top: max(22px, var(--hub-desktop-nav-gap)) !important;
        }

        #newsfeed-feed-root .left-sidebar,
        #newsfeed-feed-root .latest-news-sidebar {
            top: calc(var(--ilearnzed-navbar-offset, 72px) + var(--hub-desktop-nav-gap)) !important;
        }
    }

    /* ==========================================================================
       MODERN SCROLLABLE FEED & PERFORMANCE POLISH (SPRINT 3 UPGRADES)
       ========================================================================== */

    /* 1. DOM Rendering Performance Optimization */
    #newsfeed-feed-root .post-card {
        content-visibility: visible;
        contain-intrinsic-size: auto;
    }

    /* 3. Opportunities Sidebar Widget & Mobile Pill Styling */
    .opportunity-widget-item {
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
        border: 1px solid var(--hub-border-subtle, #e4e6eb) !important;
    }
    .opportunity-widget-item:hover {
        border-color: var(--hub-accent, #00A651) !important;
        background: var(--hub-surface-3, #f0fdf4) !important;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 166, 81, 0.08);
    }

    .mobile-opportunities-pill {
        display: none !important;
    }

    @media (max-width: 767px) {
        .mobile-opportunities-pill,
        html.is-mobile-device .mobile-opportunities-pill,
        html.mobile-forced .mobile-opportunities-pill,
        body.is-mobile-device .mobile-opportunities-pill,
        body.mobile-forced .mobile-opportunities-pill {
            display: inline-flex !important;
            position: fixed !important;
            right: calc(16px + env(safe-area-inset-right)) !important;
            bottom: calc(20px + env(safe-area-inset-bottom)) !important;
            top: auto !important;
            left: auto !important;
            z-index: 2147483640 !important;
            height: 42px !important;
            min-height: 42px !important;
            border-radius: 999px !important;
            padding: 0 18px !important;
            gap: 8px !important;
            align-items: center !important;
            justify-content: center !important;
            background: #ffffff !important;
            color: #0f172a !important;
            font-weight: 700 !important;
            font-size: 13px !important;
            text-decoration: none !important;
            border: 1px solid #dbe3ea !important;
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
            -webkit-tap-highlight-color: transparent !important;
        }

        .mobile-opportunities-pill i {
            font-size: 14px !important;
            color: var(--hub-accent, #00A651) !important;
        }

        .mobile-opportunities-pill:active {
            transform: scale(0.96) !important;
            background: #f8fafc !important;
            border-color: var(--hub-accent, #00A651) !important;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
        }
    }

    /* 2. Skeleton Loader Styling */
    .skeleton-card {
        background: #ffffff !important;
        border: 1px solid #e4e6eb !important;
        border-radius: var(--card-radius, 8px) !important;
        padding: 16px !important;
        margin-bottom: 16px !important;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    }
    .skeleton-header {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 16px;
    }
    .skeleton-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
    }
    .skeleton-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
    .skeleton-line {
        height: 12px;
        background: #e4e6eb;
        border-radius: 6px;
    }
    .skeleton-line.short {
        width: 35%;
    }
    .skeleton-line.medium {
        width: 60%;
    }
    .skeleton-line.long {
        width: 85%;
    }
    .skeleton-body {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 16px;
    }
    .skeleton-media {
        height: 200px;
        background: #e4e6eb;
        border-radius: 8px;
        margin-bottom: 12px;
    }

    /* Shimmer effect animation */
    @keyframes shimmer {
        0% { background-position: -200% 0; }
        100% { background-position: 200% 0; }
    }
    .skeleton-shimmer {
        background: linear-gradient(90deg, #f0f2f5 25%, #e4e6eb 50%, #f0f2f5 75%) !important;
        background-size: 200% 100% !important;
        animation: shimmer 1.5s infinite linear !important;
    }

    @media (prefers-reduced-motion: reduce) {
        .skeleton-shimmer {
            animation: none !important;
            background: #e4e6eb !important;
        }
    }

    /* 3. Sticky Columns Layout Polish */
    @media (min-width: 992px) {
        #newsfeed-feed-root .left-sidebar,
        #newsfeed-feed-root .latest-news-sidebar {
            position: sticky !important;
            max-height: calc(100vh - 110px) !important;
            overflow-y: auto !important;
            scrollbar-width: none; /* Hide scrollbars for sidebars to keep clean */
        }
        #newsfeed-feed-root .left-sidebar::-webkit-scrollbar,
        #newsfeed-feed-root .latest-news-sidebar::-webkit-scrollbar {
            display: none;
        }
    }

    /* 4. Opportunity Widgets & Pills */
    .opportunities-sticky-card {
        background: #ffffff;
        border: 1px solid #CED0D4;
        border-radius: 8px;
        padding: 16px;
        margin-bottom: 16px;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        transition: transform 0.2s, box-shadow 0.2s;
    }
    .opportunities-sticky-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }
    .opp-card-title {
        font-size: 0.95rem;
        font-weight: 700;
        color: #050505;
        margin-bottom: 12px;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .opp-card-title i {
        color: #00A651; /* Zambian Green */
    }
    .opp-card-item {
        padding: 8px 0;
        border-bottom: 1px dashed #E4E6EB;
    }
    .opp-card-item:last-child {
        border-bottom: none;
    }
    .opp-item-name {
        font-size: 0.85rem;
        font-weight: 600;
        color: #050505;
        text-decoration: none;
    }
    .opp-item-name:hover {
        text-decoration: underline;
        color: #00A651;
    }
    .opp-item-meta {
        font-size: 0.75rem;
        color: #65676B;
        margin-top: 2px;
        display: flex;
        justify-content: space-between;
    }

    /* 5. Spacing Polish for devices under 768px (Mobile Spacing) */
    @media (max-width: 768px) {
        #newsfeed-feed-root .container {
            padding-left: 8px !important;
            padding-right: 8px !important;
        }
        #newsfeed-feed-root .post-card {
            border-radius: 0 !important; /* Edge-to-edge card feeling on narrow viewports like FB mobile */
            border-left: none !important;
            border-right: none !important;
            margin-bottom: 8px !important;
            padding: 12px 10px !important;
        }
        #newsfeed-feed-root .post-actions {
            padding: 4px 0 !important;
        }
        #newsfeed-feed-root .action-btn {
            font-size: 0.84rem !important;
        }
        #newsfeed-feed-root .action-label {
            display: inline !important; /* Ensure labels are readable but concise on mobile */
        }
    }

    /* Desktop composer/filter fit: keep mobile rail untouched below 769px. */
    @media (min-width: 769px) {
        #newsfeed-feed-root .feed-filter-search-zone .feed-filter-bar {
            display: grid !important;
            grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
            gap: 8px !important;
            overflow: visible !important;
            padding: 0 !important;
            scroll-snap-type: none !important;
        }

        #newsfeed-feed-root .feed-filter-search-zone .feed-filter-chip {
            width: 100% !important;
            min-width: 0 !important;
            max-width: 100% !important;
            min-height: 34px !important;
            padding: 0 10px !important;
            gap: 6px !important;
            overflow: hidden !important;
            text-decoration: none !important;
        }

        #newsfeed-feed-root .feed-filter-chip span {
            min-width: 0 !important;
            overflow: hidden !important;
            text-overflow: ellipsis !important;
        }

        #newsfeed-feed-root .newsfeed-container > .container {
            padding-left: 16px !important;
            padding-right: 16px !important;
        }

        #newsfeed-feed-root .create-post {
            padding: 18px 16px 20px !important;
            margin-bottom: 12px !important;
        }

        #newsfeed-feed-root .create-post-form {
            padding: 0 !important;
            gap: 12px !important;
        }

        #newsfeed-feed-root .create-post .media-attachment-area {
            margin-top: 14px !important;
            padding-top: 14px !important;
        }

        #newsfeed-feed-root .create-post .media-attachment-bar {
            display: grid !important;
            grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
            gap: 10px !important;
            width: 100% !important;
            background: transparent !important;
            border: 0 !important;
            border-radius: 0 !important;
            overflow: visible !important;
        }

        #newsfeed-feed-root .create-post .social-action-btn {
            width: 100% !important;
            min-width: 0 !important;
            min-height: 54px !important;
            padding: 0 12px !important;
            border: 1px solid #dce8df !important;
            border-radius: 999px !important;
            display: inline-flex !important;
            align-items: center !important;
            justify-content: center !important;
            gap: 8px !important;
            white-space: nowrap !important;
            overflow: hidden !important;
        }
    }

    @media (min-width: 769px) and (max-width: 1024px) {
        #newsfeed-feed-root.main-container.feed-shell {
            grid-template-columns: minmax(0, 1fr) !important;
        }
    }

    @media (min-width: 1025px) and (max-width: 1280px) {
        #newsfeed-feed-root.main-container.feed-shell {
            grid-template-columns: 190px minmax(0, 1fr) 240px !important;
            gap: 16px !important;
        }

        #newsfeed-feed-root .latest-news-sidebar {
            display: block !important;
            visibility: visible !important;
            opacity: 1 !important;
            pointer-events: auto !important;
            min-width: 0 !important;
            width: 240px !important;
        }

        #newsfeed-feed-root .left-sidebar {
            display: flex !important;
        }

        #newsfeed-feed-root .feed-filter-chip {
            padding: 0 6px !important;
            gap: 4px !important;
        }

        #newsfeed-feed-root .feed-filter-chip i,
        #newsfeed-feed-root .feed-filter-chip span {
            font-size: 0.72rem !important;
        }
    }


/* ===== Mobile final fix layer (was <style id="newsfeed-mobile-final-fix">; must stay after base rules) ===== */
@media (max-width: 768px) {
    html.is-mobile-device,
    html.mobile-forced,
    html.pwa-mobile,
    html {
        height: auto !important;
        min-height: 100% !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        scrollbar-gutter: auto !important;
    }

    body.is-mobile-device,
    body.mobile-forced,
    body.pwa-mobile,
    body {
        width: 100vw !important;
        max-width: 100vw !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        height: auto !important;
        min-height: 100svh !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
    }

    body.is-mobile-device .main-content.container-fluid,
    body.mobile-forced .main-content.container-fluid,
    body.pwa-mobile .main-content.container-fluid {
        width: 100vw !important;
        max-width: 100vw !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        transform: translateX(calc(-1 * max(0px, (100vw - 100%) / 2))) !important;
    }

    #newsfeed-feed-root,
    #newsfeed-feed-root .newsfeed-container,
    #newsfeed-feed-root .newsfeed-container > .container {
        width: 100vw !important;
        max-width: 100vw !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        overflow-x: clip !important;
        overflow-y: visible !important;
        contain: none !important;
    }

    #newsfeed-feed-root .feed-filter-search-zone {
        width: 100%;
        margin: 0 0 14px;
        padding: 0 16px;
        background: transparent;
        border: none;
        box-sizing: border-box;
    }

    #newsfeed-feed-root .feed-search-label {
        display: block;
        margin: 0 0 6px;
        font-size: 13px;
        font-weight: 500;
        color: #6b7280;
    }

    #newsfeed-feed-root .feed-post-search-wrap {
        position: relative;
        display: flex;
        align-items: center;
        width: 100%;
        height: 40px;
        background: #ffffff;
        border: 1.5px solid #e5e7eb;
        border-radius: 8px;
        transition: border-color 200ms ease, box-shadow 200ms ease;
        box-sizing: border-box;
        font-size: 0;
        line-height: 0;
    }

    #newsfeed-feed-root .feed-post-search-wrap:focus-within {
        border-color: #22c55e;
        box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
    }

    #newsfeed-feed-root .feed-post-search-icon {
        position: absolute;
        left: 12px;
        color: #9ca3af;
        font-size: 16px;
        line-height: 1;
        pointer-events: none;
    }

    #newsfeed-feed-root .feed-post-search-input {
        flex: 1;
        width: 100%;
        height: 100%;
        /* !important: beat the global mobile input rule (mobile-responsive.css)
           that forces padding:0.75rem and pushes text under the search icon. */
        padding: 0 40px 0 38px !important;
        border: 0;
        background: transparent;
        color: #1f2937;
        font-size: 14px;
        font-weight: 400;
        outline: none;
    }

    #newsfeed-feed-root .feed-post-search-input::placeholder {
        color: #6b7280;
    }

    #newsfeed-feed-root .feed-post-search-clear {
        position: absolute;
        right: 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 26px;
        height: 26px;
        border: 0;
        border-radius: 50%;
        background: rgba(107, 114, 128, 0.12);
        color: #6b7280;
        cursor: pointer;
        transition: background 200ms ease, color 200ms ease;
    }

    #newsfeed-feed-root .feed-post-search-clear:hover {
        background: rgba(34, 197, 94, 0.14);
        color: #16a34a;
    }

    #newsfeed-feed-root .feed-filter-search-zone .feed-filter-bar {
        margin-top: 10px;
        margin-bottom: 0;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        min-height: 0 !important;
        box-shadow: none !important;
        gap: 8px !important;
    }

    #newsfeed-feed-root .feed-filter-search-zone .feed-filter-chip {
        min-height: 34px !important;
        padding: 0 12px !important;
        font-size: 13px !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 999px !important;
        background: #ffffff !important;
        color: #374151 !important;
    }

    #newsfeed-feed-root .feed-filter-search-zone .feed-filter-chip.active {
        background: #22c55e !important;
        border-color: #22c55e !important;
        color: #ffffff !important;
    }

    #newsfeed-feed-root .feed-filter-search-zone .feed-filter-chip:not(.active):hover {
        background: #f0fdf4 !important;
    }

    #newsfeed-feed-root .feed-search-empty-state {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 28px 20px;
        gap: 10px;
    }

    #newsfeed-feed-root .feed-search-empty-icon {
        color: #9ca3af;
        font-size: 32px;
        line-height: 1;
    }

    #newsfeed-feed-root .feed-search-empty-title {
        margin: 0;
        font-size: 15px;
        font-weight: 500;
        color: #6b7280;
    }

    #newsfeed-feed-root .feed-search-empty-clear {
        margin-top: 4px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #22c55e;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        text-decoration: underline;
        text-underline-offset: 2px;
    }

    #newsfeed-feed-root .feed-filter-bar {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 6px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 60px !important;
        margin: 0 !important;
        padding: 8px 10px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        overscroll-behavior-x: contain !important;
        scroll-snap-type: x proximity !important;
        scroll-padding-inline: 10px !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 0 !important;
        border-left: 0 !important;
        border-right: 0 !important;
    }

    #newsfeed-feed-root .quick-links-bar {
        padding-top: 6px !important;
        padding-bottom: 6px !important;
        margin-bottom: 0 !important;
    }

    #newsfeed-feed-root .feed-filter-bar::-webkit-scrollbar {
        display: none !important;
    }

    #newsfeed-feed-root .feed-filter-chip {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: 68px !important;
        max-width: none !important;
        min-height: 44px !important;
        padding: 0 12px !important;
        gap: 5px !important;
        white-space: nowrap !important;
        justify-content: center !important;
        scroll-snap-align: start !important;
    }

    #newsfeed-feed-root .feed-filter-chip i,
    #newsfeed-feed-root .feed-filter-chip span {
        flex: 0 0 auto !important;
        font-size: 0.8rem !important;
        line-height: 1 !important;
    }

    #newsfeed-feed-root .post-gallery {
        overflow: hidden !important;
        contain: none !important;
    }

    #newsfeed-feed-root .post-gallery-track {
        display: flex !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        overscroll-behavior-x: contain !important;
        scroll-snap-type: x mandatory !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
    }

    #newsfeed-feed-root .post-gallery-track::-webkit-scrollbar {
        display: none !important;
    }

    #newsfeed-feed-root .post-gallery-slide {
        flex: 0 0 100% !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        scroll-snap-align: center !important;
    }

    #newsfeed-feed-root .post-gallery-slide img,
    #newsfeed-feed-root img.post-media {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: min(58svh, 430px) !important;
        object-fit: contain !important;
    }

    #newsfeed-feed-root video.post-video {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 170px !important;
        height: auto !important;
        max-height: min(48svh, 360px) !important;
        object-fit: contain !important;
    }

    #newsfeed-feed-root .post-actions {
        min-height: 52px !important;
        padding: 6px 0 !important;
        gap: 6px !important;
    }

    #newsfeed-feed-root .action-btn {
        min-height: 44px !important;
        border-radius: 12px !important;
        padding: 0 8px !important;
        font-size: 0.83rem !important;
        gap: 6px !important;
    }

    #newsfeed-feed-root .action-btn i {
        font-size: 0.92rem !important;
    }

    #newsfeed-feed-root .action-count {
        min-width: 26px !important;
        height: 26px !important;
        font-size: 0.76rem !important;
    }

    #newsfeed-feed-root .post-learning-tags {
        gap: 6px !important;
        padding: 0 0 8px !important;
        overflow-x: auto !important;
        scrollbar-width: none !important;
    }

    #newsfeed-feed-root .post-learning-tags::-webkit-scrollbar {
        display: none !important;
    }

    #newsfeed-feed-root .post-learning-tag {
        min-height: 24px !important;
        padding: 3px 9px !important;
        font-size: 0.7rem !important;
        white-space: nowrap !important;
        flex: 0 0 auto !important;
    }

    #newsfeed-feed-root .post-poll-card {
        margin: 0 0 8px !important;
        padding: 12px !important;
        border-radius: 14px !important;
    }

    #newsfeed-feed-root .post-poll-kicker {
        margin-bottom: 6px !important;
        font-size: 0.72rem !important;
    }

    #newsfeed-feed-root .post-poll-question {
        margin-bottom: 9px !important;
        font-size: 0.94rem !important;
        line-height: 1.32 !important;
        font-weight: 800 !important;
    }

    #newsfeed-feed-root .post-poll-options {
        gap: 7px !important;
    }

    #newsfeed-feed-root .post-poll-option {
        min-height: 44px !important;
        padding: 0 10px !important;
        border-radius: 11px !important;
        gap: 8px !important;
    }

    #newsfeed-feed-root .post-poll-option-main {
        gap: 7px !important;
        font-size: 0.9rem !important;
        line-height: 1.18 !important;
    }

    #newsfeed-feed-root .post-poll-result,
    #newsfeed-feed-root .post-poll-hint,
    #newsfeed-feed-root .post-poll-total {
        margin-top: 8px !important;
        font-size: 0.78rem !important;
    }

    #newsfeed-feed-root .mastery-challenge-card {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        padding-bottom: 12px !important;
    }

    #newsfeed-feed-root .mastery-challenge-card[data-rendered="true"] {
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        animation: none !important;
    }

    #newsfeed-feed-root .mastery-card-body {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
    }

    #newsfeed-feed-root .mastery-options {
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }
}

/* ===== Scroll rendering performance =====
   Off-screen post cards skip layout/paint entirely; the placeholder size keeps
   the scrollbar stable. Big win on long feeds and low-end devices. */
#newsfeed-posts-list .post-card {
    content-visibility: auto;
    contain-intrinsic-size: auto 420px;
}
