/* ==========================================================================
   App shell: shared top bar, account menu and design tokens
   Used by every layout except the Million Dollar Project landing page.
   Everything is prefixed `mdx-` so it never collides with Bootstrap,
   Tailwind or the older per-page stylesheets.
   ========================================================================== */

@font-face {
    font-family: 'Figtree';
    src: url('../fonts/Figtree/Figtree-VariableFont_wght.ttf') format('truetype');
    font-weight: 300 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter Tight';
    src: url('../fonts/Inter_Tight/InterTight-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --mdx-brand-1: #ac95f8;
    --mdx-brand-2: #7c6dae;
    --mdx-brand-gradient: linear-gradient(135deg, #ac95f8 0%, #7c6dae 100%);
    --mdx-brand-tint: #efeafe;
    --mdx-pink: #fd4380;
    --mdx-cosmic: #14121f;
    --mdx-ink: var(--dk-tx-0f172a,#0f172a);
    --mdx-text: var(--dk-tx-334155,#334155);
    --mdx-muted: #94a3b8;
    --mdx-muted-strong: var(--dk-tx-64748b,#64748b);
    --mdx-border: var(--dk-bd-e2e8f0,#e2e8f0);
    --mdx-page: var(--dk-bg-f8fafc,#f8fafc);
    --mdx-surface: var(--dk-bg-ffffff,#ffffff);
    --mdx-radius: 12px;
    --mdx-radius-sm: 8px;
    --mdx-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.04);
    --mdx-shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.16);
    --mdx-font: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --mdx-font-display: 'Inter Tight', 'Figtree', system-ui, sans-serif;
    --mdx-topbar-h: 64px;
}

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */
.mdx-topbar {
    position: relative;
    z-index: 10000000;
    font-family: var(--mdx-font);
    font-size: 15px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
}

.mdx-topbar *,
.mdx-topbar *::before,
.mdx-topbar *::after {
    box-sizing: border-box;
}

/* Some legacy stylesheets colour every element (`* { color: ... }`);
   inside the bar, colour flows from the bar unless a rule below sets it. */
.mdx-topbar * {
    color: inherit;
    font-family: inherit;
}

.mdx-topbar .bi::before {
    font-family: bootstrap-icons !important;
}

.mdx-topbar a {
    text-decoration: none;
}

.mdx-topbar-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    height: var(--mdx-topbar-h);
    padding: 0 24px;
    max-width: 1440px;
    margin: 0 auto;
}

/* Light variant: white bar for light pages */
.mdx-topbar--light {
    background: var(--mdx-surface);
    border-bottom: 1px solid var(--mdx-border);
    color: var(--mdx-text);
}

/* Dark variant: sits on the cosmic hero bands */
.mdx-topbar--dark {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.86);
}

.mdx-topbar--dark.mdx-topbar--solid {
    background: var(--mdx-cosmic);
}

/* Logo */
.mdx-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 10px;
    color: inherit;
}

.mdx-logo img {
    display: block;
    height: 40px;
    width: auto;
    max-width: 210px;
    object-fit: contain;
}

.mdx-topbar--light .mdx-logo-img--light-on-dark {
    filter: invert(1);
}

.mdx-topbar--dark .mdx-logo-img--dark-on-light {
    filter: invert(1);
}

.mdx-logo-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--mdx-brand-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mdx-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.mdx-logo-text strong {
    font-family: var(--mdx-font-display);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--mdx-ink);
    white-space: nowrap;
}

.mdx-topbar--dark .mdx-logo-text strong {
    color: #fff;
}

.mdx-logo-text small {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--mdx-brand-2);
}

/* Primary navigation */
.mdx-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 auto;
}

.mdx-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 14.5px;
    font-weight: 600;
    color: inherit;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.mdx-topbar--light .mdx-nav-link {
    color: var(--mdx-text);
}

.mdx-topbar--light .mdx-nav-link:hover {
    background: var(--mdx-page);
    color: var(--mdx-ink);
}

.mdx-topbar--light .mdx-nav-link.is-active {
    background: var(--mdx-brand-tint);
    color: var(--mdx-brand-2);
}

