/*! NBC v7.062 · P0 systemic consolidation
    Scope: global rails, knowledge scroll target, case-index dark ledger,
    diagnose dark decision space, digital-check entry robustness. */

:root{
  --nbc-rail-reading:820px;
  --nbc-rail-standard:1320px;
  --nbc-rail-feature:1680px;
  --nbc-rail-gutter:clamp(28px,3vw,56px);
  --nbc-reading-max:var(--nbc-rail-reading);
  --nbc-standard-max:var(--nbc-rail-standard);
  --nbc-feature-max:var(--nbc-rail-feature);

  /* Legacy aliases resolve into the same three-rail contract. */
  --nbc-shell-max:var(--nbc-rail-feature);
  --nbc-shell-gutter:var(--nbc-rail-gutter);
  --nbc-content-max:var(--nbc-rail-standard);
  --nbc-editorial-max:var(--nbc-rail-reading);
  --nbc-layout-wide:var(--nbc-rail-feature);
  --nbc-layout-standard:var(--nbc-rail-standard);
  --nbc-layout-editorial:var(--nbc-rail-reading);
}

/* Semantic rail utilities for all new/retouched sections. */
:is(.nbc-rail--reading,[data-nbc-rail="reading"]){
  width:min(100%,var(--nbc-rail-reading));
  max-width:var(--nbc-rail-reading);
  margin-inline:auto;
}
:is(.nbc-rail--standard,[data-nbc-rail="standard"]){
  width:min(100%,var(--nbc-rail-standard));
  max-width:var(--nbc-rail-standard);
  margin-inline:auto;
}
:is(.nbc-rail--feature,[data-nbc-rail="feature"]){
  width:min(100%,var(--nbc-rail-feature));
  max-width:var(--nbc-rail-feature);
  margin-inline:auto;
}

/* P0.1 — one horizontal contract with explicit A/B/C responsibility.
   Default content sections use B (Standard). Heroes, instruments and large
   overviews opt into C (Feature). Reading measures remain component-owned A. */
@media (min-width:1024px){
  body.page.design-system-executive :is(.site-header,.site-footer) > .wrap{
    width:min(calc(100% - (2 * var(--nbc-rail-gutter))),var(--nbc-rail-feature))!important;
    max-width:var(--nbc-rail-feature)!important;
    margin-inline:auto!important;
    box-sizing:border-box;
  }

  /* B — default section/content rail. */
  body.page.design-system-executive:not(.page-home) main > :is(section,div,nav) > :is(.wrap,.sw,.pp-wrap,.dp-wrap,.case2-wrap,.case2-wrap--stage,.dt-wrap),
  body.page.design-system-executive:not(.page-home) main > .nbc-hero-bridge > .wrap,
  body.page.design-system-executive:not(.page-home) main > section > .nbc-hero-bridge > .wrap,
  body.page.design-system-executive main > article > .ep-article-layout,
  body.page.design-system-executive.page-contact main.nbc-page-shell > section > .wrap,
  body.page.design-system-executive.page-about main.nbc-page-shell > section > .wrap,
  body.page-template-case-detail main > .dg5-guide-bridge{
    width:min(calc(100% - (2 * var(--nbc-rail-gutter))),var(--nbc-rail-standard))!important;
    max-width:var(--nbc-rail-standard)!important;
    margin-inline:auto!important;
    box-sizing:border-box;
  }

  /* C — heroes, active instruments, broad overviews and signature compositions. */
  body.page.design-system-executive main > section.nbc-hero-system > :is(.wrap,.sw,.pp-wrap,.dp-wrap),
  body.page.design-system-executive main > section:is(.service-hero,.local-hero,.bi-hero,.case2-index-hero,.case2-hero,.dt-hero,.km-hero) > :is(.wrap,.sw,.case2-wrap,.dt-wrap),
  body.page.design-system-executive main > section:is(.case2-index-library,.dt-triage,.km-instrument-section) > :is(.wrap,.case2-wrap,.dt-wrap),
  body.page.design-system-executive main > section > :is(.premium-hub-hero,.premium-hub-landscape) > .wrap,
  body.page.design-system-executive main > article > :is(.ep-hero,.ep-signature-stage) > .ep-hero-wrap,
  body.page.design-system-executive main > article > .nbc-hero-bridge > .wrap,
  body.page.design-system-executive.page-barometer #barometer > .wrap,
  body.page.design-system-executive.page-digital-check #digital-check > .wrap{
    width:min(calc(100% - (2 * var(--nbc-rail-gutter))),var(--nbc-rail-feature))!important;
    max-width:var(--nbc-rail-feature)!important;
    margin-inline:auto!important;
    box-sizing:border-box;
  }

  /* Homepage retains its signed-off composition; only the shared rail tokens apply. */
  body.page.design-system-executive.page-home main > section > :is(.wrap,.home-service-choice__inner),
  body.page.design-system-executive.page-home #situationen > .wrap{
    width:min(calc(100% - (2 * var(--nbc-rail-gutter))),var(--nbc-rail-feature))!important;
    max-width:var(--nbc-rail-feature)!important;
    margin-inline:auto!important;
    box-sizing:border-box;
  }

  /* Guides have their own wrapper vocabulary. */
  body.page-template-guide .dg3-hero > .dg3-wrap{
    width:min(calc(100% - (2 * var(--nbc-rail-gutter))),var(--nbc-rail-feature))!important;
    max-width:var(--nbc-rail-feature)!important;
    margin-inline:auto!important;
  }
  body.page-template-guide :is(.dg3-section,.dg3-access) > .dg3-wrap,
  body.page-template-guide main.dg3-page > .dg3-wrap{
    width:min(calc(100% - (2 * var(--nbc-rail-gutter))),var(--nbc-rail-standard))!important;
    max-width:var(--nbc-rail-standard)!important;
    margin-inline:auto!important;
  }
}

