/* ============================================
   NAVIGATION STYLES
   Стили навигации: left-nav, nav-items, nav-overflow, mobile-menu
   ============================================ */
.left-nav.collapsed .nav-items {
    width: 100%;
}
/* Left Navigation - Twitter style */
.left-nav {
    width: 240px; /* Reduced width from 320px to 240px */
    height: calc(100% - 32px);
    display: flex;
    flex-direction: column;
    padding: var(--spacing-xl) var(--spacing-xl) 0 var(--spacing-xl);
    gap: var(--spacing-xs);
    position: relative;
    z-index: 30;
    margin: var(--spacing-lg) 0 var(--spacing-lg) var(--spacing-lg);
    box-sizing: border-box;
    align-self: center;
    background: var(--color-bg-menu);
    border-radius: var(--radius-xl);
    border: none;
    box-shadow: none;
    transition: width var(--transition-slow) ease, padding var(--transition-slow) ease, margin var(--transition-slow) ease;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;      /* Firefox */
    -ms-overflow-style: none;   /* IE/Edge */
}

.left-nav::-webkit-scrollbar {
    display: none;              /* Chrome/Safari */
}

.nav-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--spacing-lg);
    width: 100%;
    padding-bottom: var(--spacing-lg);
}

.nav-logo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    border-radius: var(--radius-full);
    background: transparent;
    position: relative;
    gap: var(--spacing-sm);
    transition: none;
    text-decoration: none;
}

.nav-logo-btn:hover {
    background: transparent;
}

.nav-collapse-toggle {
    margin-left: auto;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    margin-right: 0;
    margin-top: 0;
    margin-bottom: 0;
    position: relative;
    flex-shrink: 0;
}

.nav-collapse-toggle:hover {
    background: transparent;
}

.nav-collapse-icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
    opacity: 0.4;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.nav-collapse-icon svg {
    width: 100%;
    height: 100%;
    display: block;
    margin: 0;
    padding: 0;
}

.nav-collapse-toggle:hover .nav-collapse-icon,
.nav-collapse-toggle:active .nav-collapse-icon,
.nav-collapse-toggle:focus-visible .nav-collapse-icon {
    opacity: 1;
}

.theme-toggle {
    cursor: pointer;
}

/* hover for theme button is set on child .switch, separate styles not needed */

.nav-logo-text {
    font-family: var(--font-serif);
    font-style: normal;
    font-weight: var(--font-weight-normal);
    font-size: var(--font-size-xl);
    line-height: var(--line-height-tight);
    text-transform: uppercase;
    color: var(--color-logo);
    -webkit-text-fill-color: var(--color-logo);
    user-select: none;
    pointer-events: auto;
    cursor: pointer;
    position: relative;
    display: inline-flex;
    gap: 0.18em;
    align-items: center;
    padding-top: 2px;
}

.nav-logo-text span {
    display: inline-block;
    letter-spacing: 0;
    transition: none;
    transform: none;
}

.nav-logo-text span.logo-wave {
    animation: none;
}

.nav-logo-text span.logo-wave-secondary {
    animation: none;
}

.nav-logo-full {
    height: 16px;
}

.nav-logo-short {
    display: none;
    font-family: var(--font-serif);
    font-style: normal;
    font-weight: var(--font-weight-normal);
    font-size: var(--font-size-xl);
    line-height: var(--line-height-tight);
    text-transform: uppercase;
    color: var(--color-logo);
}

.nav-logo-svg {
    display: none;
    width: auto;
    height: 18px;
}

/* Dark theme: white SVG logo in collapsed menu */
.nav-logo-svg-icon svg {
    color: #ffffff;
    fill: #ffffff;
}

.nav-logo-svg-icon svg path {
    fill: #ffffff !important;
}

/* Ensure no filters in dark theme that could change the color */
body:not(.light-theme) .nav-logo-svg-icon {
    filter: none;
}

body:not(.light-theme) .nav-logo-svg-icon svg {
    color: #ffffff;
    fill: #ffffff;
}

body:not(.light-theme) .nav-logo-svg-icon svg path {
    fill: #ffffff !important;
}

/* Collapsed menu state */
.left-nav.collapsed {
    width: auto;
    padding: var(--spacing-lg) var(--spacing-lg) 0 var(--spacing-lg);
    margin: var(--spacing-lg) 0 var(--spacing-lg) var(--spacing-lg);
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

.nav-item-back {
    margin-top: auto;
    margin-bottom: var(--spacing-4xl);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* Bottom section - User and Theme Switch */
.nav-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    padding-top: var(--spacing-lg);
    padding-bottom: var(--spacing-2xl);
}

/* Divider between auth/user and settings - stretches to full left-nav width */
.nav-divider {
    width: calc(100% + var(--spacing-xl) * 2);
    height: 1px;
    background: var(--color-border-tertiary);
    margin: var(--spacing-lg) calc(var(--spacing-xl) * -1);
}

/* Subtle divider before Settings item in nav-items - stretches to full left-nav width */
.nav-items-divider {
    width: calc(100% + var(--spacing-xl) * 2);
    height: 1px;
    background: rgba(168, 168, 168, 0.2);
    margin: var(--spacing-2xl) calc(var(--spacing-xl) * -1);
}

/* Settings link in nav-bottom - styled like nav-items */
.nav-item-settings {
    margin-top: 0;
    margin-bottom: 0;
    padding: var(--spacing-md) var(--spacing-2xl) var(--spacing-md) var(--spacing-md);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-slow);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
    text-decoration: none;
    color: inherit;
    position: relative;
    pointer-events: auto !important;
        z-index: 99999 !important; /* Above everything - highest z-index */
}

.nav-item-settings:hover:not(.nav-item-active) {
    background: rgba(255, 255, 255, 0.08);
}

.nav-item-settings:hover:not(.nav-item-active) .nav-text {
    color: rgba(255, 255, 255, 0.7);
}

.nav-item-settings:hover:not(.nav-item-active) .nav-icon {
    filter: brightness(0) invert(1) opacity(0.8);
}

.nav-item-settings.nav-item-active {
    background: rgba(255, 255, 255, 0.12);
}

