/* Shared desktop header geometry and typography.
   Reference: approved Deal Analysis V5 header. Navigation targets, page-specific
   controls, calculator code, and phone layouts are intentionally unchanged. */
@media (min-width: 1200px) {
  :is(
    body.ds-home > header.home-nav,
    body.da-standalone > header.da-site-header,
    body.mc-standalone > header.mc-site-header,
    body.ds-tool-standalone > header.mc-site-header,
    body.pricing-public-page .public-pricing-header,
    body.ds-account-v6 > header.ds-account-sitebar,
    body.analyzer-property > .wrap > header.site-header,
    body.funnel-v5 > header.site-header,
    body.privacy-policy-page > header.privacy-site-header
  ) {
    box-sizing: border-box !important;
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 24px !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 84px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 20px max(24px, calc((100% - 1240px)/2)) !important;
    border: 0 !important;
    border-bottom: 1px solid #d8e0e5 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
  }

  /* Center-contained pages must never pull their mastheads out to 100vw.
     Restore the original Deal Analysis / Pricing content width. */
  body.pricing-public-page .public-pricing-header {
    width: 100% !important;
    max-width: 100% !important;
    margin-inline: 0 !important;
    padding: 18px 0 22px !important;
  }
  body.analyzer-property > .wrap > header.site-header {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 18px 22px !important;
  }

  :is(
    body.ds-home > header.home-nav .home-logo,
    body.da-standalone > header.da-site-header .home-logo,
    body.mc-standalone > header.mc-site-header .home-logo,
    body.ds-tool-standalone > header.mc-site-header .home-logo,
    body.pricing-public-page .public-pricing-brand,
    body.ds-account-v6 > header.ds-account-sitebar .ds-account-brand,
    body.analyzer-property > .wrap > header.site-header .site-header-brand,
    body.funnel-v5 > header.site-header .site-header-brand,
    body.privacy-policy-page > header.privacy-site-header .privacy-brand
  ) {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 0 !important;
    font: 700 22px/1.2 'Space Grotesk', Inter, Arial, sans-serif !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    text-decoration: none !important;
    white-space: nowrap !important;
  }

  :is(
    body.ds-home > header.home-nav .home-logo img,
    body.da-standalone > header.da-site-header .home-logo img,
    body.mc-standalone > header.mc-site-header .home-logo img,
    body.ds-tool-standalone > header.mc-site-header .home-logo img,
    body.pricing-public-page .public-pricing-brand img,
    body.ds-account-v6 > header.ds-account-sitebar .ds-account-brand img,
    body.analyzer-property > .wrap > header.site-header .site-header-brand img,
    body.funnel-v5 > header.site-header .site-header-brand img,
    body.privacy-policy-page > header.privacy-site-header .privacy-brand img
  ) {
    display: block !important;
    width: 43px !important;
    height: 43px !important;
    flex: 0 0 43px !important;
    object-fit: contain !important;
  }

  /* Reset inherited legacy font rules on the brand's inner span. */
  :is(
    body.da-standalone > header.da-site-header .site-header-name,
    body.mc-standalone > header.mc-site-header .site-header-name,
    body.ds-tool-standalone > header.mc-site-header .site-header-name,
    body.pricing-public-page .public-pricing-brand span,
    body.analyzer-property > .wrap > header.site-header .site-header-name,
    body.funnel-v5 > header.site-header .site-header-name,
    body.privacy-policy-page > header.privacy-site-header .privacy-brand span
  ) {
    font: inherit !important;
    letter-spacing: inherit !important;
    color: inherit !important;
    text-transform: none !important;
  }

  :is(
    body.ds-home > header.home-nav > nav,
    body.da-standalone > header.da-site-header > nav,
    body.mc-standalone > header.mc-site-header > nav,
    body.ds-tool-standalone > header.mc-site-header > nav,
    body.pricing-public-page .public-pricing-nav,
    body.ds-account-v6 > header.ds-account-sitebar > nav,
    body.analyzer-property > .wrap > header.site-header > nav,
    body.funnel-v5 > header.site-header > nav
  ) {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: clamp(12px, 1.7vw, 25px) !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 0 0 auto !important;
    padding: 0 !important;
    font: 700 14px/1.4 Inter, Arial, sans-serif !important;
    letter-spacing: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }

  :is(
    body.ds-home > header.home-nav > nav > a,
    body.da-standalone > header.da-site-header > nav > a,
    body.mc-standalone > header.mc-site-header > nav > a,
    body.ds-tool-standalone > header.mc-site-header > nav > a,
    body.pricing-public-page .public-pricing-nav > a,
    body.ds-account-v6 > header.ds-account-sitebar > nav > a,
    body.analyzer-property > .wrap > header.site-header > nav > a,
    body.funnel-v5 > header.site-header > nav > a
  ) {
    font: inherit !important;
    letter-spacing: inherit !important;
    white-space: nowrap !important;
    line-height: 1.4 !important;
  }

  :is(
    body.ds-home > header.home-nav .ds-prof-nav-menu > summary,
    body.da-standalone > header.da-site-header .ds-prof-nav-menu > summary,
    body.mc-standalone > header.mc-site-header .ds-prof-nav-menu > summary,
    body.ds-tool-standalone > header.mc-site-header .ds-prof-nav-menu > summary,
    body.pricing-public-page .ds-prof-nav-menu > summary,
    body.ds-account-v6 > header.ds-account-sitebar .ds-prof-nav-menu > summary
  ) {
    font: 700 14px/1.4 Inter, Arial, sans-serif !important;
    white-space: nowrap !important;
  }

  /* The remaining controls stay in the header's same vertical centerline. */
  :is(
    body.ds-home > header.home-nav > .home-language-toggle,
    body.ds-home > header.home-nav > .home-theme-toggle,
    body.da-standalone > header.da-site-header > .home-language-toggle,
    body.da-standalone > header.da-site-header > .home-theme-toggle,
    body.mc-standalone > header.mc-site-header > .home-language-toggle,
    body.mc-standalone > header.mc-site-header > .home-theme-toggle,
    body.ds-tool-standalone > header.mc-site-header > .home-language-toggle,
    body.ds-tool-standalone > header.mc-site-header > .home-theme-toggle,
    body.pricing-public-page .public-pricing-nav > .ds-pref-lang,
    body.pricing-public-page .public-pricing-nav > .ds-pref-theme,
    body.ds-account-v6 .ds-appearance-switches
  ) { align-self: center !important; }

  body.privacy-policy-page > header.privacy-site-header {
    background: #fff !important;
  }
  html[data-theme="dark"] :is(
    body.ds-home > header.home-nav,
    body.da-standalone > header.da-site-header,
    body.mc-standalone > header.mc-site-header,
    body.ds-tool-standalone > header.mc-site-header,
    body.pricing-public-page .public-pricing-header,
    body.ds-account-v6 > header.ds-account-sitebar,
    body.analyzer-property > .wrap > header.site-header,
    body.funnel-v5 > header.site-header,
    body.privacy-policy-page > header.privacy-site-header
  ) {
    background: #1c1b15 !important;
    border-bottom-color: #504d40 !important;
  }
}

