/*
  VELAEA Dashboard Shell — Mobile Account Parity
  Makes every page using data-velaea-dashboard-shell="v1" match the
  proven mobile header/layout behavior of account.html.
  Scope: mobile/tablet only. Desktop is untouched.
*/

@media (max-width:980px){
  html,
  body[data-velaea-dashboard-shell="v1"],
  body.dashboard-shell{
    width:100%!important;
    max-width:100%!important;
    overflow-x:hidden!important;
  }

  body[data-velaea-dashboard-shell="v1"] .app,
  body[data-velaea-dashboard-shell="v1"] .main,
  body[data-velaea-dashboard-shell="v1"] main.main,
  body.dashboard-shell .app,
  body.dashboard-shell .main,
  body.dashboard-shell main.main{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    margin:0!important;
  }

  body[data-velaea-dashboard-shell="v1"] .app,
  body.dashboard-shell .app{
    display:block!important;
    grid-template-columns:none!important;
  }

  body[data-velaea-dashboard-shell="v1"] .topbar,
  body.dashboard-shell .topbar{
    position:sticky!important;
    top:0!important;
    z-index:900!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:center!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:62px!important;
    min-height:62px!important;
    padding:0 10px!important;
    gap:8px!important;
    overflow:visible!important;
    box-sizing:border-box!important;
  }

  body[data-velaea-dashboard-shell="v1"] .top-left,
  body.dashboard-shell .top-left{
    display:flex!important;
    align-items:center!important;
    min-width:0!important;
    max-width:100%!important;
    gap:8px!important;
    overflow:hidden!important;
  }

  body[data-velaea-dashboard-shell="v1"] .topbar .top-nav,
  body.dashboard-shell .topbar .top-nav{
    display:none!important;
  }

  body[data-velaea-dashboard-shell="v1"] .top-actions,
  body.dashboard-shell .top-actions{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    margin:0!important;
    gap:6px!important;
    flex:0 0 auto!important;
    flex-wrap:nowrap!important;
    overflow:visible!important;
  }

  body[data-velaea-dashboard-shell="v1"] .topbar .page-title,
  body.dashboard-shell .topbar .page-title{
    position:relative!important;
    display:inline-flex!important;
    align-items:center!important;
    width:auto!important;
    min-width:0!important;
    max-width:min(150px,42vw)!important;
    height:34px!important;
    min-height:34px!important;
    padding:0 11px!important;
    margin:0!important;
    gap:10px!important;
    border-radius:999px!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    font-size:13px!important;
    line-height:1!important;
    flex:0 1 auto!important;
    box-sizing:border-box!important;
  }

  body[data-velaea-dashboard-shell="v1"] .topbar .page-title::before,
  body.dashboard-shell .topbar .page-title::before{
    content:""!important;
    position:static!important;
    display:block!important;
    width:8px!important;
    min-width:8px!important;
    max-width:8px!important;
    height:8px!important;
    min-height:8px!important;
    max-height:8px!important;
    flex:0 0 8px!important;
    border-radius:999px!important;
    background:var(--velaea-shell-gold,var(--gold,#f2c76a))!important;
    box-shadow:0 0 0 5px rgba(242,199,106,.13),0 0 20px rgba(242,199,106,.35)!important;
  }

  body[data-velaea-dashboard-shell="v1"] .menu-btn,
  body[data-velaea-dashboard-shell="v1"] .dashboard-theme-toggle,
  body[data-velaea-dashboard-shell="v1"] .dashboard-language-switcher,
  body[data-velaea-dashboard-shell="v1"] .dashboard-language-switcher .lang-trigger,
  body[data-velaea-dashboard-shell="v1"] .user-account-link,
  body[data-velaea-dashboard-shell="v1"] .top-actions>.user,
  body.dashboard-shell .menu-btn,
  body.dashboard-shell .dashboard-theme-toggle,
  body.dashboard-shell .dashboard-language-switcher,
  body.dashboard-shell .dashboard-language-switcher .lang-trigger,
  body.dashboard-shell .user-account-link,
  body.dashboard-shell .top-actions>.user{
    flex:0 0 40px!important;
    width:40px!important;
    min-width:40px!important;
    max-width:40px!important;
    height:40px!important;
    min-height:40px!important;
    max-height:40px!important;
    padding:0!important;
    margin:0!important;
    border-radius:13px!important;
    box-sizing:border-box!important;
  }

  /* Correct three-line hamburger. The old dashboard grid rule collapsed the bars. */
  body[data-velaea-dashboard-shell="v1"] .menu-btn,
  body.dashboard-shell .menu-btn{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    flex-direction:column!important;
    gap:4px!important;
    line-height:0!important;
  }

  body[data-velaea-dashboard-shell="v1"] .menu-btn span,
  body.dashboard-shell .menu-btn span{
    display:block!important;
    width:18px!important;
    min-width:18px!important;
    max-width:18px!important;
    height:2px!important;
    min-height:2px!important;
    max-height:2px!important;
    margin:0!important;
    padding:0!important;
    flex:0 0 2px!important;
    border-radius:999px!important;
    background:var(--velaea-shell-gold,var(--gold,#f2c76a))!important;
    box-shadow:0 0 8px rgba(242,199,106,.35)!important;
    opacity:1;
    transform:none;
    transition:transform .22s ease,opacity .18s ease,background .18s ease!important;
  }

  body[data-velaea-dashboard-shell="v1"].sidebar-open .menu-btn span:nth-child(1),
  body.dashboard-shell.sidebar-open .menu-btn span:nth-child(1){
    transform:translateY(6px) rotate(45deg)!important;
  }
  body[data-velaea-dashboard-shell="v1"].sidebar-open .menu-btn span:nth-child(2),
  body.dashboard-shell.sidebar-open .menu-btn span:nth-child(2){
    opacity:0!important;
  }
  body[data-velaea-dashboard-shell="v1"].sidebar-open .menu-btn span:nth-child(3),
  body.dashboard-shell.sidebar-open .menu-btn span:nth-child(3){
    transform:translateY(-6px) rotate(-45deg)!important;
  }

  body[data-velaea-dashboard-shell="v1"] .dashboard-theme-toggle,
  body[data-velaea-dashboard-shell="v1"] .dashboard-language-switcher .lang-trigger,
  body[data-velaea-dashboard-shell="v1"] .user-account-link,
  body[data-velaea-dashboard-shell="v1"] .top-actions>.user,
  body.dashboard-shell .dashboard-theme-toggle,
  body.dashboard-shell .dashboard-language-switcher .lang-trigger,
  body.dashboard-shell .user-account-link,
  body.dashboard-shell .top-actions>.user{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:0!important;
    overflow:hidden!important;
  }

  body[data-velaea-dashboard-shell="v1"] .dashboard-language-switcher .lang-current-flag,
  body[data-velaea-dashboard-shell="v1"] .dashboard-language-switcher .lang-current-img,
  body.dashboard-shell .dashboard-language-switcher .lang-current-flag,
  body.dashboard-shell .dashboard-language-switcher .lang-current-img{
    display:block!important;
    width:28px!important;
    min-width:28px!important;
    max-width:28px!important;
    height:28px!important;
    min-height:28px!important;
    max-height:28px!important;
    border-radius:999px!important;
    object-fit:cover!important;
  }

  body[data-velaea-dashboard-shell="v1"] .user-account-link .avatar,
  body[data-velaea-dashboard-shell="v1"] .top-actions>.user .avatar,
  body.dashboard-shell .user-account-link .avatar,
  body.dashboard-shell .top-actions>.user .avatar{
    display:grid!important;
    place-items:center!important;
    width:34px!important;
    min-width:34px!important;
    max-width:34px!important;
    height:34px!important;
    min-height:34px!important;
    max-height:34px!important;
    flex:0 0 34px!important;
    padding:0!important;
    border-radius:11px!important;
    overflow:hidden!important;
  }

  body[data-velaea-dashboard-shell="v1"] .user-account-link .avatar img,
  body[data-velaea-dashboard-shell="v1"] .top-actions>.user .avatar img,
  body.dashboard-shell .user-account-link .avatar img,
  body.dashboard-shell .top-actions>.user .avatar img{
    display:block!important;
    width:100%!important;
    height:100%!important;
    object-fit:cover!important;
    border-radius:inherit!important;
  }

  body[data-velaea-dashboard-shell="v1"] .dashboard-theme-toggle .theme-text,
  body[data-velaea-dashboard-shell="v1"] .dashboard-language-switcher .lang-current-text,
  body[data-velaea-dashboard-shell="v1"] .dashboard-language-switcher .lang-chevron,
  body[data-velaea-dashboard-shell="v1"] .user-account-link>div:last-child,
  body[data-velaea-dashboard-shell="v1"] .top-actions>.user>div:last-child,
  body[data-velaea-dashboard-shell="v1"] #logoutBtn,
  body.dashboard-shell .dashboard-theme-toggle .theme-text,
  body.dashboard-shell .dashboard-language-switcher .lang-current-text,
  body.dashboard-shell .dashboard-language-switcher .lang-chevron,
  body.dashboard-shell .user-account-link>div:last-child,
  body.dashboard-shell .top-actions>.user>div:last-child,
  body.dashboard-shell #logoutBtn{
    display:none!important;
  }

  body[data-velaea-dashboard-shell="v1"] .velaea-notification-wrap,
  body[data-velaea-dashboard-shell="v1"] .velaea-public-notification-wrap,
  body[data-velaea-dashboard-shell="v1"] .top-actions>.notify,
  body.dashboard-shell .velaea-notification-wrap,
  body.dashboard-shell .velaea-public-notification-wrap,
  body.dashboard-shell .top-actions>.notify{
    display:none!important;
  }

  body[data-velaea-dashboard-shell="v1"] .content,
  body.dashboard-shell .content{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    padding-left:10px!important;
    padding-right:10px!important;
    margin-left:0!important;
    margin-right:0!important;
    box-sizing:border-box!important;
    overflow-x:clip!important;
  }

  body[data-velaea-dashboard-shell="v1"] .sidebar,
  body.dashboard-shell .sidebar{
    position:fixed!important;
    top:0!important;
    bottom:0!important;
    left:-290px!important;
    width:268px!important;
    min-width:268px!important;
    max-width:min(86vw,320px)!important;
    height:100dvh!important;
    display:flex!important;
    transition:left .22s ease!important;
    z-index:950!important;
  }

  body[data-velaea-dashboard-shell="v1"] .sidebar.open,
  body[data-velaea-dashboard-shell="v1"].sidebar-open .sidebar,
  body.dashboard-shell .sidebar.open,
  body.dashboard-shell.sidebar-open .sidebar{
    left:0!important;
  }

  body[data-velaea-dashboard-shell="v1"] .sidebar-backdrop,
  body.dashboard-shell .sidebar-backdrop{
    position:fixed!important;
    inset:0!important;
    z-index:940!important;
    background:rgba(2,8,18,.56)!important;
    backdrop-filter:blur(5px)!important;
    -webkit-backdrop-filter:blur(5px)!important;
  }

  body[data-velaea-dashboard-shell="v1"].sidebar-open,
  body.dashboard-shell.sidebar-open{
    overflow:hidden!important;
  }
}

@media (max-width:420px){
  body[data-velaea-dashboard-shell="v1"] .topbar,
  body.dashboard-shell .topbar{
    padding-inline:8px!important;
    gap:6px!important;
  }

  body[data-velaea-dashboard-shell="v1"] .top-left,
  body[data-velaea-dashboard-shell="v1"] .top-actions,
  body.dashboard-shell .top-left,
  body.dashboard-shell .top-actions{
    gap:5px!important;
  }

  body[data-velaea-dashboard-shell="v1"] .topbar .page-title,
  body.dashboard-shell .topbar .page-title{
    display:inline-flex!important;
    max-width:126px!important;
    height:32px!important;
    min-height:32px!important;
    padding-inline:9px!important;
    font-size:12px!important;
  }

  body[data-velaea-dashboard-shell="v1"] .content,
  body.dashboard-shell .content{
    padding-left:8px!important;
    padding-right:8px!important;
  }
}

@media (max-width:340px){
  body[data-velaea-dashboard-shell="v1"] .topbar .page-title,
  body.dashboard-shell .topbar .page-title{
    display:inline-flex!important;
    max-width:112px!important;
    padding-inline:8px!important;
    gap:8px!important;
  }
}
