.auth-strip {
    flex: 0 1 auto;
    flex-wrap: nowrap;
    min-width: 0;
}

.auth-email {
    max-width: 8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.auth-strip .link-button {
    white-space: nowrap;
}
.theme-menu {
    position: relative;
    flex: 0 0 auto;
}

.theme-menu summary {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: var(--tap-size);
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 780;
    line-height: 1;
    list-style: none;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.theme-menu summary::-webkit-details-marker {
    display: none;
}

.theme-menu summary:hover,
.theme-menu summary:focus-visible,
.theme-menu[open] summary {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.theme-menu-icon {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.78rem;
    font-weight: 850;
}

.theme-menu-current {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.theme-menu-popover {
    position: absolute;
    z-index: 60;
    top: calc(100% + 0.5rem);
    right: 0;
    width: min(18rem, calc(100vw - 2rem));
    padding: 0.55rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.theme-menu-heading {
    margin: 0;
    padding: 0.45rem 0.55rem 0.55rem;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.theme-menu form,
.theme-menu-choices {
    display: grid;
    gap: 0.25rem;
    margin: 0;
}

.theme-menu [data-theme-choice] {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.7rem;
    align-items: center;
    width: 100%;
    min-height: var(--tap-size);
    padding: 0.65rem;
    border: 1px solid transparent;
    border-radius: 0.75rem;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.theme-menu [data-theme-choice]:hover,
.theme-menu [data-theme-choice]:focus-visible {
    border-color: var(--border);
    background: var(--surface-muted);
}

.theme-menu [data-theme-choice][aria-pressed="true"] {
    border-color: var(--border-strong);
    background: var(--accent-soft);
}

.theme-menu [data-theme-choice] > span:nth-child(2) {
    display: grid;
    min-width: 0;
}

.theme-menu [data-theme-choice] strong {
    color: var(--text);
    font-size: 0.9rem;
}

.theme-menu [data-theme-choice] small {
    color: var(--muted);
    font-size: 0.75rem;
}

.theme-swatch {
    width: 1.75rem;
    height: 1.75rem;
    border: 1px solid var(--border-strong);
    border-radius: 0.45rem;
}

.theme-swatch-classic {
    background: linear-gradient(135deg, #f6f4ec 0 48%, #273321 48% 70%, #ffffff 70%);
}

.theme-swatch-neovim {
    background: linear-gradient(135deg, #1a1b26 0 42%, #7aa2f7 42% 58%, #bb9af7 58% 74%, #9ece6a 74%);
}

.theme-choice-check {
    color: var(--accent);
    font-weight: 900;
    opacity: 0;
}

.theme-menu [data-theme-choice][aria-pressed="true"] .theme-choice-check {
    opacity: 1;
}

@media (max-width: 700px) {
    .site-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.65rem 0.75rem;
    }

    .brand {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
        margin: 0;
    }

    .theme-menu {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }

    .site-nav {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .auth-strip {
        grid-column: 1 / -1;
        grid-row: 3;
        justify-content: flex-start;
        min-width: 0;
    }

    .auth-email {
        max-width: min(18rem, 66vw);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .theme-menu-title {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .theme-menu-popover {
        position: fixed;
        top: calc(3.9rem + env(safe-area-inset-top));
        right: max(0.75rem, env(safe-area-inset-right));
        left: max(0.75rem, env(safe-area-inset-left));
        width: auto;
        max-height: calc(100dvh - 5rem - env(safe-area-inset-top));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 390px) {
    .theme-menu-current {
        display: none;
    }
}