.nav-item-settings.nav-item-active .nav-text {
    color: var(--color-text-primary);
}

.nav-item-settings.nav-item-active .nav-icon {
    filter: brightness(0) invert(1) opacity(1);
}

/* Collapsed menu styles for settings */
.left-nav.collapsed .nav-item-settings {
    width: 44px;
    height: 44px;
    min-width: 44px;
    justify-content: center;
    padding: var(--spacing-md);
}

.left-nav.collapsed .nav-item-settings .nav-text {
    display: none;
}

/* User block in left nav */
.nav-user {
    margin-top: 0;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-md) var(--spacing-md) var(--spacing-md);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border-tertiary);
    text-align: left;
    position: relative;
}

.nav-theme-switch {
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-lg);
    cursor: pointer;
}

/* Collapsed menu: keep one theme icon instead of switch */
.left-nav.collapsed .nav-theme-switch {
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.left-nav.collapsed .switch__slider {
    display: none;
}

.left-nav.collapsed .switch {
    display: none;
}

.left-nav.collapsed .switch {
    width: 24px;
    height: 24px;
}

.left-nav.collapsed .switch__input {
    inset: 0;
}

/* In collapsed menu: hide both icons by default... */
.left-nav.collapsed .nav-theme-icon--sun,
.left-nav.collapsed .nav-theme-icon--moon {
    display: none !important;
}

/* ...and show exactly ONE depending on theme */
body:not(.light-theme) .left-nav.collapsed .nav-theme-icon--sun {
    display: inline-flex !important;
}

body.light-theme .left-nav.collapsed .nav-theme-icon--moon {
    display: inline-flex !important;
}

/* Additional bottom margin for theme icon in collapsed menu */
.left-nav.collapsed .nav-theme-icon {
    margin-bottom: 16px;
}

.theme-toggle--switch {
    padding: 0;
    border: none;
    background: transparent;
    display: inline-flex;
    align-items: center;
}

/* New switch styles (desktop + mobile) */
.switch {
    position: relative;
    display: inline-block;
    width: 2.8rem;
    height: 1.6rem;
}

.switch__input {
    position: absolute;
    inset: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.switch__slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-button-primary);
    border-radius: 1rem;
    transition: background 0.2s;
    cursor: pointer;
}

.switch__slider::before {
    content: "";
    position: absolute;
    left: 0.2rem;
    top: 50%;
    transform: translateY(-50%);
    height: 1.2rem;
    width: 1.2rem;
    border-radius: 1.2rem;
    background: #272727;
    transition: transform 0.2s, width 0.2s, background 0.2s;
}

/* Dark theme: switch circle #272727 */
body:not(.light-theme) .switch__slider::before {
    background: #ffffff;
}

/* Light theme: switch circle white */
body.light-theme .switch__slider::before {
    background: #ffffff;
}

.switch__input:checked + .switch__slider {
    background: #e5e7eb;
}

.switch__input:not(:checked):active + .switch__slider::before {
    width: 1.8rem;
}

.switch__input:checked:active + .switch__slider::before {
    transform: translate(0.75rem, -50%);
    width: 1.8rem;
}

.switch__input:checked + .switch__slider::before {
    transform: translate(1.35rem, -50%);
}

.nav-theme-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--spacing-2xl);
    height: var(--spacing-2xl);
    opacity: 0.6;
    cursor: pointer;
    transition: opacity var(--transition-base), transform var(--transition-base);
    border-radius: var(--radius-circle);
    padding: var(--spacing-xs);
}

.nav-theme-icon-img {
    width: var(--spacing-lg);
    height: var(--spacing-lg);
    transition: transform var(--transition-base);
    cursor: pointer;
    pointer-events: none;
}

/* Hover effect for theme icons */
.nav-theme-icon:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
}

.nav-theme-icon:hover .nav-theme-icon-img {
    transform: scale(1.1);
}

/* Active state on press */
.nav-theme-icon:active {
    transform: scale(0.95);
}

/* No shadows/glows for switch icons in both themes */
.nav-theme-icon--sun .nav-theme-icon-img,
.nav-theme-icon--moon .nav-theme-icon-img {
    filter: none;
}

/* Light theme: hover effect for theme icons */
body.light-theme .nav-theme-icon:hover {
    background: rgba(15, 23, 42, 0.08);
}

body.light-theme .nav-theme-icon:hover .nav-theme-icon-img {
    transform: scale(1.1);
}

.nav-user-logout {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--color-text-tertiary);
    cursor: pointer;
    padding: var(--spacing-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xs);
    transition: color var(--transition-base), background-color var(--transition-base);
    font-family: var(--font-primary);
}

.nav-user-logout:hover {
    color: var(--color-text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.nav-user-avatar {
    width: var(--spacing-2xl);
    height: var(--spacing-2xl);
    border-radius: var(--radius-circle);
    flex-shrink: 0;
    object-fit: cover;
}

.nav-user-avatar-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-button-primary);
    color: var(--color-button-primary-text);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-primary);
    border: none;
}

.nav-user-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    line-height: 1;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.nav-user-name {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-normal);
    font-family: var(--font-primary);
    color: var(--color-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-user-role {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-normal);
    font-family: var(--font-primary);
    letter-spacing: 0.01em;
    color: var(--color-text-muted);
}

/* Subscribe button styles removed – user block is used instead */

/* Auth buttons in navigation */
.nav-auth {
    margin-top: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    width: 100%;
    padding: var(--spacing-lg);
    border: 1px solid var(--color-border-tertiary);
    border-radius: var(--radius-xl);
}

.nav-auth-link {
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-normal);
    color: var(--color-text-secondary);
    text-decoration: none;
    text-align: center;
    padding: var(--spacing-sm) var(--spacing-lg);
    transition: color var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.nav-auth-link:hover {
    color: var(--color-text-primary);
}