.mdx-topbar--dark .mdx-nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.mdx-topbar--dark .mdx-nav-link.is-active {
    background: rgba(172, 149, 248, 0.24);
    color: #fff;
}

/* Right-hand actions */
.mdx-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.mdx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 18px;
    border-radius: 999px;
    font-family: var(--mdx-font);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.mdx-btn--primary {
    background: var(--mdx-brand-gradient);
    color: #fff !important;
    box-shadow: 0 6px 16px rgba(124, 109, 174, 0.3);
}

.mdx-btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(124, 109, 174, 0.38);
}

.mdx-btn--ghost {
    background: transparent;
    border-color: var(--mdx-border);
    color: var(--mdx-ink) !important;
}

.mdx-btn--ghost:hover {
    background: var(--mdx-page);
}

.mdx-topbar--dark .mdx-btn--ghost {
    border-color: var(--dk-bd-ffffff73,rgba(255, 255, 255, 0.45));
    color: #fff !important;
}

.mdx-topbar--dark .mdx-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.12);
}

.mdx-icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: background 0.15s ease;
}

.mdx-topbar--light .mdx-icon-btn {
    color: var(--mdx-muted-strong);
}

.mdx-topbar--light .mdx-icon-btn:hover {
    background: var(--mdx-page);
    color: var(--mdx-ink);
}

.mdx-topbar--dark .mdx-icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.mdx-icon-btn svg {
    width: 20px;
    height: 20px;
}

.mdx-count {
    position: absolute;
    top: 4px;
    right: 3px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--mdx-pink);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--mdx-surface);
}

.mdx-topbar--dark .mdx-count {
    box-shadow: 0 0 0 2px var(--mdx-cosmic);
}

/* Account button + menu */
.mdx-account {
    position: relative;
}

.mdx-account-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: 42px;
    padding: 0 10px 0 4px;
    border-radius: 999px;
    border: 1px solid var(--mdx-border);
    background: var(--mdx-surface);
    color: var(--mdx-ink);
    font-family: var(--mdx-font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: box-shadow 0.15s ease;
}

.mdx-account-btn:hover,
.mdx-account.is-open .mdx-account-btn {
    box-shadow: 0 0 0 3px var(--mdx-brand-tint);
}

.mdx-topbar--dark .mdx-account-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.mdx-topbar--dark .mdx-account-btn:hover,
.mdx-topbar--dark .mdx-account.is-open .mdx-account-btn {
    box-shadow: 0 0 0 3px rgba(172, 149, 248, 0.35);
}

.mdx-avatar {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--mdx-brand-gradient);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.mdx-avatar img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
}

.mdx-account-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mdx-chevron {
    width: 16px;
    height: 16px;
    opacity: 0.7;
    transition: transform 0.15s ease;
}

.mdx-account.is-open .mdx-chevron {
    transform: rotate(180deg);
}

.mdx-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 290px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    background: var(--mdx-surface);
    border: 1px solid var(--mdx-border);
    border-radius: 14px;
    box-shadow: var(--mdx-shadow-lg);
    padding: 6px;
    color: var(--mdx-text);
    display: none;
    text-align: left;
}

.mdx-account.is-open .mdx-menu {
    display: block;
}

.mdx-menu-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px 14px;
    border-bottom: 1px solid var(--mdx-border);
    margin-bottom: 6px;
}

.mdx-menu-head .mdx-avatar {
    width: 40px;
    height: 40px;
    font-size: 16px;
}

.mdx-menu-head strong {
    display: block;
    color: var(--mdx-ink);
    font-size: 15px;
    line-height: 1.3;
}

.mdx-menu-head > div > span {
    display: block;
    color: var(--mdx-muted-strong);
    font-size: 12.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.mdx-menu-label {
    padding: 10px 12px 4px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--mdx-muted);
}

.mdx-menu a,
.mdx-menu button.mdx-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border-radius: var(--mdx-radius-sm);
    border: 0;
    background: none;
    color: var(--mdx-text);
    font-family: var(--mdx-font);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.mdx-menu a:hover,