@media (min-width:761px) and (max-width:1023px){
  :root{--nbc-rail-gutter:24px}
  body.page.design-system-executive :is(.site-header,.site-footer) > .wrap,
  body.page.design-system-executive main > :is(section,div,nav) > :is(.wrap,.sw,.pp-wrap,.dp-wrap,.case2-wrap,.case2-wrap--stage,.dt-wrap,.home-service-choice__inner),
  body.page.design-system-executive main > article > :is(.ep-hero,.ep-signature-stage) > .ep-hero-wrap,
  body.page.design-system-executive main > article > .ep-article-layout,
  body.page-template-guide .dg3-wrap{
    width:calc(100% - 48px)!important;
    max-width:none!important;
    margin-inline:auto!important;
    box-sizing:border-box;
  }
}

@media (max-width:760px){
  :root{--nbc-rail-gutter:20px}
  body.page.design-system-executive :is(.site-header,.site-footer) > .wrap,
  body.page.design-system-executive main > :is(section,div,nav) > :is(.wrap,.sw,.pp-wrap,.dp-wrap,.case2-wrap,.case2-wrap--stage,.dt-wrap,.home-service-choice__inner),
  body.page.design-system-executive main > article > :is(.ep-hero,.ep-signature-stage) > .ep-hero-wrap,
  body.page.design-system-executive main > article > .ep-article-layout,
  body.page-template-guide .dg3-wrap{
    width:calc(100% - 40px)!important;
    max-width:none!important;
    margin-inline:auto!important;
    box-sizing:border-box;
  }
}

/* P0.2 — stable target geometry for the knowledge recommendation. */
body.page-blog [data-b4-recommendation],
body.page-blog [data-km-feature]{
  scroll-margin-top:calc(var(--nbc-header-h,72px) + 40px);
}
@media (max-width:760px){
  body.page-blog [data-b4-recommendation],
  body.page-blog [data-km-feature]{scroll-margin-top:calc(var(--nbc-header-h,64px) + 24px)}
}