.nav-auth-button {
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    color: #FFFFFF !important;
    background: var(--color-button-primary);
    text-decoration: none;
    text-align: center;
    padding: var(--spacing-md) var(--spacing-2xl);
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.nav-auth-button:hover {
    background: var(--color-button-primary-hover);
    color: #FFFFFF !important;
    transform: translateY(-1px);
}

.nav-auth-button:active {
    background: var(--color-button-primary-active);
    color: #FFFFFF !important;
    transform: translateY(0);
}

.nav-auth-icon {
    display: none;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.nav-auth-icon svg {
    width: 24px;
    height: 24px;
}

.nav-auth-text {
    transition: opacity var(--transition-base);
}

/* Collapsed menu styles for auth buttons */
.left-nav.collapsed .nav-auth {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    width: 100%;
    padding: 0;
    border: none;
    border-radius: 0;
    margin-bottom: var(--spacing-lg);
}

.left-nav.collapsed .nav-auth-link,
.left-nav.collapsed .nav-auth-button {
    padding: var(--spacing-md);
    border-radius: var(--radius-circle);
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.left-nav.collapsed .nav-auth-button {
    background: transparent;
    color: var(--color-text-secondary);
}

.left-nav.collapsed .nav-auth-button:hover {
    background: transparent;
    transform: none;
    color: var(--color-text-primary);
}

.left-nav.collapsed .nav-auth-text {
    display: none;
}

.left-nav.collapsed .nav-auth-icon {
    display: inline-flex;
}

.left-nav.collapsed .nav-auth-link .nav-auth-icon svg,
.left-nav.collapsed .nav-auth-button .nav-auth-icon svg {
    filter: brightness(0) invert(1) opacity(0.6);
    transition: opacity var(--transition-base);
}

.left-nav.collapsed .nav-auth-link:hover .nav-auth-icon svg,
.left-nav.collapsed .nav-auth-button:hover .nav-auth-icon svg {
    filter: brightness(0) invert(1) opacity(1);
}

.nav-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.nav-item-hidden {
    display: none !important;
}

.nav-overflow {
    display: none;
    width: 100%;
    margin-top: var(--spacing-sm);
    position: relative;
    justify-content: flex-end;
}

.nav-overflow.nav-overflow-visible {
    display: flex;
}

/* Hide mobile menu and nav-overflow on tablet devices (801px - 1024px) */
@media (min-width: 801px) and (max-width: 1024px) {
    /* Hide mobile menu header on tablets - must be hidden */
    .mobile-menu-header {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        height: 0 !important;
        overflow: hidden !important;
    }
    
    /* Hide nav-overflow on tablets (801-1024px) */
    .nav-overflow {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    
    .nav-overflow.nav-overflow-visible {
        display: none !important;
    }
}

.nav-overflow-toggle {
    width: var(--spacing-5xl);
    height: var(--spacing-5xl);
    border-radius: var(--radius-xl);
    border: none;
    background: transparent; /* no background by default */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-base), border-color var(--transition-base);
    padding: 0;
}

.nav-overflow-toggle[disabled] {
    opacity: 0;
    pointer-events: none;
}

.nav-overflow-toggle-icon {
    width: 22px;
    height: 22px;
    filter: brightness(0) invert(1) opacity(0.9);
}

.nav-overflow-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.nav-overflow-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + var(--spacing-md));
    min-width: 220px;
    padding: var(--spacing-lg);
    border-radius: var(--radius-xl);
    background: var(--color-bg-secondary); /* same as invoice dropdowns */
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    display: none;
    flex-direction: column;
    gap: var(--spacing-md);
    z-index: 60;
}

/* Light theme для nav-overflow-menu (десктоп) */
body.light-theme .nav-overflow-menu {
    background: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, 0.1) !important;
}

/* Light theme для открытого меню - убеждаемся что все элементы светлые */
body.light-theme .nav-overflow-menu.open {
    background: #ffffff !important;
}

body.light-theme .nav-overflow-menu.open .nav-overflow-link {
    background: rgba(15, 23, 42, 0.05) !important;
    color: rgba(15, 23, 42, 0.7) !important;
}

body.light-theme .nav-overflow-menu.open .nav-overflow-link:hover {
    background: rgba(15, 23, 42, 0.1) !important;
    color: #0f172a !important;
}

body.light-theme .nav-overflow-menu.open .nav-overflow-label {
    color: rgba(15, 23, 42, 0.7) !important;
}

body.light-theme .nav-overflow-menu.open .nav-overflow-link:hover .nav-overflow-label {
    color: #0f172a !important;
}

body.light-theme .nav-overflow-menu.open .nav-overflow-icon {
    filter: brightness(0) opacity(0.7) !important;
}

body.light-theme .nav-overflow-menu.open .nav-overflow-link:hover .nav-overflow-icon {
    filter: brightness(0) opacity(1) !important;
}

.nav-overflow-menu.open {
    display: flex;
}

.nav-overflow-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.nav-overflow-link {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-md);
    border-radius: var(--radius-xl);
    border: none;
    /* make background more noticeable by default so all items are equally visible */
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-primary);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    font-family: var(--font-primary);
    text-align: left;
    cursor: pointer;
    transition: background var(--transition-base), color var(--transition-base);
}

/* Light theme для nav-overflow-link (базовый стиль) */
body.light-theme .nav-overflow-link {
    background: rgba(15, 23, 42, 0.05);
    color: rgba(15, 23, 42, 0.7);
}

.nav-overflow-label {
    display: inline-flex;
    align-items: center;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    font-family: var(--font-primary);
}

.nav-overflow-icon {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1) opacity(0.8);
    flex-shrink: 0;
}

/* Light theme для nav-overflow-icon (десктоп) */
body.light-theme .nav-overflow-icon {
    filter: brightness(0) opacity(0.7) !important;
}

body.light-theme .nav-overflow-link:hover .nav-overflow-icon {
    filter: brightness(0) opacity(1) !important;
}

.nav-overflow-link:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Light theme для nav-overflow-link:hover (десктоп) */
body.light-theme .nav-overflow-link:hover {
    background: rgba(15, 23, 42, 0.1) !important;
    color: #0f172a !important;
}

/* Light theme для nav-overflow-link:hover */
body.light-theme .nav-overflow-link:hover {
    background: rgba(15, 23, 42, 0.1) !important;
    color: #0f172a !important;
}

