.rail-community-group { border: 0; }
.rail-community-group > summary { cursor: pointer; list-style: none; }
.rail-community-group > summary::-webkit-details-marker { display: none; }
.rail-community-group .rail-heading { min-height: 32px; margin: 0; }
.rail-community-group .rail-heading svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; transition: transform .16s ease; }
.rail-community-group:not([open]) .rail-heading svg { transform: rotate(-90deg); }
.rail-see-all { display: block; margin-top: 5px; padding: 7px 10px; color: var(--accent-2); font-size: 10px; }
#shell-main.shell-loading { opacity: .45; pointer-events: none; }
#shell-main { transition: opacity .14s ease; }
.home-shell > #shell-main { width: 100%; max-width: none; min-width: 0; margin: 0; }
.home-shell > #shell-main.single,.home-shell > #shell-main.thread,.home-shell > #shell-main.explore-shell,.home-shell > #shell-main.communities-page { width: 100%; min-width: 0; margin: 0; padding: 0 0 80px; }
.home-shell > #shell-main .community-head { margin-top: 0; }
.home-shell > #shell-main.post-main,.home-shell > #shell-main.profile-shell,.home-shell > #shell-main.community-page-v2 { padding-top: 0; padding-bottom: 80px; }
.home-shell > #shell-main .community-home-link,.home-shell > #shell-main .shell-home-fallback { display: none; }
.home-nav a.active { box-shadow: inset 3px 0 0 var(--accent); }