.mdx-menu button.mdx-menu-item:hover {
    background: var(--mdx-page);
    color: var(--mdx-ink);
}

.mdx-menu a .mdx-menu-icon,
.mdx-menu button .mdx-menu-icon {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.mdx-menu a .mdx-count-inline {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--mdx-pink);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

.mdx-menu-divider {
    height: 1px;
    background: var(--mdx-border);
    margin: 6px 4px;
}

.mdx-menu form {
    margin: 0;
}

.mdx-menu .mdx-menu-item--danger {
    color: var(--dk-tx-dc2626,#dc2626);
}

.mdx-menu .mdx-menu-item--danger:hover {
    background: var(--dk-bg-fef2f2,#fef2f2);
    color: var(--dk-tx-b91c1c,#b91c1c);
}

/* Mobile toggle */
.mdx-burger {
    display: none;
}

/* Secondary row (Meta Daily Y X pages, marketplace links) */
.mdx-subnav {
    border-top: 1px solid var(--mdx-border);
    background: var(--mdx-surface);
}

.mdx-topbar--dark .mdx-subnav {
    border-top-color: rgba(255, 255, 255, 0.1);
    background: transparent;
}

.mdx-subnav-inner {
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: 1440px;
    margin: 0 auto;
    padding: 6px 24px;
}

/* Only scroll sideways on small screens, so desktop dropdowns are never clipped */
@media (max-width: 767.98px) {
    .mdx-subnav-inner {
        overflow-x: auto;
        scrollbar-width: none;
    }
}

.mdx-subnav-inner::-webkit-scrollbar {
    display: none;
}

.mdx-subnav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--mdx-radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--mdx-muted-strong);
    white-space: nowrap;
    background: none;
    border: 0;
    cursor: pointer;
}

.mdx-subnav-link:hover {
    color: var(--mdx-ink);
    background: var(--mdx-page);
}

.mdx-subnav-link.is-active {
    color: var(--mdx-brand-2);
    background: var(--mdx-brand-tint);
    font-weight: 600;
}

.mdx-topbar--dark .mdx-subnav-link {
    color: rgba(255, 255, 255, 0.72);
}

.mdx-topbar--dark .mdx-subnav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.mdx-topbar--dark .mdx-subnav-link.is-active {
    color: #fff;
    background: rgba(172, 149, 248, 0.24);
}

.mdx-subnav-spacer {
    flex: 1;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1199.98px) {
    .mdx-topbar-inner {
        gap: 12px;
        padding: 0 16px;
    }

    .mdx-nav {
        display: none;
    }

    .mdx-burger {
        display: inline-flex;
        order: 3;
    }

    .mdx-actions {
        margin-left: auto;
    }

    .mdx-topbar.is-nav-open .mdx-nav {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        position: absolute;
        top: calc(var(--mdx-topbar-h) - 4px);
        left: 12px;
        right: 12px;
        margin: 0;
        padding: 8px;
        background: var(--mdx-surface);
        border: 1px solid var(--mdx-border);
        border-radius: 14px;
        box-shadow: var(--mdx-shadow-lg);
    }

    .mdx-topbar.is-nav-open .mdx-nav-link {
        color: var(--mdx-text);
        border-radius: var(--mdx-radius-sm);
        padding: 12px 14px;
    }

    .mdx-topbar.is-nav-open .mdx-nav-link.is-active {
        background: var(--mdx-brand-tint);
        color: var(--mdx-brand-2);
    }

    .mdx-subnav-inner {
        padding: 6px 16px;
    }
}

@media (max-width: 640px) {
    .mdx-logo img {
        height: 32px;
        max-width: 140px;
    }

    .mdx-logo-text small {
        display: none;
    }

    .mdx-logo-text strong {
        font-size: 15px;
    }

    .mdx-account-name,
    .mdx-account-btn .mdx-chevron,
    .mdx-hide-sm {
        display: none;
    }

    .mdx-account-btn {
        padding: 0 4px;
    }

    .mdx-btn {
        height: 34px;
        padding: 0 12px;
        font-size: 13px;
    }

    .mdx-menu {
        position: fixed;
        top: calc(var(--mdx-topbar-h) + 4px);
        left: 12px;
        right: 12px;
        width: auto;
    }
}

/* ==========================================================================
   Community: Social Feed polish (scoped to the feed list, not the post modal)
   ========================================================================== */
.community-app-body .feed-container {
    background: var(--mdx-page);
    padding: 28px 24px 48px;
}

.community-app-body .feed-layout {
    display: grid;
    grid-template-columns: minmax(0, 660px) 300px;
    gap: 28px;
    justify-content: center;
    align-items: start;
}

.community-app-body .feed-wrapper {
    max-width: none;
    margin: 0;
    min-width: 0;
}

/* Composer */
.community-app-body .feed-header {
    background: var(--mdx-surface);
    border: 1px solid var(--mdx-border);
    border-radius: 14px;
    box-shadow: var(--mdx-shadow);
    padding: 16px 18px;
    gap: 16px;
}

.feed-composer-prompt {
    display: inline-block;
    margin-top: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--mdx-page);
    border: 1px solid var(--mdx-border);
    color: var(--mdx-muted-strong) !important;
    font-size: 13.5px;
    text-decoration: none;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.feed-composer-prompt:hover {
    border-color: var(--mdx-brand-1);
    color: var(--mdx-brand-2) !important;
}

.community-app-body #th-btn {
    background: var(--mdx-brand-gradient) !important;
    color: #fff !important;
    font-size: 13.5px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 999px;
    box-shadow: 0 6px 16px rgba(124, 109, 174, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.community-app-body #th-btn img {
    filter: brightness(0) invert(1);
    width: 16px;
}

/* Posts as cards */
.posts-feed > .post-card {
    background: var(--mdx-surface);
    border: 1px solid var(--mdx-border);
    border-radius: 14px;
    box-shadow: var(--mdx-shadow);
    padding: 18px 20px 14px;
    margin-bottom: 16px;
}

.posts-feed > .post-card:hover {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
}

/* Quiet post buttons instead of solid black squares */
.posts-feed .btn-pin {
    background: var(--mdx-surface) !important;
    border: 1px solid var(--mdx-border) !important;
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.posts-feed .btn-pin:hover {
    background: var(--mdx-page) !important;
}

.posts-feed .btn-pin img {
    filter: none;
    width: 18px;
}

/* Right rail */
.feed-rail {
    position: sticky;
    top: calc(var(--mdx-topbar-h) + 24px);
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-family: var(--mdx-font);
}

.feed-rail * {
    font-family: inherit;
}

.rail-card {
    background: var(--mdx-surface);
    border: 1px solid var(--mdx-border);
    border-radius: 14px;
    box-shadow: var(--mdx-shadow);
    padding: 16px 18px;
    color: var(--mdx-text);
}

.rail-card--cosmic {
    background: radial-gradient(120% 120% at 100% 0%, #2a2142 0%, var(--mdx-cosmic) 60%);
    border-color: transparent;
    color: #fff;
}

.rail-eyebrow {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--mdx-brand-1);
}

.rail-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--mdx-ink);
    margin-bottom: 10px;
}

.rail-element-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 12px 0 14px;
}

