/*! NBC v7.544 · Package C · Calculator Mobile Premium
    Responsive density, interaction stability and touch-target contract only.
    Desktop information architecture and calculator semantics stay unchanged. */

/* --------------------------------------------------------------------------
   Shared coarse-pointer contract
   -------------------------------------------------------------------------- */
@media (max-width:700px), (pointer:coarse) and (max-width:980px){
  html body.service-process #sollweg-echtweg :is(button,[role="button"],select,input),
  html body.service-erp #erp-belastungsprobe :is(button,[role="button"],select,input),
  html body.service-ki .ki-lab :is(button,[role="button"],select,input){
    touch-action:manipulation;
  }
}

/* --------------------------------------------------------------------------
   PROCESS · keep the instrument readable without turning mobile into a second
   long-form page. Secondary metadata is compacted; operational controls grow.
   -------------------------------------------------------------------------- */
@media (max-width:700px){
  html body.service-process #sollweg-echtweg [data-process-reality-app="v6416"] .pr-process-picker button,
  html body.service-process #sollweg-echtweg [data-process-reality-app="v6416"] .pc-mobile-mode button,
  html body.service-process #sollweg-echtweg [data-process-reality-app="v6416"] .pr-reset,
  html body.service-process #sollweg-echtweg [data-process-reality-app="v6416"] .rf-process-causal-action,
  html body.service-process #sollweg-echtweg [data-process-reality-app="v6416"] .pr-causal-resolve,
  html body.service-process #sollweg-echtweg [data-process-reality-app="v6416"] [data-pr-stable-confirm]{
    min-height:46px!important;
  }

  html body.service-process #sollweg-echtweg [data-process-reality-app="v6416"] .rf-process-causal-action{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    padding-inline:15px!important;
    font-size:11px!important;
    line-height:1.2!important;
  }

  /* Operational labels must not fall into 8 px microtype on a phone. */
  html body.service-process #sollweg-echtweg [data-process-reality-app="v6416"] .rf-process-causal-cell>span,
  html body.service-process #sollweg-echtweg [data-process-reality-app="v6416"] .pr-causal-cell span{
    font-size:10px!important;
    line-height:1.25!important;
    letter-spacing:.055em!important;
  }
  html body.service-process #sollweg-echtweg [data-process-reality-app="v6416"] .rf-process-causal-cell>strong,
  html body.service-process #sollweg-echtweg [data-process-reality-app="v6416"] .pr-causal-cell strong{
    font-size:12.5px!important;
    line-height:1.36!important;
  }

  /* Route context stays available, but is capped at two lines instead of
     consuming an arbitrary amount of vertical space. */
  html body.service-process #sollweg-echtweg [data-process-reality-app="v6416"] .pr-case-context__identity small,
  html body.service-process #sollweg-echtweg [data-process-reality-app="v6416"] .rf-process-casebar__identity>small{
    display:-webkit-box!important;
    -webkit-box-orient:vertical!important;
    -webkit-line-clamp:2!important;
    overflow:hidden!important;
    white-space:normal!important;
    font-size:10.5px!important;
    line-height:1.34!important;
  }

  /* The legend already names the visible states. Its explanatory tail is
     secondary metadata on mobile and was a source of tiny type + extra height. */
  html body.service-process #sollweg-echtweg [data-process-reality-app="v6416"] .rf-flow-key small{
    display:none!important;
  }
  html body.service-process #sollweg-echtweg [data-process-reality-app="v6416"] .rf-flow-key{
    margin-top:6px!important;
    font-size:10.5px!important;
    line-height:1.3!important;
  }

  html body.service-process #sollweg-echtweg [data-process-reality-app="v6416"] .rf-process-result{
    margin-top:18px!important;
  }
  html body.service-process #sollweg-echtweg [data-process-reality-app="v6416"] .rf-process-result__journey{
    margin-top:17px!important;
    padding-top:16px!important;
  }
  html body.service-process #sollweg-echtweg [data-process-reality-app="v6416"] .rf-process-result__handoff{
    margin-top:14px!important;
  }
}