.home-feed .mixed-item.feed-item-hidden > :not(.feed-hidden-placeholder){display:none!important}
.feed-hidden-placeholder{min-height:58px;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 16px;border:1px solid #252e3d;border-radius:12px;background:#10151f;color:#8f99a8;font-size:13px}
.feed-hidden-placeholder::before{content:"";width:7px;height:7px;flex:0 0 auto;border-radius:999px;background:#596579}
.feed-hidden-placeholder>span{margin-right:auto}
.feed-hidden-show{border:1px solid #343f52;border-radius:999px;background:#171e29;color:#c9d0db;min-height:34px;padding:6px 13px;font:inherit;font-weight:700;cursor:pointer}
.feed-hidden-show:hover{border-color:#6655b9;background:#201d35;color:#e3ddff}
.feed-hidden-show:disabled{opacity:.55;cursor:wait}

/* Mobile shell: brand + search in the header, account actions in the bottom navigation. */
@media(max-width:680px){
    .home .home-topbar{
        display:grid;
        grid-template-columns:auto minmax(0,1fr);
        gap:12px;
        min-height:72px;
        padding:10px 16px;
        align-items:center;
    }
    .home .home-topbar .brand{
        display:flex;
        align-items:center;
        justify-self:start;
        flex:0 0 auto;
        margin:0;
        font-size:23px;
        line-height:1;
    }
    .home .home-topbar .brand-name{
        display:none;
    }
    .home .home-topbar .brand-mark{
        display:block;
        white-space:nowrap;
    }
    .home .home-topbar .compact-account{
        display:none;
    }
    .home .home-topbar .header-search{
        display:flex;
        width:100%;
        max-width:none;
        min-width:0;
        margin:0;
        height:46px;
        justify-self:stretch;
    }
    .home .home-topbar .header-search input{
        width:100%;
        min-width:0;
        font-size:16px;
    }
    .home .feed-header{
        top:72px;
    }
    .home .mobile-bottom-nav .mobile-nav-icon{
        position:relative;
        width:28px;
        height:28px;
        display:grid;
        place-items:center;
    }
    .home .mobile-bottom-nav .mobile-nav-icon svg{
        width:25px;
        height:25px;
        fill:none;
        stroke:currentColor;
        stroke-width:1.8;
        stroke-linecap:round;
        stroke-linejoin:round;
    }
    .home .mobile-notification-count{
        position:absolute;
        top:-5px;
        right:-8px;
        min-width:17px;
        height:17px;
        padding:0 4px;
        display:grid;
        place-items:center;
        border:2px solid #151b25;
        border-radius:999px;
        background:var(--accent);
        color:#fff;
        font-size:9px;
        line-height:1;
    }
    .home .mobile-profile-avatar{
        width:29px;
        height:29px;
        display:grid;
        place-items:center;
        border-radius:999px;
        background:linear-gradient(135deg,#7c5cff,#4d78c9);
        border:1px solid rgba(255,255,255,.16);
        box-shadow:0 0 0 3px rgba(124,92,255,.08);
        color:#fff;
        font-size:11px;
        font-weight:800;
    }
    .feed-hidden-placeholder{margin:0 8px;border-radius:10px;min-height:54px;padding:10px 13px}
    .feed-hidden-show{min-height:38px;padding-inline:14px}
}

@media(max-width:390px){
    .home .home-topbar{
        grid-template-columns:44px minmax(0,1fr);
        gap:9px;
        padding-inline:12px;
    }
    .home .home-topbar .brand{
        font-size:21px;
    }
}

/* Every page uses the same mobile account entry points and translation control. */
@media(max-width:680px){
    .home .home-topbar { grid-template-columns:auto minmax(0,1fr) auto; }
    .home .home-topbar .compact-account { display:flex; grid-column:3; grid-row:1; }
    .home .home-topbar .header-search { order:0; grid-column:2; grid-row:1; }
    .home .home-topbar .compact-account > :not(.global-translation):not(.muxi-indicator) { display:none; }
    .home .home-topbar .translation-menu-trigger { width:38px; height:38px; }
}

/* Size the mobile dock from its actual links, including the signed-out state. */
@media(max-width:680px){
    .home .mobile-bottom-nav{
        position:fixed;
        z-index:30;
        left:12px;
        right:12px;
        bottom:max(10px,env(safe-area-inset-bottom));
        display:grid;
        grid-template-columns:none;
        grid-auto-flow:column;
        grid-auto-columns:minmax(0,1fr);
        gap:2px;
        padding:6px;
        border:1px solid rgba(127,132,156,.20);
        border-radius:24px;
        background:rgba(18,23,32,.93);
        box-shadow:0 12px 34px rgba(0,0,0,.36),inset 0 1px 0 rgba(255,255,255,.035);
        backdrop-filter:blur(20px) saturate(1.18);
    }
    .home .mobile-bottom-nav > a{
        width:auto;
        min-width:0;
        height:auto;
        min-height:64px;
        margin:0;
        padding:6px 2px;
        display:flex;
        flex-direction:column;
        justify-content:flex-start;
        align-items:center;
        gap:4px;
        border:0;
        border-radius:14px;
        box-shadow:none;
        color:#8f99aa;
        transition:background .15s ease,color .15s ease,transform .12s ease;
    }
    .home .mobile-bottom-nav > a:hover,
    .home .mobile-bottom-nav > a.active{background:rgba(203,166,247,.11);color:#d8ccff}
    .home .mobile-bottom-nav > a:active{transform:scale(.96)}
    .home .mobile-bottom-nav > a > small{
        position:static;
        width:100%;
        height:auto;
        margin:0;
        clip:auto;
        overflow:visible;
        white-space:nowrap;
        overflow-wrap:normal;
        word-break:normal;
        text-overflow:clip;
        text-align:center;
        font-size:10px;
        line-height:1.2;
    }
    .home .mobile-bottom-nav > .mobile-create{
        width:50px;
        height:54px;
        min-height:54px;
        justify-self:center;
        align-self:center;
        justify-content:center;
        padding:0;
        border:1px solid rgba(255,255,255,.18);
        border-radius:17px;
        background:linear-gradient(145deg,#8068ff,#654ce8);
        color:#fff;
        box-shadow:0 7px 18px rgba(92,67,214,.35),inset 0 1px 0 rgba(255,255,255,.18);
    }
    .home .mobile-bottom-nav > .mobile-create > svg{
        width:28px;
        height:28px;
        fill:none;
        stroke:currentColor;
        stroke-width:1.9;
        stroke-linecap:round;
    }
    .home .mobile-bottom-nav > .mobile-create > small{
        position:absolute;
        width:1px;
        height:1px;
        padding:0;
        margin:-1px;
        overflow:hidden;
        clip:rect(0 0 0 0);
        white-space:nowrap;
        border:0;
    }
    .home .mobile-bottom-nav .mobile-nav-icon,
    .home .mobile-bottom-nav .mobile-profile-avatar{flex:none;height:28px}
    .home .home-shell{padding-bottom:calc(110px + env(safe-area-inset-bottom))}
}

@media(max-width:360px){
    .home .mobile-bottom-nav > a > small{font-size:9px}
}