.nav-overflow-link[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

.nav-overflow-link-disabled {
    opacity: 0.4;
    cursor: pointer; /* Clickable but visually disabled */
}

.nav-overflow-link-disabled:hover {
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.05) !important;
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    /* dark theme: icons white via filter */
    filter: brightness(0) invert(1) opacity(0.6);
    transition: opacity 0.2s ease;
}

.nav-item.active .nav-icon {
    filter: brightness(0) invert(1) opacity(1);
}

.nav-item-disabled .nav-icon {
    filter: brightness(0) invert(1) opacity(0.3);
}

.nav-back-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    filter: brightness(0) invert(1) opacity(0.5);
}

.nav-item {
    padding: var(--spacing-md) var(--spacing-2xl) var(--spacing-md) var(--spacing-md); /* Extended right padding for text alignment */
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-slow);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm); /* Reduced gap from 12px to 10px */
    width: fit-content;
    min-width: fit-content;
    text-decoration: none; /* Ensure no underline for nav links */
    color: inherit; /* Inherit color from parent */
}

/* Ensure links in navigation menu look the same as divs */
a.nav-item,
.nav-item a {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
}

a.nav-item:hover,
a.nav-item:focus,
a.nav-item:visited,
a.nav-item:active {
    text-decoration: none;
    color: inherit;
}

/* Collapsed button state - icons only, round */
.left-nav.collapsed .nav-item {
    padding: var(--spacing-md);
    border-radius: var(--radius-circle);
    width: 44px;
    height: 44px;
    min-width: 44px;
    justify-content: center;
    gap: 0;
}

.left-nav.collapsed .nav-item .nav-text {
    display: none;
}

.left-nav.collapsed .nav-logo {
    justify-content: center;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    width: 100%;
}

.left-nav.collapsed .nav-logo-btn {
    padding: var(--spacing-sm);
    gap: 0;
}

.left-nav.collapsed .nav-logo-full {
    display: none;
}

.left-nav.collapsed .nav-logo-short {
    display: none;
}

.left-nav.collapsed .nav-logo-svg {
    display: block;
}

.left-nav.collapsed .nav-logo-text {
    display: none;
}

.left-nav.collapsed .nav-collapse-toggle {
    order: 2;
    margin-left: 0;
    align-self: center;
}

.left-nav.collapsed .nav-user {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-circle);
    justify-content: center;
}

.left-nav.collapsed .nav-user-avatar {
    width: var(--spacing-4xl);
    height: var(--spacing-4xl);
}

.left-nav.collapsed .nav-user-info {
    display: none;
}

.nav-item-disabled {
    opacity: 0.4;
    cursor: pointer; /* Change to pointer to show it's clickable */
}

.nav-item-disabled:hover {
    opacity: 0.6; /* Slightly increase opacity on hover */
    background: rgba(255, 255, 255, 0.05) !important;
}

.nav-item-disabled:active {
    opacity: 0.5;
    transform: scale(0.98);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.06); /* Less highlighted by default */
}

.nav-item.active .nav-text {
    color: #ffffff;
    font-weight: 600;
}

/* Hover for active item - becomes more highlighted */
.nav-item.active:hover {
    background: rgba(255, 255, 255, 0.08); /* Becomes lighter on hover */
}

.nav-item.active:hover .nav-text {
    color: rgba(255, 255, 255, 0.95); /* Slightly lighter */
}

.nav-item.active:hover .nav-icon {
    filter: brightness(0) invert(1) opacity(0.95); /* Slightly lighter */
}

/* Hover for regular (inactive) items - becomes more highlighted (lighter) */
.nav-item:hover:not(.nav-item-disabled):not(.active) {
    background: rgba(255, 255, 255, 0.08); /* Background appears (dark theme) */
}

.nav-item:hover:not(.nav-item-disabled):not(.active) .nav-text {
    color: rgba(255, 255, 255, 0.7); /* Becomes lighter (dark theme) */
}

.nav-item:hover:not(.nav-item-disabled):not(.active) .nav-icon {
    filter: brightness(0) invert(1) opacity(0.8); /* Becomes lighter (dark theme) */
}

.nav-item-disabled .nav-text {
    color: rgba(255, 255, 255, 0.3);
}

.nav-text {
    font-size: 16px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
    white-space: nowrap;
    transition: opacity 0.3s ease, width 0.3s ease;
    overflow: hidden;
}

/* Current section name - hidden by default on desktop */
.nav-current-section {
    display: none;
}

/* Center Content - Sphere */
.center-content {
    flex: 1;
    position: relative;
    display: flex;
    align-items: stretch;
    justify-content: center;
    overflow: hidden;
    background: none;
    height: 100%;
    z-index: 1; /* Below menu and chat */
}

/* Canvas for particle sphere - interactive */
#particleSphere {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: default; /* Default cursor by default, changed dynamically via JS */
    z-index: 20;
    background: transparent;
    /* Opacity transitions managed via JS to prevent distortions */
    will-change: opacity; /* Optimization for smooth transitions */
}

#particleSphere:hover {
    opacity: 0.95;
}

/* UI controls */
.controls {
    position: absolute;
    bottom: 68px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 10;
    pointer-events: none; /* Don't block clicks on sphere */
}

/* Button hidden */
.control-btn {
    display: none;
}

/* Status text - main control element */
.status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(74, 74, 74, 0.7);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-normal);
    font-family: var(--font-primary);
    text-align: center;
    min-height: var(--spacing-2xl);
    padding: var(--spacing-md) var(--spacing-2xl);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-3xl);
    transition: all var(--transition-slow);
    animation: softPulse 3s ease-in-out infinite;
    background-clip: padding-box; /* Important for correct gradient display */
    white-space: nowrap;
    min-width: max-content;
    pointer-events: none;
}

/* Soft pulse to attract attention */
@keyframes softPulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

/* Animation for active state - "thinking" text effect */
.status.listening {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.05) 0%, 
        rgba(255, 255, 255, 0.12) 50%, 
        rgba(255, 255, 255, 0.05) 100%);
    background-size: 200% 100%;
    background-position: -200% 0;
    animation: thinkingGlow 2s ease-in-out infinite;
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.15);
    opacity: 1;
}

