/* Batch one: shared header fit only. Existing artwork, copy and scripts remain unchanged. */
body { min-width: 0; }

/* Preserve long article headlines without extending a very narrow viewport. */
@media (max-width: 350px) {
  .library-article h1 { font-size: 2.5rem; overflow-wrap: anywhere; }
  .site-header .mobile-menu > div { max-width: calc(100vw - 40px); }
}

/* Long compound terms must not widen an advisor knowledge card on a narrow phone. */
@media (max-width: 620px) {
  .profile-section .knowledge-grid > article {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}

@media (min-width: 1251px) {
  .site-header { column-gap: 28px; }
}

/* Continue the existing compact desktop treatment through its measured fit boundary. */
@media (min-width: 981px) and (max-width: 1270px) {
  .site-header nav { gap: 16px; }
  .site-header nav > a,
  .site-header .nav-group > a,
  .site-header .portal-link { font-size: .8rem; }
  .site-header .wordmark-brand img { width: 190px; }
  .site-header .mark-brand img { width: 46px; height: auto; }
}

/* Reuse the native phone menu when the desktop links cannot fit, without changing its contents. */
@media (min-width: 981px) and (max-width: 1150px) {
  .site-header > nav { display: none; }
  .site-header .mobile-menu { display: block; }
  .site-header .header-actions { margin-left: 0; }
  .site-header .mark-brand { display: none; }
  .site-header .wordmark-brand img { width: 220px; }
}
