/* Shared controls occupy genuine header space instead of covering existing links.
   Every standalone page has one drop-down and one appearance switch. */
body.ox-nav-ready header.site-header .site-nav{display:none!important}
body.ox-nav-integrated > header{
  display:flex!important;align-items:center!important;justify-content:space-between!important;
  gap:10px!important;flex-wrap:nowrap!important;
  position:relative!important;z-index:900!important;overflow:visible!important;
  width:100%!important;max-width:100%!important;box-sizing:border-box!important;
}
/* The shared menu supersedes separate breadcrumbs, backlinks and old nav links. */
body.ox-nav-integrated > header > nav,
body.ox-nav-integrated > header > a:not(:first-child){display:none!important}
body.ox-nav-integrated > header > :first-child:not(.ox-header-actions){
  min-width:0;max-width:calc(100% - 170px);flex:0 1 auto;
}
body.ox-nav-integrated > header .ox-header-actions,
body.ox-nav-utility > .ox-header-actions--utility{
  display:flex!important;align-items:center!important;justify-content:flex-end!important;
  gap:8px!important;flex:0 0 auto;min-width:0;margin-left:auto;
  position:relative;z-index:1000;
}
body .ox-header-actions .appearance-switch{
  position:static!important;inset:auto!important;margin:0!important;
  flex:0 0 auto!important;white-space:nowrap;
}
body .ox-header-actions .ox-standalone-nav{
  position:relative!important;inset:auto!important;margin:0!important;
  flex:0 0 auto;
}
/* ONS has a real article heading inside <header>; leave its document structure
   alone and place a normal-flow toolbar immediately before the article. */