@keyframes thinkingGlow {
    0% {
        background-position: -200% 0;
        color: rgba(255, 255, 255, 0.7);
    }
    50% {
        background-position: 200% 0;
        color: rgba(255, 255, 255, 0.85);
    }
    100% {
        background-position: -200% 0;
        color: rgba(255, 255, 255, 0.7);
    }
}

/* Light theme styles for status text */
body.light-theme .status {
    color: rgba(0, 0, 0, 0.6);
}

body.light-theme .status.listening {
    background: linear-gradient(90deg, 
        rgba(0, 0, 0, 0.05) 0%, 
        rgba(0, 0, 0, 0.12) 50%, 
        rgba(0, 0, 0, 0.05) 100%);
    background-size: 200% 100%;
    background-position: -200% 0;
    animation: thinkingGlowLight 2s ease-in-out infinite;
    color: rgba(0, 0, 0, 0.8);
    border-color: rgba(0, 0, 0, 0.15);
}

@keyframes thinkingGlowLight {
    0% {
        background-position: -200% 0;
        color: rgba(0, 0, 0, 0.7);
    }
    50% {
        background-position: 200% 0;
        color: rgba(0, 0, 0, 0.85);
    }
    100% {
        background-position: -200% 0;
        color: rgba(0, 0, 0, 0.7);
    }
}

/* Chat styles moved to css/chat.css */



/* Back button icon styles */
.back-icon {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1) opacity(0.8);
}

/* Mobile Menu Header (320-800px) */
.mobile-menu-header {
    display: none !important;
    position: fixed;
    top: 16px;
    left: 16px;
    right: 16px;
    height: 56px;
    padding: 0 var(--spacing-lg);
    background: #272727 !important;
    border: 1px solid #353434;
    border-radius: 16px;
    z-index: 52; /* Above chat (z-index: 30) */
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Hide mobile menu header on desktop and tablets (801px and above) */
@media (min-width: 801px) {
    .mobile-menu-header {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}

/* Additional rule for 801-1024px range to ensure it's hidden - already defined above at line 725 */

/* Light theme для mobile-menu-header */
body.light-theme .mobile-menu-header {
    background: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, 0.1);
}

.mobile-menu-logo {
    display: flex;
    align-items: center;
}

.mobile-menu-logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.mobile-menu-logo-text {
    font-family: var(--font-serif);
    font-style: normal;
    font-weight: var(--font-weight-normal);
    font-size: var(--font-size-lg);
    line-height: var(--line-height-tight);
    text-transform: uppercase;
    color: var(--color-logo);
    user-select: none;
}

/* Light theme для mobile-menu-logo-text */
body.light-theme .mobile-menu-logo-text {
    color: #020617;
    -webkit-text-fill-color: #020617;
}

.mobile-menu-burger {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-base);
    padding: 0;
    position: relative;
    z-index: 100;
    pointer-events: auto;
}

.mobile-menu-burger:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Light theme для mobile-menu-burger */
body.light-theme .mobile-menu-burger:hover {
    background: rgba(15, 23, 42, 0.08);
}

body.light-theme .mobile-menu-burger-icon {
    filter: brightness(0);
    opacity: 0.7;
}

