/**
 * Shared portal chrome — teal + orange (design/mockup-design.html).
 * Requires /assets/css/pbx-brand.css first (or :root fallbacks below).
 */
.portal-shell-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  padding-left: max(1rem, env(safe-area-inset-left, 0));
  padding-right: max(1rem, env(safe-area-inset-right, 0));
  padding-top: max(0.5rem, env(safe-area-inset-top, 0));
  border-bottom: 3px solid var(--pbx-header-accent, #ff5b00);
  background: linear-gradient(
    180deg,
    var(--pbx-teal, #0e5775) 0%,
    var(--pbx-teal-deep, #0a4a61) 100%
  );
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(12px);
  color: #fff;
}

@media (min-width: 640px) {
  .portal-shell-header {
    padding: 0 1.5rem;
    gap: 1rem;
  }
}

@media (min-width: 1024px) {
  .portal-shell-header {
    padding: 0 2.5rem;
  }
}

.portal-shell-header__left {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

@media (min-width: 640px) {
  .portal-shell-header__left {
    gap: 1rem;
  }
}

.portal-shell-header__brand {
  display: flex;
  min-width: 0;
  flex-shrink: 0;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem;
  margin: -0.25rem;
  border-radius: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s ease;
}

.portal-shell-header__brand:hover {
  background: rgba(255, 255, 255, 0.1);
}

.portal-shell-header__logo {
  display: flex;
  height: 2.75rem;
  width: 2.75rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--pbx-orange, #ff5b00);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 91, 0, 0.35), 0 4px 14px rgba(0, 0, 0, 0.2);
  font-size: 1.05rem;
}

.portal-shell-header__brand-text {
  display: none;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.95rem;
  color: #fff;
}

@media (min-width: 640px) {
  .portal-shell-header__brand-text {
    display: inline;
    font-size: 1rem;
  }
}

.portal-shell-header__title {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.96);
}

@media (min-width: 640px) {
  .portal-shell-header__title {
    font-size: 1rem;
  }
}

.portal-shell-header__back {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.5rem 0.85rem;
  border-radius: 0.75rem;
  background: rgba(255, 91, 0, 0.22);
  border: 1px solid rgba(255, 180, 140, 0.45);
  color: #fff !important;
  text-decoration: none !important;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s ease;
}

.portal-shell-header__back:hover {
  background: rgba(255, 91, 0, 0.38);
  color: #fff !important;
}

.portal-shell-header__back span {
  display: none;
}

@media (min-width: 640px) {
  .portal-shell-header__back {
    padding: 0.5rem 1rem;
  }
  .portal-shell-header__back span {
    display: inline;
  }
}

.portal-page-main {
  padding-top: 72px;
  min-height: 100vh;
  box-sizing: border-box;
}

.portal-shell-header .profile-dropdown {
  z-index: 10050;
}

/* Optional right cluster: back + user menu (profile) */
.portal-shell-header__right {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .portal-shell-header__right {
    gap: 0.75rem;
  }
}

/* Call Flow: tool buttons */
.portal-shell-header__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  width: 100%;
}

@media (min-width: 640px) {
  .portal-shell-header__toolbar {
    width: auto;
    max-width: 58%;
  }
}

@media (min-width: 1280px) {
  .portal-shell-header__toolbar {
    max-width: none;
  }
}

.portal-shell-header__title--lg {
  font-size: 0.95rem;
}

@media (min-width: 640px) {
  .portal-shell-header__title--lg {
    font-size: 1.05rem;
  }
}

@media (min-width: 1024px) {
  .portal-shell-header__title--lg {
    font-size: 1.25rem;
  }
}

/* Call Flow headline: allow wrap on narrow screens */
.portal-shell-header__title--headline {
  white-space: normal;
  overflow: visible;
  font-weight: 700;
  line-height: 1.25;
  max-width: 10rem;
}

@media (min-width: 480px) {
  .portal-shell-header__title--headline {
    max-width: none;
  }
}
