/* ============================================================
   OBSIDIAN AERO — Total Dark Redesign
   Apple Liquid Glass × Windows Vista Aero
   Loaded after style.css from includes/navbar.php — every rule
   here is an override layer on top of the legacy theme.
   ============================================================ */

/* ── 1. Design tokens ──────────────────────────────────────── */
:root {
    --primary-bg: #030409;
    --secondary-bg: rgba(10, 14, 24, 0.62);
    --tertiary-bg: rgba(16, 22, 38, 0.55);

    /* Liquid glass recipe */
    --glass-bg: rgba(255, 255, 255, 0.045);
    --glass-bg-strong: rgba(14, 18, 32, 0.72);
    --glass-border: rgba(255, 255, 255, 0.10);
    --glass-edge: rgba(255, 255, 255, 0.16);          /* specular top edge */
    --glass-sheen: linear-gradient(180deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.03) 48%, rgba(255,255,255,0) 52%);
    --blur: blur(24px) saturate(170%);
    --blur-heavy: blur(36px) saturate(190%);

    /* Vista aero glints */
    --aero-cyan: #4cc9f0;
    --aero-teal: #06d6a0;
    --aero-blue: #3a86ff;

    --primary-text: #eef2f9;
    --secondary-text: #97a2ba;
    --border: rgba(255, 255, 255, 0.08);

    --radius-panel: 20px;
    --radius-control: 12px;
}

/* ── 2. Aurora backdrop (Vista) over true-black (Apple) ────── */
html {
    background: var(--primary-bg);
}

body {
    background: var(--primary-bg);
    background-attachment: fixed;
}

/* Aurora ribbons — sits above page shader canvases (z:-1) and
   below particles (z:1) / content (z:2). */
body::before {
    content: '';
    position: fixed;
    inset: -20%;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(42% 34% at 18% 22%, rgba(58, 134, 255, 0.14), transparent 70%),
        radial-gradient(38% 30% at 82% 16%, rgba(6, 214, 160, 0.10), transparent 70%),
        radial-gradient(46% 38% at 70% 84%, rgba(255, 0, 110, 0.10), transparent 72%),
        radial-gradient(30% 26% at 34% 72%, rgba(76, 201, 240, 0.08), transparent 70%);
    filter: blur(48px);
    animation: aurora-drift 36s ease-in-out infinite alternate;
}

/* Faint diagonal light streak — the Vista "glass beam" */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(115deg,
        transparent 32%,
        rgba(255, 255, 255, 0.020) 44%,
        rgba(255, 255, 255, 0.045) 50%,
        rgba(255, 255, 255, 0.020) 56%,
        transparent 68%);
    mix-blend-mode: screen;
    animation: beam-sweep 22s ease-in-out infinite alternate;
}

@keyframes aurora-drift {
    0%   { transform: translate3d(-3%, -2%, 0) scale(1); }
    50%  { transform: translate3d(2%, 3%, 0) scale(1.06); }
    100% { transform: translate3d(4%, -3%, 0) scale(1.02); }
}

@keyframes beam-sweep {
    0%   { transform: translateX(-12%); }
    100% { transform: translateX(12%); }
}

@media (prefers-reduced-motion: reduce) {
    body::before, body::after { animation: none; }
}

/* ── 3. Global finish ──────────────────────────────────────── */
::selection {
    background: rgba(76, 201, 240, 0.35);
    color: #fff;
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.08));
    border-radius: 999px;
    border: 2px solid rgba(3, 4, 9, 0.8);
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(76,201,240,0.45), rgba(58,134,255,0.3));
}

/* ── 4. Navbar — floating liquid-glass toolbar ─────────────── */
.navbar-ultra {
    background: linear-gradient(180deg, rgba(8, 11, 22, 0.72) 0%, rgba(8, 11, 22, 0.55) 100%);
    -webkit-backdrop-filter: var(--blur-heavy);
    backdrop-filter: var(--blur-heavy);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 0 1px 0 var(--glass-edge),
        0 10px 40px rgba(0, 0, 0, 0.45);
}