/* --------------------------------------------------------------------------
   ERP · Package C only owns mobile hit areas and compact-control legibility.
   Package A/B retain geometry and runtime ownership.
   -------------------------------------------------------------------------- */
@media (max-width:700px){
  html body.service-erp #erp-belastungsprobe :is(
    .ec-scenario-button,.ec-scenario-change,.ec-mobile-provider-tab,
    .ec-global-station,.ec-provider-switch,.ec-edit,.ec-action,
    .ec-reset,.ec-run,.ec-close,.ec-share,.ec-contact,.ec-mobile-tech-item
  ){
    min-height:44px!important;
  }

  html body.service-erp #erp-belastungsprobe :is(.ec-scenario-button,.ec-scenario-change,.ec-mobile-provider-tab,.ec-provider-switch,.ec-edit,.ec-mobile-tech-item){
    display:flex!important;
    align-items:center!important;
  }
  html body.service-erp #erp-belastungsprobe .ec-mobile-tech-item{
    padding-block:8px!important;
  }
  html body.service-erp #erp-belastungsprobe .ec-mobile-tech-item span{
    font-size:9.5px!important;
    line-height:1.2!important;
  }
  html body.service-erp #erp-belastungsprobe .ec-edit{
    padding-block:8px!important;
    font-size:11px!important;
  }
  html body.service-erp #erp-belastungsprobe .ec-provider-switch,
  html body.service-erp #erp-belastungsprobe .ec-mobile-provider-tab{
    font-size:11px!important;
    line-height:1.2!important;
  }
}

/* --------------------------------------------------------------------------
   KI DECISION LAB · mobile premium / stability
   -------------------------------------------------------------------------- */
