/* Isolate the bottom bar from desktop sidebar styles, including hover states. */
@media (max-width:980px) {
  body.org-v4 nav.mobile-bottom-nav {
    --mobile-nav-text:#344d66;
    --mobile-nav-active:#075a9c;
    --mobile-nav-selected:#e7f1fc;
    box-sizing:border-box!important;
    position:fixed;inset:auto 0 0;width:auto;min-width:0;max-width:100%;
    height:calc(72px + env(safe-area-inset-bottom));min-height:0;
    margin:0;padding:6px 8px calc(6px + env(safe-area-inset-bottom));
    display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:3px;
    background:#fff;border:0;border-top:1px solid #d6e0ea;
    color:var(--mobile-nav-text);box-shadow:0 -3px 16px #172f4b12;
    overflow:clip;isolation:isolate;z-index:1000;backdrop-filter:none;
  }
  body.org-v4 nav.mobile-bottom-nav :is(.org-nav-link,.mobile-bottom-more) {
    box-sizing:border-box!important;display:flex!important;flex-direction:column;
    align-items:center;justify-content:center;gap:4px;
    width:100%;min-width:0;max-width:100%;height:58px;min-height:44px;
    margin:0;padding:5px 2px!important;border:1px solid transparent;
    border-radius:11px;background:transparent!important;
    color:var(--mobile-nav-text)!important;opacity:1!important;
    box-shadow:none!important;transform:none!important;text-decoration:none;
  }
  body.org-v4 nav.mobile-bottom-nav :is(.org-nav-link,.mobile-bottom-more):hover {
    color:var(--mobile-nav-active)!important;background:var(--mobile-nav-selected)!important;
  }
  body.org-v4 nav.mobile-bottom-nav :is(.org-nav-link,.mobile-bottom-more):focus-visible {
    outline:2px solid var(--mobile-nav-active);outline-offset:-2px;
  }
  body.org-v4 nav.mobile-bottom-nav :is(.org-nav-link.active,.org-nav-link[aria-current=page]) {
    color:var(--mobile-nav-active)!important;background:var(--mobile-nav-selected)!important;
    border-color:transparent!important;
  }
  body.org-v4 nav.mobile-bottom-nav .org-nav-link::after {display:none!important}
  body.org-v4 nav.mobile-bottom-nav :is(.org-nav-icon,.mobile-more-icon) {
    display:grid!important;place-items:center;flex:none;
    width:24px!important;height:24px!important;min-width:0;
    margin:0;padding:0;border:0;border-radius:0;background:transparent!important;
    color:inherit!important;font-size:22px;line-height:1;opacity:1!important;
  }
  body.org-v4 nav.mobile-bottom-nav :is(strong,.org-nav-link>span:not(.org-nav-icon)) {
    display:block!important;min-width:0;max-width:100%;width:auto;
    color:inherit!important;opacity:1!important;
  }
  body.org-v4 nav.mobile-bottom-nav strong {
    font:inherit;font-size:11px;line-height:1.5;font-weight:700;
    white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  }
  body.org-v4 nav.mobile-bottom-nav :is(small,.org-nav-link>b){display:none!important}
  /* Both controls remain reachable, but never occupy a navigation target. */
  body.org-v4:has(nav.mobile-bottom-nav) .ai-chat-launcher {
    left:max(14px,env(safe-area-inset-left))!important;right:auto!important;
    bottom:calc(86px + env(safe-area-inset-bottom))!important;
    width:48px!important;height:48px!important;margin:0!important;
  }
  body.org-v4:has(nav.mobile-bottom-nav) .onboarding-replay {
    left:74px!important;right:auto!important;
    bottom:calc(89px + env(safe-area-inset-bottom))!important;
    width:auto!important;max-width:calc(100vw - 100px)!important;
    min-height:42px!important;height:42px!important;margin:0!important;
    padding:0 11px!important;
  }
  html[lang=en] body.org-v4:has(nav.mobile-bottom-nav) .ai-chat-launcher {
    left:auto!important;right:max(14px,env(safe-area-inset-right))!important;
  }
  html[lang=en] body.org-v4:has(nav.mobile-bottom-nav) .onboarding-replay {
    left:auto!important;right:74px!important;
  }
  body.org-v4:has(.mobile-more-dialog[open]) :is(.ai-chat-launcher,.onboarding-replay) {
    visibility:hidden!important;pointer-events:none!important;
  }
  body.org-v4 .mobile-more-dialog,body.org-v4 .mobile-more-dialog * {box-sizing:border-box}
  body.org-v4 .mobile-more-dialog {width:100%;max-width:100%;overflow-x:hidden}
  body.org-v4 .mobile-more-dialog .org-nav-link {min-width:0;width:100%;margin:0;color:#243e58!important;background:#f7f9fc!important}
  body.org-v4 .mobile-more-dialog .org-nav-link :is(strong,.org-nav-icon) {color:#243e58!important}
  body.org-v4 .mobile-more-dialog .org-nav-link small {color:#526b83!important}
  html[data-theme=dark] body.org-v4 nav.mobile-bottom-nav {
    --mobile-nav-text:#d8e4ef;--mobile-nav-active:#a5d6ff;--mobile-nav-selected:#263e56;
    background:#152536;border-top-color:#3b5067;
  }
  html[data-theme=dark] body.org-v4 .mobile-more-dialog .org-nav-link {color:#ecf3fa!important;background:#21364b!important}
  html[data-theme=dark] body.org-v4 .mobile-more-dialog .org-nav-link :is(strong,.org-nav-icon) {color:#ecf3fa!important}
  html[data-theme=dark] body.org-v4 .mobile-more-dialog .org-nav-link small {color:#c1d0df!important}
}
