/* One navigation row; secondary sections live in a native modal bottom sheet. */
#dashboard>nav.main-navigation{display:flex;flex-wrap:nowrap;gap:3px}
#dashboard>nav.main-navigation>button{display:flex;flex:1 1 0;min-width:0;min-height:52px;padding:5px 2px;flex-direction:column;align-items:center;justify-content:center;gap:3px;white-space:nowrap;font-size:11px;line-height:1.2}
#dashboard>nav.main-navigation>button svg{display:block;width:19px;height:19px;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
#dashboard>nav.main-navigation>button.selected{color:var(--lime)}
#more-open{position:relative}
#more-badge{position:absolute;top:8px;left:calc(50% + 8px);width:6px;height:6px;border-radius:50%;background:var(--lime)}
#more-menu{position:fixed;inset:auto 0 0;margin:0 auto;width:min(100%,540px);max-width:100%;max-height:85vh;max-height:85dvh;padding:10px 20px max(22px,env(safe-area-inset-bottom));border:1px solid #ffffff1a;border-bottom:0;border-radius:25px 25px 0 0;overflow:auto;overscroll-behavior:contain;box-shadow:0 -12px 60px #0005}
#more-menu::backdrop{background:#0008;backdrop-filter:blur(5px)}
.more-menu-handle{width:35px;height:4px;margin:0 auto 12px;border-radius:4px;background:#ffffff25}
.more-menu-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px}
.more-menu-heading h2{font-size:25px;margin:0 0 5px}
.more-menu-heading p{font-size:12px;margin:0;color:var(--muted)}
.more-menu-heading .icon-button{width:44px;min-width:44px;height:44px;border-radius:50%;font-size:25px;color:var(--muted)}
.more-menu-items{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.more-menu-item{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:13px;min-width:0;min-height:94px;padding:15px 16px;border:1px solid var(--line);border-radius:15px;background:#ffffff03;color:var(--text);text-align:left;font-size:13px;line-height:1.3}
.more-menu-item>svg,.more-menu-icon>svg{display:block;width:23px;height:23px;color:var(--muted);stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}
.more-menu-item.selected{color:var(--lime);border-color:#c9fa5c44;background:#c9fa5c09}
.more-menu-item.selected svg{color:var(--lime)}
.more-menu-icon{display:flex;align-items:center;gap:9px;min-height:23px}
#more-menu #notifications-badge{min-width:20px;margin:0;padding:3px 6px;border-radius:9px;text-align:center;font:10px/1.4 ui-monospace,monospace}
.more-menu-item:active{background:#c9fa5c12}
@media(max-width:360px){#more-menu{padding-left:16px;padding-right:16px}.more-menu-item{padding:14px;font-size:12px}.more-menu-items{gap:8px}}
@media(max-height:480px) and (min-width:550px){.more-menu-items{grid-template-columns:repeat(3,minmax(0,1fr))}.more-menu-item{min-height:82px;padding:12px}.more-menu-heading{margin-bottom:12px}}

/* The main phone navigation stays within thumb reach and reserves the home indicator. */
@media(max-width:900px), (max-width:1100px) and (max-height:600px){
  body:not(.chats-fullscreen):has(#dashboard:not([hidden])) .shell{padding-bottom:calc(76px + env(safe-area-inset-bottom))}
  #dashboard>nav.main-navigation{position:fixed;z-index:25;bottom:0;left:50%;transform:translateX(-50%);width:min(100%,540px);margin:0;padding:5px max(7px,env(safe-area-inset-right)) max(5px,env(safe-area-inset-bottom)) max(7px,env(safe-area-inset-left));border:1px solid var(--line);border-bottom:0;border-radius:17px 17px 0 0;background:#101512f7;box-shadow:0 -8px 30px #0005}
  body.desktop-active #dashboard>nav.main-navigation,body.phone-workspace #dashboard>nav.main-navigation{position:relative;left:auto;bottom:auto;transform:none;order:10;flex:0 0 auto;width:auto;margin:0 6px;padding:4px 2px 2px;border-radius:12px;box-shadow:none}
  body.desktop-active #dashboard>nav.main-navigation>button,body.phone-workspace #dashboard>nav.main-navigation>button{min-height:48px;padding:4px 2px;font-size:11px}
  body:is(.keyboard-open,.navigation-editing,.direct-typing,.composer-open,.screen-expanded,.landscape-desktop) #dashboard>nav.main-navigation{display:none!important}
  body:has(#dashboard :is(input:not([type=checkbox]):not([type=radio]):not([type=file]),textarea,[contenteditable=true]):focus) #dashboard>nav.main-navigation{display:none!important}
  body:not(.desktop-active):not(.chats-fullscreen):has(#dashboard:not([hidden])) #toast{bottom:calc(75px + env(safe-area-inset-bottom))}
  @supports not selector(:has(*)){
    .shell{padding-bottom:calc(76px + env(safe-area-inset-bottom))}
    body:not(.desktop-active) #toast{bottom:calc(75px + env(safe-area-inset-bottom))}
  }
}