@media (max-width:620px){
  /* 1) The six-step autonomy result is a true 2 × 3 grid. No hidden horizontal
     scrollbar, no clipped sixth step, no dependency on 372 px fixed content. */
  html body.service-ki[data-nbc-ki-evidence-personalization="v7528"] .ki7520-autonomy{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-auto-rows:minmax(78px,auto)!important;
    gap:7px!important;
    overflow:visible!important;
    overscroll-behavior:auto!important;
    padding:4px 0 10px!important;
  }
  html body.service-ki[data-nbc-ki-evidence-personalization="v7528"] .ki7520-autonomy:before{
    display:none!important;
  }
  html body.service-ki[data-nbc-ki-evidence-personalization="v7528"] .ki7520-auto-step{
    display:grid!important;
    grid-template-columns:34px minmax(0,1fr)!important;
    align-items:center!important;
    gap:9px!important;
    min-width:0!important;
    min-height:78px!important;
    padding:10px!important;
    text-align:left!important;
    border:1px solid rgba(169,239,196,.10)!important;
    border-radius:10px!important;
    background:rgba(5,20,14,.56)!important;
  }
  html body.service-ki[data-nbc-ki-evidence-personalization="v7528"] .ki7520-auto-step i{
    width:32px!important;
    height:32px!important;
    margin:0!important;
    font-size:10px!important;
  }
  html body.service-ki[data-nbc-ki-evidence-personalization="v7528"] .ki7520-auto-step strong{
    font-size:11.5px!important;
    line-height:1.3!important;
    text-align:left!important;
  }

  /* 2) Fixed mobile stage height across signatures. Stress tests may change
     semantics, but they must not resize the main visual by 40+ px. */
  html body.service-ki .ki-lab[data-ki-visual="v7519"] .ki-flow__canvas,
  html body.service-ki .ki-lab[data-ki-visual="v7519"] .ki-flow[data-signature] .ki-flow__canvas{
    height:1220px!important;
    min-height:1220px!important;
  }

  /* 3) Reserve predictable readout space so changing a stress state replaces
     content instead of pushing the instrument below it. */
  html body.service-ki .ki-lab[data-ki-lab="v7519"] .ki-lab__stage-head{
    min-height:152px!important;
    align-content:start!important;
  }
  html body.service-ki .ki-lab[data-ki-lab="v7519"] .ki-lab__stage-head>div:first-child{
    min-height:78px!important;
  }
  html body.service-ki .ki-lab[data-ki-lab="v7519"] .ki-lab__stage-head h3{
    min-height:2.25em!important;
    margin-bottom:6px!important;
  }
  html body.service-ki .ki-lab[data-ki-lab="v7519"] .ki-lab__stop{
    min-height:74px!important;
    display:grid!important;
    align-content:center!important;
  }
  html body.service-ki .ki-lab[data-ki-lab="v7519"] .ki-lab__stop strong{
    min-height:2.7em!important;
  }
  html body.service-ki .ki-lab[data-ki-lab="v7519"] .ki7533-state dd{
    min-height:2.7em!important;
    display:flex!important;
    align-items:flex-start!important;
  }
  html body.service-ki .ki-lab[data-ki-lab="v7519"] .ki-p1-result__grid strong{
    min-height:2.8em!important;
  }

  /* Cause → effect → next action remains readable but no longer uses 8–9 px
     labels. The rows keep a stable rhythm across stress states. */
  html body.service-ki .ki-lab[data-ki-lab="v7519"] .ki-causality>div{
    grid-template-columns:88px minmax(0,1fr)!important;
    min-height:58px!important;
    padding:10px 11px!important;
  }
  html body.service-ki .ki-lab[data-ki-lab="v7519"] .ki-causality span{
    font-size:10px!important;
    line-height:1.2!important;
    letter-spacing:.055em!important;
  }
  html body.service-ki .ki-lab[data-ki-lab="v7519"] .ki-causality strong{
    font-size:12px!important;
    line-height:1.38!important;
  }

  /* 4) Density: the three-step reading key is orientation, not a second essay.
     Keep the decision logic, suppress duplicate explanatory microcopy. */
  html body.service-ki .ki7533-logic{
    margin:10px 0 13px!important;
  }
  html body.service-ki .ki7533-logic>div{
    display:grid!important;
    grid-template-columns:92px minmax(0,1fr)!important;
    gap:9px!important;
    align-items:baseline!important;
    padding:8px 0!important;
  }
  html body.service-ki .ki7533-logic>div>span{
    font-size:9.5px!important;
    line-height:1.2!important;
  }
  html body.service-ki .ki7533-logic>div>strong{
    font-size:12px!important;
    line-height:1.3!important;
  }
  html body.service-ki .ki7533-logic>div>small{
    display:none!important;
  }

  /* Six stress choices need readable labels and 44+ px hit areas. */
  html body.service-ki .ki-lab[data-ki-lab="v7519"] .ki-lab__stress{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:7px!important;
  }
  html body.service-ki .ki-lab[data-ki-lab="v7519"] .ki-lab__stress button{
    min-height:48px!important;
    padding:9px 8px 9px 39px!important;
    font-size:11.5px!important;
    line-height:1.26!important;
  }

  /* The three mode choices remain side-by-side for comparison, but their
     operational labels leave the 8 px range. Descriptions are already hidden
     by the existing mobile contract. */
  html body.service-ki .ki-lab[data-ki-lab="v7519"] .ki-lab__mode{
    min-height:82px!important;
    padding:10px 8px!important;
  }
  html body.service-ki .ki-lab[data-ki-lab="v7519"] .ki-lab__mode span{
    font-size:9.5px!important;
    line-height:1.2!important;
  }
  html body.service-ki .ki-lab[data-ki-lab="v7519"] .ki-lab__mode strong{
    font-size:11.5px!important;
    line-height:1.24!important;
  }

  /* 5) Mobile microtype floor for operational information. Decorative SVG
     annotations stay governed by their own viewBox-scale typography. */
  html body.service-ki .ki-lab[data-ki-lab="v7519"] :is(
    .ki-lab__mini,.ki7533-effect,.ki-p1-result__grid span,
    .ki-task-detail__grid span,.ki7520-result__top span,
    .ki7520-result__triad span,.ki7520-proofline>span
  ){
    font-size:10px!important;
    line-height:1.25!important;
  }
  html body.service-ki .ki-lab[data-ki-lab="v7519"] .ki-task-detail__eyebrow :is(span,b){
    font-size:9.5px!important;
    line-height:1.3!important;
  }
  html body.service-ki .ki-lab[data-ki-lab="v7519"] .ki-task-detail__grid strong{
    font-size:12.5px!important;
    line-height:1.45!important;
  }

  /* 6) Touch contract. Evidence selects previously stopped at 42 px; compact
     personalization buttons at 42 px. Both move to the same 44 px minimum. */
  html body.service-ki[data-nbc-ki-evidence-personalization="v7528"] .ki7528-state-control select,
  html body.service-ki[data-nbc-ki-evidence-personalization="v7528"] .ki-p1-conditions .ki-evidence-control select,
  html body.service-ki[data-nbc-ki-evidence-personalization="v7528"] .ki7520-personalize button,
  html body.service-ki .ki-lab[data-ki-lab="v7519"] .ki-lab__field select,
  html body.service-ki .ki-lab[data-ki-lab="v7519"] .ki-p1-work-details>summary,
  html body.service-ki .ki-lab[data-ki-lab="v7519"] .ki-p1-pilot-details>summary{
    min-height:44px!important;
    height:auto!important;
  }

  /* Result/economics summaries are secondary depth: keep them easy to open,
     but avoid tiny labels that make the lower half feel denser than it is. */
  html body.service-ki .ki-lab[data-ki-lab="v7519"] :is(.ki-p1-work-details>summary,.ki-p1-pilot-details>summary){
    font-size:12px!important;
    line-height:1.35!important;
  }
}

