/* Appearance only: retain existing sizing, responsive layouts, images and CTA styles. */
html[data-theme="light"] { color-scheme:light; --theme-page:#f6f9fc; --theme-panel:#fff; --theme-ink:#142b40; --theme-muted:#455f77; --theme-line:#b8ccdd; --theme-tint:#e5f2fc; --theme-accent:#09679f; }
html[data-theme="dark"] { color-scheme:dark; --theme-page:#0b1724; --theme-panel:#111f30; --theme-ink:#eaf0f7; --theme-muted:#bacbdd; --theme-line:#455c73; --theme-tint:#142b40; --theme-accent:#9ddcff; }
.brand-top-strip { position:relative; padding-inline:52px; background:var(--theme-tint); color:var(--theme-muted); }
.brand-top-strip a { color:var(--theme-accent); }
.site-header .brand-top-strip > a { color:#fff; text-decoration:underline; text-underline-offset:3px; }
.fht-theme-control { position:absolute; top:0; right:14px; z-index:5; }
.fht-theme-trigger { display:grid; place-items:center; width:34px; height:34px; border:1px solid transparent; border-radius:8px; background:transparent; color:var(--theme-accent); cursor:pointer; }
.fht-theme-trigger:hover,.fht-theme-trigger[aria-expanded="true"] { background:var(--theme-panel); border-color:var(--theme-accent); }
.fht-theme-options { position:absolute; top:calc(100% + 8px); right:0; width:170px; padding:6px; border:1px solid var(--theme-line); border-radius:12px; background:var(--theme-panel); color:var(--theme-ink); box-shadow:0 12px 32px #0003; }
.fht-theme-options button { display:flex; align-items:center; gap:10px; width:100%; min-height:44px; padding:8px 10px; border:0; border-radius:7px; color:inherit; background:transparent; font:400 14px/1.4 Inter,Arial,sans-serif; cursor:pointer; }
.brand-top-strip .fht-theme-options span { display:block; flex:1; text-align:left; }
.brand-top-strip .fht-theme-options .theme-check { flex:0; }
.fht-theme-options button:hover,.fht-theme-options button[aria-pressed="true"] { background:var(--theme-tint); color:var(--theme-accent); }
.fht-theme-control button:focus-visible { outline:2px solid var(--theme-accent); outline-offset:2px; }
/* Navigation keeps its original dark branding in either appearance. */
.site-header { --theme-panel:#111f30; --theme-ink:#eaf0f7; --theme-muted:#bacbdd; --theme-line:#455c73; --theme-tint:#142b40; --theme-accent:#9ddcff; color-scheme:dark; }
html[data-theme="light"] :is(.home-section-deep,.home-commercial-bridge,.home-final-cta,.managed-closing,.managed-local-promise) { background:#edf4fa!important; color:#142b40!important; }
html[data-theme="light"] :is(.home-section-deep,.home-commercial-bridge,.home-final-cta,.managed-closing,.managed-local-promise) :is(h2,h3,p,a:not([class*="button"])) { color:#24455f!important; }
/* Light softens dark hero overlays. */
html[data-theme="light"] :is(.home-refresh-hero-shade,.managed-hero-shade) { background:linear-gradient(90deg,#f6f9fcf5,#f6f9fcbf 55%,#f6f9fc30)!important; }
html[data-theme="light"] :is(.home-refresh-hero-content,.managed-hero-content,.managed-detail-hero) :is(h1,p) { color:#142b40!important; }
html[data-theme="light"] .managed-detail-hero { background-color:#f6f9fc; background-blend-mode:screen; }
@media print { .fht-theme-control { display:none; } }
/* Light-mode navigation labels and closing CTAs must not inherit dark-theme ink. */
html[data-theme="light"] #main-content :is(.overview-nav,.package-selector,.value-selector,.managed-selector) > a { background:#fff!important; color:#173b57!important; }
html[data-theme="light"] #main-content :is(.overview-nav,.package-selector,.value-selector,.managed-selector) > a :is(strong,span) { color:inherit!important; }
html[data-theme="light"] #main-content :is(.overview-nav,.package-selector,.value-selector,.managed-selector) > a[aria-current="page"] { background:#dceefa!important; color:#173b57!important; }
html[data-theme="light"] #main-content :is(.home-final-cta,.home-commercial-bridge) :is(h2,p) { color:#173b57!important; }
html[data-theme="light"] #main-content :is(.home-final-cta,.home-commercial-bridge) .package-button.primary { background:#126fa8!important; border-color:#126fa8!important; color:#fff!important; }
/* Legacy package scope cards retain white hero headings unless light mode owns them explicitly. */
html[data-theme="light"] #main-content .package-scope :is(h2,h3) { color:#173b57!important; }
html[data-theme="light"] #main-content .package-scope :is(p,li) { color:#496171!important; }
/* Keep homepage link lists filled at intermediate widths as well as phones. */
html #main-content :is(.home-value-grid,.home-jump-grid) > a {
  grid-column:auto!important;
  grid-row:auto!important;
  opacity:1!important;
  transform:none!important;
}
html #main-content .home-value-grid { grid-auto-rows:auto; }
@media(max-width:1100px) {
  html #main-content .home-jump-grid { grid-template-columns:minmax(0,1fr)!important; }
  html #main-content :is(.home-jump-grid,.home-value-grid) > a {
    min-height:0!important;
    border:0!important;
    border-bottom:1px solid var(--theme-line)!important;
  }
  html #main-content :is(.home-jump-grid,.home-value-grid) > a:last-child { border-bottom:0!important; }
}
html[data-theme="dark"] #main-content .vision-detail-library summary,
html[data-theme="dark"] #main-content .vision-detail-library details[open] > summary { background:#142b40!important; color:#eaf0f7!important; }
html[data-theme="dark"] #main-content .vision-detail-library summary:hover { background:#24516e!important; }
html[data-theme="dark"] #main-content .vision-detail-library summary:focus-visible { outline-color:#9ddcff; }
/* Single continuous stack avoids the unfilled last row of residential systems. */
html #main-content .home-value-grid { grid-template-columns:minmax(0,1fr); background:var(--theme-panel); border-color:var(--theme-line); }
html #main-content .home-value-grid > a { min-height:0; border-right:0; border-bottom:1px solid var(--theme-line); }
html #main-content .home-value-grid > a:last-child { border-bottom:0; }
/* Value Packages remain a four-column, two-row navigator at every width. */
html[data-theme] #main-content .value-selector,
html[data-theme] #main-content .overview-nav[aria-label="Explore Value Packages"] {
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
}
html[data-theme] #main-content .value-selector > a,
html[data-theme] #main-content .overview-nav[aria-label="Explore Value Packages"] > a {
  grid-column:auto!important;
  min-width:0;
  overflow-wrap:anywhere;
}
@media(max-width:600px) {
  html[data-theme] #main-content .value-selector > a,
  html[data-theme] #main-content .overview-nav[aria-label="Explore Value Packages"] > a {
    padding:14px 5px!important;
    font-size:12px!important;
    line-height:1.3;
  }
  html[data-theme] #main-content .value-selector > a strong { font-size:inherit!important; }
}
/* Shared navigator geometry: no legacy upward overlap on detail pages. */
html[data-theme] #main-content :is(.package-selector,.value-selector,.managed-selector,.overview-nav) {
  margin:28px auto!important;
  transform:none!important;
  top:auto!important;
  padding:0!important;
  gap:0!important;
  border:1px solid var(--theme-line)!important;
  border-radius:16px!important;
  overflow:hidden;
}
html[data-theme] #main-content :is(.package-selector,.value-selector,.managed-selector,.overview-nav) > a {
  min-height:68px!important;
  padding:16px 10px!important;
  border-radius:0!important;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
}
/* Contain the top margin, including Foundation's standalone navigation wrapper. */
html #main-content .foundation-package-nav { display:flow-root; }
@media(max-width:820px) {
  html[data-theme] #main-content :is(.package-selector,.value-selector,.managed-selector,.overview-nav) > a { min-height:60px!important; padding:14px 10px!important; }
}
/* Theme-owned hero treatment stays consistent after dynamic route changes. */
html[data-theme] #main-content .foundation-package-nav { background:var(--theme-page)!important; }
html[data-theme] #main-content :is(.package-hero-image,.signature-hero-image) { opacity:1!important; filter:none!important; }
html[data-theme="light"] #main-content :is(.package-hero-shade,.signature-hero-overlay) {
  background:linear-gradient(90deg,#f6f9fcf5 0%,#f6f9fcdf 40%,#f6f9fc66 75%,#f6f9fc30 100%)!important;
}
html[data-theme="dark"] #main-content :is(.package-hero-shade,.signature-hero-overlay) {
  background:linear-gradient(90deg,#0b1724f5 0%,#0b1724df 40%,#0b172466 75%,#0b172430 100%)!important;
}
html[data-theme="light"] #main-content .foundation-network-hero {
  background:linear-gradient(90deg,#f6f9fcf5 0%,#f6f9fcdf 40%,#f6f9fc66 75%,#f6f9fc30 100%),url('/assets/foundation-network-hero-v2.avif') center right/cover no-repeat!important;
}
@media(max-width:700px) {
  html[data-theme="light"] #main-content :is(.package-hero-shade,.signature-hero-overlay) { background:linear-gradient(90deg,#f6f9fcf2,#f6f9fcbf)!important; }
  html[data-theme="dark"] #main-content :is(.package-hero-shade,.signature-hero-overlay) { background:linear-gradient(90deg,#0b1724f2,#0b1724bf)!important; }
}
/* Detail navigators include a real return route to the category overview. */
html #main-content .package-selector { grid-template-columns:repeat(5,minmax(0,1fr)); }
html #main-content .value-selector { grid-template-columns:repeat(4,minmax(0,1fr)); }
html[data-theme] #main-content .package-overview-link { background:var(--theme-panel)!important; color:var(--theme-ink)!important; box-shadow:none!important; }
@media(max-width:820px) {
  html #main-content :is(.package-selector,.value-selector) { grid-template-columns:repeat(2,minmax(0,1fr)); }
  html #main-content .package-selector > .package-overview-link { grid-column:1 / -1!important; }
  html #main-content .value-selector > a { grid-column:auto!important; }
}
/* Legacy prewire/estate/value templates have their own inner gradient and CTA surfaces. */
html[data-theme="dark"] #main-content :is(.package-gradient,.value-package-gradient,.package-hero) { background:#0b1724!important; }
html[data-theme="dark"] #main-content :is(.package-closing,.package-step,.package-fit,.value-scope-note,.value-combine,.package-comparison) { background:#111f30!important; color:#eaf0f7!important; border-color:#455c73!important; }
html[data-theme="dark"] #main-content :is(.package-fit,.value-scope-note,.package-hero-plan) span { color:#9ddcff!important; }
/* Overview remains selectable, without the persistent active-page highlight. */
html[data-theme] #main-content :is(.overview-nav,.managed-selector) > a:first-child,
html[data-theme] #main-content :is(.overview-nav,.managed-selector) > a:first-child:is(:hover,:focus-visible,[aria-current]) {
  background:var(--theme-panel)!important;
  color:var(--theme-ink)!important;
  box-shadow:none!important;
  border-color:var(--theme-line)!important;
}
html[data-theme] #main-content :is(.overview-nav,.managed-selector) > a:first-child:hover {
  background:var(--theme-tint)!important;
}
/* Explicit cell outlines survive wrapped/two-column layouts and both palettes. */
@media(max-width:1024px) {
  html[data-theme] #main-content :is(.package-selector,.value-selector,.managed-selector,.overview-nav) {
    border:1px solid var(--theme-line)!important;
  }
  html[data-theme] #main-content :is(.package-selector,.value-selector,.managed-selector,.overview-nav) > a {
    border:1px solid var(--theme-line)!important;
  }
}