/* Keep the approved mobile layout intact; synchronize header type only at
   tablet widths, where navigation currently uses multiple header variants. */
@media (min-width: 768px) and (max-width: 1199px) {
  body.pricing-public-page .public-pricing-brand,
  body.ds-account-v6 > header.ds-account-sitebar .ds-account-brand {
    font-family: 'Space Grotesk', Inter, Arial, sans-serif !important;
    font-size: 22px !important;
    font-weight: 700 !important;
  }
  body.pricing-public-page .public-pricing-nav > a,
  body.ds-account-v6 > header.ds-account-sitebar > nav > a {
    font-family: Inter, Arial, sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
  }
}

@media (min-width: 1200px) {
  /* Business Analyzer and Deal Check previously used white text on a navy masthead.
     Match the V5 white header without leaving invisible text behind. */
  body.analyzer-property > .wrap > header.site-header,
  body.funnel-v5 > header.site-header {
    color: #0f1b2d !important;
  }
  :is(body.analyzer-property > .wrap > header.site-header,
      body.funnel-v5 > header.site-header)
  :is(.site-header-brand, .site-header-name, .site-header-nav > a,
      .site-header-link) {
    color: #0f1b2d !important;
  }
  :is(body.analyzer-property > .wrap > header.site-header,
      body.funnel-v5 > header.site-header) .account-signin-link {
    color: #fff !important;
    background: #0f1b2d !important;
    border-color: #0f1b2d !important;
  }
  html[data-theme="dark"] :is(body.analyzer-property > .wrap > header.site-header,
      body.funnel-v5 > header.site-header) {
    color: #f7f4ec !important;
  }
  html[data-theme="dark"] :is(body.analyzer-property > .wrap > header.site-header,
      body.funnel-v5 > header.site-header)
  :is(.site-header-brand, .site-header-name, .site-header-nav > a,
      .site-header-link) {
    color: #f7f4ec !important;
  }
  html[data-theme="dark"] :is(body.analyzer-property > .wrap > header.site-header,
      body.funnel-v5 > header.site-header) .account-signin-link {
    color: #13291e !important;
    background: #9de5c0 !important;
    border-color: #9de5c0 !important;
  }
  body.ds-account-v6 .app-shell { min-height: calc(100vh - 84px) !important; }
  body.ds-account-v6 .sidebar { height: calc(100vh - 84px) !important; }
}