/* Tablet KI: keep the visual height invariant there as well. */
@media (min-width:621px) and (max-width:980px){
  html body.service-ki .ki-lab[data-ki-visual="v7519"] .ki-flow__canvas,
  html body.service-ki .ki-lab[data-ki-visual="v7519"] .ki-flow[data-signature] .ki-flow__canvas{
    height:1240px!important;
    min-height:1240px!important;
  }
}


/* v7.563 · ERP mobile provider tabs: full provider names, no truncation. */
@media (max-width:760px){
  html body.service-erp #erp-belastungsprobe .ec-mobile-provider-tabs{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:8px!important;
  }
  html body.service-erp #erp-belastungsprobe .ec-mobile-provider-tab{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;
    justify-items:center!important;
    align-content:center!important;
    gap:5px!important;
    min-width:0!important;
    min-height:68px!important;
    padding:8px 4px!important;
    text-align:center!important;
  }
  html body.service-erp #erp-belastungsprobe .ec-mobile-provider-tab .ec-provider-letter{
    margin:0!important;
  }
  html body.service-erp #erp-belastungsprobe .ec-mobile-provider-tab strong{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    white-space:normal!important;
    overflow:visible!important;
    text-overflow:clip!important;
    overflow-wrap:normal!important;
    text-align:center!important;
    font-size:10.5px!important;
    line-height:1.1!important;
  }
}

/* v7.563 · layered override: legacy important rules must be superseded inside their own layer. */
@layer nbc.legacy {
  @media (max-width:760px){
    html body.service-erp #erp-belastungsprobe .ec-mobile-provider-tab{
      display:grid!important;
      grid-template-columns:minmax(0,1fr)!important;
      grid-template-rows:auto auto!important;
      justify-items:center!important;
      align-content:center!important;
      gap:5px!important;
      min-height:68px!important;
      padding:8px 4px!important;
      text-align:center!important;
    }
    html body.service-erp #erp-belastungsprobe .ec-mobile-provider-tab .ec-provider-letter{
      margin:0!important;
    }
    html body.service-erp #erp-belastungsprobe .ec-mobile-provider-tab strong{
      display:block!important;
      width:100%!important;
      min-width:0!important;
      white-space:normal!important;
      overflow:visible!important;
      text-overflow:clip!important;
      overflow-wrap:normal!important;
      text-align:center!important;
      font-size:10.5px!important;
      line-height:1.1!important;
    }
  }
}
