.nav svg,
.page-tools svg,
.menu svg {
    width: 20px;
    height: 20px;
    flex: none;
    vertical-align: middle;
}
.nav button,
.page-tools button,
.menu button {
    margin: 0;
    height: auto;
    min-height: 0;
    min-width: 0;
    padding: 3px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: none;
    box-shadow: none;
    opacity: 1;
    font: inherit;
    font-size: 15px;
    line-height: 1.4;
    color: var(--text);
    text-decoration: none;
}
.nav button:hover,
.page-tools button:hover,
.menu button:hover {
    background: var(--th);
    border-color: var(--border);
    text-decoration: none;
}
.nav b,
.menu b {
    font-size: 15px;
    font-weight: 600;
}
.nav .tool,
.page-tools .tool {
    padding: 3px 8px;
}
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 4px;
    padding: 4px 12px;
    font-family: "Lexend", "Inter", "Poppins", "Roboto", ui-sans-serif, system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.4;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.nav a,
.tool,
.user-menu summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 3px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    font: inherit;
    color: var(--text);
    text-decoration: none;
    background: none;
    cursor: pointer;
}
.nav a:hover,
.nav a.active,
.tool:hover,
.user-menu summary:hover,
.user-menu[open] summary {
    background: var(--th);
    border-color: var(--border);
}
.spacer {
    margin-left: auto;
}
.user-menu {
    position: relative;
}
.user-menu summary {
    list-style: none;
    padding: 2px 8px 2px 4px;
}
.user-menu summary::-webkit-details-marker {
    display: none;
}
.av {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 24px;
    height: 24px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--field);
    font-size: 12px;
    line-height: 1;
    object-fit: cover;
}
.chev {
    width: 7px;
    height: 7px;
    margin: 0 2px 3px 4px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.15s;
}
.user-menu[open] .chev {
    margin: 3px 2px 0 4px;
    transform: rotate(225deg);
}
.menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 70;
    display: flex;
    flex-direction: column;
    min-width: 180px;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
}
.menu::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
}
.menu a,
.menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 3px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    font: inherit;
    font-size: 15px;
    line-height: 1.4;
    color: var(--text);
    text-align: left;
    text-decoration: none;
    background: none;
    cursor: pointer;
}
.menu a:hover,
.menu button:hover {
    background: var(--th);
    border-color: var(--border);
}
.menu form {
    margin: 0;
}
.menu .out {
    color: var(--danger);
}
.menu .out:hover {
    background: var(--error-bg);
}
.sep {
    height: 1px;
    margin: 4px -4px;
    background: var(--border);
}
.tools {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.tool {
    padding: 3px 8px;
}
.tool .lbl {
    display: none;
}
.menu .tools {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.menu .tool .lbl {
    display: inline;
}
.ico-moon,
:root[data-theme="dark"] .ico-sun {
    display: none;
}
:root[data-theme="dark"] .ico-moon {
    display: inline-block;
}
.audio-toggle .ico-playing,
.audio-toggle.is-on .ico-muted {
    display: none;
}
.audio-toggle.is-on .ico-playing {
    display: inline-block;
}
.page-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
}
.mob-only {
    display: none;
}
@media (max-width: 700px) {
    .desk-only {
        display: none !important;
    }
    .mob-only {
        display: block;
    }
    .nav {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 4px 8px calc(4px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--border);
        border-bottom: 0;
    }
    .nav a,
    .user-menu summary {
        padding: 8px 10px;
    }
    .user-menu .menu {
        top: auto;
        bottom: calc(100% + 8px);
    }
    .user-menu .menu::before {
        top: auto;
        bottom: -10px;
    }
}