/* Aero glint line under the navbar — cool cyan/blue instead of pink */
.navbar-ultra::before {
    background: linear-gradient(90deg,
        transparent,
        rgba(76, 201, 240, 0.55),
        rgba(58, 134, 255, 0.40),
        rgba(255, 0, 110, 0.35),
        transparent);
    opacity: 0.75;
}

/* Nav pills — frosted chips with specular top edge */
.nav-pill {
    border-radius: var(--radius-control);
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: linear-gradient(180deg, rgba(255,255,255,0.055) 0%, rgba(255,255,255,0.02) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.nav-pill:hover {
    background: linear-gradient(180deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.04) 100%);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 6px 18px rgba(0, 0, 0, 0.35);
}

.nav-pill.active {
    background: linear-gradient(180deg, rgba(255, 0, 110, 0.22) 0%, rgba(255, 0, 110, 0.08) 100%);
    border-color: rgba(255, 0, 110, 0.45);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 6px 22px rgba(255, 0, 110, 0.22);
}

/* Icon buttons + profile button */
.nav-icon-btn,
.nav-profile-btn {
    background: linear-gradient(180deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.025) 100%);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-control);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
}

.nav-icon-btn:hover,
.nav-profile-btn:hover {
    background: linear-gradient(180deg, rgba(76,201,240,0.16) 0%, rgba(58,134,255,0.06) 100%);
    border-color: rgba(76, 201, 240, 0.35);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 18px rgba(76, 201, 240, 0.18);
}

/* Dropdown panels — heavy Apple glass sheets */
.nav-dropdown-panel,
.nav-dropdown-menu {
    background: linear-gradient(180deg, rgba(13, 17, 30, 0.82) 0%, rgba(9, 12, 22, 0.88) 100%);
    -webkit-backdrop-filter: var(--blur-heavy);
    backdrop-filter: var(--blur-heavy);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    box-shadow:
        inset 0 1px 0 var(--glass-edge),
        0 24px 60px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.dropdown-header {
    background: linear-gradient(180deg, rgba(255,255,255,0.05), transparent);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.dropdown-link:hover,
.dropdown-item:hover {
    background: linear-gradient(90deg, rgba(76, 201, 240, 0.12), rgba(58, 134, 255, 0.05));
}

/* Mobile menu */
.nav-mobile-menu {
    background: rgba(6, 8, 16, 0.92);
    -webkit-backdrop-filter: var(--blur-heavy);
    backdrop-filter: var(--blur-heavy);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-nav-link {
    border-radius: var(--radius-control);
}

.mobile-nav-link:hover {
    background: linear-gradient(90deg, rgba(76, 201, 240, 0.12), rgba(58, 134, 255, 0.05));
}

/* Login / Get Started buttons */
.nav-btn-ghost {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-control);
}

.nav-btn-primary {
    border-radius: var(--radius-control);
    background: linear-gradient(180deg, #ff2f85 0%, #e30063 55%, #c70057 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -6px 12px rgba(0, 0, 0, 0.25),
        0 6px 20px rgba(255, 0, 110, 0.35);
}

/* Upgrade button — gold aero glass */
.nav-upgrade-btn {
    background: linear-gradient(180deg, rgba(255, 204, 0, 0.22) 0%, rgba(255, 170, 0, 0.10) 100%);
    border: 1px solid rgba(255, 204, 0, 0.4);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        0 4px 16px rgba(255, 190, 0, 0.18);
    border-radius: var(--radius-control);
}

/* ── 5. Panels, cards, containers ──────────────────────────── */
.card,
.content-card,
.post-card,
.grid-post-card,
.instagram-post,
.create-post-form,
.empty-state,
.post-stats-card,
.profile-header,
.stories-bar,
.hero-section,
.feed-header {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.02) 40%, rgba(10, 14, 26, 0.55) 100%);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius-panel);
    box-shadow:
        inset 0 1px 0 var(--glass-edge),
        inset 0 0 0 1px rgba(255, 255, 255, 0.02),
        0 16px 48px rgba(0, 0, 0, 0.42);
    position: relative;
}

