.portal-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  min-height: 72px;
  padding: 12px 26px;
  border-bottom: 1px solid rgba(11, 42, 102, 0.14);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  color: var(--pmo-ink, var(--ink-900, #1a2433));
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* Blueprint-level sticky headings should pass behind the shared site header. */
body.pmo-blueprint > .page-header {
  z-index: 20;
}

body.pmo-blueprint .portal-header {
  width: 100vw;
  margin-inline: calc(50% - 50vw);
}

.portal-brand-group {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  gap: 10px;
  min-width: 0;
}

.portal-logo-link,
.portal-title-link {
  color: var(--pmo-navy, var(--brand-blue-deep, #0b2a66));
  text-decoration: none;
}

.portal-logo-link {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
}

.portal-logo-link img {
  display: block;
  width: auto;
  height: 34px;
}

.portal-title-link {
  overflow: hidden;
  font-size: 1.1rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-logo-link:hover,
.portal-logo-link:focus-visible,
.portal-title-link:hover,
.portal-title-link:focus-visible {
  color: var(--pmo-blue, var(--brand-blue, #0057b8));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 auto;
  gap: 16px;
  min-width: 0;
  margin-left: auto;
}

.portal-header .actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
}

.portal-header .account-actions {
  padding-left: 16px;
  border-left: 1px solid var(--pmo-line, var(--line, rgba(26, 36, 51, 0.14)));
}

.portal-header .logout-form {
  display: inline-flex;
  gap: 0;
  margin: 0;
}

.portal-header .pill,
.portal-header .btn-link,
.portal-header button {
  min-height: 36px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--pmo-line, var(--line, rgba(26, 36, 51, 0.14)));
  border-radius: 10px;
  background: var(--pmo-surface, var(--surface, #fff));
  color: var(--pmo-ink, var(--ink-900, #1a2433));
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.portal-header .pill,
.portal-header .btn-link {
  display: inline-flex;
  align-items: center;
}

.portal-header .btn-link:hover,
.portal-header button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(11, 42, 102, 0.1);
}

.portal-header .btn-link.primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(160deg, #0074e0 0%, var(--pmo-blue, var(--brand-blue, #0057b8)) 75%);
}

@media (max-width: 1180px) {
  .portal-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .portal-brand-group,
  .topbar {
    width: 100%;
  }

  .topbar {
    justify-content: space-between;
    margin-left: 0;
  }
}

@media (max-width: 860px) {
  .portal-header {
    padding: 10px 14px;
  }

  .portal-logo-link img {
    height: 30px;
  }

  .portal-title-link {
    font-size: 0.96rem;
  }

  .topbar,
  .portal-header .actions {
    flex-wrap: wrap;
  }

  .topbar {
    justify-content: flex-start;
    gap: 8px;
  }

  .portal-header .account-actions {
    padding-left: 0;
    border-left: 0;
  }
}

@media (max-width: 620px) {
  .portal-title-link {
    display: none;
  }
}
