/* Reserve space below the footer for the existing mobile navigation and IMANI. */
@media (max-width:640px){
  .footer { padding-bottom:calc(156px + env(safe-area-inset-bottom, 0px)); }
  .footer .footer-link { scroll-margin-block:90px 160px; }
}
.profile-completion-item { display:inline-flex; align-items:center; gap:.5em; text-align:left; max-width:100%; }
.profile-completion-mark { flex:none; }

/* The existing assistant occupies navigation space, never the page below it. */
#imani-toggle.imani-navigation-button {
  position:static; inset:auto; flex:none; min-height:44px; min-width:44px;
  margin:0; z-index:auto; animation:none; transform:none;
}
@media (min-width:641px) and (max-width:1100px) {
  .topbar { flex-wrap:wrap; }
  .topbar-right { flex-wrap:wrap; max-width:100%; }
}
@media (max-width:640px) {
  .mobile-bottom-nav { grid-template-columns:repeat(6,minmax(0,1fr)); }
  #imani-toggle.imani-navigation-button {
    order:6; width:100%; padding:4px 2px; font-size:.68rem;
    border-radius:12px; box-shadow:none;
  }
  .mobile-bottom-nav .mobile-tab-btn { padding-inline:2px; }
}
#imani-toggle:focus-visible, #imb-toast-root button:focus-visible {
  outline:2px solid currentColor; outline-offset:2px;
}
#imb-toast-root {
  position:fixed; top:80px; left:50%; transform:translateX(-50%);
  width:min(420px,calc(100vw - 24px)); z-index:9999;
  display:grid; gap:8px; pointer-events:none;
}
#imb-toast-root .imb-toast {
  display:flex; align-items:center; gap:12px; padding:12px 14px;
  background:#171725; color:#f7f7ff; border:1px solid #9494af;
  border-radius:12px; box-shadow:0 4px 20px #0006;
  pointer-events:auto; overflow-wrap:anywhere; font-size:.9rem;
}
#imb-toast-root .imb-toast > span { flex:1; min-width:0; }
#imb-toast-root button {
  flex:none; min-width:44px; min-height:44px; padding:4px;
  border:1px solid currentColor; border-radius:8px;
  background:transparent; color:inherit; font:inherit; font-size:1.3rem; cursor:pointer;
}
@media (forced-colors:active) {
  .mobile-bottom-nav, body.shell-ready .mobile-bottom-nav {
    background:Canvas;
    color:CanvasText;
    border-top:1px solid CanvasText;
    backdrop-filter:none;
    -webkit-backdrop-filter:none;
    animation:none;
  }
  #imb-toast-root .imb-toast, #imani-toggle.imani-navigation-button {
    background:Canvas; color:CanvasText; border:1px solid ButtonText;
  }
}

/* Keep profile field names distinct from their values at narrow widths. */
.imb-userinfo-row { display:flex; flex-wrap:wrap; gap:.25em .5em; }
.imb-userinfo-h { flex:none; }
.imb-userinfo-v { min-width:0; max-width:100%; overflow-wrap:anywhere; }
