/* Floating navigation layer. Shared header tokens/base rules live in design-system.css. */
body > header > nav {
    position: fixed;
    right: clamp(0.75rem, 3vw, 1.5rem);
    bottom: calc(clamp(0.75rem, 3vw, 1.5rem) + 52px);
    z-index: 120;
    width: min(330px, calc(100vw - 1.5rem));
    max-height: min(70dvh, 560px);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: .5rem;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: .75rem;
    color: var(--fg);
    background: var(--card-bg);
    box-shadow: 0 18px 52px rgba(0, 0, 0, .18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(.5rem);
    transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
}

body > header.open > nav {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

body > header > nav > a,
body > header > nav .button,
body > header > nav select,
body > header > nav button {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
}

body > header > nav > a {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .55rem .7rem;
    color: var(--fg);
    background: var(--chip-bg);
}

body > header > nav > a:hover {
    color: var(--fg);
    background: var(--card-bg);
}

body > header > nav .nav-actions,
body > header > nav .section-switcher,
body > header > nav .nav-inline-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .5rem;
}

body > header > nav .nav-inline-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
}

body > header > nav .nav-inline-actions > * {
    flex: 0 0 auto;
}

body > header > nav .button,
body > header > nav select,
body > header > nav button:not(.theme-toggle),
body > header > nav .donate-toggle,
body > header > nav .signin-toggle {
    border-color: var(--border);
    color: var(--fg);
    background: var(--chip-bg);
}

body > header > nav .button:hover,
body > header > nav select:hover,
body > header > nav button:not(.theme-toggle):hover,
body > header > nav .donate-toggle:hover,
body > header > nav .signin-toggle:hover {
    color: var(--fg);
    background: var(--card-bg);
    filter: none;
}

body > header > nav .signin-toggle {
    text-decoration: none;
}

body > header > nav .nav-reveal-action {
    width: auto;
    min-width: 0;
    max-width: none;
    height: 36px;
    min-height: 36px;
    border: 1px solid var(--border);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    overflow: hidden;
    padding: 0 .55rem;
    white-space: nowrap;
    transition:
        max-width .25s ease,
        width .25s ease,
        gap .25s ease,
        padding .25s ease,
        background-color .15s ease,
        color .15s ease,
        transform .15s ease,
        filter .15s ease;
}

body > header > nav .nav-reveal-action:hover,
body > header > nav .nav-reveal-action:focus,
body > header > nav .nav-reveal-action:focus-visible {
    width: max-content;
    max-width: 16rem;
    gap: .4rem;
    padding: 0 .85rem;
}

body > header > nav .nav-reveal-action svg,
body > header > nav .nav-reveal-action .signin-icon {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
    stroke: currentColor;
}

body > header > nav .nav-reveal-text {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    margin-left: 0;
    font-size: .85rem;
    font-weight: 600;
    transition: max-width .25s ease, opacity .2s ease, margin .25s ease;
}

body > header > nav .nav-reveal-action:hover .nav-reveal-text,
body > header > nav .nav-reveal-action:focus .nav-reveal-text,
body > header > nav .nav-reveal-action:focus-visible .nav-reveal-text {
    max-width: 200px;
    opacity: 1;
    margin-left: .4rem;
}

body > header > nav .theme-toggle {
    border-color: var(--border);
    color: var(--fg);
    background: var(--chip-bg);
}

body > header > nav .theme-toggle:hover {
    background: var(--card-bg);
}

body > header > nav .theme-toggle .knob {
    color: var(--bg);
    background: var(--fg);
}

body > header > nav .donate-panel {
    color: var(--fg);
    background: var(--card-bg);
}

#nav-toggle,
#dashboard-nav-toggle,
.nav-toggle {
    position: fixed;
    right: clamp(0.75rem, 3vw, 1.5rem);
    bottom: clamp(0.75rem, 3vw, 1.5rem);
    z-index: 130;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: .35rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--fg);
    background-color: var(--card-bg);
    background-image: none;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .14);
}

#nav-toggle svg,
#dashboard-nav-toggle svg,
.nav-toggle svg {
    width: 22px;
    height: 22px;
    color: currentColor;
    stroke: currentColor;
}

#nav-toggle:empty,
#dashboard-nav-toggle:empty,
.nav-toggle:empty {
    font-size: 0;
}

#nav-toggle:empty::before,
#dashboard-nav-toggle:empty::before,
.nav-toggle:empty::before {
    content: "";
    width: 22px;
    height: 22px;
    display: block;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='white' stroke-width='2' stroke-linecap='round' d='M4 7h16M4 12h16M4 17h16'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='white' stroke-width='2' stroke-linecap='round' d='M4 7h16M4 12h16M4 17h16'/%3E%3C/svg%3E") center / contain no-repeat;
}

.dashboard-fab,
.project-fab {
    position: fixed;
    right: clamp(0.75rem, 3vw, 1.5rem);
    bottom: clamp(0.75rem, 3vw, 1.5rem);
    z-index: 130;
    display: flex;
    align-items: center;
    gap: .5rem;
    max-width: calc(100vw - 1.5rem);
}

.dashboard-fab .nav-toggle,
.project-fab .nav-toggle {
    position: static;
}

.project-fab .back-fab {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: .35rem;
}

@media (max-width: 560px) {
    body > header > nav {
        right: .5rem;
        bottom: 4.25rem;
        width: calc(100vw - 1rem);
    }
}
