/* Portal shell header — matches portal-poc wireframes (scoped under .sc-hub-portal-shell) */

.sc-hub-portal-shell {
  --portal-purple-900: #2D1350;
  --portal-purple-700: #4E2584;
  --portal-purple-600: #5F2F9E;
  --portal-purple-500: #7040B0;
  --portal-orange: #F26522;
  --portal-bg: #F0EFF4;
  --portal-surface: #ffffff;
  --portal-text: #1A1A2E;
  --portal-muted: #646970;
  --portal-border: #E8E6EF;
  --portal-radius: 12px;
  /* Content width for non-header blocks (hero helpers, banners). Header uses full bleed. */
  --portal-max: 1120px;
  --portal-header-pad-x: clamp(20px, 4vw, 48px);
  /* Co-brand logo strip */
  --portal-brand-mark-height: 64px;
  --portal-brand-partner-size: 80px;
  --portal-brand-sc-max-width: 260px;
}

.sc-hub-partner-mode-header,
.sc-hub-portal-sticky-host {
  position: sticky !important;
  top: 0;
  z-index: 9990;
}

/* Let full-screen Breakdance recommendation popups own the viewport. */
body.sc-recommendation-popup-open .sc-hub-partner-mode-header,
body.sc-recommendation-popup-open .sc-hub-portal-sticky-host {
  visibility: hidden !important;
  pointer-events: none !important;
}

body.admin-bar .sc-hub-partner-mode-header,
body.admin-bar .sc-hub-portal-sticky-host {
  top: 32px;
}

@media (max-width: 782px) {
  body.admin-bar .sc-hub-partner-mode-header,
  body.admin-bar .sc-hub-portal-sticky-host {
    top: 46px;
  }
}

.sc-hub-portal-shell a {
  color: var(--portal-purple-600);
}

.sc-hub-portal-shell .portal-header {
  background: var(--portal-surface);
  border-bottom: 1px solid var(--portal-border);
  box-shadow: 0 2px 12px rgba(45, 19, 80, 0.06);
}

.sc-hub-portal-shell .portal-header__inner {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 18px var(--portal-header-pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: nowrap;
}

.sc-hub-portal-shell .portal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.sc-hub-portal-shell a.portal-brand,
.sc-hub-portal-shell a.portal-brand:hover,
.sc-hub-portal-shell a.portal-brand:focus {
  color: inherit !important;
  text-decoration: none !important;
  cursor: pointer;
}

.sc-hub-portal-shell a.portal-brand:hover .portal-brand__marks {
  border-color: var(--portal-purple-600);
}

.sc-hub-portal-shell a.portal-brand:focus-visible {
  outline: 3px solid #c8451f;
  outline-offset: 4px;
  border-radius: 12px;
}

/* Logo cluster — makes co-branding read as one unit beside the page title */
.sc-hub-portal-shell .portal-brand__marks {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 8px 10px;
  background: var(--portal-bg);
  border: 1px solid var(--portal-border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(45, 19, 80, 0.04);
}

.sc-hub-portal-shell .portal-brand__marks-divider {
  width: 1px;
  align-self: stretch;
  min-height: 40px;
  margin: 0 10px;
  background: var(--portal-border);
  flex-shrink: 0;
}

/* SmartConnect — height fixed; width tightened by portal-header.js to artwork */
.sc-hub-portal-shell .portal-brand__sc-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: var(--portal-brand-mark-height);
  max-width: var(--portal-brand-sc-max-width);
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--portal-purple-900);
  color: #fff;
}

.sc-hub-portal-shell .portal-brand__sc-logo--image {
  width: auto;
  max-width: var(--portal-brand-sc-max-width);
  min-width: 92px;
  padding: 5px 8px;
  box-sizing: border-box;
}

.sc-hub-portal-shell .portal-brand__mark-bg--dark {
  background-color: var(--portal-purple-900) !important;
  border: none !important;
}

.sc-hub-portal-shell .portal-brand__mark-bg--light {
  background-color: #fff !important;
  border: 1px solid var(--portal-border) !important;
}

