/* 24.10.41 — keep every header action inside the available main-column width.
   No permission, navigation, sidebar preference or application data changes. */
@media screen {
  body.nm-theme .topbar {
    width:100%; max-width:100%; min-width:0;
    flex-wrap:wrap!important;
    gap:10px 12px!important;
    overflow:visible;
  }
  body.nm-theme .topbar .nm-header-left {
    flex:0 1 auto; min-width:0; max-width:100%; gap:10px;
  }
  body.nm-theme .topbar .nm-breadcrumb {
    min-width:0; max-width:220px;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  }
  body.nm-theme .topbar .nm-header-right {
    display:flex; flex:1 1 640px; min-width:0; max-width:100%;
    flex-wrap:wrap; justify-content:flex-end; align-items:center;
    gap:8px!important;
  }
  body.nm-theme .topbar .nm-header-right > * {
    flex:0 0 auto; max-width:100%;
  }
  body.nm-theme .topbar .nm-header-right > .globalSearch {
    flex:1 1 180px; width:auto; min-width:min(160px,100%); max-width:360px;
  }
  body.nm-theme .topbar .globalSearch > input {
    flex:1 1 0%; min-width:0;
  }
  body.nm-theme .topbar .nm247-clock-pill { white-space:nowrap; }
  body.nm-theme .topbar .nm-va-button,
  body.nm-theme .topbar .profileChip {
    flex:0 0 auto; min-width:42px; min-height:42px;
  }
}
@media screen and (max-width:900px) {
  body.nm-theme .topbar .nm-header-left,
  body.nm-theme .topbar .nm-header-right { display:contents; }
  body.nm-theme .topbar { justify-content:flex-end; gap:7px!important; }
  body.nm-theme .topbar .nm-breadcrumb { margin-right:auto; }
  body.nm-theme .topbar .nm-header-right > .globalSearch {
    flex:1 1 200px; max-width:none;
  }
}
@media screen and (max-width:560px) {
  /* Search stays in flow on phones instead of covering View As / the avatar. */
  body.nm-theme .topbar .nm-header-right > .globalSearch,
  body.nm-theme .topbar .nm-header-right > .globalSearch:focus-within {
    position:relative!important; inset:auto!important;
    flex:1 1 180px; min-width:140px; width:auto!important;
    padding:0 6px; min-height:44px;
  }
  body.nm-theme .topbar .globalSearch > input,
  body.nm-theme .topbar .globalSearch:focus-within > input {
    position:static!important; opacity:1; width:100%; min-width:0;
    cursor:text;
  }
  body.nm-theme .topbar .nm-header-right { gap:7px!important; }
}
