.portal-shell {
  --mp-ink: #203346;
  --mp-dark: #182631;
  --mp-gold: #ceac72;
  --mp-border: #cbd5dc;
  background: #f1f4f6;
}
.portal-shell .prestige-topbar {
  position: sticky;
  top: 0;
  z-index: 35;
  background: #fff !important;
  border-bottom: 1px solid #cbd5dc !important;
}
.portal-shell .command-subnav {
  background: var(--mp-dark) !important;
  border-right: 1px solid #3a4a55 !important;
}
.portal-shell .portal-nav-heading {
  padding: 0 8px 20px;
  border-color: #485763;
}
.portal-shell .command-subnav .portal-nav-heading .mp-sidebar-brand {
  display: flex;
  flex-direction: row !important;
  align-items: center !important;
  text-align: left;
  gap: 9px;
}
.portal-nav-heading .mp-sidebar-brand img {
  width: 55px;
  height: 55px;
  object-fit: contain;
  flex: 0 0 55px;
}
.portal-nav-heading .mp-sidebar-brand strong {
  margin-top: 0;
  font-size: 15px;
  line-height: 1.2;
}
.portal-nav-heading .mp-sidebar-brand small {
  display: block;
  margin-top: 5px;
  color: #e6c68b;
  font-size: 12px;
}
.portal-shell .command-subnav .tab-nav-button[aria-current="page"] {
  background: #304555 !important;
  border: 1px solid #697d8c !important;
  border-left: 3px solid var(--mp-gold) !important;
  color: #fff !important;
  box-shadow: none !important;
}
.portal-shell .tab-nav-button:focus-visible, .mp-menu-toggle:focus-visible,
.mp-overview button:focus-visible {
  outline: 2px solid #997434;
  outline-offset: 2px;
}
.portal-shell .mp-top-identity {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.portal-shell .mp-top-identity img { height: 42px; width: 42px; object-fit: contain; }
.portal-shell .mp-top-title { color: var(--mp-ink); font-size: 15px; font-weight: 700; line-height: 1.2; }
.portal-shell .mp-top-subtitle { display: block; font-size: 13px; color: #5d6d79; }
.portal-shell .mp-menu-toggle {
  display: none;
  place-items: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  color: #203346;
  background: #f0f4f6;
  border: 1px solid var(--mp-border);
}
:is(#view-client,#view-lawyer) .portal-page-heading {
  color: #f9fbfc;
  background: linear-gradient(110deg, #243949, #172631) !important;
  border: 1px solid #506777 !important;
  border-left: 3px solid var(--mp-gold) !important;
}
:is(#view-client,#view-lawyer) .portal-page-heading :is(h1,p) { color: #f9fbfc !important; }
:is(#view-client,#view-lawyer) .portal-page-heading .portal-kicker { color: #f0cb89; }
.portal-shell .portal-page-heading .portal-heading-mark { display: none; }
.mp-overview-metrics, .mp-overview-panels { display: grid; gap: 16px; }
.mp-overview-metrics { grid-template-columns: repeat(4, minmax(0,1fr)); }
.mp-overview-panels { grid-template-columns: minmax(0,1fr) minmax(0,1fr); margin-top: 18px; }
.mp-overview-metric, .mp-overview-panel {
  min-width: 0;
  border: 1px solid var(--mp-border);
  background: #fff;
  color: var(--mp-ink);
}
.mp-overview-metric {
  padding: 16px 17px;
  border-top: 2px solid #ac8b54;
  text-align: left;
  cursor: pointer;
}
.mp-overview-metric:hover, .mp-overview-row:hover { background: #edf3f6; }
.mp-overview-metric span { display: block; font-size: 14px; line-height: 1.4; }
.mp-overview-metric strong { font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mp-overview-panel header {
  min-height: 57px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--mp-border);
  background: #f8fafb;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 5px 15px;
}
.mp-overview-panel h2 { margin: 0; font-size: 16px; font-weight: 700; color: var(--mp-ink); }
.mp-overview-link {
  min-height: 30px;
  color: #27556f;
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.mp-overview-row {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 11px 16px;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.mp-overview-row + .mp-overview-row { border-top: 1px solid #e1e8ed; }
.mp-overview-row strong { display: block; font-size: 13px; color: #203346; }
.mp-overview-row span, .mp-overview-empty, .mp-overview-state { font-size: 14px; color: #4e6474; }
.mp-overview-empty { margin: 0; padding: 15px 16px; }
.mp-overview-state { margin: 12px 0 0; }
.mp-overview [hidden] { display: none !important; }
@media (max-width: 1060px) {
  .mp-overview-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .portal-shell .mp-menu-toggle { display: inline-grid; }
  .portal-shell .command-subnav:not(.mp-mobile-open) { display: none !important; }
  .portal-shell .command-subnav.mp-mobile-open { position: sticky; top: 70px; z-index: 34; }
  .portal-shell .command-subnav.mp-mobile-open .sidebar-navigation {
    display: grid !important;
    grid-template-columns: repeat(2,minmax(0,1fr));
    width: 100%;
  }
  .portal-shell .command-subnav.mp-mobile-open .sidebar-navigation .tab-nav-button {
    justify-content: flex-start;
    white-space: normal;
    min-width: 0;
  }
  .portal-shell .mp-top-subtitle { display: none; }
  .portal-shell .mp-top-identity img { width: 34px; height: 34px; }
  .portal-shell .mp-top-title { font-size: 14px; }
  #view-client .prestige-topbar .user-profile-capsule > :last-child { display: none; }
  .mp-overview-panels { grid-template-columns: minmax(0,1fr); }
  .mp-overview-metrics, .mp-overview-panels { gap: 10px; }
  .mp-overview-metric { padding: 12px; }
}
@media (max-width: 420px) {
  .portal-shell .prestige-topbar { padding-inline: 8px !important; }
  .portal-shell .prestige-topbar > div { gap: 5px; }
  .portal-shell .prestige-topbar > div > .mp-top-identity { gap: 5px !important; }
  .portal-shell .prestige-topbar > div > :last-child { gap: 5px !important; flex-shrink: 0; }
  #view-lawyer .prestige-topbar .lawyer-profile-copy { display: none !important; }
  #view-lawyer .prestige-topbar button.user-profile-capsule { padding-inline: 5px !important; }
  .portal-shell .mp-top-title { font-size: 13px; }
}
@media (max-width: 350px) {
  .portal-shell .mp-top-identity img { width: 28px; height: 28px; }
  .portal-shell .mp-menu-toggle { width: 34px; }
  .portal-shell .mp-top-title { max-width: 52px; }
}

/* Both strokes share one layer, so the legacy hover sweep cannot replace either. */
html body :is(.modal-backdrop,#office-security-dialog)
  :is(.modal-prestige-header,.office-security-heading) button.modal-prestige-close-btn::before {
  width: 10px !important;
  height: 10px !important;
  transform: translate(-50%,-50%) !important;
  background:
    linear-gradient(45deg,transparent calc(50% - .75px),currentColor calc(50% - .75px),currentColor calc(50% + .75px),transparent calc(50% + .75px)),
    linear-gradient(-45deg,transparent calc(50% - .75px),currentColor calc(50% - .75px),currentColor calc(50% + .75px),transparent calc(50% + .75px)) !important;
}
html body :is(.modal-backdrop,#office-security-dialog)
  :is(.modal-prestige-header,.office-security-heading) button.modal-prestige-close-btn::after,
html body :is(.modal-backdrop,#office-security-dialog)
  :is(.modal-prestige-header,.office-security-heading) button.modal-prestige-close-btn:not(:disabled):hover::after {
  content: none !important;
  display: none !important;
}