.sc-hub-portal-shell .portal-brand__sc-logo img {
  display: block;
  width: auto;
  height: calc(var(--portal-brand-mark-height) - 10px);
  max-width: calc(var(--portal-brand-sc-max-width) - 16px);
  object-fit: contain;
  object-position: center;
}

.sc-hub-portal-shell .portal-brand__partner-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* Co-brand row: match SC frame height to partner tile */
.sc-hub-portal-shell .portal-brand:not(.portal-brand--sc-only) {
  --portal-brand-mark-height: var(--portal-brand-partner-size);
}

.sc-hub-portal-shell .portal-brand:not(.portal-brand--sc-only) .portal-brand__sc-logo img {
  height: calc(var(--portal-brand-partner-size) - 10px);
}

.sc-hub-portal-shell .portal-brand__sc-fallback {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.06em;
}

/* Partner/broker — taller square, minimal padding */
.sc-hub-portal-shell .portal-brand__partner-logo {
  width: var(--portal-brand-partner-size);
  height: var(--portal-brand-partner-size);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  background-color: #fff;
  border: 1px solid var(--portal-border);
  padding: 5px;
  box-sizing: border-box;
}

.sc-hub-portal-shell .portal-brand--sc-only {
  --portal-brand-sc-max-width: 280px;
}

.sc-hub-portal-shell .portal-brand__text {
  min-width: 0;
}

.sc-hub-portal-shell .portal-brand__text h1 {
  /* Size/weight/color from portal-typography.css */
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-hub-portal-shell .portal-brand__text p {
  margin: 4px 0 0;
  font-size: clamp(13px, 1.2vw, 15px);
  color: var(--portal-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-hub-portal-shell .portal-header__aside {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
  flex-shrink: 0;
  max-width: min(100%, 520px);
}

.sc-hub-portal-shell .portal-header__am-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-wrap: nowrap;
  gap: 4px 8px;
  font-size: 15px;
  text-align: right;
  white-space: normal;
}

.sc-hub-portal-shell .portal-header__am-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--portal-muted);
  width: 100%;
}

.sc-hub-portal-shell .portal-header__am-contact strong {
  color: var(--portal-purple-800, #3D1B6A);
  font-weight: 700;
}

.sc-hub-portal-shell .portal-header__am-contact a {
  font-weight: 600;
  white-space: nowrap;
}

/* B2C (logged-out partner) CTA */
.sc-hub-portal-shell .portal-header__b2c-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  text-align: right;
  min-width: 0;
}

