/* ===================================================================
   导航栏 snx-* 全新方案 (2026-10-22)
   彻底隔离旧 .site-header/.site-nav/.nav-* 规则，避免历史冲突
   =================================================================== */

/* 1. 基础防抖动 */
html, body {
    overflow-x: clip !important; /* 只裁切，不产生滚动条，不搞死下拉 */
    margin: 0 !important;
    padding: 0 !important;
}

/* 2. 导航栏外壳：固定在顶部，全宽，白底 */
.snx-header {
    position: sticky !important;
    top: 0 !important;
    width: 100% !important;
    height: 72px !important;
    background-color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important;
    z-index: 99999 !important;
    display: flex !important;
    justify-content: center !important; /* 整体居中 */
}

/* 3. 导航内层容器：限制最大宽度，左右两端对齐 */
.snx-header-inner {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 1400px !important; /* 限制宽度，不贴边 */
    height: 100% !important;
    padding: 0 24px !important;
    box-sizing: border-box !important;
}

/* 4. 左侧菜单区：水平排列，禁止折行 */
.snx-nav {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    flex-wrap: nowrap !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 100% !important;
}

/* 5. 菜单项：相对定位，不被压缩 */
.snx-nav-item {
    position: relative !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    cursor: pointer !important;
}

.snx-nav-title {
    color: #333333 !important;
    font-size: 15px !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
}

/* 6. 下拉菜单：纯 CSS 绝对定位隐藏 */
.snx-dropdown-menu {
    display: none !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    min-width: 220px !important;
    background-color: #ffffff !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    z-index: 999999 !important;
    padding: 8px 0 !important;
    list-style: none !important;
    margin: 0 !important;
}

/* 7. 核心：鼠标悬停直接展开 */
.snx-nav-item:hover .snx-dropdown-menu {
    display: block !important;
}

/* 8. 靠右侧的最后 4 个菜单，下拉框向右展开，绝不撑出屏幕 */
.snx-nav-item:nth-last-child(-n+4) .snx-dropdown-menu {
    left: auto !important;
    right: 0 !important;
}

/* 9. 下拉子项样式 */
.snx-dropdown-menu li a {
    display: block !important;
    padding: 10px 20px !important;
    color: #333333 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    text-align: left !important;
    white-space: nowrap !important;
}
.snx-dropdown-menu li a:hover {
    background-color: #f3f4f6 !important;
    color: #4a3a6b !important;
}


.snx-nav-item:hover .snx-dropdown-menu {
display: block !important;
}
/* 确保父级相对定位 */
.snx-nav-item {
position: relative !important;
}
/* 祖先容器显式放开裁切 */
.snx-header,
.snx-header-inner,
.snx-nav,
.site-shell {
overflow: visible !important;
}

/* ===================================================================
   强行解除一切遮挡与点击失效 (2026-10-22)
   =================================================================== */
.snx-header {
position: sticky !important;
top: 0 !important;
z-index: 99999 !important;
overflow: visible !important; /* 绝对不许裁剪下拉 */
}
.snx-header-inner {
display: flex !important;
justify-content: space-between !important;
align-items: center !important;
overflow: visible !important;
}
.snx-nav {
display: flex !important;
overflow: visible !important;
}
/* 确保父级相对定位 */
.snx-nav-item {
position: relative !important;
z-index: 100000 !important;
}
/* 确保父级链接能点击且不被挡住 */
.snx-nav-item > a,
.snx-nav-title {
position: relative !important;
z-index: 100001 !important;
pointer-events: auto !important;
cursor: pointer !important;
}
/* 下拉菜单绝对定位与极高层级 */
.snx-dropdown-menu {
display: none !important;
position: absolute !important;
top: 100% !important;
left: 0 !important;
background-color: #ffffff !important;
box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important;
z-index: 100002 !important;
min-width: 220px !important;
padding: 10px 0 !important;
}
/* 悬停显示 */
.snx-nav-item:hover .snx-dropdown-menu {
display: block !important;
}
/* 下拉子项 */
.snx-dropdown-menu li a {
display: block !important;
padding: 10px 20px !important;
color: #333 !important;
text-decoration: none !important;
position: relative !important;
z-index: 100003 !important;
}

/* ===================================================================
   最终通用样式 (2026-10-24)
   =================================================================== */