/* Vista top-half gloss on every panel */
.card::after,
.content-card::after,
.post-card::after,
.grid-post-card::after,
.instagram-post::after,
.empty-state::after,
.post-stats-card::after,
.feed-header::after {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 46%;
    border-radius: inherit;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    z-index: 0;
}

.post-card:hover,
.grid-post-card:hover,
.instagram-post:hover {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 40%, rgba(12, 17, 32, 0.6) 100%);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 24px 64px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(76, 201, 240, 0.08);
    transform: translateY(-4px);
}

/* Feed header glint — cool aero */
.feed-header::before {
    background: linear-gradient(90deg,
        transparent,
        rgba(76, 201, 240, 0.5),
        rgba(58, 134, 255, 0.3),
        transparent);
}

/* Stories scroll buttons */
.stories-scroll-btn {
    background: rgba(10, 14, 26, 0.85);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 4px 16px rgba(0, 0, 0, 0.5);
}

/* ── 6. Modals — full liquid glass sheets ──────────────────── */
.modal-content,
.story-create-modal {
    background: linear-gradient(165deg, rgba(18, 23, 40, 0.86) 0%, rgba(8, 11, 21, 0.92) 100%);
    -webkit-backdrop-filter: var(--blur-heavy);
    backdrop-filter: var(--blur-heavy);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 22px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 40px 100px rgba(0, 0, 0, 0.7);
}

/* ── 7. Forms — frosted inputs ─────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="file"],
textarea,
select {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.28) 0%, rgba(255, 255, 255, 0.035) 100%);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
    backdrop-filter: blur(14px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: var(--radius-control);
    box-shadow:
        inset 0 2px 6px rgba(0, 0, 0, 0.35),
        inset 0 -1px 0 rgba(255, 255, 255, 0.06);
    color: var(--primary-text);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
    border-color: rgba(76, 201, 240, 0.55);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, rgba(76, 201, 240, 0.05) 100%);
    box-shadow:
        inset 0 2px 6px rgba(0, 0, 0, 0.3),
        0 0 0 3px rgba(76, 201, 240, 0.14),
        0 0 24px rgba(76, 201, 240, 0.12);
}

select option {
    background: #0b0f1c;
    color: var(--primary-text);
}

/* ── 8. Buttons — Vista aero gloss ─────────────────────────── */
.btn,
.feed-action-btn {
    border-radius: var(--radius-control);
    position: relative;
    overflow: hidden;
}

/* glossy top-half highlight (the Aero signature) */
.btn::before,
.feed-action-primary::before,
.nav-btn-primary::before {
    content: '';
    position: absolute;
    inset: 1px 1px 50% 1px;
    border-radius: inherit;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.06) 100%);
    opacity: 0.55;
    pointer-events: none;
}