.rail-element-row strong {
    display: block;
    font-size: 16px;
    color: #fff;
}

.rail-element-row small {
    display: block;
    font-size: 12.5px;
    color: var(--mdx-muted);
}

.rail-element-row--light {
    margin-top: 0;
}

.rail-element-row--light strong {
    color: var(--mdx-ink);
}

.rail-symbol {
    font-family: var(--mdx-font-display) !important;
    font-size: 44px;
    font-weight: 800;
    line-height: 1;
    color: var(--mdx-pink);
    min-width: 56px;
}

.rail-symbol--light {
    font-size: 30px;
    min-width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--mdx-brand-tint);
    color: var(--mdx-brand-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rail-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--mdx-brand-1) !important;
    text-decoration: none;
}

.rail-link--light {
    color: var(--mdx-brand-2) !important;
}

.rail-small-link {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--mdx-brand-2) !important;
    text-decoration: none;
}

.rail-notif {
    display: flex;
    gap: 10px;
    padding: 9px 6px;
    margin: 0 -6px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--mdx-text) !important;
    font-size: 13px;
    line-height: 1.4;
}

.rail-notif:hover {
    background: var(--mdx-page);
}

.rail-notif small {
    display: block;
    color: var(--mdx-muted);
    font-size: 11.5px;
    margin-top: 2px;
}