/* 彻底解除裁剪 */
html, body {
overflow-x: clip !important;
}
.snx-header, .snx-header-inner, .snx-nav, .site-shell {
overflow: visible !important;
}
/* 下拉菜单终极强制样式 */
.snx-nav-item {
position: relative !important;
}
.snx-dropdown-menu {
display: none !important;
position: absolute !important;
top: 100% !important;
left: 0 !important;
min-width: 220px !important;
background-color: #ffffff !important;
box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
border: 1px solid #e5e7eb !important; /* 正常边框，不是红框 */
z-index: 999999 !important;
padding: 10px 0 !important;
}
/* 鼠标悬停必定展开 */
.snx-nav-item:hover .snx-dropdown-menu {
display: block !important;
}
/* 右侧最后四个菜单靠右展开 */
.snx-nav-item:nth-last-child(-n+4) .snx-dropdown-menu {
left: auto !important;
right: 0 !important;
}
/* 子菜单文字样式 */
.snx-dropdown-menu li a {
display: block !important;
padding: 10px 20px !important;
color: #333 !important;
text-decoration: none !important;
white-space: nowrap !important;
}

/* ===================================================================
   导航栏字体与颜色高级美化 (2026-10-24)
   =================================================================== */
/* 1. 基础字体优化 */
.snx-header {
/* 使用更现代、学术的无衬线字体 */
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif !important;
-webkit-font-smoothing: antialiased !important; /* 让字体边缘更平滑 */
}
/* 2. 一级菜单文字颜色与字重 */
.snx-nav-title {
color: #374151 !important; /* 高级深灰（不用纯黑） */
font-size: 15px !important;
font-weight: 500 !important; /* 稍微加粗，显得更有力量 */
letter-spacing: 0.5px !important; /* 增加一点字间距，更有呼吸感 */
transition: color 0.2s ease !important;
}
/* 3. 一级菜单悬停效果（变成品牌紫） */
.snx-nav-item:hover > .snx-nav-title {
color: #4A3A6B !important;
}
/* 4. 下拉菜单容器微调 */
.snx-dropdown-menu {
border-radius: 12px !important; /* 更圆润的边角 */
box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08) !important; /* 更柔和高级的阴影 */
border: 1px solid #f3f4f6 !important;
padding: 8px !important; /* 统一内边距 */
}
/* 5. 下拉子项的文字与颜色 */
.snx-dropdown-menu li a {
color: #4b5563 !important; /* 子项文字稍微浅一点 */
font-size: 14px !important;
border-radius: 8px !important; /* 子项悬停时也是圆角 */
margin: 2px 8px !important; /* 让子项不要太贴边 */
padding: 10px 16px !important;
transition: all 0.2s ease !important;
}
/* 6. 下拉子项悬停效果（浅色背景 + 品牌紫文字） */
.snx-dropdown-menu li a:hover {
background-color: #f3f4f6 !important;
color: #4A3A6B !important;
font-weight: 500 !important;
}
/* 7. 当前菜单项激活状态高亮 */
.snx-nav-item.active > .snx-nav-title {
color: #4A3A6B !important;
font-weight: 600 !important;
}

/* ====== 下拉子项图标对齐 (2026-10-24) ====== */
.snx-dropdown-menu li a {
display: flex !important;
align-items: center !important; /* 确保图标和文字居中对齐 */
gap: 8px !important; /* 图标和文字之间的间距 */
}

/* ====== 颜色强制修正：干掉蓝色，锁定品牌紫 (2026-10-24) ====== */
/* 1. 干掉所有链接的默认蓝色和下划线 */
.snx-nav-item > a,
.snx-nav-title {
color: #374151 !important; /* 默认深灰 */
text-decoration: none !important; /* 去掉蓝色下划线 */
transition: color 0.2s ease !important;
}
/* 2. 悬停时变成品牌紫 */
.snx-nav-item:hover > a,
.snx-nav-item:hover > .snx-nav-title {
color: #4A3A6B !important;
}
/* 3. 当前所在页面的菜单，强制保持品牌紫 */
.snx-nav-item.active > a,
.snx-nav-item.active > .snx-nav-title {
color: #4A3A6B !important;
font-weight: 600 !important; /* 加粗一点突出当前状态 */
}
/* 4. 确保不出现蓝色 */
.snx-header a:visited {
color: #1F2937 !important;
}