/* Site-wide dark surfaces, including the legacy package templates. */
html[data-theme="dark"] body { background:#0b1724; color:#eaf0f7; }
html[data-theme="dark"] #main-content :is(.home-refresh,.home-section,.home-jump-section,.home-commercial-bridge,.home-final-cta,.designed-overview,.managed-services-page,.package-page,.package-body,.signature-page,.signature-body,.foundation-page,.foundation-section,.service-area,.package-feature-section,.package-flow-section) { background:#0b1724!important; color:#eaf0f7!important; }
html[data-theme="dark"] #main-content :is(article,aside,.home-package-card,.home-jump-grid a,.home-managed-grid a,.home-value-grid a,.overview-closing,.vision-detail-library details,.foundation-benefit,.foundation-group,.foundation-upgrade-card,.signature-included-card,.package-feature,.package-scope-grid > div,.signature-flow,.signature-flow-detail,.signature-flow-core,.signature-flow-branches > div,.signature-final-cta,.foundation-final-cta,.package-final-cta,.managed-local-promise,.managed-detail-intro,.managed-price-card,.managed-price-block,.managed-related-grid a,.managed-scope-list,.managed-steps li,.managed-closing,.mp-intro,.mp-card,.comparison-scroll,.managed-table-scroll) { background:#111f30!important; color:#eaf0f7!important; border-color:#455c73!important; }
html[data-theme="dark"] #main-content :is(h1,h2,h3,h4,p,li,summary,td,th,strong,small,figcaption) { color:#eaf0f7!important; }
html[data-theme="dark"] #main-content :is(.overview-eyebrow,.managed-eyebrow,.signature-eyebrow,.foundation-eyebrow,.package-eyebrow,.overview-link,.home-text-link,.signature-card-note) { color:#9ddcff!important; }
html[data-theme="dark"] #main-content :is(.package-selector,.value-selector,.managed-selector,.overview-nav,.package-comparison,.package-comparison td,.package-comparison th,.mp-comparison td,.mp-comparison th) { background:#111f30!important; color:#eaf0f7!important; border-color:#455c73!important; }
html[data-theme="dark"] #main-content :is(.package-selector,.value-selector,.managed-selector,.overview-nav) a { background:#111f30!important; color:#eaf0f7!important; border-color:#455c73!important; }
html[data-theme="dark"] #main-content :is(.package-selector,.value-selector,.managed-selector,.overview-nav) a:is(:hover,[aria-current="page"]) { background:#24516e!important; color:#fff!important; }
html[data-theme="dark"] #main-content :is(.signature-callout,.signature-note,.managed-plan-note,.foundation-safety-note,.signature-hero-plan,.package-hero-plan,.signature-hero-plan span,.package-hero-plan span,.signature-flow-results button,.signature-flow-results span) { background:#142b40!important; color:#dceaf5!important; border-color:#455c73!important; }
html[data-theme="dark"] #main-content .signature-flow-results button:is(:hover,[aria-selected="true"]) { background:#247da8!important; color:#fff!important; }
html[data-theme="dark"] #main-content :is(.signature-flow-core,.signature-flow-branches,.home-managed-grid,.managed-related-grid,.home-jump-grid) span { color:#bacbdd!important; }
html[data-theme="dark"] #main-content :is(.package-button.secondary,.foundation-button.secondary,.signature-button.secondary) { background:#142b40!important; color:#eaf0f7!important; border-color:#668ca7!important; }
html[data-theme="dark"] #main-content .overview-hero { background:linear-gradient(90deg,#0b1724f5,#0b1724bf 55%,#0b172430),var(--overview-image) center/cover!important; }
html[data-theme="dark"] #main-content .signature-hero { background:#0b1724!important; }
html[data-theme="dark"] #main-content .foundation-network-hero { background:linear-gradient(90deg,#0b1724f2,#0b1724a8 60%,#0b172430),url('/assets/foundation-network-hero-v2.avif') center right/cover no-repeat!important; }
html[data-theme="dark"] .managed-plans { --mp-ink:#eaf0f7; --mp-muted:#bacbdd; --mp-surface:#111f30; --mp-panel:#142b40; --mp-line:#455c73; }
html[data-theme="dark"] :is(.package-consultation-panel,.package-panel-toolbar) { background:#111f30!important; color:#eaf0f7!important; }
html[data-theme="dark"] .package-consultation-panel :is(h2,p,label,legend) { color:#eaf0f7!important; }
html[data-theme="dark"] .package-consultation-panel :is(input,textarea,select) { background:#142b40!important; color:#eaf0f7!important; border-color:#668ca7!important; }
html[data-theme="dark"] .package-consultation-panel { color-scheme:dark; }
html[data-theme="dark"] .package-consultation-form fieldset label { background:#142b40!important; color:#eaf0f7!important; border-color:#455c73!important; }
html[data-theme="dark"] .package-consultation-form fieldset label:has(input:checked) { background:#23465e!important; border-color:#9ddcff!important; }
html[data-theme="dark"] .package-consultation-form input[type="checkbox"]:checked { background:#247da8!important; border-color:#9ddcff!important; }
html[data-theme="dark"] .package-panel-close { background:#142b40!important; color:#fff!important; border-color:#668ca7!important; }
html[data-theme="dark"] .package-panel-close:hover { background:#24516e!important; }
html[data-theme="dark"] .package-consultation-form :is(input,textarea)::placeholder { color:#abc0d1; opacity:1; }
html[data-theme="dark"] .package-consultation-form :is(input,textarea,select,button):focus-visible { outline:2px solid #9ddcff; outline-offset:3px; }
html[data-theme="dark"] .package-consultation-form input[type="file"]::file-selector-button { background:#24516e; color:#fff; border-color:#668ca7; }
html[data-theme="dark"] .package-consultation-panel .contact-file-upload { background:#142b40; border-color:#455c73; }
html[data-theme="dark"] .package-consultation-panel .form-status,
html[data-theme="dark"] .package-consultation-panel .contact-file-summary.has-error { color:#ffb9b9!important; }
/* Balanced homepage grids; fill the final row instead of leaving empty cells. */
html #main-content :is(.home-value-grid,.home-jump-grid) {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  grid-auto-rows:auto;
}
html #main-content :is(.home-value-grid,.home-jump-grid) > a {
  border:1px solid var(--theme-line)!important;
  min-width:0;
  height:100%;
}
html #main-content :is(.home-value-grid,.home-jump-grid) > a:last-child:nth-child(3n + 1) { grid-column:1 / -1!important; }
html #main-content :is(.home-value-grid,.home-jump-grid) > a:last-child:nth-child(3n + 2) { grid-column:span 2!important; }
@media(max-width:820px) {
  html #main-content :is(.home-value-grid,.home-jump-grid) { grid-template-columns:repeat(2,minmax(0,1fr))!important; }
  html #main-content :is(.home-value-grid,.home-jump-grid) > a:last-child { grid-column:auto!important; }
  html #main-content :is(.home-value-grid,.home-jump-grid) > a:last-child:nth-child(odd) { grid-column:1 / -1!important; width:100%; }
  html #main-content :is(.home-value-grid,.home-jump-grid) > a { padding:20px 14px; }
}
