/* Only opt-in pages load this after v1. Widths reproduce the measured Mortgage guide. */
body[data-vwa][data-vwc] {
  --vwc-trailing: 0px;
  --vwc-header-pad: 12px;
  --vwc-page-gap: max(20px, calc((100% - 1240px) / 2));
  --vwa-cap: calc(1240px - var(--vwc-trailing));
  --vwa-span: min(calc(100% - 40px - var(--vwc-trailing)), var(--vwa-cap));
  --vwc-quote: #214c3a;
  --vwc-quote-hover: #173d2d;
  --vwc-focus: #315e46;
}

@media (min-width: 1281px) {
  body[data-vwa][data-vwc] { --vwc-trailing: 5.5px; }
}

html body[data-vwa][data-vwc] header#header.vw-shared-header.oh-header {
  box-sizing: border-box;
  width: calc(var(--vwa-span) + 2 * var(--vwc-header-pad) + 2px) !important;
  max-width: none !important;
  inset-inline-start: 0 !important;
  inset-inline-end: var(--vwc-trailing) !important;
  padding-inline: var(--vwc-header-pad) !important;
  padding-block: 7px !important;
  margin-inline: auto !important;
  min-height: 68px !important;
}

html body[data-vwa][data-vwc] header#header.vw-shared-header.oh-header .oh-header-quote {
  min-height: 44px;
  min-width: 44px;
  padding-block: 6px;
  background: #f0f3e5 !important;
  color: #20352b !important;
}

html body[data-vwa][data-vwc] header#header.vw-shared-header .oh-menu-toggle,
html body[data-vwa][data-vwc] header#header.vw-shared-header .vwr-fallback-menu summary {
  min-height: 44px;
  min-width: 44px;
}

@media (max-width: 900px) {
  html body[data-vwa][data-vwc] header#header.vw-shared-header.oh-header {
    min-height: 62px !important;
    padding-block: 6px !important;
  }
}

@media (min-width: 1281px) {
  html body[data-vwa][data-vwc] .vw-footer-v14 .vw-foot-inner,
  html body[data-vwa="auto"][data-vwc] .auto-main .auto-shell,
  html body[data-vwa="life"][data-vwc] .life-page .life-wrap,
  html body[data-vwa="tool"][data-vwc] #vwi-tools .tool-wrap,
  html body[data-vwa="hub"][data-vwc] #main .r16-shell,
  html body[data-vwa="service"][data-vwc] main#main-content.svc-main,
  html body[data-vwa="editorial"][data-vwc] #top.bundle-flagship > :is(.bundle-breadcrumbs, .hero, .bundle-article-columns) {
    margin-inline-start: var(--vwc-page-gap) !important;
    margin-inline-end: auto !important;
  }
}

/* Scope color and size to existing primary controls; text links retain their role. */
@layer vwc-cta-lock {
  html body[data-vwc] :is(
    main .auto-button[href="/apply"], main .life-button[href="/apply"],
    main .r16-button[href="/apply"], main .svc-primary[href="/apply"],
    #vwi-tools .tool-button[href="/apply"],
    .bundle-flagship .btn-i[href="/apply"], .bundle-flagship .bundle-primary-action[href="/apply"],
    .bundle-flagship #zipForm button[type="submit"], .bundle-flagship #rateWatchForm button[type="submit"],
    #stickyCta a[href="/apply"], #vwScta .vwscta-btn
  ) {
    min-block-size: 44px !important;
    min-inline-size: 44px !important;
    background: var(--vwc-quote) !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    border-color: var(--vwc-quote) !important;
    text-decoration-color: currentColor !important;
    scroll-margin-block: 6rem 4.5rem;
  }

  html body[data-vwc] :is(
    main .auto-button[href="/apply"], main .life-button[href="/apply"],
    main .r16-button[href="/apply"], main .svc-primary[href="/apply"],
    #vwi-tools .tool-button[href="/apply"],
    .bundle-flagship .btn-i[href="/apply"], .bundle-flagship .bundle-primary-action[href="/apply"],
    .bundle-flagship #zipForm button[type="submit"], .bundle-flagship #rateWatchForm button[type="submit"],
    #stickyCta a[href="/apply"], #vwScta .vwscta-btn
  ):hover {
    background: var(--vwc-quote-hover) !important;
    border-color: var(--vwc-quote-hover) !important;
  }

  html body[data-vwc] :is(
    header#header a, header#header button, header#header summary,
    main a[href="/apply"], main a[href^="tel:"], #vwi-tools .tool-hero a[href="#tool"], main #zipForm button[type="submit"],
    main #rateWatchForm button[type="submit"], #stickyCta a, #vwScta a
  ):focus-visible {
    outline: 3px solid var(--vwc-focus) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 2px #fff !important;
  }

  html body[data-vwc] header#header :is(a, button, summary):focus-visible {
    outline-color: #ddf1ce !important;
    box-shadow: 0 0 0 2px #20382d !important;
  }
}

@media (forced-colors: active) {
  html body[data-vwc] :is(header#header a, header#header summary, main a[href="/apply"], main button):focus-visible {
    outline: 3px solid Highlight !important;
  }
}

/* Keep the calculator's optional quote link secondary, with a usable target. */
html body[data-vwc] #vwi-tools .tool-hero a[href="/apply"] {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding-block: .25rem;
}