.sc-hub-portal-shell .portal-header__b2c-cta-text {
  margin: 0;
  font-size: clamp(14px, 1.3vw, 16px);
  font-weight: 600;
  color: var(--portal-purple-800, #3D1B6A) !important;
  line-height: 1.35;
  max-width: 32ch;
}

.sc-hub-portal-shell .portal-header__b2c-cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.sc-hub-portal-shell .portal-header__b2c-cta-actions .portal-btn--ghost {
  font-size: 15px;
  font-weight: 700;
  color: var(--portal-purple-600) !important;
}

.sc-hub-portal-shell .portal-header__b2c-cta-actions .portal-btn--primary {
  color: #fff !important;
}

@media (max-width: 900px) {
  .sc-hub-portal-shell {
    --portal-brand-partner-size: 68px;
    --portal-brand-mark-height: 56px;
    --portal-brand-sc-max-width: 220px;
    --portal-header-pad-x: 20px;
  }

  .sc-hub-portal-shell .portal-header__inner {
    flex-wrap: wrap;
    row-gap: 12px;
  }

  .sc-hub-portal-shell .portal-header__aside {
    width: 100%;
    max-width: none;
    justify-content: space-between;
  }

  .sc-hub-portal-shell .portal-header__am-contact {
    align-items: flex-start;
    text-align: left;
  }

  .sc-hub-portal-shell .portal-header__b2c-cta {
    width: 100%;
    align-items: stretch;
    text-align: left;
  }

  .sc-hub-portal-shell .portal-header__b2c-cta-text {
    max-width: none;
  }

  .sc-hub-portal-shell .portal-header__b2c-cta-actions {
    justify-content: flex-start;
  }

  .sc-hub-portal-shell .portal-header__b2c-cta-actions .portal-btn {
    flex: 1 1 auto;
    min-width: min(100%, 140px);
  }
}

@media (max-width: 520px) {
  .sc-hub-portal-shell .portal-brand {
    flex-wrap: wrap;
  }

  .sc-hub-portal-shell .portal-brand__text h1,
  .sc-hub-portal-shell .portal-brand__text p {
    white-space: normal;
  }

  .sc-hub-portal-shell .portal-header__aside {
    flex-direction: column;
    align-items: stretch;
  }

  .sc-hub-portal-shell .portal-header__b2c-cta-actions {
    flex-direction: column;
  }

  .sc-hub-portal-shell .portal-header__b2c-cta-actions .portal-btn {
    width: 100%;
  }
}

.sc-hub-portal-shell .portal-header__aside .portal-btn {
  padding: 10px 18px;
  font-size: 14px;
  flex-shrink: 0;
}

.sc-hub-portal-shell .portal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.sc-hub-portal-shell .portal-btn--ghost {
  background: transparent;
  color: var(--portal-purple-600);
  border: 1px solid var(--portal-border);
}

.sc-hub-portal-shell .portal-btn--ghost:hover {
  background: rgba(112, 64, 176, 0.06);
}

.sc-hub-portal-shell .portal-btn--primary {
  background: var(--portal-orange);
  color: #fff;
  border: 1px solid transparent;
}

.sc-hub-portal-shell .portal-btn--primary:hover {
  background: #e0551a;
  color: #fff;
}

.sc-hub-portal-shell .portal-site-banner {
  background: var(--portal-orange);
  color: #fff;
  font-size: 14px;
}

.sc-hub-portal-shell .portal-site-banner__inner {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 12px var(--portal-header-pad-x);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sc-hub-portal-shell .portal-site-banner p {
  margin: 0;
  flex: 1;
  min-width: 200px;
}

.sc-hub-portal-shell .portal-site-banner .portal-btn {
  background: #fff;
  color: var(--portal-purple-900);
  padding: 8px 16px;
  font-size: 13px;
  white-space: nowrap;
}

.sc-hub-portal-shell .portal-partner-hero {
  max-width: var(--portal-max);
  margin: 0 auto;
  padding: 24px 20px 0;
}

.sc-hub-portal-shell .portal-partner-hero h2 {
  /* Size/weight/color from portal-typography.css */
  margin: 0 0 8px;
}

.sc-hub-portal-shell .portal-my-portal-hero__meta,
.sc-hub-portal-shell .portal-broker-hero__meta {
  margin: 0;
  max-width: 52ch;
  font-size: 15px;
  color: var(--portal-muted);
  line-height: 1.5;
}

.sc-hub-portal-shell .portal-broker-hero__meta {
  font-size: 14px;
}

/* ── SC Admin portal header variant ── */

.sc-hub-portal-shell--sc-portal .portal-header {
  background: var(--portal-purple-900);
  border-bottom: none;
}

.sc-hub-portal-shell--sc-portal .portal-brand__text h1,
.sc-hub-portal-shell--sc-portal .portal-brand__text p {
  color: #fff !important;
}

.sc-hub-portal-shell--sc-portal .portal-brand__sc-fallback {
  color: #fff !important;
  border-color: rgba(255,255,255,0.3);
}

.sc-hub-portal-shell--sc-portal .portal-header__aside {
  align-items: center;
  gap: 12px;
}

.sc-hub-portal-shell--sc-portal .portal-header__sc-admin-greeting {
  font-size: 14px;
  color: rgba(255,255,255,0.75) !important;
  font-weight: 500;
}

.sc-hub-portal-shell--sc-portal .portal-btn--ghost {
  border-color: rgba(255,255,255,0.35);
  color: #fff !important;
}

.sc-hub-portal-shell--sc-portal .portal-btn--ghost:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.6);
  color: #fff !important;
}
