/* =========================================================
   PM516 section header/tab colors (NO JS, robust to relative hrefs)
   Uses active tab position in the tabs list.
   ========================================================= */

/* Make header + tabs text white everywhere */
.md-header, .md-header *,
.md-tabs, .md-tabs * {
  color: #fff !important;
}

/* HOME = first top-level tab */
header.md-header:has(.md-tabs__list > .md-tabs__item:nth-child(1).md-tabs__item--active),
header.md-header:has(.md-tabs__list > .md-tabs__item:nth-child(1).md-tabs__item--active) .md-header__inner,
header.md-header:has(.md-tabs__list > .md-tabs__item:nth-child(1).md-tabs__item--active) .md-tabs {
  background-color: #1f2a44 !important;
}

/* PM516A = second top-level tab */
header.md-header:has(.md-tabs__list > .md-tabs__item:nth-child(2).md-tabs__item.md-tabs__item--active),
header.md-header:has(.md-tabs__list > .md-tabs__item:nth-child(2).md-tabs__item.md-tabs__item--active) .md-header__inner,
header.md-header:has(.md-tabs__list > .md-tabs__item:nth-child(2).md-tabs__item.md-tabs__item--active) .md-tabs {
  background-color: #1f3c88 !important;
}

/* PM516B = third top-level tab */
header.md-header:has(.md-tabs__list > .md-tabs__item:nth-child(3).md-tabs__item.md-tabs__item--active),
header.md-header:has(.md-tabs__list > .md-tabs__item:nth-child(3).md-tabs__item.md-tabs__item--active) .md-header__inner,
header.md-header:has(.md-tabs__list > .md-tabs__item:nth-child(3).md-tabs__item.md-tabs__item--active) .md-tabs {
  background-color: #4b2e83 !important;
}

/* Optional: active link tints */
header.md-header:has(.md-tabs__list > .md-tabs__item:nth-child(1).md-tabs__item--active) .md-tabs__link--active { color: #c5cae9 !important; }
header.md-header:has(.md-tabs__list > .md-tabs__item:nth-child(2).md-tabs__item--active) .md-tabs__link--active { color: #cbd7f7 !important; }
header.md-header:has(.md-tabs__list > .md-tabs__item:nth-child(3).md-tabs__item--active) .md-tabs__link--active { color: #d7cfe8 !important; }