.mobile-menu-burger-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 320px) and (max-width: 800px) {
    /* Body background uses CSS variable - no override needed */
    
    .mobile-menu-header {
        display: flex !important;
        z-index: 52; /* Above chat (z-index: 30) */
    }
    
    /* Hide nav-overflow toggle in this range, use mobile-menu-burger instead */
    .nav-overflow {
        display: none !important;
    }
    
    /* Modal menu - fullscreen overlay - override all base styles */
    /* Reset base styles first */
    .nav-overflow-menu {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        min-width: 100% !important;
        border-radius: 0 !important;
        border: none !important;
        background: #272727 !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        z-index: 99999 !important; /* Above everything - highest z-index */
        padding: 0 !important;
        box-shadow: none !important;
        overflow-y: auto !important;
        display: none !important;
        flex-direction: column !important;
        gap: 0 !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        /* Reset base positioning */
        bottom: auto !important;
        min-width: 100% !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    /* Light theme для nav-overflow-menu на мобильных */
    body.light-theme .nav-overflow-menu {
        background: #ffffff !important;
    }
    
    body.light-theme .nav-overflow-menu.open {
        background: #ffffff !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    body.light-theme .nav-overflow-menu.open .nav-overflow-link {
        background: rgba(15, 23, 42, 0.05) !important;
        color: rgba(15, 23, 42, 0.7) !important;
    }
    
    body.light-theme .nav-overflow-menu.open .nav-overflow-link:hover {
        background: rgba(15, 23, 42, 0.1) !important;
        color: #0f172a !important;
    }
    
    /* Light theme для всех элементов внутри мобильного меню */
    body.light-theme .nav-overflow-menu .nav-overflow-link {
        background: rgba(15, 23, 42, 0.05) !important;
        color: rgba(15, 23, 42, 0.7) !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-link:hover {
        background: rgba(15, 23, 42, 0.1) !important;
        color: #0f172a !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-label {
        color: rgba(15, 23, 42, 0.7) !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-link:hover .nav-overflow-label {
        color: #0f172a !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-icon {
        filter: brightness(0) opacity(0.7) !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-link:hover .nav-overflow-icon {
        filter: brightness(0) opacity(1) !important;
    }
    
    /* Light theme для nav-overflow-header внутри мобильного меню */
    body.light-theme .nav-overflow-menu .nav-overflow-header {
        background: #ffffff !important;
        border: 1px solid rgba(15, 23, 42, 0.1) !important;
    }
    
    /* Light theme для nav-overflow-close внутри мобильного меню */
    body.light-theme .nav-overflow-menu .nav-overflow-close:hover {
        background: rgba(15, 23, 42, 0.08) !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-close:active {
        background: rgba(15, 23, 42, 0.12) !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-close-icon {
        filter: brightness(0) !important;
        opacity: 0.7 !important;
    }
    
    /* Light theme для nav-overflow-logo внутри мобильного меню */
    body.light-theme .nav-overflow-menu .nav-overflow-logo {
        color: #020617 !important;
        -webkit-text-fill-color: #020617 !important;
    }
    
    /* Light theme для nav-overflow-list внутри мобильного меню */
    body.light-theme .nav-overflow-menu .nav-overflow-list {
        /* Наследует стили от родителя */
    }
    
    /* Light theme для nav-overflow-auth внутри мобильного меню */
    body.light-theme .nav-overflow-menu .nav-overflow-auth-button {
        background: #10B981 !important;
        color: #ffffff !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-auth-button,
    body.light-theme .nav-overflow-menu .nav-overflow-auth-button *,
    body.light-theme .nav-overflow-menu .nav-overflow-auth-button span,
    body.light-theme .nav-overflow-menu .nav-overflow-auth-button div {
        color: #ffffff !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-auth-button:hover {
        background: #059669 !important;
        color: #ffffff !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-auth-button:hover,
    body.light-theme .nav-overflow-menu .nav-overflow-auth-button:hover *,
    body.light-theme .nav-overflow-menu .nav-overflow-auth-button:hover span,
    body.light-theme .nav-overflow-menu .nav-overflow-auth-button:hover div {
        color: #ffffff !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-auth-link {
        color: rgba(15, 23, 42, 0.7) !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-auth-link:hover {
        color: #0f172a !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-auth-text {
        color: rgba(15, 23, 42, 0.7) !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-auth-link:hover .nav-overflow-auth-text {
        color: #0f172a !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-auth-icon {
        filter: brightness(0) opacity(0.7) !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-auth-link:hover .nav-overflow-auth-icon {
        filter: brightness(0) opacity(1) !important;
    }
    
    body.light-theme .nav-overflow-menu.open .nav-overflow-link:hover {
        background: rgba(15, 23, 42, 0.1) !important;
        color: #0f172a !important;
    }
    
    body.light-theme .nav-overflow-menu.open .nav-overflow-label {
        color: rgba(15, 23, 42, 0.7) !important;
    }
    
    body.light-theme .nav-overflow-menu.open .nav-overflow-link:hover .nav-overflow-label {
        color: #0f172a !important;
    }
    
    body.light-theme .nav-overflow-menu.open .nav-overflow-icon {
        filter: brightness(0) opacity(0.7) !important;
    }
    
    body.light-theme .nav-overflow-menu.open .nav-overflow-link:hover .nav-overflow-icon {
        filter: brightness(0) opacity(1) !important;
    }
    
            .nav-overflow-menu.open {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Light theme для nav-overflow-menu на мобильных (внутри медиа-запроса max-width: 800px) */
    body.light-theme .nav-overflow-menu {
        background: #ffffff !important;
    }
    
    body.light-theme .nav-overflow-menu.open {
        background: #ffffff !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-link {
        background: rgba(15, 23, 42, 0.05) !important;
        color: rgba(15, 23, 42, 0.7) !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-link:hover {
        background: rgba(15, 23, 42, 0.1) !important;
        color: #0f172a !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-label {
        color: rgba(15, 23, 42, 0.7) !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-link:hover .nav-overflow-label {
        color: #0f172a !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-icon {
        filter: brightness(0) opacity(0.7) !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-link:hover .nav-overflow-icon {
        filter: brightness(0) opacity(1) !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-header {
        background: #ffffff !important;
        border: 1px solid rgba(15, 23, 42, 0.1) !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-close:hover {
        background: rgba(15, 23, 42, 0.08) !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-close-icon {
        filter: brightness(0) !important;
        opacity: 0.7 !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-logo {
        color: #020617 !important;
        -webkit-text-fill-color: #020617 !important;
    }
    
    .nav-overflow-menu:not(.open) {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
            }
    
    /* Ensure chat is fullscreen but below menu */
    .chat-wrapper {
        z-index: 30 !important; /* Below mobile menu (z-index: 52) */
        height: 100vh !important;
    }
}

/* Mobile responsive */
@media (max-width: 800px) {
    /* Body background uses CSS variable - no override needed */
    
    /* Reduce padding-bottom for content-main-title on mobile */
    .content-main-title {
        padding-bottom: 24px !important;
            }
            /* Mobile menu: move navigation to bottom in icon+text format */
            .back-btn {
                bottom: 40px;
                left: 16px;
                width: 50px;
                height: 50px;
            }

            .back-btn .back-icon {
                width: 20px;
                height: 20px;
            }

            .container {
                flex-direction: column !important;
                width: 100% !important;
                height: 100vh !important;
                margin: 0 !important;
                padding: 0 !important;
            }
            
    /* Hide sphere on index.html, but keep tool cards visible on appsuite.html */
    /* Hide center-content only if it contains sphere/assistant-view */
    .center-content:has(#particleSphere),
    .center-content:has(.assistant-view) {
        display: none !important;
    }
    
    /* Keep center-content visible if it contains tool cards (appsuite.html) */
    .center-content:has(.tool-card),
    .center-content:has(.tools-grid),
    .center-content:has(.content-block) {
        display: flex !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        height: calc(100vh - 56px - env(safe-area-inset-top)) !important;
        width: 100% !important;
        position: fixed !important;
        top: calc(56px + env(safe-area-inset-top)) !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        z-index: 25 !important; /* Above chat (z-index: 20/30) */
        pointer-events: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* Ensure content-block is visible on mobile */
    .center-content:has(.content-block) .content-block {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: var(--spacing-lg) var(--spacing-lg) var(--spacing-6xl) var(--spacing-lg) !important;
        margin: 0 !important;
        overflow-y: visible !important;
        overflow-x: hidden !important;
        height: auto !important;
        min-height: 100% !important;
        pointer-events: auto !important;
    }
    
    
    #particleSphere {
        display: none !important;
    }
    
    .assistant-view {
        display: none !important;
            }
            
            .nav-logo {
        display: none !important;
            }
            
            .nav-collapse-toggle {
        display: none !important;
            }
            
            /* Chat wrapper styles moved to css/chat.css */
            
    /* Hide entire left-nav on mobile - replaced by burger menu */
            .left-nav {
        display: none !important;
    }
    
    /* Hide nav-overflow on mobile - use mobile-menu-header instead */
    .nav-overflow {
        display: none !important;
        visibility: hidden !important;
    }
            
            /* Show avatar on left */
            .nav-user {
                display: flex;
                align-items: center;
                justify-content: center;
                margin: 0;
                padding: 0;
                background: transparent;
                border-radius: 0;
            }
            
            .nav-user-avatar {
                width: 32px;
                height: 32px;
                border-radius: 50%;
                flex-shrink: 0;
            }
            
            .nav-user-info {
                display: none;
            }

            /* Auth buttons on mobile */
            .nav-auth {
                flex-direction: row;
                gap: 8px;
                margin-bottom: 16px;
            }

            .nav-auth-link {
                flex: 1;
                padding: 10px 16px;
                font-size: 14px;
            }

            .nav-auth-button {
                flex: 1;
                padding: 10px 16px;
                font-size: 14px;
            }
            
            /* Current section name centered (mobile only) */
            .nav-current-section {
                display: flex;
                align-items: center;
                justify-content: center;
                width: auto;
                flex: 0 0 auto;
                font-size: 16px;
                font-weight: 600;
                color: #ffffff;
                text-align: center;
                position: absolute;
                left: 50%;
                transform: translateX(-50%);
            }
            
    /* Modal menu - fullscreen overlay */
            .nav-overflow-menu {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        min-width: 100% !important;
        padding: 0 !important;
        border-radius: 0 !important;
        background: #272727 !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border: none !important;
        display: none !important;
        flex-direction: column !important;
        gap: 0 !important;
        z-index: 99999 !important; /* Above everything - highest z-index */
        overflow-y: auto !important;
        box-sizing: border-box !important;
        box-shadow: none !important;
            }
            
            .nav-overflow-menu.open {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Light theme для nav-overflow-menu на мобильных (внутри медиа-запроса max-width: 800px) - должно быть после базовых стилей */
    body.light-theme .nav-overflow-menu {
        background: #ffffff !important;
    }
    
    body.light-theme .nav-overflow-menu.open {
        background: #ffffff !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-link {
        background: rgba(15, 23, 42, 0.05) !important;
        color: rgba(15, 23, 42, 0.7) !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-link:hover {
        background: rgba(15, 23, 42, 0.1) !important;
        color: #0f172a !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-label {
        color: rgba(15, 23, 42, 0.7) !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-link:hover .nav-overflow-label {
        color: #0f172a !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-icon {
        filter: brightness(0) opacity(0.7) !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-link:hover .nav-overflow-icon {
        filter: brightness(0) opacity(1) !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-header {
        background: #ffffff !important;
        border: 1px solid rgba(15, 23, 42, 0.1) !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-close:hover {
        background: rgba(15, 23, 42, 0.08) !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-close-icon {
        filter: brightness(0) !important;
        opacity: 0.7 !important;
    }
    
    body.light-theme .nav-overflow-menu .nav-overflow-logo {
        color: #020617 !important;
        -webkit-text-fill-color: #020617 !important;
    }
    
    .nav-overflow-menu:not(.open) {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
            }
            
    /* Menu header with logo and close button - copy mobile-menu-header styles */
            .nav-overflow-header {
                position: absolute;
        top: 16px;
        left: 16px;
                right: 16px;
        height: 56px;
        padding: 0 var(--spacing-lg);
        background: #272727 !important;
        border: 1px solid #353434 !important;
        border-radius: 16px;
                display: flex;
                align-items: center;
                justify-content: space-between;
        z-index: 100000;
        box-sizing: border-box;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        margin: 0;
            }
            
    /* Logo wrapper */
            .nav-overflow-logo-wrapper {
                width: auto;
        height: auto;
        border-radius: 0;
                display: flex;
                align-items: center;
        justify-content: flex-start;
                padding: 0;
        margin: 0;
        flex: 1;
            }
            
            /* Logo in menu */
            .nav-overflow-logo {
        font-family: var(--font-serif);
                font-style: normal;
        font-weight: var(--font-weight-normal);
        font-size: var(--font-size-lg);
        line-height: var(--line-height-tight);
                text-transform: uppercase;
        color: var(--color-logo);
                user-select: none;
            }
            
    /* Menu close button - copy mobile-menu-burger styles */
            .nav-overflow-close {
                width: 40px;
                height: 40px;
                border-radius: 12px;
                background: transparent;
        border: none;
                display: flex;
                align-items: center;
                justify-content: center;
                cursor: pointer;
        transition: background var(--transition-base);
                padding: 0;
        position: relative;
        z-index: 100;
        pointer-events: auto;
        flex-shrink: 0;
        margin: 0;
            }
            
            .nav-overflow-close:hover {
        background: rgba(255, 255, 255, 0.12);
            }
            
            .nav-overflow-close:active {
                background: rgba(255, 255, 255, 0.15);
            }
            
            /* Light theme для nav-overflow-close внутри мобильного меню (внутри медиа-запроса max-width: 800px) */
            body.light-theme .nav-overflow-close:hover {
                background: rgba(15, 23, 42, 0.08) !important;
            }
            
            body.light-theme .nav-overflow-close:active {
                background: rgba(15, 23, 42, 0.12) !important;
            }
            
            .nav-overflow-close-icon {
                width: 20px;
                height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
                filter: brightness(0) invert(1);
        opacity: 0.9;
            }
            
            /* Light theme для nav-overflow-close-icon внутри мобильного меню (внутри медиа-запроса max-width: 800px) */
            body.light-theme .nav-overflow-close-icon {
                filter: brightness(0) !important;
                opacity: 0.7 !important;
            }
            
    /* Light theme для nav-overflow-close внутри мобильного меню (внутри медиа-запроса max-width: 800px) */
    body.light-theme .nav-overflow-close:hover {
        background: rgba(15, 23, 42, 0.08) !important;
    }
    
    body.light-theme .nav-overflow-close:active {
        background: rgba(15, 23, 42, 0.12) !important;
    }
    
    body.light-theme .nav-overflow-close-icon {
        filter: brightness(0) !important;
        opacity: 0.7 !important;
    }
    
    /* Light theme для nav-overflow-logo внутри мобильного меню (внутри медиа-запроса max-width: 800px) */
    body.light-theme .nav-overflow-logo {
        color: #020617 !important;
        -webkit-text-fill-color: #020617 !important;
    }
            
    .nav-overflow-close-icon svg {
        width: 100%;
        height: 100%;
        display: block;
            }
            
            .nav-overflow-list {
                display: flex;
                flex-direction: column;
        gap: var(--spacing-sm);
                width: 100%;
        margin-top: calc(56px + 16px + 16px); /* Header height + top margin + spacing */
        padding: var(--spacing-lg) 16px;
        box-sizing: border-box;
        flex: 1 1 auto;
        overflow-y: auto;
    }
    
    /* Auth buttons container at bottom */
    .nav-overflow-auth {
        position: absolute;
        bottom: 16px;
        left: 16px;
        right: 16px;
        padding: 0;
        z-index: 100001;
            }
            
    .nav-overflow-auth-container {
                display: flex;
                flex-direction: column;
        gap: var(--spacing-md);
        padding: 0;
        margin: 0;
    }
    
    .nav-overflow-auth-button,
    .nav-overflow-auth-link {
                width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: var(--spacing-sm);
        padding: var(--spacing-md) var(--spacing-2xl);
        border-radius: var(--radius-full);
        font-family: var(--font-primary);
        font-size: var(--font-size-md);
        font-weight: var(--font-weight-semibold);
        text-decoration: none;
        cursor: pointer;
        transition: background var(--transition-base), color var(--transition-base), transform var(--transition-base);
        border: 1px solid var(--color-border-tertiary);
        box-sizing: border-box;
    }
    
    .nav-overflow-auth-button {
        background: var(--color-accent-primary);
        color: #FFFFFF !important;
        border: none;
    }
    
    .nav-overflow-auth-button,
    .nav-overflow-auth-button *,
    .nav-overflow-auth-button span,
    .nav-overflow-auth-button div {
        color: #FFFFFF !important;
    }
    
    .nav-overflow-auth-button:hover {
        background: var(--color-accent-hover);
        color: #FFFFFF !important;
        transform: translateY(-1px);
    }
    
    .nav-overflow-auth-button:hover,
    .nav-overflow-auth-button:hover *,
    .nav-overflow-auth-button:hover span,
    .nav-overflow-auth-button:hover div {
        color: #FFFFFF !important;
    }
    
    .nav-overflow-auth-button:active {
        background: var(--color-accent-active);
        color: #FFFFFF !important;
        transform: translateY(0);
    }
    
    .nav-overflow-auth-button:active,
    .nav-overflow-auth-button:active *,
    .nav-overflow-auth-button:active span,
    .nav-overflow-auth-button:active div {
        color: #FFFFFF !important;
    }
    
    .nav-overflow-auth-link {
        background: var(--color-bg-button-secondary);
        color: var(--color-text-tertiary);
    }
    
    .nav-overflow-auth-link:hover {
        background: var(--color-bg-button-secondary-hover);
        color: var(--color-text-primary);
    }
    
    .nav-overflow-auth-text {
        transition: opacity var(--transition-base);
    }
    
    .nav-overflow-auth-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
    }
    
    .nav-overflow-auth-icon svg {
        width: 24px;
        height: 24px;
            }
            
            .nav-overflow-link {
                width: 100%;
                display: flex;
                align-items: center;
                justify-content: flex-start;
                gap: 12px;
                padding: 12px;
                border-radius: 18px;
                border: none;
                background: transparent;
                color: #ffffff;
                font-size: 16px;
                font-weight: 500;
                text-align: left;
                cursor: pointer;
                transition: background 0.2s ease, color 0.2s ease;
            }
            
            /* Light theme для nav-overflow-link внутри мобильного меню (внутри медиа-запроса max-width: 800px) */
            body.light-theme .nav-overflow-link {
                background: rgba(15, 23, 42, 0.05) !important;
                color: rgba(15, 23, 42, 0.7) !important;
            }
            
            body.light-theme .nav-overflow-link:hover {
                background: rgba(15, 23, 42, 0.1) !important;
                color: #0f172a !important;
            }
            
            body.light-theme .nav-overflow-link .nav-overflow-label {
                color: rgba(15, 23, 42, 0.7) !important;
            }
            
            body.light-theme .nav-overflow-link:hover .nav-overflow-label {
                color: #0f172a !important;
            }
            
            body.light-theme .nav-overflow-link .nav-overflow-icon {
                filter: brightness(0) opacity(0.7) !important;
            }
            
            body.light-theme .nav-overflow-link:hover .nav-overflow-icon {
                filter: brightness(0) opacity(1) !important;
            }
            
            .nav-overflow-link:hover {
                background: rgba(255, 255, 255, 0.12);
            }
            
            /* Light theme для nav-overflow-link:hover внутри мобильного меню (внутри медиа-запроса max-width: 800px) */
            body.light-theme .nav-overflow-link:hover {
                background: rgba(15, 23, 42, 0.1) !important;
                color: #0f172a !important;
            }
            
            .nav-overflow-link.active {
                background: rgba(255, 255, 255, 0.06);
            }
            
            .nav-overflow-link[disabled] {
                opacity: 0.4;
                cursor: not-allowed;
            }
            
            .nav-overflow-link-disabled {
                opacity: 0.4;
                cursor: pointer;
            }
            
            .nav-overflow-link-disabled:hover {
                opacity: 0.6;
                background: rgba(255, 255, 255, 0.05) !important;
            }
            
            .nav-overflow-icon {
                width: 24px;
                height: 24px;
                filter: brightness(0) invert(1) opacity(0.8);
                flex-shrink: 0;
            }
            
            .nav-overflow-label {
                display: inline-flex;
                align-items: center;
                font-size: 16px;
                font-weight: 500;
            }
        }