.rail-notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
    background: var(--mdx-border);
}

.rail-notif.is-unread .rail-notif-dot {
    background: var(--mdx-pink);
}

.rail-empty {
    font-size: 13px;
    color: var(--mdx-muted);
    margin: 0;
}

@media (max-width: 1279.98px) {
    .community-app-body .feed-layout {
        grid-template-columns: minmax(0, 660px);
    }

    .feed-rail {
        display: none;
    }
}

@media (max-width: 640px) {
    .community-app-body .feed-container {
        padding: 16px 12px 40px;
    }

    .community-app-body .feed-header {
        flex-wrap: wrap;
    }
}

/* Bootstrap dropdowns inside the top bar's second row (marketplace EBID Portal) */
.mdx-subnav .dropdown-toggle::after {
    margin-left: 4px;
    vertical-align: 2px;
}

.mdx-dropdown {
    border-radius: 12px;
    border: 1px solid var(--mdx-border);
    padding: 6px;
    font-family: var(--mdx-font);
    font-size: 14px;
    min-width: 230px;
    z-index: 10000001;
}

.mdx-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: var(--mdx-radius-sm);
    padding: 8px 12px;
    color: var(--mdx-text);
}

.mdx-dropdown .dropdown-item i {
    color: var(--mdx-muted-strong);
    width: 18px;
}

.mdx-dropdown .dropdown-item:hover,
.mdx-dropdown .dropdown-item:focus {
    background: var(--mdx-page);
    color: var(--mdx-ink);
}

/* ==========================================================================
   Login / Register / Forgot password (auth layout): keep the cosmic video
   background, add the shared bar on top, use the brand button style.
   ========================================================================== */
.authpage-content {
    position: relative;
    padding-top: calc(var(--mdx-topbar-h) + 24px) !important;
    padding-bottom: 32px !important;
}

.auth-topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
}

.auth-topbar .mdx-topbar--dark {
    border-radius: 20px 20px 0 0;
}

