/* v6.9.400 — header utility control order and responsive grouping.
   FMO stays first, utility icons sit directly beside it, and the
   dark/light toggle is always the last control on the right. */

html[data-theme] body .header .fmo-login-v56{
  order:1!important;
}

html[data-theme] body .header .social-link-v75{
  order:2!important;
}

html[data-theme] body .header .a11y-menu-v163{
  order:3!important;
}

html[data-theme] body .header .pages-menu-btn-v56{
  order:4!important;
}

html[data-theme] body .header .sky-theme-switch[data-theme-toggle]{
  order:5!important;
}

/* Pull the utility controls together now the wide theme toggle is no longer
   sitting between FMO and the icon buttons. */
html[data-theme] body .header .header-actions-v56{
  gap:6px!important;
}

/* Small visual breathing room before the final theme control. */
html[data-theme] body .header .sky-theme-switch[data-theme-toggle]{
  margin-left:2px!important;
  margin-right:0!important;
}

/* Laptop / tablet: keep the same sequence without the controls spreading out. */
@media(max-width:1220px){
  html[data-theme] body .header .header-actions-v56{
    gap:5px!important;
    justify-content:flex-end!important;
    align-items:center!important;
  }
}

/* Tablet reflow: LinkedIn can remain visible where there is room. */
@media(min-width:641px) and (max-width:880px){
  html[data-theme] body .header .header-actions-v56{
    width:max-content!important;
    max-width:100%!important;
    min-width:0!important;
    justify-self:end!important;
  }
}

/* Phones: existing mobile rules hide the social shortcut. Keep FMO,
   accessibility, menu and theme in a compact, predictable sequence. */
@media(max-width:640px){
  html[data-theme] body .header .header-actions-v56{
    gap:4px!important;
    width:max-content!important;
    max-width:100%!important;
    min-width:0!important;
    padding-inline:3px!important;
  }

  html[data-theme] body .header .social-link-v75{
    display:none!important;
  }

  html[data-theme] body .header .fmo-login-v56{
    order:1!important;
  }

  html[data-theme] body .header .a11y-menu-v163{
    order:2!important;
  }

  html[data-theme] body .header .pages-menu-btn-v56{
    order:3!important;
  }

  html[data-theme] body .header .sky-theme-switch[data-theme-toggle]{
    order:4!important;
    margin-left:0!important;
  }
}

/* Very narrow phones: preserve all four useful controls without horizontal
   clipping. Only tighten widths; the functionality and icon designs stay. */
@media(max-width:460px){
  html[data-theme] body .header .header-actions-v56{
    gap:3px!important;
  }

  html[data-theme] body .header .a11y-menu-v163,
  html[data-theme] body .header .a11y-trigger-v163,
  html[data-theme] body .header .pages-menu-btn-v56{
    flex-basis:40px!important;
    width:40px!important;
    min-width:40px!important;
    max-width:40px!important;
    height:40px!important;
    min-height:40px!important;
    max-height:40px!important;
  }

  html[data-theme] body .header .sky-theme-switch[data-theme-toggle],
  html[data-theme] body .header .sky-theme-switch[data-theme-toggle] .sky-theme-switch__container{
    width:60px!important;
    min-width:60px!important;
    max-width:60px!important;
  }
}
