/* ===== 统一导航栏样式 - 纯导航栏版本 ===== */

/* 主导航栏 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    --nav-bar-height: 96px;
    height: var(--nav-bar-height);
    padding: 0;
}

/* 导航容器 */
.navbar .nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    min-height: var(--nav-bar-height);
}

/* 品牌标识 */
.navbar .brand-logo {
    display: flex;
    align-items: center;
    z-index: 10;
}

.navbar .brand-logo a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--spinmatch-font-family);
    letter-spacing: 0.5px;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar .brand-emblem {
    width: 44px;
    height: 44px;
    object-fit: contain;
    flex-shrink: 0;
}

.navbar .brand-logo a:hover {
    opacity: 0.8;
}

/* 导航菜单 */
.navbar .nav-menu {
    display: flex;
    list-style: none;
    gap: clamp(2px, 1vw, 14px);
    margin: 0 12px;
    padding: 0;
    flex: 1;
    min-width: 0;
    justify-content: center;
    align-items: center;
    font-family: var(--spinmatch-font-family);
    font-size: 16px;
    letter-spacing: 0.5px;
}

.navbar .nav-menu li {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* 导航反馈保持原位：透明底色和明亮文字标记当前页面。 */
.navbar .nav-menu a {
    color: var(--sm-text-muted, #aeb4bf);
    font-weight: 500;
    font-size: 16px;
    font-family: var(--spinmatch-font-family);
    letter-spacing: 0.5px;
    line-height: 1.5;
    position: relative;
    padding: 8px clamp(4px, .65vw, 9px);
    border-radius: 12px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 120ms ease, color 120ms ease;
}

.navbar .nav-menu a:hover {
    color: var(--sm-text, #f4f5f7);
    background: rgba(var(--sm-accent-rgb, 216, 222, 232), 0.07);
}

.navbar .nav-menu a:active {
    color: var(--sm-text, #f4f5f7);
    background: rgba(var(--sm-accent-rgb, 216, 222, 232), 0.14);
}

.navbar .nav-menu a.active {
    color: var(--sm-text, #f4f5f7);
    background: var(--sm-nav-selection, rgba(255, 255, 255, 0.10));
    box-shadow: none;
}


/* 认证区域 */
.navbar .nav-auth {
    display: flex;
    gap: 1rem;
    margin-left: auto;
    margin-right: 1rem;
    z-index: 10;
    align-items: center;
}

/* 认证按钮容器 */
.navbar .nav-auth .auth-buttons {
    display: flex;
    gap: 0.5rem;
}

.navbar .auth-buttons.auth-buttons-hidden {
    display: none;
}

/* 用户菜单（登录后） */
.navbar .user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar .user-menu.user-menu-hidden {
    display: none;
}

.navbar .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    padding: 4px 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font: inherit;
    cursor: pointer;
    transition: background-color 180ms ease;
}

.navbar .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 0;
}

.navbar .user-welcome {
    color: white;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.navbar .username {
    color: white;
    font-weight: 600;
}

.navbar .user-info:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Keep three centered strokes in both menu states. */
.navbar .hamburger {
    --hamburger-line-width: 24px;
    --hamburger-line-offset: 7px;
    position: relative;
    display: flex;
    flex-shrink: 0;
    margin-left: 8px;
    cursor: pointer;
    z-index: 10;
    background: transparent;
    border: 0;
    color: var(--sm-text, #f4f5f7);
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.navbar .hamburger > .hamburger-line {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--hamburger-line-width);
    height: 2px;
    margin: 0;
    border-radius: 2px;
    background: currentColor;
    transform: translate(-50%, -50%);
    transform-origin: center;
    pointer-events: none;
    transition: transform 240ms cubic-bezier(.2, .7, .2, 1), opacity 100ms ease;
}

.navbar .hamburger > .hamburger-line--top {
    transform: translate(-50%, -50%) translateY(calc(-1 * var(--hamburger-line-offset)));
}
.navbar .hamburger > .hamburger-line--bottom {
    transform: translate(-50%, -50%) translateY(var(--hamburger-line-offset));
}
.navbar .hamburger:hover { color: var(--sm-accent, #d8dee8); }
.navbar .hamburger[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}


/* 响应式设计 */
@media (min-width: 1025px) and (max-width: 1279px) {
    .navbar .user-welcome { display: none; }
    .navbar .nav-menu { gap: 2px; margin-inline: 8px; }
    .navbar .nav-menu a { padding-inline: 4px; font-size: 14px; letter-spacing: 0; }
}

@media (max-width: 1024px) {
    /* 调整导航容器高度和内间距 */
    .navbar { --nav-bar-height: 72px; }
    
    .navbar .nav-container {
        justify-content: space-between;
        min-height: var(--nav-bar-height);
        padding: 0 15px;
    }
    
    /* 优化品牌标识在移动端的显示 */
    .navbar .brand-logo {
        margin-left: 15px;
    }
    
    .navbar .brand-logo a {
        font-size: 1.2rem;
        gap: 0.3rem;
    }
    
    /* 移动端认证区域优化 */
    .navbar .nav-auth {
        margin-left: auto;
        padding-right: 0;
        gap: 0.5rem;
    }
    
    /* 移动端隐藏桌面版退出按钮 */
    .navbar .logout-desktop {
        display: none;
    }
    
    /* 移动端按钮样式优化 */
    .navbar .nav-auth .btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
        min-height: 36px;
        border-radius: 8px;
    }
    
    /* 用户信息区域优化 - 移动端改为上下布局 */
    .navbar .user-info {
        flex-direction: column;
        gap: 2px;
        align-items: center;
        text-align: center;
    }
    
    .navbar .user-avatar {
        width: 28px;
        height: 28px;
    }
    
    .navbar .user-welcome {
        font-size: 0.8rem;
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* 汉堡菜单按钮优化 */
    .navbar .hamburger {
        display: flex;
        padding: 5px;
        margin-right: 8px;
    }
    
    .navbar .hamburger {
        --hamburger-line-width: 22px;
        --hamburger-line-offset: 6px;
    }
    
    /* 完整站点导航由底栏和更多发现承接。 */
    .navbar .nav-menu {
        display: none;
    }
}

/* 更小屏幕优化 */
@media (max-width: 480px) {
    .navbar { --nav-bar-height: 66px; }
    .navbar .nav-container {
        padding: 0 10px;
        min-height: var(--nav-bar-height);
    }
    
    /* 小屏幕下品牌标识位置调整 */
    .navbar .brand-logo {
        margin-left: 12px;
    }
    
    .navbar .brand-logo a {
        font-size: 1.1rem;
    }
    
    .navbar .nav-auth .btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        min-height: 32px;
    }
    
    /* 小屏幕用户信息区域 - 保持上下布局 */
    .navbar .user-info {
        flex-direction: column;
        gap: 1px;
        align-items: center;
        text-align: center;
    }
    
    .navbar .user-welcome {
        font-size: 0.75rem;
        max-width: 60px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .navbar .user-avatar {
        width: 24px;
        height: 24px;
    }
    
    /* 小屏幕汉堡菜单调整 */
    .navbar .hamburger {
        margin-right: 6px;
    }
    
}

/* ===== 移动端底部导航栏样式 ===== */

/* 底部导航栏主容器 */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    --bottom-nav-height: 60px;
    height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
    display: none; /* 默认隐藏，只在移动端显示 */
    padding: 0;
    margin: 0;
    /* 确保底部导航栏始终在最底部 */
    min-height: var(--bottom-nav-height);
}

/* 底部导航容器 */
.bottom-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
    padding: 6px 12px;
    position: relative;
    height: 60px;
    /* 确保容器高度固定 */
    box-sizing: border-box;
}

/* 底部导航项 */
.bottom-nav-item {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    height: 100%;
    /* 确保所有项目高度一致 */
    max-width: 80px;
}

/* More occupies the same column as the other destinations. */
.bottom-nav-item.bottom-nav-center {
    flex: 1;
    margin: 0;
    position: relative;
    z-index: 10;
}

/* 底部导航链接 */
.bottom-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--sm-text-muted, #aeb4bf);
    padding: 6px 8px;
    border-radius: 12px;
    position: relative;
    width: 100%;
    height: 100%;
    /* 确保链接填满容器 */
    min-height: 48px;
    /* 最小高度确保触摸友好 */
    -webkit-tap-highlight-color: transparent;
    transition: background-color 120ms ease, color 120ms ease;
}

/* 底部导航图标 */
.bottom-nav-link i {
    font-size: 20px;
    margin-bottom: 2px;
    color: inherit;
}

/* 底部导航文字 */
.bottom-nav-text {
    font-size: 11px;
    font-weight: 500;
    font-family: var(--spinmatch-font-family);
    letter-spacing: 0.3px;
    line-height: 1.2;
    color: inherit;
    white-space: nowrap;
    margin-top: 1px;
}

/* 当前页面在 hover 和触摸按下时始终保留选中提示。 */
.bottom-nav-link:hover {
    color: var(--sm-text, #f4f5f7);
    background: rgba(var(--sm-accent-rgb, 216, 222, 232), 0.07);
}

.bottom-nav-link:active {
    color: var(--sm-text, #f4f5f7);
    background: rgba(var(--sm-accent-rgb, 216, 222, 232), 0.14);
}

.bottom-nav-item.active .bottom-nav-link,
.bottom-nav-link.active {
    color: var(--sm-text, #f4f5f7);
    background: var(--sm-nav-selection, rgba(255, 255, 255, 0.10));
    box-shadow: none;
}


/* More navigation is a destination, with the same footprint as its neighbours. */
.bottom-nav-add-btn {
    touch-action: none;
    width: 100%;
    height: 56px;
    border-radius: 12px;
    background: transparent;
    border: 0;
    color: var(--sm-text-muted, #aeb4bf);
    font-size: 24px;
    cursor: pointer;
    transition: background-color 120ms ease, box-shadow 120ms ease;
    box-shadow: none;
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
    margin-top: 0;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-add-btn:hover { background: rgba(var(--sm-accent-rgb), .07); color: var(--sm-text); }

.bottom-nav-add-btn:active,
.bottom-nav-add-btn[aria-expanded="true"] {
    background: var(--sm-nav-selection, rgba(255,255,255,.10));
    color: var(--sm-text);
    box-shadow: none;
}

.nav-more-icon { display: block; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 24px; transition: transform 240ms ease; }
.bottom-nav-add-btn[aria-expanded="true"] .nav-more-icon { transform: rotate(180deg); }

/* Capture the glass itself so an ancestor transition layer cannot isolate its backdrop. */
#main-navbar .nav-surface { view-transition-name: spinmatch-navbar; }
#mobile-bottom-nav .bottom-nav-surface { view-transition-name: spinmatch-bottom-nav; }
::view-transition-group(spinmatch-navbar),
::view-transition-group(spinmatch-bottom-nav) { animation: none; z-index: 100; }
::view-transition-old(spinmatch-navbar),
::view-transition-old(spinmatch-bottom-nav) { animation: nav-chrome-out 180ms ease both; opacity: 1; }
::view-transition-new(spinmatch-navbar),
::view-transition-new(spinmatch-bottom-nav) { animation: nav-chrome-in 180ms ease both; opacity: 1; mix-blend-mode: normal; }
@keyframes nav-chrome-out { to { opacity:0; } }
@keyframes nav-chrome-in { from { opacity:0; } }

/* 消息徽章 */
.nav-message-icon { position:relative; display:inline-flex; align-items:center; justify-content:center; width:24px; height:24px; }
.message-badge {
    position:absolute; inset:auto auto calc(100% - 9px) calc(100% - 7px);
    display:flex; align-items:center; justify-content:center;
    box-sizing:border-box; min-width:18px; height:18px; padding:0 4px;
    border:0; border-radius:999px;
    background:linear-gradient(145deg,#ff5265,#e72748 70%); color:#fff;
    font-size:10px; font-weight:750; line-height:1; font-variant-numeric:tabular-nums;
    box-shadow:inset 0 1px 1px rgba(255,255,255,.22), 0 2px 5px rgba(204,29,58,.2); pointer-events:none;
}

/* The lower drawer shares its bar's surface; the right drawer meets the fixed upper bar. */
.nav-surface,
.bottom-nav-surface {
    position: absolute;
    left: 0;
    right: 0;
    background: var(--sm-sticky-surface);
    backdrop-filter: var(--sm-sticky-blur);
    -webkit-backdrop-filter: var(--sm-sticky-blur);
}
.nav-surface { top: 0; box-shadow: none; border-radius: 0 0 18px 18px; }
.bottom-nav-surface { bottom: 0; padding-bottom: env(safe-area-inset-bottom, 0px); box-shadow: none; }
.mobile-tools-overlay {
    position: absolute;
    top: 100%;
    right: 0;
    width: min(320px, calc(100vw - 32px));
    background: rgba(20,20,20,.52);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 0 0 0 14px;
    box-shadow: -5px 8px 18px rgba(0,0,0,.08);
}

.nav-page-dismiss {
    position: fixed;
    inset: 0;
    z-index: 998;
    background: rgba(0,0,0,.08);
    opacity: 0;
    pointer-events: none;
    transition: opacity 240ms ease;
}
.nav-page-dismiss.show { opacity: 1; pointer-events: auto; }

.nav-panel-overlay {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: grid-template-rows 300ms cubic-bezier(.2,.7,.2,1), opacity 240ms ease, visibility 0s linear 300ms;
}
.nav-panel-overlay.show {
    grid-template-rows: 1fr;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}
.nav-panel { min-width: 0; min-height: 0; overflow: hidden; color: #f4f4f4; }
.nav-panel:focus { outline: none; }
.nav-panel-content { max-height: calc(100dvh - var(--nav-bar-height, 72px) - 80px); overflow-y: auto; padding: 10px 20px 18px; }
.mobile-tools-panel .nav-panel-content { padding: 10px 16px 18px; overscroll-behavior-y: contain; }
.add-menu-content .nav-panel-content { max-width: 480px; max-height: calc(100dvh - var(--bottom-nav-height, 60px) - 96px); margin: 0 auto; padding-top: 14px; padding-bottom: 12px; }
.nav-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.nav-panel-heading h2 { margin: 0; color: #bdbdbd; font-size: 13px; line-height: 1.4; font-weight: 500; letter-spacing: .06em; }
.add-menu-content .nav-panel-heading { justify-content: flex-end; margin-bottom: 0; }
.nav-panel-close { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 50%; background: transparent; color: #bdbdbd; cursor: pointer; }
.nav-explore-links { display: grid; gap: 2px; }
.add-menu-item,
.nav-tool-link { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 48px; padding: 12px; color: #ececec; border: 0; border-radius: 10px; background: transparent; text-decoration: none; font: inherit; font-size: 14px; line-height: 1.35; text-align: left; cursor: pointer; transition: background-color 160ms ease, color 160ms ease; }
.add-menu-item { min-height: 52px; }
.add-menu-item > i:first-child,
.nav-tool-link > i:first-child { flex: 0 0 20px; width: 20px; color: #c5c5c5; text-align: center; }
.nav-home-icon { flex: 0 0 20px; width: 20px; height: 20px; fill: none; stroke: #c5c5c5; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.add-menu-item > i:last-child,
.nav-tools-actions .nav-tool-link > i:last-child { margin-left: auto; color: #888; font-size: 11px; }
.add-menu-item:hover,
.add-menu-item.active,
.nav-tool-link:not(:disabled):hover,
.nav-tool-link.active,
.nav-panel-close:hover { background: rgba(255,255,255,.065); color: #fff; }
.add-menu-text { flex: 1; }
.nav-tools-actions { margin-bottom: 4px; }
.nav-tools-actions .nav-tool-link { width: 100%; }
.nav-tools-auth-buttons { display: flex; gap: 12px; margin-top: 12px; }
.nav-tools-auth-buttons .btn { flex: 1; min-width: 0; min-height: 44px; }
.nav-tools-utilities { display: grid; gap: 4px; }
.nav-tools-utilities .nav-tool-link { gap: 8px; font-size: 13px; min-height: 44px; }
.nav-tools-utilities .nav-tool-link > i { color: inherit; }
.nav-tools-settings { margin-top: 16px; }
.nav-tools-settings h3 { margin: 0 12px 4px; color: #aaa; font-size: 12px; line-height: 1.5; font-weight: 500; }
.nav-tools-settings .nav-tool-link { width: 100%; min-height: 44px; }
.nav-tools-settings .nav-tool-link:disabled { opacity: 1; color: #929292; cursor: default; }
.nav-tools-settings .nav-tool-link:disabled > i { color: #929292; }
.nav-language-picker { padding: 8px 12px 12px; }
.nav-language-picker > span { display: block; margin-bottom: 8px; color: #ececec; font-size: 14px; }
.nav-language-options, .nav-theme-options { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 4px; padding: 3px; border: 0; border-radius: 10px; }
.nav-language-options .nav-tool-link { justify-content: center; padding: 8px 12px; }
.nav-language-options .nav-tool-link[aria-pressed="true"] { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.nav-preferences-panel { padding: 0; overflow: hidden; }
.nav-preferences-panel > .nav-language-picker { padding: 4px 20px 12px; }
[data-action="toggle-preferences"] > i:last-child { transition: transform 300ms cubic-bezier(.2,.7,.2,1); }
[data-action="toggle-preferences"][aria-expanded="true"] > i:last-child { transform: rotate(180deg); }
.nav-theme-options .nav-tool-link { justify-content: center; flex-direction: column; gap: 6px; padding: 8px 2px; font-size: 12px; }
.nav-theme-options .nav-tool-link[aria-pressed="true"] { background: var(--sm-segment-fill); color: var(--sm-text); }
.navbar .mobile-tools-panel .nav-language-options .nav-tool-link { padding-inline: 2px; font-size: 12px; }
.nav-upcoming-label { margin-left: auto; font-size: 11px; color: #929292; white-space: nowrap; }
.nav-tools-logout { margin-top: 12px; min-height: 44px; color: #b7b7b7; font-size: 12px; }
.nav-share-copy-field { position: fixed; left: -9999px; top: 0; opacity: 0; pointer-events: none; }
.nav-panel [hidden], .message-badge[hidden] { display: none; }
.nav-panel :focus-visible,
.navbar button:focus-visible,
.navbar .nav-menu a:focus-visible,
.bottom-nav-link:focus-visible,
.bottom-nav-add-btn:focus-visible { outline: 2px solid #e8e8e8; outline-offset: -3px; }

@media (prefers-reduced-motion: reduce) {
    [data-action="toggle-preferences"] > i:last-child,
    .nav-panel-overlay,
    .nav-panel,
    .nav-page-dismiss,
    .add-menu-item,
    .nav-tool-link,
    .navbar .hamburger > .hamburger-line,
    .navbar .nav-menu a,
    .bottom-nav-link,
    .bottom-nav-add-btn,
    .bottom-nav-add-btn i { transition: none; }
}

/* 响应式设计 - 只在移动端显示底部导航栏 */
@media (max-width: 1024px) {
    .mobile-bottom-nav {
        display: block;
    }
    
    /* 为底部导航栏预留空间，避免内容被遮挡 */
    body {
        padding-bottom: 60px;
    }
    
    /* 确保页面内容不会被底部导航栏遮挡 */
    .main-content,
    .page-content,
    .container {
        margin-bottom: 20px;
    }
}

/* 更小屏幕优化 */
@media (max-width: 480px) {
    .mobile-bottom-nav { --bottom-nav-height: 58px; }
    
    .bottom-nav-container {
        height: 58px;
        padding: 5px 8px;
    }
    
    .bottom-nav-link {
        padding: 4px 6px;
        min-height: 44px;
    }
    
    .bottom-nav-link i {
        font-size: 18px;
        margin-bottom: 1px;
    }
    
    .bottom-nav-text {
        font-size: 10px;
    }
    
    .bottom-nav-add-btn {
        width: 100%;
        height: 48px;
        font-size: 20px;
        margin-top: 0;
    }
    
    body {
        padding-bottom: 58px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {
    .navbar .nav-container { padding-inline: 8px; }
    .navbar .brand-logo { margin-left: 0; }
    .navbar .nav-auth { margin-right: 0; }
    .navbar .nav-auth .btn { padding-inline: 8px; }
    .navbar .hamburger { margin-inline: 0; }

    .bottom-nav-container {
        padding: 6px 4px;
    }
    
    .bottom-nav-item.bottom-nav-center {
        margin: 0;
    }
    
    .bottom-nav-link {
        padding: 4px;
    }
    
    .bottom-nav-text {
        font-size: 9px;
    }
    
    .bottom-nav-add-btn {
        width: 100%;
        height: 44px;
        font-size: 18px;
    }
} 

/* Compact right-hand settings rail; the lower navigation keeps its own motion. */
.navbar .mobile-tools-overlay { position: fixed; top: var(--nav-bar-height); right: 0; bottom: auto; width: min(252px, 80vw); display: block; border: 0; border-radius: 0 0 0 18px; background: rgba(26,26,26,.82); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); transform: translateX(100%); transition: transform 220ms ease,opacity 180ms ease,visibility 220ms; }
.navbar .mobile-tools-overlay.show { transform: translateX(0); }
.navbar .mobile-tools-panel { height: auto; }
.navbar .mobile-tools-panel .nav-panel-content { display: flex; flex-direction: column; height: auto; max-height: calc(100dvh - var(--nav-bar-height) - 80px); box-sizing: border-box; padding: 8px 14px 18px; }
.navbar .mobile-tools-panel .nav-panel-heading { margin: 0; height: 0; }
.navbar .mobile-tools-panel .nav-tools-settings { margin: 0; }
.navbar .mobile-tools-panel .nav-tools-settings > h3 { display: none; }
.navbar .mobile-tools-panel .nav-language-options { gap: 4px; padding: 4px; border: 0; background: rgba(255,255,255,.025); }
.navbar .mobile-tools-panel .nav-language-options .nav-tool-link { min-width: 0; padding: 8px; }
.navbar .mobile-tools-panel .nav-language-options .nav-tool-link[aria-pressed="true"] { box-shadow: none; background: transparent; }
.navbar .mobile-tools-panel .nav-tools-guest, .navbar .mobile-tools-panel .nav-tools-logout { margin-top: 12px; }
@media (prefers-reduced-motion: reduce) { .navbar .mobile-tools-overlay { transition: none; } }
/* Reveal inside the viewport so a closed rail cannot widen narrow pages. */
.navbar .mobile-tools-overlay { transform: none; clip-path: inset(0 0 0 100%); transition: clip-path 220ms ease,opacity 180ms ease,visibility 220ms; }
.navbar .mobile-tools-overlay.show { transform: none; clip-path: inset(0); }

.navbar .nav-surface { background: var(--sm-sticky-surface, rgba(26,26,26,.72)); border: 0; box-shadow: none; }
.mobile-bottom-nav .add-menu-overlay { border-radius: 18px 18px 0 0; overflow: hidden; }
.mobile-bottom-nav:has(.add-menu-overlay.show) .bottom-nav-surface { border-radius: 18px 18px 0 0; }

/* One connected edge while the right-hand menu unfolds. */
.navbar:has(.mobile-tools-overlay.show) .nav-surface { border-bottom-right-radius: 0; }
.navbar .mobile-tools-overlay {
    top: calc(var(--nav-bar-height, 72px) - 1px);
    border-radius: 0 0 18px 18px;
    background: var(--sm-sticky-surface);
    backdrop-filter: var(--sm-sticky-blur);
    -webkit-backdrop-filter: var(--sm-sticky-blur);
    overflow: hidden;
    border: 0;
    box-shadow: none;
}
html.sm-chat-scroll-locked .mobile-bottom-nav {
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(calc(100% + env(safe-area-inset-bottom, 0px))) !important;
    transition: none !important;
}

/* The top bar, pinned rows and settings share one physical backdrop. */
html.sm-unified-navigation .navbar :is(.nav-surface,.mobile-tools-overlay) {
    background: transparent !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
    border: 0; box-shadow: none;
}
html.sm-unified-navigation .navbar .mobile-tools-overlay {
    top: var(--nav-bar-height, 72px); border-radius: 0;
    opacity: 1; transition: clip-path 240ms cubic-bezier(.2,.7,.2,1), visibility 0s linear 240ms;
}
html.sm-unified-navigation .navbar .mobile-tools-overlay.show { transition-delay: 0s; }
.nav-page-dismiss { background: transparent; }
.nav-auth[data-auth-pending] { visibility: hidden; }
.notification-email-setting { padding: 6px 12px; }
.notification-email-setting label { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin: 0; color: var(--sm-text); font-size: 14px; cursor: pointer; }
.notification-email-setting input { flex: 0 0 34px; width: 34px; height: 20px; margin: 0; appearance: none; border: 0; border-radius: 99px; background: rgba(var(--sm-ink-rgb),.17); position: relative; cursor: pointer; transition: background-color 180ms ease; }
.notification-email-setting input::after { content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%; top: 3px; left: 3px; background: var(--sm-text); transition: transform 180ms ease; }
.notification-email-setting input:checked { background: #b92532; }
.notification-email-setting input:checked::after { transform: translateX(14px); background: #fff; }
.notification-email-setting input:disabled { opacity: .45; cursor: default; }
.notification-email-setting input:focus-visible { outline: 2px solid var(--sm-text); outline-offset: 3px; }
.notification-email-setting small { display: block; font-size: 11px; line-height: 1.5; color: var(--sm-text-muted); }
.notification-email-setting small[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) {
    html.sm-unified-navigation .navbar .mobile-tools-overlay,
    .nav-more-icon, .notification-email-setting input, .notification-email-setting input::after { transition: none; }
}

.nav-page-dismiss--aux { backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);background:rgba(0,0,0,.12); }
.bottom-nav-container { transition:filter 280ms ease,opacity 280ms ease; }
.nav-auxiliary-open .bottom-nav-container { filter:blur(2px);opacity:.6;pointer-events:none; }
@media(min-width:769px) { .mobile-bottom-nav.nav-auxiliary-open { display:block; } }
@media(prefers-reduced-motion:reduce) { .bottom-nav-container { transition:none; } }
