/* STRIX EDGE v61 — Professional mobile navigation
   Targeted fix only: guarantees the hamburger remains visible and usable
   without altering the restored v48 desktop foundation.
*/

@media (max-width: 768px){

  body.neo-v2 .nav{
    left:0;
    right:0;
    width:100%;
    padding-left:8px;
    padding-right:8px;
    box-sizing:border-box;
  }

  body.neo-v2 .nav__inner{
    width:100%;
    min-width:0;
    height:58px;
    padding:0 7px 0 8px;
    gap:6px;
    overflow:visible;
    box-sizing:border-box;
  }

  /* Keep the complete brand while allowing the controls to own their space. */
  body.neo-v2 .nav__logo{
    min-width:0;
    max-width:168px;
    flex:1 1 auto;
    gap:7px;
    min-height:42px;
    padding:3px 7px 3px 4px;
    overflow:hidden;
    border-radius:13px;
  }

  body.neo-v2 .nav__brand-mark{
    width:32px;
    height:32px;
    flex:0 0 32px;
    border-radius:10px;
  }

  body.neo-v2 .nav__brand-mark svg{
    width:24px!important;
    height:24px!important;
  }

  body.neo-v2 .nav__logo-text{
    min-width:0;
    gap:4px;
    overflow:hidden;
  }

  body.neo-v2 .nav__logo-text .nav__brand-strix{
    font-size:12.5px;
    letter-spacing:.105em;
  }

  body.neo-v2 .nav__logo-text .nav__brand-edge{
    font-size:9.5px;
    letter-spacing:.13em;
  }

  body.neo-v2 .nav__logo-text .nav__brand-dot{
    width:3px;
    height:3px;
    flex-basis:3px;
    margin:0;
  }

  body.neo-v2 .nav__actions{
    min-width:0;
    flex:0 0 auto;
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:5px;
    margin-left:auto;
    overflow:visible;
  }

  /* Language becomes a clean flag-only control on phones. */
  body.neo-v2 .lang-switcher{
    flex:0 0 auto;
  }

  body.neo-v2 .lang-switcher__trigger{
    width:42px!important;
    min-width:42px!important;
    height:42px!important;
    min-height:42px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:0!important;
    padding:0!important;
    border-radius:12px!important;
  }

  body.neo-v2 .lang-switcher__name,
  body.neo-v2 .lang-switcher__code,
  body.neo-v2 .lang-switcher__chevron{
    display:none!important;
  }

  body.neo-v2 .lang-switcher__flag{
    width:22px;
    height:15px;
  }

  body.neo-v2 .lang-switcher__menu{
    position:fixed;
    top:76px;
    right:9px;
    width:min(210px,calc(100vw - 18px));
    max-height:calc(100dvh - 90px);
    overflow:auto;
    border-radius:16px;
  }

  /* Theme becomes icon-only on mobile. */
  body.neo-v2 .theme-toggle{
    width:42px!important;
    min-width:42px!important;
    height:42px!important;
    min-height:42px!important;
    padding:0!important;
    gap:0!important;
    display:grid!important;
    place-items:center!important;
    border-radius:12px!important;
  }

  body.neo-v2 .theme-toggle__track,
  body.neo-v2 .theme-toggle__label{
    display:none!important;
  }

  body.neo-v2 .theme-toggle__icon{
    width:auto!important;
    min-width:0!important;
    font-size:17px!important;
  }

  /*
   * Account dropdown is intentionally moved out of the top bar on phones.
   * It was the element pushing the hamburger outside the viewport.
   */
  body.neo-v2 .nav__actions > .auth-profile{
    display:none!important;
  }

  /* Hamburger is now a guaranteed, fixed-size final control. */
  body.neo-v2 .nav__toggle{
    order:99;
    width:44px!important;
    min-width:44px!important;
    height:42px!important;
    min-height:42px!important;
    flex:0 0 44px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    flex-direction:column!important;
    gap:4px!important;
    padding:0!important;
    margin:0!important;
    border:1px solid var(--neo-border)!important;
    border-radius:12px!important;
    background:var(--neo-surface)!important;
    box-shadow:var(--neo-shadow-xs)!important;
    position:relative!important;
    z-index:1002!important;
  }

  body.neo-v2 .nav__toggle span{
    width:18px!important;
    height:2px!important;
    flex:0 0 2px;
    display:block!important;
    border-radius:999px!important;
    background:var(--text-primary)!important;
  }

  body.neo-v2 .nav__toggle.active{
    border-color:rgba(21,147,111,.28)!important;
    color:var(--accent);
    box-shadow:var(--neo-inset-soft)!important;
  }

  body.neo-v2 .nav__toggle.active span{
    background:var(--accent)!important;
  }

  /*
   * Professional full-screen menu.
   * Navigation starts below the fixed header and includes account actions.
   */
  body.neo-v2 .nav__mobile{
    z-index:1000;
    padding:
      calc(86px + env(safe-area-inset-top,0px))
      16px
      calc(24px + env(safe-area-inset-bottom,0px));
    align-items:center;
    justify-content:flex-start;
    gap:7px;
    overflow-y:auto;
  }

  body.neo-v2 .nav__mobile > a{
    width:100%;
    max-width:360px;
    min-height:52px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 16px;
    margin:0;
    border-radius:13px;
    font-size:15px;
    text-align:left;
  }

  body.neo-v2 .nav__mobile > a::after{
    content:"→";
    color:var(--text-muted);
    font-family:var(--font-mono);
    font-size:12px;
  }

  body.neo-v2 .nav-mobile-account{
    width:100%;
    max-width:360px;
    display:grid;
    grid-template-columns:1fr;
    gap:7px;
    margin-top:8px;
    padding-top:14px;
    border-top:1px solid var(--neo-border);
  }

  body.neo-v2 .nav-mobile-account__label{
    padding:0 4px 2px;
    color:var(--text-muted);
    font-family:var(--font-mono);
    font-size:8px;
    font-weight:850;
    letter-spacing:.9px;
  }

  body.neo-v2 .nav-mobile-account a,
  body.neo-v2 .nav-mobile-account button{
    width:100%;
    min-height:48px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding:0 14px;
    border:1px solid var(--neo-border);
    border-radius:12px;
    background:var(--neo-surface);
    color:var(--text-primary);
    box-shadow:var(--neo-shadow-xs);
    font-family:var(--font-display);
    font-size:13px;
    font-weight:800;
    text-align:left;
    text-decoration:none;
    cursor:pointer;
  }

  body.neo-v2 .nav-mobile-account a span:last-child,
  body.neo-v2 .nav-mobile-account button span:last-child{
    color:var(--text-muted);
    font-family:var(--font-mono);
    font-size:11px;
  }

  body.neo-v2 .nav-mobile-account__primary{
    border-color:rgba(21,147,111,.24)!important;
    background:linear-gradient(135deg,#15936F,#0B6B53)!important;
    color:#fff!important;
    box-shadow:0 9px 22px rgba(11,107,83,.18)!important;
  }

  body.neo-v2 .nav-mobile-account__primary span:last-child{
    color:rgba(255,255,255,.76)!important;
  }

  body.neo-v2 .nav-mobile-account__danger{
    color:#dc425a!important;
  }
}

@media (max-width: 390px){
  body.neo-v2 .nav{
    padding-left:6px;
    padding-right:6px;
  }

  body.neo-v2 .nav__inner{
    padding-left:6px;
    padding-right:5px;
    gap:4px;
  }

  body.neo-v2 .nav__logo{
    max-width:146px;
    gap:5px;
    padding-right:4px;
  }

  body.neo-v2 .nav__brand-mark{
    width:30px;
    height:30px;
    flex-basis:30px;
  }

  body.neo-v2 .nav__brand-mark svg{
    width:22px!important;
    height:22px!important;
  }

  body.neo-v2 .nav__logo-text .nav__brand-strix{
    font-size:11.5px;
    letter-spacing:.09em;
  }

  body.neo-v2 .nav__logo-text .nav__brand-edge{
    font-size:8.5px;
    letter-spacing:.105em;
  }

  body.neo-v2 .lang-switcher__trigger,
  body.neo-v2 .theme-toggle{
    width:39px!important;
    min-width:39px!important;
    height:40px!important;
    min-height:40px!important;
  }

  body.neo-v2 .nav__toggle{
    width:42px!important;
    min-width:42px!important;
    flex-basis:42px!important;
    height:40px!important;
    min-height:40px!important;
  }
}

@media (max-width: 335px){
  /* Ultra-narrow phones keep the symbol and STRIX while preserving the menu. */
  body.neo-v2 .nav__logo-text .nav__brand-edge,
  body.neo-v2 .nav__logo-text .nav__brand-dot{
    display:none!important;
  }

  body.neo-v2 .nav__logo{
    max-width:104px;
  }
}


/* v62 — uniform mobile menu geometry */
@media (max-width:768px){

  body.neo-v2 .nav__mobile{
    --mobile-menu-row-width: min(100%, 360px);
    --mobile-menu-row-height: 54px;
  }

  /* Back, public links and authenticated account actions share one grid width. */
  body.neo-v2 .nav-mobile-back,
  body.neo-v2 .nav__mobile > a,
  body.neo-v2 .nav-mobile-account{
    width:var(--mobile-menu-row-width)!important;
    max-width:none!important;
    min-width:0!important;
    align-self:center!important;
    box-sizing:border-box!important;
  }

  body.neo-v2 .nav-mobile-account{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
  }

  body.neo-v2 .nav-mobile-back,
  body.neo-v2 .nav__mobile > a,
  body.neo-v2 .nav-mobile-account a,
  body.neo-v2 .nav-mobile-account button{
    width:100%!important;
    height:var(--mobile-menu-row-height)!important;
    min-height:var(--mobile-menu-row-height)!important;
    max-height:var(--mobile-menu-row-height)!important;
    box-sizing:border-box!important;
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:12px!important;
    margin:0!important;
    padding:0 17px!important;
    border:1px solid var(--neo-border)!important;
    border-radius:13px!important;
    background:var(--neo-surface)!important;
    box-shadow:var(--neo-shadow-xs)!important;
    color:var(--text-primary)!important;
    font-family:var(--font-display)!important;
    font-size:15px!important;
    font-weight:800!important;
    line-height:1!important;
    text-align:left!important;
    text-decoration:none!important;
  }

  body.neo-v2 .nav-mobile-back{
    appearance:none!important;
    -webkit-appearance:none!important;
    cursor:pointer!important;
  }

  body.neo-v2 .nav-mobile-back__icon{
    width:20px;
    flex:0 0 20px;
    color:var(--accent);
    font-family:var(--font-mono);
    font-size:18px;
    font-weight:800;
  }

  body.neo-v2 .nav-mobile-back > span:last-child{
    flex:1 1 auto;
  }

  body.neo-v2 .nav-mobile-back::after{
    content:"CLOSE";
    color:var(--text-muted);
    font-family:var(--font-mono);
    font-size:8px;
    font-weight:800;
    letter-spacing:.8px;
  }

  body.neo-v2 .nav__mobile > a::after{
    flex:0 0 auto;
  }

  body.neo-v2 .nav-mobile-account a span:first-child,
  body.neo-v2 .nav-mobile-account button span:first-child{
    min-width:0;
    flex:1 1 auto;
  }

  body.neo-v2 .nav-mobile-account a span:last-child,
  body.neo-v2 .nav-mobile-account button span:last-child{
    flex:0 0 auto;
  }

  /* The account label aligns to the exact same left/right edges as every card. */
  body.neo-v2 .nav-mobile-account__label{
    width:100%!important;
    box-sizing:border-box!important;
    padding:0 9px 4px!important;
  }

  /* Keep the primary workspace action green, with identical row geometry. */
  body.neo-v2 .nav-mobile-account__primary{
    height:var(--mobile-menu-row-height)!important;
    min-height:var(--mobile-menu-row-height)!important;
    max-height:var(--mobile-menu-row-height)!important;
  }

  body.neo-v2 .nav-mobile-account__danger{
    height:var(--mobile-menu-row-height)!important;
    min-height:var(--mobile-menu-row-height)!important;
    max-height:var(--mobile-menu-row-height)!important;
  }
}

@media (max-width:390px){
  body.neo-v2 .nav__mobile{
    --mobile-menu-row-width: min(100%, 360px);
    --mobile-menu-row-height: 52px;
  }

  body.neo-v2 .nav-mobile-back,
  body.neo-v2 .nav__mobile > a,
  body.neo-v2 .nav-mobile-account a,
  body.neo-v2 .nav-mobile-account button{
    font-size:14px!important;
    padding-left:15px!important;
    padding-right:15px!important;
  }
}


/* v64 — exact uniform mobile menu cards */
@media (max-width:768px){
  body.neo-v2 .nav__mobile{
    --menu-side-gap:16px;
    --menu-card-height:54px;
    --menu-card-radius:14px;
    box-sizing:border-box!important;
    width:100vw!important;
    max-width:100vw!important;
    left:0!important;
    right:0!important;
    padding-left:var(--menu-side-gap)!important;
    padding-right:var(--menu-side-gap)!important;
  }

  /* Same outside width for Back, Home/About/Pricing and the account section. */
  body.neo-v2 .nav-mobile-back,
  body.neo-v2 .nav__mobile > a,
  body.neo-v2 .nav-mobile-account{
    width:calc(100vw - (var(--menu-side-gap) * 2))!important;
    min-width:calc(100vw - (var(--menu-side-gap) * 2))!important;
    max-width:calc(100vw - (var(--menu-side-gap) * 2))!important;
    flex:0 0 auto!important;
    align-self:center!important;
    margin-left:auto!important;
    margin-right:auto!important;
    box-sizing:border-box!important;
  }

  body.neo-v2 .nav-mobile-account{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
  }

  /* Exact same height, radius, padding and typography for every card. */
  body.neo-v2 .nav-mobile-back,
  body.neo-v2 .nav__mobile > a,
  body.neo-v2 .nav-mobile-account > a,
  body.neo-v2 .nav-mobile-account > button{
    width:100%!important;
    min-width:100%!important;
    max-width:100%!important;
    height:var(--menu-card-height)!important;
    min-height:var(--menu-card-height)!important;
    max-height:var(--menu-card-height)!important;
    margin:0!important;
    padding:0 18px!important;
    box-sizing:border-box!important;
    border-radius:var(--menu-card-radius)!important;
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:12px!important;
    font-size:15px!important;
    line-height:1!important;
  }

  /* Keep labels/arrows aligned on the same vertical grid. */
  body.neo-v2 .nav__mobile > a::after,
  body.neo-v2 .nav-mobile-account > a span:last-child,
  body.neo-v2 .nav-mobile-account > button span:last-child{
    width:20px!important;
    min-width:20px!important;
    flex:0 0 20px!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    text-align:center!important;
  }

  body.neo-v2 .nav-mobile-account__label{
    width:100%!important;
    min-width:100%!important;
    max-width:100%!important;
    box-sizing:border-box!important;
    padding:0 18px 4px!important;
  }

  /* The primary Market row keeps the accent, but never changes size. */
  body.neo-v2 .nav-mobile-account__primary{
    width:100%!important;
    min-width:100%!important;
    max-width:100%!important;
    height:var(--menu-card-height)!important;
    min-height:var(--menu-card-height)!important;
    max-height:var(--menu-card-height)!important;
  }

  body.neo-v2 .nav-mobile-account__danger{
    width:100%!important;
    min-width:100%!important;
    max-width:100%!important;
    height:var(--menu-card-height)!important;
    min-height:var(--menu-card-height)!important;
    max-height:var(--menu-card-height)!important;
  }
}

@media (max-width:390px){
  body.neo-v2 .nav__mobile{
    --menu-side-gap:14px;
    --menu-card-height:52px;
  }

  body.neo-v2 .nav-mobile-back,
  body.neo-v2 .nav__mobile > a,
  body.neo-v2 .nav-mobile-account > a,
  body.neo-v2 .nav-mobile-account > button{
    padding-left:16px!important;
    padding-right:16px!important;
    font-size:14px!important;
  }

  body.neo-v2 .nav-mobile-account__label{
    padding-left:16px!important;
    padding-right:16px!important;
  }
}
