.vd-mobile-menu:not([open]) {
    display: none;
}

.vd-menu-icon {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
}

.vd-mobile-menu {
    position: fixed;
    inset: 0 auto 0 0;
    width: 100%;
    max-width: none;
    height: 100%;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: var(--vd-strong, #39373a);
    background: transparent;
    font: inherit;
    overflow: hidden;
}

.vd-mobile-menu-shade {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .48);
    opacity: 0;
}

.vd-mobile-menu-panel {
    position: relative;
    width: min(380px, calc(100% - 24px));
    height: 100%;
    background: var(--vd-panel);
    box-shadow: 8px 0 32px rgba(0, 0, 0, .15);
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
    transform: translateX(-100%);
    will-change: transform;
}

.vd-mobile-menu-viewport {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.vd-mobile-menu-grip {
    position: absolute;
    z-index: 2;
    top: 50%;
    right: 0;
    display: grid;
    place-items: center;
    width: 24px;
    height: 64px;
    transform: translateY(-50%);
    cursor: grab;
    touch-action: pan-y pinch-zoom;
}

.vd-mobile-menu-grip::before {
    content: "";
    width: 4px;
    height: 40px;
    border-radius: 2px;
    background: #b8bfbb;
}

.vd-mobile-menu-panel.is-dragging .vd-mobile-menu-grip {
    cursor: grabbing;
}

.vd-mobile-menu-panel.is-dragging .vd-mobile-menu-grip::before {
    background: var(--vd-green-dark, #007e51);
}

.vd-mobile-menu-panel.is-dragging {
    user-select: none;
    cursor: grabbing;
}

.vd-mobile-menu[open] {
    display: block;
}

.vd-mobile-menu::backdrop {
    background: transparent;
}

body.vd-menu-open {
    position: fixed;
    inset-inline: 0;
    top: var(--vd-menu-scroll-top, 0);
    width: 100%;
    overflow: hidden;
}

.vd-mobile-menu-header {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: max(12px, env(safe-area-inset-top)) 24px 12px;
    background: var(--vd-panel);
    border-bottom: 1px solid var(--vd-line);
}

.vd-mobile-menu-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0;
}

.vd-mobile-menu-close {
    display: inline-flex;
    flex: 0 0 48px;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 12px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
}

.vd-mobile-menu-nav {
    padding: 8px 24px 24px;
}

.vd-mobile-menu .vd-nav-items {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
}

.vd-mobile-menu .vd-nav-items > a,
.vd-mobile-menu .vd-nav-group > button,
.vd-mobile-menu .vd-dashboard-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    width: 100%;
    padding: 12px 0;
    border: 0;
    border-radius: 0;
    color: var(--vd-strong, #39373a);
    background: transparent;
    font: inherit;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.vd-mobile-menu .vd-nav-group {
    width: 100%;
    margin: 0;
    border-bottom: 1px solid var(--vd-line);
}

/* Expansion is explicit on touch; hover and retained focus do not mean open. */
.vd-mobile-menu .vd-nav-items > a,
.vd-mobile-menu .vd-nav-items > .vd-nav-group > .vd-dashboard-link,
.vd-mobile-menu .vd-nav-items > .vd-nav-group > button {
    color: var(--vd-strong, #39373a);
    background: transparent;
}

.vd-mobile-menu .vd-nav-group::after {
    display: none;
}

.vd-mobile-menu .vd-dashboard-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
}

.vd-mobile-menu .vd-nav-group > button {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
}

.vd-mobile-menu .vd-dashboard-group > button {
    display: flex;
    justify-content: center;
    width: 48px;
}

.vd-mobile-menu .vd-nav-group > button::after {
    content: "";
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    justify-self: center;
    margin-left: 0;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
}

.vd-mobile-menu .vd-nav-group.is-open > button::after {
    transform: rotate(225deg) translateY(-2px);
}

.vd-mobile-menu .vd-nav-menu {
    position: static;
    z-index: auto;
    display: grid;
    min-height: 0;
    overflow: hidden;
    min-width: 0;
    margin: 0;
    padding: 0 0 0 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    transition: padding-bottom var(--vd-motion-disclosure, 200ms) var(--vd-motion-ease, ease);
}

.vd-mobile-menu-submenu {
    display: grid;
    grid-column: 1 / -1;
    grid-template-rows: 0fr;
    visibility: hidden;
    transition: grid-template-rows var(--vd-motion-disclosure, 200ms) var(--vd-motion-ease, ease),
        visibility 0s var(--vd-motion-disclosure, 200ms);
}

.vd-mobile-menu .vd-nav-group.is-open > .vd-mobile-menu-submenu {
    grid-template-rows: 1fr;
    visibility: visible;
    transition-delay: 0s;
}

.vd-mobile-menu .vd-nav-group.is-open .vd-nav-menu {
    padding-bottom: 12px;
}

.vd-mobile-menu .vd-nav-group:hover .vd-nav-menu,
.vd-mobile-menu .vd-nav-group:focus-within .vd-nav-menu {
    transform: none;
}

.vd-mobile-menu .vd-nav-menu a,
.vd-mobile-menu .vd-nav-menu button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    padding: 10px 0;
    border: 0;
    color: var(--vd-muted, #77747a);
    background: transparent;
    font: inherit;
    font-size: 16px;
    line-height: 1.4;
    text-align: left;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.vd-mobile-menu .vd-module-nav-menu img {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    object-fit: contain;
}

.vd-mobile-menu .vd-nav-items > a[aria-current="page"],
.vd-mobile-menu .vd-nav-items > .vd-nav-group > .vd-dashboard-link[aria-current="page"],
.vd-mobile-menu .vd-nav-items > .vd-nav-group.is-open > .vd-dashboard-link,
.vd-mobile-menu .vd-nav-items > .vd-nav-group.is-open > button,
.vd-mobile-menu .vd-nav-menu a[aria-current="page"] {
    color: var(--vd-green-dark, #007e51);
}

.vd-mobile-menu-footer {
    flex: 0 0 auto;
    margin-top: auto;
    border-top: 1px solid var(--vd-line);
}

.vd-mobile-menu .vd-mobile-menu-footer .vd-header-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    margin-top: 0;
    padding: 24px 24px max(24px, env(safe-area-inset-bottom));
    border-top: 0;
}

.vd-mobile-menu .vd-account-identity {
    display: grid;
    flex: initial;
    max-width: none;
    margin: 0 0 4px;
    text-align: left;
    overflow-wrap: anywhere;
}

.vd-mobile-menu .vd-account-identity strong {
    font-size: 16px;
}

.vd-mobile-menu .vd-header-actions form,
.vd-mobile-menu .vd-header-actions .vd-button {
    width: 100%;
}

.vd-mobile-menu .vd-guest-header-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
}

.vd-mobile-menu a:focus-visible,
.vd-mobile-menu button:focus-visible {
    outline: 2px solid #00953b;
    outline-offset: 3px;
}

.vd-mobile-menu .vd-nav-group > button::after {
    transition: transform var(--vd-motion-disclosure, 200ms) var(--vd-motion-ease, ease);
}

header.vd-shell-header.vd-mobile-header-ready,
header.vd-security-header.vd-mobile-header-ready {
    position: sticky;
    top: 0;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 72px;
    padding: 12px 16px;
}

header.vd-mobile-header-ready > .vd-brand,
header.vd-mobile-header-ready > .vd-security-brand {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
    min-width: 0;
}

header.vd-mobile-header-ready > .vd-primary-nav {
    display: block;
    grid-column: 1;
    grid-row: 1;
    width: 44px;
}

header.vd-mobile-header-ready .vd-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 10px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
}

header.vd-mobile-header-ready .vd-menu-toggle::after {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .vd-mobile-menu-submenu,
    .vd-mobile-menu .vd-nav-menu,
    .vd-mobile-menu .vd-nav-group > button::after { transition: none; }
}
