body.portal-ui .topbar .portal-sections {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
body.portal-ui .portal-sections form { margin: 0; }
body.portal-ui .portal-context-navigation {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
  min-width: 0;
}
body.portal-ui .portal-context-navigation [aria-current="page"] {
  border-color: #8da9ce;
  box-shadow: inset 0 -2px 0 #4778bb;
}
body.portal-ui .portal-context-navigation .primary[aria-current="page"] {
  border-color: #245ca8;
  box-shadow: inset 0 -2px 0 #fff;
}
/* Decorative Lucide masks inherit the existing button color. */

body.portal-ui .portal-context-navigation > a[href="/cases/"] { --portal-context-icon: url("/static/brand/nav-files.svg"); }
body.portal-ui .portal-context-navigation > a[href="/cases/new/"] { --portal-context-icon: url("/static/brand/nav-file-plus-2.svg"); }
body.portal-ui .portal-context-navigation > a[href="/tariffs/"] { --portal-context-icon: url("/static/brand/nav-receipt-text.svg"); }
body.portal-ui .portal-context-navigation > a[href="/staff/power-of-attorney/"] { --portal-context-icon: url("/static/brand/nav-shield-check.svg"); }
body.portal-ui .portal-context-navigation > a[href="/staff/"] { --portal-context-icon: url("/static/brand/nav-contact-round.svg"); }
body.portal-ui .portal-context-navigation > a[href="/accounts/"] { --portal-context-icon: url("/static/brand/nav-key-round.svg"); }
body.portal-ui .staff-register-toolbar > [data-staff-new] { --portal-context-icon: url("/static/brand/nav-user-round-plus.svg"); }
body.portal-ui .accounts-toolbar > .accounts-invite { --portal-context-icon: url("/static/brand/nav-mail-plus.svg"); }
body.portal-ui .portal-context-navigation > a[href="/cases/"]::before,
body.portal-ui .portal-context-navigation > a[href="/cases/new/"]::before,
body.portal-ui .portal-context-navigation > a[href="/tariffs/"]::before,
body.portal-ui .portal-context-navigation > a[href="/staff/power-of-attorney/"]::before,
body.portal-ui .portal-context-navigation > a[href="/staff/"]::before,
body.portal-ui .portal-context-navigation > a[href="/accounts/"]::before,
body.portal-ui .staff-register-toolbar > [data-staff-new]::before,
body.portal-ui .accounts-toolbar > .accounts-invite::before {
  display: block;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: var(--portal-context-icon) center / contain no-repeat;
  mask: var(--portal-context-icon) center / contain no-repeat;
  content: "";
}
@media (forced-colors: active) {
  body.portal-ui .portal-context-navigation > a[href="/cases/"]::before,
  body.portal-ui .portal-context-navigation > a[href="/cases/new/"]::before,
  body.portal-ui .portal-context-navigation > a[href="/tariffs/"]::before,
  body.portal-ui .portal-context-navigation > a[href="/staff/power-of-attorney/"]::before,
  body.portal-ui .portal-context-navigation > a[href="/staff/"]::before,
  body.portal-ui .portal-context-navigation > a[href="/accounts/"]::before,
  body.portal-ui .staff-register-toolbar > [data-staff-new]::before,
  body.portal-ui .accounts-toolbar > .accounts-invite::before { background: ButtonText; }
}
@media (max-width: 650px) {
  body.portal-ui .topbar .portal-sections { justify-content: flex-start; width: 100%; }
  body.portal-ui .portal-sections .portal-button { flex-grow: 1; }
  body.portal-ui .portal-sections form { display: flex; flex-grow: 1; }
  body.portal-ui .portal-context-navigation { margin-bottom: 18px; }
}
