/* Profile-first sidebar, inspired by familiar mobile account drawers.
   One account control at the bottom; no account button in the chat header. */
.topline > #account-toggle{display:none!important}
#yap-desktop-menu[open] > #yap-tool-menu{
  padding:15px 11px 10px!important;gap:3px!important;
  background:var(--side);box-shadow:none;
}
#yap-tool-menu .yap-sidebar-caption{padding:5px 11px 12px!important;letter-spacing:.09em!important}
#yap-tool-menu > #yapcode-open{display:none!important} /* Code already has one primary navigation item. */
#yap-tool-menu .yap-sidebar-footer{
 display:flex;flex:none;flex-direction:column;gap:5px;
 margin-top:auto;padding:8px 2px max(4px,env(safe-area-inset-bottom));
 border-top:1px solid var(--border);min-width:0;
}
#yap-tool-menu .yap-nav-recents{
 flex:1;min-height:0!important;overflow:hidden;margin:8px 0 0!important;
 padding-top:10px!important;
}
#yap-tool-menu #yap-menu-settings{
 display:block;margin:0!important;padding:0!important;
 border:0!important;background:transparent;
}
#yap-tool-menu #yap-menu-settings>summary{
 min-height:40px!important;padding:9px 12px!important;
 border-radius:10px;list-style:none;display:flex;align-items:center;
 font-weight:500;font-size:13px;opacity:.84;letter-spacing:0;
}
#yap-tool-menu #yap-menu-settings>summary:focus-visible,
#yap-tool-menu #account-toggle:focus-visible{
 outline:2px solid var(--accent);outline-offset:2px;
}
#yap-tool-menu #yap-menu-settings .top-actions{
 padding:7px 4px!important;margin:4px 0!important;gap:2px!important;
 border:1px solid var(--border)!important;border-radius:12px;
 max-height:min(32dvh,220px);overflow:auto;
}
#yap-tool-menu .yap-sidebar-footer #account-toggle{
 display:flex!important;align-items:center;gap:10px;text-align:left;
 width:100%!important;min-height:57px!important;padding:8px 10px!important;
 border:0!important;border-radius:12px!important;background:transparent;
 color:var(--fg);box-shadow:none!important;font-size:13px;cursor:pointer;
}
#yap-tool-menu .yap-sidebar-footer #account-toggle:hover,
#yap-tool-menu .yap-sidebar-footer #account-toggle[aria-expanded="true"]{
 background:var(--bubble)!important;
}
#yap-tool-menu #account-toggle>img{
 width:35px;height:35px;object-fit:contain;border-radius:12px;flex:none;
 background:var(--panel);padding:5px;border:1px solid var(--border);
}
#yap-tool-menu .yap-account-identity{
 flex:1;min-width:0;display:grid;gap:3px;line-height:1.15;
}
#yap-tool-menu .yap-account-name{
 overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
 font-size:12.5px;font-weight:650;color:var(--fg);
}
#yap-tool-menu .yap-account-meta{
 font-size:11px;color:var(--fg);opacity:.65;overflow:hidden;
 text-overflow:ellipsis;white-space:nowrap;
}
#yap-tool-menu .yap-account-chevron{
 flex:none;font-size:15px;opacity:.65;
}
#yap-desktop-menu:not([open]) #account-panel{display:none!important}
#yap-tool-menu #account-panel{
 position:fixed!important;top:auto!important;right:auto!important;
 bottom:86px!important;left:12px!important;z-index:160!important;
 width:min(325px,calc(100vw - 24px))!important;
 max-height:min(66dvh,565px)!important;overflow:auto;
 padding:15px!important;background:var(--panel);
 border:1px solid var(--border)!important;border-radius:16px!important;
 box-shadow:0 16px 50px #00000028!important;
}
#yap-tool-menu #account-panel[hidden]{display:none!important}
#yap-tool-menu #account-panel form button{width:100%;text-align:center}
@media (max-width:700px){
 #yap-desktop-menu[open]>#yap-tool-menu{
  width:min(304px,87vw)!important;height:100dvh!important;
  padding:calc(12px + env(safe-area-inset-top)) 11px 8px!important;
 }
 #yap-tool-menu .yap-sidebar-footer #account-toggle{min-height:60px!important}
 #yap-tool-menu #account-panel{
  left:9px!important;bottom:calc(90px + env(safe-area-inset-bottom))!important;
  width:min(320px,calc(min(304px,87vw) - 18px))!important;
  max-height:min(58dvh,510px)!important;
 }
}
@media(prefers-reduced-motion:reduce){
 #yap-tool-menu .yap-sidebar-footer button{transition:none}
}
