/* Member navigation v2: explicit hierarchy, stable rows and in-flow counters. */
body.member-workspace #user-center-navigation,
body.member-workspace #user-center-navigation :is(li, dd, dl) {
    box-sizing: border-box;
    min-width: 0;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}
body.member-workspace #user-center-navigation > .layui-nav-item {
    display: block;
    width: 100%;
    margin: 0 0 5px !important;
    padding: 0 !important;
    line-height: normal !important;
}
body.member-workspace #user-center-navigation :is(li, dd, a)::before,
body.member-workspace #user-center-navigation :is(li, dd, a)::after {
    content: none !important;
    display: none !important;
}
body.member-workspace #user-center-navigation a {
    position: relative !important;
    inset: auto !important;
    display: flex !important;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    height: auto !important;
    min-height: 36px;
    margin: 0 !important;
    padding: 8px 12px !important;
    border: 0 !important;
    border-radius: 7px !important;
    background: transparent !important;
    color: #475569 !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 20px !important;
    text-decoration: none;
    text-overflow: clip;
    overflow: visible;
    white-space: normal;
    box-shadow: none !important;
    box-sizing: border-box;
}
body.member-workspace #user-center-navigation > .layui-nav-item > a {
    display: grid !important;
    grid-template-columns: 20px minmax(0, 1fr) 16px;
    column-gap: 10px;
    min-height: 46px;
    padding: 11px 12px !important;
    color: #334155 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}
body.member-workspace #user-center-navigation .member-nav-label {
    position: static !important;
    flex: 1 1 auto !important;
    min-width: 0;
    overflow: hidden;
    color: inherit !important;
    font: inherit;
    line-height: inherit;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body.member-workspace #user-center-navigation > .layui-nav-item > a > .layui-icon:not(.member-nav-chevron) {
    position: static !important;
    display: inline-block;
    width: 20px;
    height: 20px;
    margin: 0 !important;
    font-size: 20px !important;
    line-height: 20px !important;
    text-align: center;
    transform: none !important;
}
/* Child rows deliberately use labels alone; icons belong to primary sections. */
body.member-workspace #user-center-navigation .layui-nav-child > dd > a > .layui-icon:not(.member-nav-chevron) {
    display: none !important;
}
body.member-workspace #user-center-navigation .layui-nav-child {
    position: static !important;
    inset: auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100%;
    margin: 2px 0 7px 22px !important;
    padding: 0 0 0 12px !important;
    border: 0 !important;
    border-left: 1px solid #e2e8f0 !important;
    border-radius: 0 !important;
    line-height: normal !important;
    transform: none !important;
    white-space: normal;
}
body.member-workspace #user-center-navigation .layui-nav-child > dd {
    display: block;
    width: 100%;
    margin: 1px 0 !important;
    padding: 0 !important;
    line-height: normal !important;
}
body.member-workspace #user-center-navigation .layui-nav-child .layui-nav-child {
    margin: 2px 0 6px 10px !important;
    padding-left: 10px !important;
}
body.member-workspace #user-center-navigation .layui-nav-child .member-nav-toggle {
    font-weight: 500 !important;
}
body.member-workspace #user-center-navigation .member-nav-chevron {
    position: static !important;
    inset: auto !important;
    display: inline-block !important;
    flex: 0 0 16px !important;
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
    color: #94a3b8 !important;
    font-size: 13px !important;
    line-height: 16px !important;
    text-align: center;
    transform: none;
    transition: transform .18s ease;
}
body.member-workspace #user-center-navigation > .layui-nav-item > a > .member-nav-chevron { grid-column: 3; }
body.member-workspace #user-center-navigation .layui-nav-itemed > .member-nav-toggle > .member-nav-chevron {
    color: #0f766e !important;
    transform: rotate(90deg);
}
body.member-workspace #user-center-navigation .layui-nav-itemed > .member-nav-toggle {
    color: #0f766e !important;
    background: transparent !important;
}
body.member-workspace #user-center-navigation a:hover {
    color: #0f766e !important;
    background: #f1f7f5 !important;
}
/* Selection belongs only to the direct destination, never all its descendants. */
body.member-workspace #user-center-navigation .layui-this > a:not(.member-nav-toggle) {
    color: #0f766e !important;
    background: #e3f3ef !important;
    font-weight: 600 !important;
}
body.member-workspace #user-center-navigation a:focus-visible {
    outline: 2px solid #0f766e;
    outline-offset: -2px;
}
body.member-workspace #user-center-navigation :is(.layui-nav-more, .layui-nav-bar) { display: none !important; }

/* Preserve inline hide()/show() and hidden: counters must remain in normal flow. */
body.member-workspace #user-center-navigation :is(.layui-badge, .merchant-after-sale-badge) {
    position: static !important;
    inset: auto !important;
    flex: 0 0 auto !important;
    align-self: center;
    min-width: 22px;
    max-width: 60px;
    height: 20px;
    margin: 0 !important;
    padding: 0 6px;
    border: 0;
    border-radius: 5px;
    background: #edf5f3 !important;
    color: #0f766e !important;
    font-size: 11px !important;
    font-weight: 600;
    line-height: 20px !important;
    text-align: center;
    white-space: nowrap;
    transform: none !important;
    box-sizing: border-box;
}
body.member-workspace #user-center-navigation .merchant-after-sale-badge {
    background: #fff1f2 !important;
    color: #be123c !important;
}
body.member-workspace #user-center-navigation [hidden] { display: none !important; }

/* Member level is profile metadata, away from the section title and chevron. */
body.member-workspace .member-sidebar-profile .member-sidebar-identity {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    gap: 3px;
}
body.member-workspace .member-sidebar-identity strong {
    overflow: hidden;
    color: #334155;
    font-size: 13px;
    font-weight: 500;
    line-height: 20px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body.member-workspace .member-sidebar-level {
    overflow: hidden;
    color: #64748b;
    font-size: 11px;
    line-height: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body.member-workspace .member-sidebar-profile > .layui-icon {
    flex: 0 0 14px;
    width: 14px;
    margin-left: auto;
    color: #94a3b8;
    font-size: 13px;
}
body.member-workspace .member-sidebar-footer .user-center-feedback-entry > .layui-icon {
    width: 20px;
    font-size: 19px;
    line-height: 20px;
    text-align: center;
}

/* Native drawer presentation formerly lived in a conflicting inline style. */
body.member-workspace .user-center-menu-control > summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    list-style: none;
    cursor: pointer;
}
body.member-workspace .user-center-menu-control > summary::-webkit-details-marker { display: none; }
body.member-workspace .user-center-menu-control .user-center-menu-collapse,
body.member-workspace .user-center-menu-control[open] .user-center-menu-expand { display: none; }
body.member-workspace .user-center-menu-control[open] .user-center-menu-collapse { display: inline-flex; }
body.member-workspace .user-center-menu-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
@media (max-width: 768px) {
    body.member-workspace:has(.user-center-menu-control[open]),
    body.member-workspace .bg-content:has(.user-center-menu-control[open]) { overflow: hidden !important; }
    body.member-workspace .user-center-menu-control { --user-center-menu-width: min(300px, 85vw); }
    body.member-workspace #user-center-navigation .user-center-menu-heading {
        display: flex;
        min-height: 40px;
        margin: 0 48px 12px 0 !important;
        padding: 4px 12px !important;
        color: #334155;
        font-size: 14px;
        font-weight: 600;
    }
}
@media (prefers-reduced-motion: reduce) {
    body.member-workspace #user-center-navigation .member-nav-chevron { transition: none; }
}