.authpage .custom-btn.custom-primary-btn {
    background: var(--mdx-brand-gradient) !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 999px !important;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(124, 109, 174, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.authpage .custom-btn.custom-primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(124, 109, 174, 0.45);
}

.authpage .regiterpage-link,
.authpage .login-link {
    color: #d8ccff !important;
}

.auth-topbar .mdx-topbar--dark {
    background: linear-gradient(180deg, rgba(8, 10, 22, 0.85) 0%, rgba(8, 10, 22, 0.35) 100%);
}

.authpage a[href*="forgot-password"] {
    color: rgba(255, 255, 255, 0.8) !important;
}

.authpage a[href*="forgot-password"]:hover {
    color: #fff !important;
}

/* ==========================================================================
   Admin panel: same fonts and colours as the site (cosmic instead of pure
   black, lilac active states) plus a "Back to site" link.
   ========================================================================== */
.adminpage,
.adminpage * {
    font-family: var(--mdx-font);
}

.adminpage .bi::before {
    font-family: bootstrap-icons !important;
}

.adminpage .topbar {
    background: var(--mdx-cosmic);
    padding: 10px 24px;
    box-shadow: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.adminpage .siteidentity.logo img {
    padding-bottom: 0;
    max-height: 44px;
    width: auto;
}

.adminpage .topbar .topbar-content .topbar-right {
    gap: 16px;
}

.admin-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff !important;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.admin-back-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.adminpage .sidebar-main {
    background: var(--mdx-cosmic);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    padding: 12px 10px;
}

.adminpage .sidebar-main .submenu {
    background: transparent;
    padding-left: 10px;
}

.adminpage .sidebar-main .list-item-main,
.adminpage .sidebar-main .submenu .submenu-list-item {
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 14px;
    transition: background 0.15s ease;
}

.adminpage .sidebar-main .list-item-main:hover,
.adminpage .sidebar-main .submenu .submenu-list-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.adminpage .sidebar-main .submenu .submenu-list-item.active {
    background: rgba(172, 149, 248, 0.24);
    color: #fff !important;
    font-weight: 600;
}

.adminpage .main-content {
    background: var(--mdx-page);
}

.adminpage .topbar .topbar-content {
    background: transparent;
    padding: 0;
    box-shadow: none;
}

/* ==========================================================================
   Metapedia pages inside the shell (My Calendar, Profile, pricing,
   Elemental Calendar, zodiac seasons): light bar + sidebar around a
   cosmic content panel, like the feed's "Today's element" card.
   ========================================================================== */
.community-main-content.mdx-main--cosmic {
    background: var(--bg, #0d0d12);
    color: var(--text, #f1f1f5);
}

.community-main-content > .mdx-cosmic-panel {
    position: relative;
    min-height: calc(100vh - var(--mdx-topbar-h) - 1px) !important;
    background-size: cover;
    background-position: center top;
}

/* ==========================================================================
   Page transitions: slim loading bar + soft fade-in of each page
   ========================================================================== */
.mdx-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    z-index: 2147483000;
    pointer-events: none;
    opacity: 0;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(90deg, var(--mdx-brand-1), var(--mdx-brand-2) 60%, var(--mdx-pink));
    box-shadow: 0 0 10px rgba(172, 149, 248, 0.7), 0 0 4px rgba(253, 67, 128, 0.5);
}

/* Climbs quickly, then slows down while the server responds */
.mdx-progress.is-loading {
    opacity: 1;
    animation: mdx-progress-grow 10s cubic-bezier(0.08, 0.7, 0.2, 1) forwards;
}

/* New page arrived: the bar starts where the old page left it... */
.mdx-progress.is-finishing {
    opacity: 1;
    width: 80%;
    transition: none;
}

/* ...then completes and fades away */
.mdx-progress.is-done {
    width: 100%;
    opacity: 0;
    transition: width 0.25s ease-out, opacity 0.35s ease 0.2s;
}

@keyframes mdx-progress-grow {
    0% { width: 0; }
    8% { width: 30%; }
    30% { width: 60%; }
    100% { width: 92%; }
}

html.mdx-is-navigating,
html.mdx-is-navigating * {
    cursor: progress !important;
}

/* Fade each page's content in (opacity only, so fixed-position modals are unaffected) */
@keyframes mdx-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.community-main-content,
.mdx-meta-header ~ main,
.mdx-meta-header ~ .sub-header,
body.mp-body > main,
.authpage-content > section,
.adminpage .main-content {
    animation: mdx-fade-in 0.35s ease-out;
}

/* Gentle hover feedback on the main navigation */
.mdx-nav-link,
.sidebar-item,
.mdx-subnav-link {
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.mdx-menu {
    transform-origin: top right;
}

.mdx-account.is-open .mdx-menu {
    animation: mdx-menu-in 0.16s ease-out;
}

@keyframes mdx-menu-in {
    from { opacity: 0; transform: translateY(-4px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .mdx-progress,
    .community-main-content,
    .mdx-meta-header ~ main,
    .mdx-meta-header ~ .sub-header,
    body.mp-body > main,
    .authpage-content > section,
    .adminpage .main-content,
    .mdx-account.is-open .mdx-menu {
        animation: none !important;
        transition: none !important;
    }

    .mdx-progress {
        display: none;
    }
}

/* Stop the first child's top margin collapsing through the panel (it left a white strip on Profile) */
.community-main-content > .mdx-cosmic-panel {
    display: flow-root;
}

/* Identical sidebar rows on every page, whatever line-height the page itself uses */
.community-sidebar .sidebar-item {
    min-height: 41px;
    box-sizing: border-box;
    line-height: 1.3;
}

.community-sidebar .sidebar-item i {
    line-height: 1;
}

.community-sidebar .sidebar-section-title {
    line-height: 1.4;
}