/* P0.3 — case library returns to the continuous dark NBC canvas. */
body.page-template-case-index[data-case-layout="v6692"] .case2-index-library.f2-case-ledger{
  --case-final-ink:#edf2ed;
  --case-final-muted:rgba(232,238,232,.62);
  --case-final-line:rgba(220,236,226,.14);
  --case-final-mint:#8bd8a5;
  --nbc-folio-ink:#edf2ed;
  --nbc-folio-muted:rgba(232,238,232,.62);
  --nbc-folio-moss:#8bd8a5;
  --nbc-folio-rule:rgba(220,236,226,.14);
  background:
    radial-gradient(72% 78% at 74% 18%,rgba(67,126,82,.10),transparent 68%),
    linear-gradient(180deg,#07100b 0%,#08120c 54%,#07100b 100%)!important;
  color:#edf2ed!important;
  border:0!important;
}
body.page-template-case-index[data-case-layout="v6692"] .case2-index-library.f2-case-ledger::before,
body.page-template-case-index[data-case-layout="v6692"] .case2-index-library.f2-case-ledger::after{
  background:none!important;
  box-shadow:none!important;
}
body.page-template-case-index[data-case-layout="v6692"] .case2-index-library.f2-case-ledger .case2-wrap{
  background:transparent!important;
  box-shadow:none!important;
}
body.page-template-case-index[data-case-layout="v6692"] .case2-index-library.f2-case-ledger :is(h2,h3,strong){color:#edf2ed!important}
body.page-template-case-index[data-case-layout="v6692"] .case2-index-library.f2-case-ledger :is(.case2-eyebrow,.case2-index-link,.p74-ledger-note){color:#8bd8a5!important}
body.page-template-case-index[data-case-layout="v6692"] .case2-index-library.f2-case-ledger :is(.case2-index-library-head>p,.case2-index-copy p){color:rgba(232,238,232,.62)!important}
body.page-template-case-index[data-case-layout="v6692"] .case2-index-library.f2-case-ledger :is(.case2-index-library-head,.case2-index-grid,.case2-index-card){border-color:rgba(220,236,226,.14)!important}
body.page-template-case-index[data-case-layout="v6692"] .case2-index-library.f2-case-ledger .case2-index-card:hover,
body.page-template-case-index[data-case-layout="v6692"] .case2-index-library.f2-case-ledger .case2-index-card:focus-visible{
  background:linear-gradient(90deg,rgba(139,216,165,.055),transparent 72%)!important;
  outline:none;
}

/* P0.4/0.5 — Diagnose remains one dark decision space; no paper folio. */
body.page-diagnose[data-diagnostic-studio="v7043"] .dt-knowledge{
  background:
    radial-gradient(70% 90% at 18% 36%,rgba(57,113,73,.10),transparent 70%),
    transparent!important;
  color:#edf2ed!important;
}
body.page-diagnose[data-diagnostic-studio="v7043"] .dt-knowledge__folio{
  position:relative;
  margin:0!important;
  padding:clamp(54px,6.2vw,96px) 0!important;
  background:transparent!important;
  color:#edf2ed!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
}
body.page-diagnose[data-diagnostic-studio="v7043"] .dt-knowledge .dt-kicker{color:#8bd8a5!important}
body.page-diagnose[data-diagnostic-studio="v7043"] .dt-knowledge h2{color:#edf2ed!important}
body.page-diagnose[data-diagnostic-studio="v7043"] .dt-knowledge header>p:last-child{color:rgba(232,238,232,.64)!important}
body.page-diagnose[data-diagnostic-studio="v7043"] .dt-knowledge__paths{border-color:rgba(220,236,226,.14)!important}
body.page-diagnose[data-diagnostic-studio="v7043"] .dt-knowledge__paths a{
  color:#edf2ed!important;
  border-color:rgba(220,236,226,.14)!important;
  background:transparent!important;
}
body.page-diagnose[data-diagnostic-studio="v7043"] .dt-knowledge__paths a:hover,
body.page-diagnose[data-diagnostic-studio="v7043"] .dt-knowledge__paths a:focus-visible{
  background:linear-gradient(90deg,rgba(139,216,165,.05),transparent 70%)!important;
  outline:none;
}
body.page-diagnose[data-diagnostic-studio="v7043"] .dt-knowledge__paths span{color:rgba(232,238,232,.50)!important}
body.page-diagnose[data-diagnostic-studio="v7043"] .dt-knowledge__paths strong{color:#edf2ed!important}
body.page-diagnose[data-diagnostic-studio="v7043"] .dt-knowledge__paths em{color:#8bd8a5!important}
body.page-diagnose :is(.dt-question[data-question="2"],.dt-result,#diagnose-triage){
  scroll-margin-top:calc(var(--nbc-header-h,72px) + 40px);
}
body.page-diagnose[data-diagnostic-premium="v7044"] .dt-signal.is-selected{
  background:linear-gradient(90deg,rgba(139,216,165,.085),rgba(139,216,165,.018) 62%,transparent)!important;
  color:#f3f6f3!important;
}
body.page-diagnose[data-diagnostic-premium="v7044"] .dt-signal.is-selected .dt-signal__icon{color:#9ce3b2!important}
body.page-diagnose[data-diagnostic-premium="v7044"] .dt-signal.is-selected>i{color:#9ce3b2!important;transform:translateX(4px)}
@media (max-width:760px){
  body.page-diagnose[data-diagnostic-studio="v7043"] .dt-knowledge__folio{
    margin-inline:0!important;
    padding:48px 0 54px!important;
  }
  body.page-diagnose :is(.dt-question[data-question="2"],.dt-result,#diagnose-triage){scroll-margin-top:calc(var(--nbc-header-h,64px) + 24px)}
  body.page-diagnose[data-diagnostic-premium="v7044"] .dt-signal.is-selected{
    background:linear-gradient(90deg,rgba(139,216,165,.075),transparent 86%)!important;
  }
}

/* P0.6 — Digital Check entry choices never create phantom columns or clipped actions. */
body.page-digital-check .dc7-choice-grid{
  width:min(100%,900px)!important;
  max-width:100%!important;
}
body.page-digital-check .dc7-choice{
  max-width:100%!important;
  box-sizing:border-box!important;
  overflow:visible!important;
}
body.page-digital-check :is(#dc-start-zero,.dc7-choice--barometer[data-has-barometer="true"]){
  min-width:0!important;
}
body.page-digital-check :is(#dc-start-zero,.dc7-choice--barometer[data-has-barometer="true"]) > *{
  min-width:0;
}
body.page-digital-check :is(#dc-start-zero,.dc7-choice--barometer[data-has-barometer="true"]) .dc7-choice__action{
  white-space:normal!important;
  overflow-wrap:normal!important;
  word-break:normal!important;
  line-height:1.35!important;
}
body.page-digital-check .dc7-choice:focus-visible{
  outline:2px solid rgba(139,216,165,.78)!important;
  outline-offset:6px!important;
}

@media (min-width:761px) and (max-width:1100px){
  body.page-digital-check #dc-start-zero{
    grid-template-columns:60px minmax(0,1fr)!important;
    grid-template-areas:"icon meta" "icon title" "copy copy" "action action"!important;
    gap:4px 18px!important;
  }
  body.page-digital-check #dc-start-zero .dc7-choice__action{
    margin-top:12px!important;
    padding-left:0!important;
    text-align:left!important;
  }
  body.page-digital-check .dc7-choice--barometer[data-has-barometer="true"]{
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-areas:"meta" "title" "copy" "action"!important;
    gap:3px!important;
  }
  body.page-digital-check .dc7-choice--barometer .dc7-choice__action{
    margin-top:8px!important;
    text-align:left!important;
  }
}

@media (max-width:760px){
  body.page-digital-check :is(#dc-start-zero,.dc7-choice--barometer[data-has-barometer="true"]){
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-areas:none!important;
    gap:5px!important;
    width:100%!important;
    min-height:44px!important;
    padding-inline:0!important;
  }
  body.page-digital-check :is(#dc-start-zero,.dc7-choice--barometer[data-has-barometer="true"]) > *{
    grid-area:auto!important;
    max-width:100%!important;
  }
  body.page-digital-check #dc-start-zero .dc7-choice__icon{display:none!important}
  body.page-digital-check :is(#dc-start-zero,.dc7-choice--barometer[data-has-barometer="true"]) .dc7-choice__action{
    margin-top:9px!important;
    padding:0!important;
    text-align:left!important;
  }
}

@media (prefers-reduced-motion:reduce){
  body.page-template-case-index .case2-index-card,
  body.page-diagnose .dt-signal,
  body.page-digital-check .dc7-choice{transition:none!important}
}