/* ====== 导航栏高级质感颜色微调 (2026-10-24) ====== */
/* 1. 默认状态：深炭灰色，去下划线 */
.snx-nav-item > a,
.snx-nav-title {
color: #1F2937 !important; /* 高级深灰，比纯黑更柔和 */
text-decoration: none !important; /* 干掉默认的蓝色下划线 */
transition: color 0.2s ease !important;
}
/* 2. 鼠标悬停：品牌紫色 */
.snx-nav-item:hover > a,
.snx-nav-item:hover > .snx-nav-title {
color: #4A3A6B !important;
}
/* 3. 当前所在页面（如有 active 类）：品牌紫色加粗 */
.snx-nav-item.active > a,
.snx-nav-item.active > .snx-nav-title {
color: #4A3A6B !important;
font-weight: 600 !important;
}
/* 4. 确保点击过的链接（visited）也不会变成紫色/蓝色 */
.snx-nav-item > a:visited {
color: #1F2937 !important;
}

/* ====== 导航栏高级视觉与微动效 (2026-10-24) ====== */
/* 1. 基础文字微调：增加字间距，使用更现代的字体栈 */
.snx-nav-title,
.snx-nav-item > a {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif !important;
font-size: 15px !important;
font-weight: 500 !important;
color: #475569 !important; /* 优雅的蓝灰色，比死灰更高级 */
letter-spacing: 0.5px !important;
text-decoration: none !important;
position: relative !important;
padding-bottom: 8px !important; /* 给底部指示线留空间 */
}
/* 2. 核心：底部紫金渐变指示线（默认隐藏） */
.snx-nav-title::after,
.snx-nav-item > a::after {
content: '' !important;
position: absolute !important;
bottom: 0 !important;
left: 50% !important;
transform: translateX(-50%) scaleX(0) !important; /* 初始宽度为0 */
width: 100% !important;
height: 2px !important;
background: linear-gradient(90deg, #4A3A6B, #D4AF37) !important; /* 品牌紫到金的渐变 */
border-radius: 2px !important;
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important; /* 丝滑过渡动画 */
}
/* 3. 悬浮时：文字变紫，指示线从中间向两边展开 */
.snx-nav-item:hover > .snx-nav-title,
.snx-nav-item:hover > a {
color: #4A3A6B !important;
}
.snx-nav-item:hover > .snx-nav-title::after,
.snx-nav-item:hover > a::after {
transform: translateX(-50%) scaleX(1) !important;
}
/* 4. 当前页面高亮（Active）：强制显示指示线且加粗 */
.snx-nav-item.active > .snx-nav-title,
.snx-nav-item.active > a {
color: #4A3A6B !important;
font-weight: 600 !important;
}
.snx-nav-item.active > .snx-nav-title::after,
.snx-nav-item.active > a::after {
transform: translateX(-50%) scaleX(1) !important;
}
/* 5. 导航栏容器增加微妙的毛玻璃背景，提升质感 */
.snx-header {
background-color: rgba(255, 255, 255, 0.95) !important;
backdrop-filter: blur(10px) !important;
-webkit-backdrop-filter: blur(10px) !important;
border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

/* ====== 终极导航视觉覆盖 (2026-10-24) ====== */
/* 1. 强制替换为系统级高级字体（无需加载，秒出） */
.snx-nav-title,
.snx-nav-item > a {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif !important;
font-size: 15px !important;
font-weight: 500 !important;
/* 核心：干掉死黑，使用高级深蓝灰，并强制覆盖全局颜色 */
color: #334155 !important;
letter-spacing: 0.5px !important;
text-decoration: none !important;
/* 修复垂直居中：去掉 padding-bottom，改用绝对定位 */
position: relative !important;
display: flex !important;
align-items: center !important;
height: 72px !important; /* 让 a 标签占满整个导航高度 */
}
/* 2. 下划线伪元素：绝对定位，不影响文字居中 */
.snx-nav-title::after,
.snx-nav-item > a::after {
content: '' !important;
position: absolute !important;
bottom: 0 !important; /* 贴紧底部 */
left: 50% !important;
transform: translateX(-50%) scaleX(0) !important;
width: 80% !important; /* 长度占文字的 80% */
height: 3px !important;
background: linear-gradient(90deg, #4A3A6B, #D4AF37) !important;
transition: transform 0.3s ease !important;
border-radius: 3px 3px 0 0 !important;
}
/* 3. 悬停与激活状态：变色 + 下划线展开 */
.snx-nav-item:hover > .snx-nav-title,
.snx-nav-item:hover > a,
.snx-nav-item.active > .snx-nav-title,
.snx-nav-item.active > a {
color: #4A3A6B !important; /* 品牌紫 */
font-weight: 600 !important;
}
.snx-nav-item:hover > .snx-nav-title::after,
.snx-nav-item:hover > a::after,
.snx-nav-item.active > .snx-nav-title::after,
.snx-nav-item.active > a::after {
transform: translateX(-50%) scaleX(1) !important; /* 展开下划线 */
}
/* 4. 确保已经点击过的链接不会变成死黑 */
.snx-header a:visited {
color: #334155 !important;
}


/* 下拉菜单分组标题 (2026-10-23-perfect-nav) */
.dropdown-header {
    padding: 8px 20px 4px 20px !important;
    font-size: 12px !important;
    color: #9CA3AF !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin: 0 !important;
    pointer-events: none !important;
    border-top: 1px solid #f3f4f6 !important;
    margin-top: 8px !important;
}
.dropdown-header:first-child {
    border-top: none !important;
    margin-top: 0 !important;
}
.dropdown-header h6 {
    margin: 0 !important;
    padding: 0 !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    color: inherit !important;
    line-height: 1.4 !important;
}
.snx-dropdown-menu .snx-dropdown-group {
    list-style: none !important;
    cursor: default !important;
}
.snx-dropdown-menu .snx-dropdown-group:hover {
    background-color: transparent !important;
}

/* ============================================================
   导航「筹备中」状态徽章（2026-10-27）
   位置说明：徽章挂在 <li class="snx-nav-item"> 内、<a class="snx-nav-title"> 之后，
   而不是塞进 <a> 内部 —— 因为 <a> 带 data-zh/data-en，platform.js 的 switchLang()
   会对它执行 node.textContent = ...，会把内部的 <span> 和徽章一起抹掉。
   ============================================================ */
/* ⚠️ 必须用高特异性 + !important：
   nav.css 里有 `html body .snx-header .snx-nav .snx-nav-item > a {... !important}`
   一类规则会把同容器内文本的 color / font-size 一起带偏（实测徽章被染成 #475569、字号变 15px）。
   这里把选择器提到 0,4,x 级别并全部 !important，确保徽章自己的配色与字号生效。 */
html body .snx-header .snx-nav .snx-nav-item > .badge-soon,
.snx-nav-item > .badge-soon,
.badge-soon {
    display: inline-block !important;
    font-size: 10px !important;
    line-height: 1.5 !important;
    padding: 1px 6px !important;
    margin-left: 5px !important;
    border-radius: 4px !important;
    background-color: #FEF3C7 !important;
    color: #92400E !important;   /* 深棕，对比度 ≈ 7.2:1，WCAG AA 达标 */
    border: 1px solid #FDE68A !important;
    font-weight: 700 !important;
    vertical-align: middle !important;
    white-space: nowrap !important;  /* 防止移动端换行成两行 */
    flex: 0 0 auto !important;       /* 在 flex 容器里不被压缩 */
    letter-spacing: 0 !important;
    text-decoration: none !important;
}
/* 深色模式下徽章保持可读（浅黄底在深底上也清楚，只需微调色） */
html[data-theme="dark"] .snx-nav-item > .badge-soon,
html[data-theme="dark"] .badge-soon {
    background-color: rgba(254,243,199,.92) !important;
    color: #78350F !important;
    border-color: rgba(253,230,138,.6) !important;
}
/* 窄屏：徽章缩小一点，但不换行 */
@media (max-width: 768px) {
    html body .snx-header .snx-nav .snx-nav-item > .badge-soon,
    .badge-soon { font-size: 9.5px !important; padding: 1px 5px !important; margin-left: 3px !important; }
}

/* ==========================================================================
   [SNX-L51-MOBILE] Responsive collapse for the restructured primary nav
   --------------------------------------------------------------------------
   .snx-nav is display:flex;nowrap at all widths (see top of this file), which
   overflows on phones. platform.css only handled the legacy .site-nav class,
   so the live .snx-nav never collapsed. These rules close that gap.
   Scope is strictly .snx-header / .snx-nav / .snx-header-cta.
   ========================================================================== */

/* Desktop/tablet: hamburger hidden, nav inline (default state) */
.snx-header .hamburger { display: none; }

/* ---- Tablet & below: switch to hamburger + slide-down panel ---- */
@media (max-width: 1080px) {

    /* keep the CTA visible in the header row at every width */
    .snx-header .snx-header-cta {
        display: inline-flex !important;
        padding: 7px 14px !important;
        font-size: 13px !important;
        margin-right: 8px !important;
    }

    .snx-header .hamburger { display: flex !important; }

    /* collapse the nav by default */
    .snx-header .snx-nav {
        display: none !important;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0 !important;
        background: #ffffff;
        padding: 8px 0 14px;
        border-bottom: 1px solid var(--line, #e5e0ee);
        box-shadow: 0 10px 28px rgba(74, 58, 107, .14);
        max-height: calc(100vh - 72px);
        overflow-y: auto;
        z-index: 60;
    }

    /* open state driven by the existing hamburger click handler */
    .snx-header.nav-open .snx-nav { display: flex !important; }

    /* each primary group becomes a full-width row */
    .snx-header .snx-nav .snx-nav-item {
        width: 100% !important;
        height: auto !important;
        border-bottom: 1px solid rgba(74, 58, 107, .07);
    }
    .snx-header .snx-nav .snx-nav-item > a,
    .snx-header .snx-nav .snx-nav-title {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        width: 100% !important;
        padding: 13px 18px !important;
        font-size: 15px !important;
        box-sizing: border-box;
        white-space: normal !important;
    }

    /* dropdowns become static accordions, hidden until the group is open */
    .snx-header .snx-nav .snx-dropdown-menu {
        position: static !important;
        display: none !important;
        flex-direction: column !important;
        background: #faf8fd !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 4px 0 8px !important;
        margin: 0 !important;
        min-width: 0 !important;
        width: 100% !important;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    .snx-header.nav-open .snx-nav .snx-nav-item.is-open > .snx-dropdown-menu,
    .snx-header .snx-nav .snx-nav-item.is-open > .snx-dropdown-menu {
        display: flex !important;
    }

    .snx-header .snx-nav .snx-dropdown-menu li { width: 100% !important; }
    .snx-header .snx-nav .snx-dropdown-menu .nav-sub-item {
        display: block !important;
        padding: 10px 18px 10px 32px !important;
        font-size: 14px !important;
        white-space: normal !important;
    }

    /* rotate the caret when a group is expanded */
    .snx-header .snx-nav .snx-nav-item.is-open > a .nav-arrow svg,
    .snx-header .snx-nav .snx-nav-item.is-open > .snx-nav-title .nav-arrow svg {
        transform: rotate(180deg);
    }
    .snx-header .snx-nav .nav-arrow svg { transition: transform .2s ease; }
}

/* ---- Small phones: tighten spacing, CTA stays visible ---- */
@media (max-width: 520px) {
    .snx-header .snx-header-cta {
        padding: 6px 10px !important;
        font-size: 12px !important;
        margin-right: 6px !important;
    }
    .snx-header .snx-nav .snx-nav-item > a,
    .snx-header .snx-nav .snx-nav-title { padding: 12px 14px !important; font-size: 14px !important; }
    .snx-header .snx-nav .snx-dropdown-menu .nav-sub-item { padding: 9px 14px 9px 26px !important; }
}

/* ==========================================================================
   [SNX-L51-CTA-FIX] Keep the header CTA legible in every link state
   --------------------------------------------------------------------------
   nav.css has `.snx-header a:visited { color:#1F2937 !important }` (twice) to
   stop menu items turning blue. That also hit the CTA, so a visited CTA painted
   near-black text on the dark purple pill. Pin the colour across all states.
   ========================================================================== */
html body .snx-header a.snx-header-cta,
html body .snx-header a.snx-header-cta:link,
html body .snx-header a.snx-header-cta:visited,
html body .snx-header a.snx-header-cta:hover,
html body .snx-header a.snx-header-cta:active,
html body .snx-header a.snx-header-cta:focus {
    color: #ffffff !important;
    background-color: #4A3A6B !important;
    text-decoration: none !important;
}
html body .snx-header a.snx-header-cta:hover,
html body .snx-header a.snx-header-cta:focus {
    background-color: #3A2B5A !important;
}

/* ==========================================================================
   [SNX-L51-MOBILE2] Mobile header fit + panel stacking
   --------------------------------------------------------------------------
   At 390px the header row (brand + CTA + Register/Login + lang + theme +
   hamburger) overflows, pushing the hamburger off-screen. The brief requires
   the CTA visible on mobile, so secondary controls move into the nav panel and
   the brand is allowed to truncate.
   ========================================================================== */

@media (max-width: 1080px) {

    /* --- 1. header row must fit inside the viewport --- */
    html body .snx-header .snx-header-inner {
        flex-wrap: nowrap !important;
        overflow: visible !important;
        gap: 6px !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        box-sizing: border-box !important;
        max-width: 100% !important;
    }

    /* brand shrinks first, never pushes controls out */
    html body .snx-header .site-brand {
        min-width: 0 !important;
        flex: 1 1 auto !important;
        overflow: hidden !important;
    }
    html body .snx-header .site-brand .brand {
        min-width: 0 !important;
        gap: 8px !important;
    }
    html body .snx-header .site-brand .brand > span:last-child {
        min-width: 0 !important;
        overflow: hidden !important;
    }
    html body .snx-header .site-brand .brand strong {
        display: block !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        font-size: 15px !important;
    }
    /* subtitle eats width for no value on phones */
    html body .snx-header .site-brand .brand small { display: none !important; }
    html body .snx-header .site-brand .brand-logo { width: 40px !important; height: 40px !important; }

    /* CTA and hamburger never shrink */
    html body .snx-header .snx-header-cta {
        flex: 0 0 auto !important;
        margin-right: 2px !important;
    }
    html body .snx-header .hamburger {
        flex: 0 0 auto !important;
        margin-left: 0 !important;
    }

    /* secondary controls leave the header row (they move into the panel) */
    html body .snx-header .header-actions {
        flex: 0 0 auto !important;
        margin-left: 0 !important;
        gap: 0 !important;
    }
    html body .snx-header .header-actions .auth-nav,
    html body .snx-header .header-actions .snx-lang-form,
    html body .snx-header .header-actions .theme-toggle {
        display: none !important;
    }

    /* --- 2. opened panel must sit ABOVE page content --- */
    html body .snx-header.nav-open {
        /* the sticky header already has z-index 99999; make the panel a
           separate sheet so the hero can never paint over it */
        position: sticky !important;
    }
    html body .snx-header.nav-open .snx-nav {
        position: fixed !important;
        top: var(--snx-header-h, 72px) !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-height: none !important;
        overflow-y: auto !important;
        background: #ffffff !important;
        border-top: 1px solid #e5e0ee !important;
        box-shadow: 0 16px 40px rgba(74,58,107,.18) !important;
        z-index: 100000 !important;
        padding-bottom: 28px !important;
    }

    /* --- 3. put the account / language controls INSIDE the panel --- */
    html body .snx-header.nav-open .snx-nav::after {
        content: "";
        display: block;
        height: 1px;
        background: #e5e0ee;
        margin: 10px 18px;
    }
}

/* very small phones: CTA may shorten but stays visible */
@media (max-width: 400px) {
    html body .snx-header .snx-header-cta {
        padding: 7px 11px !important;
        font-size: 12px !important;
        letter-spacing: -0.1px;
    }
    html body .snx-header .site-brand .brand strong { font-size: 14px !important; }
}

/* ==========================================================================
   [SNX-L51-MOBILE3] Panel height collapse fix
   --------------------------------------------------------------------------
   `.snx-nav-item { height:100% !important }` (desktop rule) + a fixed panel with
   top:72px/bottom:0 creates a circular height dependency: the panel sizes to its
   children while the children size to the panel (100%). Result: the column
   collapses to one row (~71px) and only "Home" renders.
   Mobile now sizes the panel by content with an explicit viewport cap.
   ========================================================================== */

@media (max-width: 1080px) {

    /* break the circular dependency */
    html body .snx-header.nav-open .snx-nav {
        top: auto !important;
        bottom: auto !important;
        height: auto !important;
        max-height: calc(100vh - 72px) !important;
        /* anchor right under the sticky header */
        margin-top: 0 !important;
    }
    html body .snx-header .snx-nav > .snx-nav-item,
    html body .snx-header.nav-open .snx-nav > .snx-nav-item {
        height: auto !important;
        min-height: 0 !important;
        flex: 0 0 auto !important;
    }

    /* the panel is a flex column of intrinsically-sized rows */
    html body .snx-header.nav-open .snx-nav {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
    }
}

/* ==========================================================================
   [SNX-L51-MOBILE3] Panel height collapse fix
   --------------------------------------------------------------------------
   `.snx-nav-item { height:100% !important }` (desktop rule) + a fixed panel with
   top:72px/bottom:0 creates a circular height dependency: the panel sizes to its
   children while the children size to the panel (100%). Result: the column
   collapses to one row (~71px) and only "Home" renders.
   Mobile now sizes the panel by content with an explicit viewport cap.
   ========================================================================== */

@media (max-width: 1080px) {

    /* break the circular dependency */
    html body .snx-header.nav-open .snx-nav {
        top: 72px !important;
        bottom: auto !important;
        height: auto !important;
        max-height: calc(100vh - 72px) !important;
        /* anchor right under the sticky header */
        margin-top: 0 !important;
    }
    html body .snx-header .snx-nav > .snx-nav-item,
    html body .snx-header.nav-open .snx-nav > .snx-nav-item {
        height: auto !important;
        min-height: 0 !important;
        flex: 0 0 auto !important;
    }

    /* the panel is a flex column of intrinsically-sized rows */
    html body .snx-header.nav-open .snx-nav {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
    }
}


/* [SNX-L51-MOBILE3b] explicit anchor — the previous `top:auto` left the fixed
   panel positioned against its static origin, scrolling it above the fold. */
@media (max-width: 1080px) {
    html body .snx-header.nav-open .snx-nav {
        top: 72px !important;
        bottom: auto !important;
        position: fixed !important;
        height: auto !important;
        max-height: calc(100vh - 72px) !important;
    }
}

/* [SNX-L51-MOBILE4] Tighten accordion sub-item layout.
   The dropdown kept desktop padding-left, pushing labels far right and leaving
   a wide empty gutter on narrow screens. Full-width, modest indent instead. */
@media (max-width: 1080px) {
    html body .snx-header.nav-open .snx-nav .snx-dropdown-menu {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 2px 0 8px 0 !important;
        background: #F8F6FB !important;
    }
    html body .snx-header.nav-open .snx-nav .snx-dropdown-menu li {
        display: block !important;
        width: 100% !important;
        float: none !important;
    }
    html body .snx-header.nav-open .snx-nav .snx-dropdown-menu .nav-sub-item {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 11px 18px 11px 34px !important;
        font-size: 14px !important;
        line-height: 1.45 !important;
        text-align: left !important;
        white-space: normal !important;
        text-indent: 0 !important;
        float: none !important;
    }
    /* let long labels wrap under a hanging indent rather than push width */
    html body .snx-header.nav-open .snx-nav .snx-dropdown-menu .nav-sub-item::before {
        content: "·";
        margin-right: 7px;
        color: #8B7BA8;
        font-weight: 700;
    }
}

/* [SNX-L51-MOBILE5] Correct the accordion display model.
   MOBILE4 set `display:block !important` on the dropdown, which defeated the
   show/hide rule (only `.is-open` should be visible) and let every group's
   sub-menu render at once. It also forced a two-column look because the
   desktop dropdown remained floated beside the title.
   Restored model: flex column, hidden unless the parent item is .is-open. */
@media (max-width: 1080px) {

    html body .snx-header.nav-open .snx-nav .snx-dropdown-menu {
        display: none !important;
        position: static !important;
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        padding: 2px 0 8px 0 !important;
        margin: 0 !important;
        background: #F8F6FB !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        flex-direction: column !important;
    }

    /* only the expanded group shows its sub-menu */
    html body .snx-header.nav-open .snx-nav .snx-nav-item.is-open > .snx-dropdown-menu {
        display: flex !important;
        flex-direction: column !important;
    }

    /* each sub-item is a full-width row with a small bullet indent */
    html body .snx-header.nav-open .snx-nav .snx-dropdown-menu li {
        display: block !important;
        width: 100% !important;
        float: none !important;
        margin: 0 !important;
        padding: 0 !important;
        list-style: none !important;
    }
    html body .snx-header.nav-open .snx-nav .snx-dropdown-menu .nav-sub-item {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 10px 18px 10px 30px !important;
        font-size: 14px !important;
        line-height: 1.45 !important;
        text-align: left !important;
        white-space: normal !important;
        text-indent: 0 !important;
        float: none !important;
        border: none !important;
    }
    html body .snx-header.nav-open .snx-nav .snx-dropdown-menu .nav-sub-item::before {
        content: "·" !important;
        margin-right: 7px !important;
        color: #8B7BA8 !important;
        font-weight: 700 !important;
    }
    /* the group title must stay a full-width row, never share a line */
    html body .snx-header.nav-open .snx-nav > .snx-nav-item {
        display: block !important;
        width: 100% !important;
        float: none !important;
    }
    html body .snx-header.nav-open .snx-nav > .snx-nav-item > a,
    html body .snx-header.nav-open .snx-nav > .snx-nav-item > .snx-nav-title {
        display: flex !important;
        width: 100% !important;
        box-sizing: border-box !important;
        justify-content: space-between !important;
    }
}

/* ==========================================================================
   [SNX-L51-AUTHUI] Mobile account entry — icon button in header + full block
   in the hamburger panel.
   --------------------------------------------------------------------------
   Context: at <=1080px the .auth-nav (Register / Login text links) is hidden
   so that brand + CTA + hamburger all fit in one row. That left phones with no
   visible account entry. Two complementary fixes:

     C. a compact icon button sits immediately right of the CTA (header row),
        linking to /login/ (or /profile/ when signed in);
     A. the hamburger panel gets a full-width account block at the bottom,
        with Sign in / Create account, or Dashboard / Settings / Logout.

   The icon button is hidden on desktop: the text links already cover it there.
   ========================================================================== */

/* --- C: header icon button ------------------------------------------------ */

.snx-account-btn {
    display: none;                       /* desktop: auth-nav text links suffice */
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    margin-left: 6px;
    border-radius: 8px;
    background: #F1EFF6;
    color: #4A3A6B;
    text-decoration: none;
    box-shadow: inset 0 0 0 1px #E2DEF0;
    transition: background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.snx-account-btn:hover,
.snx-account-btn:focus-visible {
    background: #E7E2F3;
    box-shadow: inset 0 0 0 1px #CFC7E4;
    transform: translateY(-1px);
}

/* the :visited guard in this file forces dark text on header links; the icon
   inherits currentColor so pinning color on every state keeps the glyph purple */
html body .snx-header .snx-account-btn,
html body .snx-header .snx-account-btn:link,
html body .snx-header .snx-account-btn:visited,
html body .snx-header .snx-account-btn:hover,
html body .snx-header .snx-account-btn:active,
html body .snx-header .snx-account-btn:focus {
    color: #4A3A6B !important;
}

.snx-account-icon {
    width: 19px;
    height: 19px;
    display: block;
    stroke: currentColor;
}

/* --- A: panel account block ---------------------------------------------- */

.snx-mobile-auth {
    display: none;                       /* desktop: never rendered */
}

@media (max-width: 1080px) {

    /* show the icon button, sitting right next to the CTA */
    html body .snx-header .snx-account-btn {
        display: inline-flex !important;
    }

    /* panel block: full-width rows, divider above */
    html body .snx-header.nav-open .snx-nav .snx-mobile-auth {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 8px 0 0 0 !important;
        border-top: 1px solid #e5e0ee !important;
    }

    html body .snx-header.nav-open .snx-nav .snx-mobile-auth__primary,
    html body .snx-header.nav-open .snx-nav .snx-mobile-auth__link {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 13px 18px !important;
        font-size: 15px !important;
        line-height: 1.3 !important;
        text-align: center !important;
        text-decoration: none !important;
        border: none !important;
        white-space: normal !important;
    }

    /* primary: solid brand block — the one clear call to action */
    html body .snx-header.nav-open .snx-nav .snx-mobile-auth__primary {
        margin: 4px 18px 10px 18px !important;
        width: calc(100% - 36px) !important;
        border-radius: 10px !important;
        background: #4A3A6B !important;
        color: #fff !important;
        font-weight: 600 !important;
        box-shadow: 0 2px 8px rgba(74,58,107,.22) !important;
    }

    /* secondary: quiet text rows */
    html body .snx-header.nav-open .snx-nav .snx-mobile-auth__link {
        color: #4A3A6B !important;
        font-weight: 500 !important;
        background: transparent !important;
    }

    html body .snx-header.nav-open .snx-nav .snx-mobile-auth__link--danger {
        color: #C0392B !important;
    }
}

/* very small phones: shrink the icon a notch so brand + CTA + icon + burger all fit */
@media (max-width: 400px) {
    html body .snx-header .snx-account-btn {
        width: 32px !important;
        height: 32px !important;
        margin-left: 4px !important;
    }
    html body .snx-header .snx-account-icon {
        width: 17px !important;
        height: 17px !important;
    }
}

/* [SNX-L51-AUTHUI-H] Panel must reach the bottom of the viewport.
   MOBILE3b set `height:auto` to break the circular height dependency caused by
   `.snx-nav-item{height:100%!important}`. That fixed the 71px collapse but left
   the panel sized to its content (601px on a 844px screen), so page cards showed
   through underneath the last row. A min-height pins it to the viewport; the
   existing max-height keeps long menus scrollable. */
@media (max-width: 1080px) {
    html body .snx-header.nav-open .snx-nav {
        min-height: calc(100vh - 72px) !important;
        box-sizing: border-box !important;
    }
}
