/*
WRUniverse mobile-only header adjustment.
Desktop remains untouched.

Mobile target:
Row 1: WRUniverse + Gear/Badge
Row 2: Primary links
*/

@media (max-width: 640px) {
    .command-rail .rail-inner {
        width: calc(100% - 18px);
        min-height: auto;
        padding: 10px 0;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas:
            "brand . command"
            "links links links";
        align-items: center;
        gap: 10px 8px;
    }

    .command-rail .rail-brand {
        grid-area: brand;
        min-width: max-content;
    }

    .command-rail .rail-brand-text {
        display: inline;
        font-size: 16px;
    }

    .command-rail .rail-brand-mark {
        width: 36px;
        height: 36px;
        border-radius: 12px;
        font-size: 12px;
    }

    .command-rail .rail-search {
        grid-area: search;
        min-width: 0;
        width: 100%;
    }

    .command-rail .rail-search input {
        height: 36px;
        font-size: 13px;
        padding: 0 10px;
    }

    .command-rail .rail-search button {
        height: 36px;
        width: 38px;
        padding: 0;
        overflow: hidden;
        text-indent: -999px;
        position: relative;
    }

    .command-rail .rail-search button::after {
        content: "⌕";
        position: absolute;
        inset: 0;
        display: grid;
        place-items: center;
        text-indent: 0;
        font-size: 17px;
        font-weight: 1000;
    }

    .command-rail .rail-links {
        grid-area: links;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        min-width: 0;
        width: 100%;
    }

    .command-rail .rail-links a {
        height: 36px;
        padding: 0 8px;
        border-radius: 999px;
        font-size: 12px;
        flex: 1 1 auto;
        justify-content: center;
        text-align: center;
        white-space: nowrap;
    }

    .command-rail .rail-command {
        grid-area: command;
        justify-self: end;
    }

    .command-rail .command-badge {
        height: 36px;
        padding: 3px 7px 3px 3px;
        gap: 5px;
    }

    .command-rail .command-avatar {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .command-rail .command-name {
        display: none;
    }

    .command-rail .command-gear {
        font-size: 14px;
    }

    .command-rail .command-menu {
        position: fixed;
        right: 8px;
        left: 8px;
        top: 96px;
        width: auto;
    }

    .command-rail .command-menu::before {
        display: none;
    }

    .site-main {
        padding-top: 18px;
    }
}

@media (max-width: 390px) {
    .command-rail .rail-brand-text {
        display: none;
    }

    .command-rail .rail-links a {
        font-size: 11px;
        padding: 0 6px;
    }
}

/* Launch logo mobile guardrail. */
@media (max-width: 640px) {
    .command-rail .rail-brand-logo {
        height: 32px;
        max-width: 104px;
    }
}
@media (max-width: 640px) {
    .command-rail .rail-inner {
        width: calc(100% - 18px);
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas:
            "brand . command"
            "links links links";
        gap: 10px 8px;
        overflow: visible;
    }

    .command-rail .rail-brand {
        grid-area: brand;
        min-width: 0;
    }

    .command-rail .rail-search {
        grid-area: search;
        min-width: 0;
        width: 100%;
    }

    .command-rail .rail-links {
        grid-area: links;
        min-width: 0;
        width: 100%;
        overflow: hidden;
    }

    .command-rail .rail-links a {
        min-width: 0;
        flex: 1 1 0;
        padding: 0 6px;
        font-size: 11px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .command-rail .rail-command {
        grid-area: command;
        min-width: max-content;
        justify-self: end;
    }

    .command-rail .command-menu {
        left: 8px;
        right: 8px;
        width: auto;
        max-width: none;
    }
}