.btn-primary,
.feed-action-primary {
    background: linear-gradient(180deg, #ff3d8d 0%, #ec0068 50%, #cc005a 100%);
    border: 1px solid rgba(255, 90, 160, 0.6);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        inset 0 -8px 16px rgba(120, 0, 50, 0.35),
        0 6px 22px rgba(255, 0, 110, 0.30);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.btn-primary:hover,
.feed-action-primary:hover {
    background: linear-gradient(180deg, #ff549b 0%, #ff0f77 50%, #db0062 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        inset 0 -8px 16px rgba(120, 0, 50, 0.3),
        0 10px 32px rgba(255, 0, 110, 0.45);
    transform: translateY(-2px);
}

.btn-secondary,
.feed-action-ghost {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.035) 100%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 4px 14px rgba(0, 0, 0, 0.3);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
}

.btn-secondary:hover,
.feed-action-ghost:hover {
    background: linear-gradient(180deg, rgba(76, 201, 240, 0.18) 0%, rgba(58, 134, 255, 0.07) 100%);
    border-color: rgba(76, 201, 240, 0.4);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.24),
        0 8px 24px rgba(76, 201, 240, 0.16);
}

.btn-success {
    background: linear-gradient(180deg, #2fe3a8 0%, #0abf85 50%, #089e6f 100%);
    border: 1px solid rgba(60, 240, 180, 0.6);
    color: #02150e;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -8px 16px rgba(0, 80, 55, 0.3),
        0 6px 22px rgba(6, 214, 160, 0.25);
}

.btn-danger {
    background: linear-gradient(180deg, #ff4d6d 0%, #e5254b 50%, #c2103a 100%);
    border: 1px solid rgba(255, 110, 130, 0.55);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -8px 16px rgba(110, 0, 25, 0.35),
        0 6px 22px rgba(230, 30, 70, 0.28);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* ── 9. Alerts ─────────────────────────────────────────────── */
.alert-modern {
    border-radius: 14px;
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.alert-modern.alert-success {
    background: linear-gradient(180deg, rgba(6, 214, 160, 0.16), rgba(6, 214, 160, 0.06));
    border: 1px solid rgba(6, 214, 160, 0.35);
    color: #5cf0c6;
}

.alert-modern.alert-error {
    background: linear-gradient(180deg, rgba(255, 77, 109, 0.16), rgba(255, 77, 109, 0.06));
    border: 1px solid rgba(255, 77, 109, 0.35);
    color: #ff8ba0;
}

/* ── 10. Misc chrome ───────────────────────────────────────── */
.feed-stat-chip {
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.feed-stat-chip:hover {
    background: linear-gradient(180deg, rgba(76, 201, 240, 0.13), rgba(58, 134, 255, 0.05));
    border-color: rgba(76, 201, 240, 0.3);
}

.empty-state-icon {
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
    border: 1px solid rgba(255, 255, 255, 0.13);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
    border-radius: 22px;
}

.blur-overlay-content {
    background: rgba(8, 11, 21, 0.8);
    -webkit-backdrop-filter: var(--blur-heavy);
    backdrop-filter: var(--blur-heavy);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-panel);
    box-shadow: inset 0 1px 0 var(--glass-edge), 0 24px 60px rgba(0, 0, 0, 0.6);
}

/* Panic button — needs !important, its legacy styles load later */
button.panic-btn {
    background: rgba(8, 11, 21, 0.8) !important;
    -webkit-backdrop-filter: var(--blur) !important;
    backdrop-filter: var(--blur) !important;
    border: 1px solid rgba(255, 255, 255, 0.13) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 6px 20px rgba(0, 0, 0, 0.5) !important;
}

button.panic-btn:hover {
    background: linear-gradient(180deg, rgba(255, 0, 110, 0.3), rgba(255, 0, 110, 0.12)) !important;
    border-color: rgba(255, 0, 110, 0.45) !important;
}

/* Notification list rows */
.notif-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.notif-item:hover {
    background: linear-gradient(90deg, rgba(76, 201, 240, 0.10), rgba(58, 134, 255, 0.04)) !important;
}

/* Announcement banners */
.ann-banner {
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* ── 11. Focus + accessibility polish ──────────────────────── */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid rgba(76, 201, 240, 0.7);
    outline-offset: 2px;
    border-radius: 6px;
}

/* ── 12. Fallback when backdrop-filter is unsupported ──────── */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .navbar-ultra,
    .nav-dropdown-panel,
    .nav-dropdown-menu,
    .nav-mobile-menu,
    .card,
    .content-card,
    .post-card,
    .grid-post-card,
    .instagram-post,
    .create-post-form,
    .empty-state,
    .post-stats-card,
    .profile-header,
    .stories-bar,
    .hero-section,
    .feed-header,
    .modal-content,
    .story-create-modal {
        background: rgba(10, 13, 24, 0.96);
    }
}

/* ── 13. Desktop left rail — floating Aero glass dock ──────── */
/* Redesigns the documentation-style rail from style.css: the bar
   becomes a floating rounded dock with section labels, an aero
   active state, and a collapsible icon-only mode (html.rail-collapsed,
   toggled by #railToggle, persisted in localStorage). */
@media (min-width: 1025px) {
    html.nav-rail body { padding-left: 288px; transition: padding-left 0.28s cubic-bezier(0.4, 0, 0.2, 1); }

    html.nav-rail .navbar-ultra {
        top: 14px;
        left: 14px;
        bottom: 14px;
        width: 254px;
        border: 1px solid rgba(255, 255, 255, 0.11);
        border-radius: 22px;
        background: linear-gradient(170deg, rgba(16, 21, 38, 0.72) 0%, rgba(7, 10, 20, 0.82) 100%);
        box-shadow:
            inset 0 1px 0 var(--glass-edge),
            inset 0 0 0 1px rgba(255, 255, 255, 0.02),
            0 24px 70px rgba(0, 0, 0, 0.55);
        overflow: visible;
        transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Aurora glow bleeding from behind the dock */
    html.nav-rail .navbar-ultra::after {
        content: '';
        position: absolute;
        inset: 10% -30px 40% auto;
        width: 60px;
        background: linear-gradient(180deg, rgba(76, 201, 240, 0.10), rgba(255, 0, 110, 0.08));
        filter: blur(30px);
        pointer-events: none;
        z-index: -1;
    }

    html.nav-rail .nav-inner {
        height: 100%;
        padding: 1.1rem 0.85rem 1rem;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: none;
    }
    html.nav-rail .nav-inner::-webkit-scrollbar { display: none; }

    html.nav-rail .nav-logo {
        border-bottom: none;
        position: relative;
        padding: 0.4rem 0.6rem 1.1rem;
    }
    html.nav-rail .nav-logo::after {
        content: '';
        position: absolute;
        left: 0.4rem; right: 0.4rem; bottom: 0.35rem;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(76, 201, 240, 0.4), rgba(255, 0, 110, 0.3), transparent);
    }

    /* Section labels */
    html.nav-rail .nav-center::before,
    html.nav-rail .nav-right::before {
        content: 'MENU';
        display: block;
        padding: 0.2rem 0.8rem 0.45rem;
        font-size: 0.62rem;
        font-weight: 700;
        letter-spacing: 0.14em;
        color: rgba(255, 255, 255, 0.32);
    }
    html.nav-rail .nav-right::before {
        content: 'ACCOUNT';
        flex-basis: 100%;
        padding-top: 0;
    }

    /* Pills — frosted rows with a sliding aero highlight */
    html.nav-rail .nav-pill {
        position: relative;
        border: 1px solid transparent;
        border-radius: 12px;
        padding: 0.62rem 0.8rem;
        transition: background 0.2s, border-color 0.2s, color 0.2s, padding-left 0.2s;
    }
    html.nav-rail .nav-pill:hover {
        background: linear-gradient(90deg, rgba(76, 201, 240, 0.10), rgba(255, 255, 255, 0.03));
        border-color: rgba(255, 255, 255, 0.08);
        padding-left: 1.05rem;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }
    html.nav-rail .nav-pill.active {
        background: linear-gradient(90deg, rgba(255, 0, 110, 0.20) 0%, rgba(255, 0, 110, 0.05) 100%);
        border-color: rgba(255, 0, 110, 0.30);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.12),
            inset 3px 0 0 var(--accent),
            0 4px 18px rgba(255, 0, 110, 0.12);
        color: #fff;
    }
    html.nav-rail .nav-pill.active svg { filter: drop-shadow(0 0 6px rgba(255, 0, 110, 0.6)); }

    /* Bottom cluster */
    html.nav-rail .nav-right {
        border-top: none;
        position: relative;
        padding-top: 1rem;
    }
    html.nav-rail .nav-right::after {
        content: '';
        position: absolute;
        left: 0.4rem; right: 0.4rem; top: 0;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    }

    /* Collapse toggle — half-moon button riding the dock's right edge */
    html.nav-rail .rail-toggle {
        display: flex;
        position: absolute;
        top: 26px;
        right: -13px;
        z-index: 5;
        width: 26px; height: 26px;
        align-items: center; justify-content: center;
        border-radius: 50%;
        background: rgba(14, 19, 34, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.18);
        color: rgba(255, 255, 255, 0.65);
        cursor: pointer;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 4px 12px rgba(0, 0, 0, 0.5);
        transition: color 0.2s, border-color 0.2s, transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    }
    html.nav-rail .rail-toggle:hover {
        color: #4cc9f0;
        border-color: rgba(76, 201, 240, 0.5);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 14px rgba(76, 201, 240, 0.25);
    }
    html.rail-collapsed .rail-toggle { transform: rotate(180deg); }

    /* ── Collapsed: icon-only dock ── */
    html.nav-rail.rail-collapsed body { padding-left: 112px; }
    html.nav-rail.rail-collapsed .navbar-ultra { width: 78px; }
    html.nav-rail.rail-collapsed .nav-inner { padding: 1rem 0.7rem; }

    html.nav-rail.rail-collapsed .nav-logo { justify-content: center; padding: 0.4rem 0 1rem; overflow: hidden; }
    html.nav-rail.rail-collapsed .logo-img { height: 30px; }

    html.nav-rail.rail-collapsed .nav-center::before,
    html.nav-rail.rail-collapsed .nav-right::before { content: ''; padding: 0; height: 0; }

    html.nav-rail.rail-collapsed .nav-pill {
        justify-content: center;
        padding: 0.62rem 0;
    }
    html.nav-rail.rail-collapsed .nav-pill:hover { padding-left: 0; }
    html.nav-rail.rail-collapsed .nav-pill > span:not(.nav-unread-badge) { display: none; }

    /* Unread badge → corner dot */
    html.nav-rail.rail-collapsed .nav-pill-messages .nav-unread-badge {
        position: absolute;
        top: 6px; right: 10px;
        margin: 0;
        min-width: 10px; height: 10px;
        padding: 0;
        font-size: 0;
        border-radius: 50%;
        box-shadow: 0 0 8px rgba(255, 0, 110, 0.7);
    }

    /* Tooltip flyout from data-label */
    html.nav-rail.rail-collapsed .nav-pill::after {
        content: attr(data-label);
        position: absolute;
        left: calc(100% + 18px);
        top: 50%;
        transform: translateY(-50%) translateX(-6px);
        background: rgba(10, 14, 26, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: 8px;
        padding: 0.35rem 0.7rem;
        font-size: 0.75rem;
        font-weight: 600;
        color: #eef2f9;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.15s, transform 0.15s;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 8px 24px rgba(0, 0, 0, 0.5);
        z-index: 1001;
        display: block;
        height: auto;
        background-clip: padding-box;
    }
    html.nav-rail.rail-collapsed .nav-pill:hover::after {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }

    html.nav-rail.rail-collapsed .nav-right { flex-direction: column; align-items: stretch; }
    html.nav-rail.rail-collapsed .nav-upgrade-btn > span:last-child { display: none; }
    html.nav-rail.rail-collapsed .nav-icon-btn,
    html.nav-rail.rail-collapsed .nav-upgrade-btn { width: 100%; justify-content: center; }
    html.nav-rail.rail-collapsed .nav-profile-btn { justify-content: center; }
    html.nav-rail.rail-collapsed .nav-profile-btn .chevron-icon { display: none; }

    /* Dropdown flyouts track the dock edge in both widths */
    html.nav-rail .nav-dropdown-panel { left: calc(14px + 254px + 14px); }
    html.nav-rail.rail-collapsed .nav-dropdown-panel { left: calc(14px + 78px + 14px); }
}

/* Toggle is a rail-only control — hide it in the top-bar and mobile layouts */
.rail-toggle { display: none; }

@media (prefers-reduced-motion: reduce) {
    html.nav-rail body,
    html.nav-rail .navbar-ultra,
    html.nav-rail .rail-toggle { transition: none; }
}

/* ── 14. Mobile: lighter blur for perf ─────────────────────── */
@media (max-width: 768px) {
    :root {
        --blur: blur(16px) saturate(160%);
        --blur-heavy: blur(22px) saturate(170%);
    }
    body::after { display: none; }
}