body.ox-nav-utility > .ox-header-actions--utility{
  min-height:60px;padding:8px max(12px,env(safe-area-inset-right));
  background:#101214;border-bottom:1px solid #383d43;
  box-sizing:border-box;
}
html[data-appearance="light"] body.ox-nav-utility > .ox-header-actions--utility{
  background:#fff;border-color:#c7cdd3;
}
body .ox-standalone-nav{
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:#eaf1f4;
}
body .ox-standalone-nav .workspace-menu-toggle,
body .ox-standalone-nav .workspace-menu-toggle[aria-expanded="true"]{
  display:inline-flex;align-items:center;justify-content:center;
  gap:8px;min-width:102px;min-height:44px;padding:8px 12px;
  border:1px solid #68717c;border-radius:9px;
  background:#292e33;color:#f3f4f6;
  font:650 13px/1.2 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  cursor:pointer;white-space:nowrap;box-shadow:none;
}
body .ox-standalone-nav .workspace-menu-toggle:hover,
body .ox-standalone-nav .workspace-menu-toggle[aria-expanded="true"]{
  background:#343b42;border-color:#aebac3;
}
body .ox-standalone-nav .workspace-menu-toggle .ico{width:17px;height:17px;flex:none}
body .ox-standalone-nav .workspace-menu-toggle .ico:last-child{width:13px;height:13px}
body .ox-standalone-nav .workspace-menu-toggle[aria-expanded="true"] .ico:last-child{transform:rotate(180deg)}
body .ox-standalone-nav #workspaceMenu[hidden]{display:none!important}
body .ox-standalone-nav #workspaceMenu.ox-standalone-nav__dropdown{
  position:absolute!important;top:calc(100% + 8px)!important;right:0!important;left:auto!important;
  width:min(520px,calc(100vw - 24px))!important;
  max-height:min(78vh,calc(100dvh - 82px))!important;
  overflow:auto!important;overscroll-behavior:contain;
  padding:16px!important;
  border:1px solid #424b55!important;border-radius:14px!important;
  background:#16191d!important;color:#f1f3f5!important;
  box-shadow:0 22px 54px rgba(0,0,0,.38)!important;
  z-index:1100;box-sizing:border-box;
}
body .ox-standalone-nav .workspace-menu-heading{
  padding:0 4px 10px;margin:0 0 5px;color:#d8e0e5;
  font:700 11px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;
  letter-spacing:.13em;
}
body .ox-standalone-nav .workspace-menu-heading strong{color:inherit}
body .ox-standalone-nav .workspace-navigation{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
  align-items:stretch;gap:5px!important;margin:0;padding:0;
}
body .ox-standalone-nav .workspace-navigation .nav-caption{
  display:block!important;grid-column:1/-1;
  margin:12px 7px 3px!important;padding:0!important;
  color:#aab7c4!important;font:650 10px/1.4 ui-monospace,SFMono-Regular,Consolas,monospace!important;
  letter-spacing:.16em;text-transform:uppercase;
}
body .ox-standalone-nav .workspace-navigation .nav-link,
body .ox-standalone-nav .workspace-navigation .nav-link:visited{
  display:flex;align-items:center;gap:9px;min-width:0;
  min-height:44px;padding:9px 10px;margin:0;
  border:1px solid transparent;border-radius:7px;
  color:#d2dce4!important;text-decoration:none!important;background:transparent!important;
  font:550 12.5px/1.35 system-ui,-apple-system,"Segoe UI",sans-serif;
  box-shadow:none!important;overflow-wrap:anywhere;
  box-sizing:border-box;
}
body .ox-standalone-nav .workspace-navigation .nav-link .ico{
  flex:none;width:17px;height:17px;color:#98b4c4;
}
body .ox-standalone-nav .workspace-navigation .nav-link span{
  display:block;min-width:0;white-space:normal!important;overflow-wrap:anywhere;
}
body .ox-standalone-nav .workspace-navigation .nav-link:hover,
body .ox-standalone-nav .workspace-navigation .nav-link.active{
  background:#2b3239!important;color:#fff!important;
  border-color:#67747e!important;
}
body .ox-standalone-nav .workspace-navigation .nav-link.active{
  box-shadow:inset 3px 0 0 #a8dfe2!important;
}
body .ox-standalone-nav .ox-standalone-nav__footer{
  display:flex;flex-direction:column;gap:9px;
  border-top:1px solid #505963;padding:13px 4px 2px;margin-top:13px;
  font:12px/1.5 system-ui,-apple-system,"Segoe UI",sans-serif;
}
body .ox-standalone-nav .ox-standalone-nav__footer a{color:#c1e5e8!important;text-decoration:underline;text-underline-offset:3px}
body .ox-standalone-nav .ox-standalone-nav__footer span{color:#afbbc3}
body .ox-standalone-nav a:focus-visible,
body .ox-standalone-nav button:focus-visible{
  outline:3px solid #8cf9f5!important;outline-offset:3px;
}
html[data-appearance="light"] body .ox-standalone-nav .workspace-menu-toggle,
html[data-appearance="light"] body .ox-standalone-nav .workspace-menu-toggle[aria-expanded="true"]{
  background:#f5f6f7!important;color:#181e24!important;border-color:#717a85!important;
}
html[data-appearance="light"] body .ox-standalone-nav .workspace-menu-toggle:hover{
  background:#e6ebef!important;
}
html[data-appearance="light"] body .ox-standalone-nav #workspaceMenu.ox-standalone-nav__dropdown{
  background:#fff!important;color:#161a1e!important;
  border-color:#aebac4!important;box-shadow:0 22px 54px rgba(0,0,0,.19)!important;
}
html[data-appearance="light"] body .ox-standalone-nav .workspace-menu-heading{color:#242a32!important}
html[data-appearance="light"] body .ox-standalone-nav .workspace-navigation .nav-caption{color:#4b5864!important}
html[data-appearance="light"] body .ox-standalone-nav .workspace-navigation .nav-link,
html[data-appearance="light"] body .ox-standalone-nav .workspace-navigation .nav-link:visited{
  color:#23313d!important;
}
html[data-appearance="light"] body .ox-standalone-nav .workspace-navigation .nav-link .ico{color:#405e67!important}
html[data-appearance="light"] body .ox-standalone-nav .workspace-navigation .nav-link:hover,
html[data-appearance="light"] body .ox-standalone-nav .workspace-navigation .nav-link.active{
  background:#edf1f4!important;color:#15222b!important;border-color:#a6b4bf!important;
}
html[data-appearance="light"] body .ox-standalone-nav .ox-standalone-nav__footer{border-color:#c3cbd1}
html[data-appearance="light"] body .ox-standalone-nav .ox-standalone-nav__footer a{color:#155d6b!important}
html[data-appearance="light"] body .ox-standalone-nav .ox-standalone-nav__footer span{color:#4a5963!important}
@media(max-width:640px){
  body.ox-nav-integrated > header{padding:9px 12px!important;gap:6px!important;min-height:60px!important}
  body.ox-nav-integrated > header > :first-child:not(.ox-header-actions){
    max-width:calc(100% - 150px);overflow:hidden;
  }
  body.ox-nav-integrated > header > :not(:first-child):not(.ox-header-actions):not(.mc-row){display:none!important}
  body.ox-nav-integrated > header .identity small,
  body.ox-nav-integrated > header .lab-brand small,
  body.ox-nav-integrated > header .mc-brand-name{display:none!important}
  body.ox-nav-integrated > header .site-brand img{width:min(120px,32vw)!important;max-width:120px!important}
  body.ox-nav-integrated > header .ox-header-actions,
  body.ox-nav-utility > .ox-header-actions--utility{gap:6px!important}
  body.ox-nav-integrated > header.mc-header{flex-wrap:wrap!important}
  body.ox-nav-integrated > header.mc-header .mc-row{
    display:flex!important;flex-basis:100%;order:3;margin-top:2px;
  }
  body.ox-nav-integrated > header.mc-header .ox-header-actions{order:2}
  body .ox-standalone-nav .workspace-menu-toggle{min-width:82px!important;min-height:44px;padding:8px!important;gap:5px!important}
  /* A long two-column menu cannot grow downward past the phone viewport.
     Use a genuine visual-viewport overlay below the 60px mobile header. */
  body .ox-standalone-nav #workspaceMenu.ox-standalone-nav__dropdown{
    position:fixed!important;
    top:max(68px,env(safe-area-inset-top))!important;
    right:max(8px,env(safe-area-inset-right))!important;
    bottom:max(8px,env(safe-area-inset-bottom))!important;
    left:max(8px,env(safe-area-inset-left))!important;
    width:auto!important;height:auto!important;max-width:none!important;
    max-height:none!important;overflow:auto!important;z-index:11000!important;
    padding:12px!important;
  }
  body .ox-standalone-nav .workspace-navigation .nav-link{min-height:46px;font-size:12px;padding:9px 7px;gap:7px}
  body .ox-standalone-nav .workspace-navigation .nav-caption{font-size:9px;margin:11px 6px 2px!important}
}
@media(max-width:360px){
  body .ox-standalone-nav .workspace-navigation{gap:3px!important}
  body .ox-standalone-nav .workspace-navigation .nav-link{font-size:11.5px;padding:8px 6px}
  body .ox-standalone-nav .workspace-navigation .nav-link .ico{width:15px;height:15px}
}
@media(prefers-reduced-motion:reduce){
  body .ox-standalone-nav *,body .ox-standalone-nav *:before,body .ox-standalone-nav *:after{
    transition:none!important;animation:none!important
  }
}
