/* KARETA r64 — final smoke closeout guards for manual route redesign.
   Scope: final route-level cleanup only. No business logic. */

/* Shared final variables */
:root{
  --r64-bg:#eef0f2;
  --r64-card:#fff;
  --r64-line:#e7e8eb;
  --r64-text:#080b10;
  --r64-muted:#6f747d;
  --r64-orange:#ffb000;
  --r64-orange2:#ff9800;
}

/* Ensure route classes on html/body/#app all behave identically. */
html:is(.kr-route-myorders,.kr-route-messages,.kr-route-masters,.kr-route-cabinet,.kr-route-parts),
body:is(.kr-route-myorders,.kr-route-messages,.kr-route-masters,.kr-route-cabinet,.kr-route-parts),
#app:is(.kr-route-myorders,.kr-route-messages,.kr-route-masters,.kr-route-cabinet,.kr-route-parts){
  background:var(--r64-bg) !important;
}

/* Final alignment of the manually redesigned pages. */
body:is(.kr-route-myorders,.kr-route-messages,.kr-route-masters,.kr-route-cabinet,.kr-route-parts)
:where(#hero-myorders,#hero-messages,#hero-parts,.kr-screen--masters,.cab-pane > .container,.parts-reference-r61-container,.msng-page-content,.myorders-reference-r57 .container){
  box-sizing:border-box !important;
  color:var(--r64-text) !important;
}

/* No hidden wide children after all route passes. */
body:is(.kr-route-myorders,.kr-route-messages,.kr-route-masters,.kr-route-cabinet,.kr-route-parts)
:where(.container,.spa-content,.spa-page,.page,main,section,article,div){
  box-sizing:border-box;
}

/* Prevent old route tools from covering content after sticky/fixed changes. */
body:is(.kr-route-myorders,.kr-route-messages,.kr-route-parts)
:where(#myorders-sticky-tools,#msng-sticky-tools,#parts-sticky-tools,.catalog-tools){
  position:relative !important;
  top:auto !important;
  left:auto !important;
  right:auto !important;
}

/* Modal cleanup: if old cab-pane-modal is still injected by stale cache, hide it hard. */
#cab-pane-modal,
.cab-pane-modal-overlay{
  display:none !important;
  visibility:hidden !important;
  pointer-events:none !important;
}

/* Fine-tune card heights on PC so route pages look intentional, not stretched. */
@media (min-width:1120px){
  body.kr-route-myorders .mo-card,
  body.kr-route-messages .msng-item--v2,
  body.kr-route-masters .kr-master-screen-card,
  body.kr-route-parts .parts-category-card,
  body.kr-route-parts .part-card-v2{
    height:100% !important;
  }
}

/* Final mobile text safety. */
@media (max-width:430px){
  body:is(.kr-route-myorders,.kr-route-messages,.kr-route-masters,.kr-route-cabinet,.kr-route-parts)
  :where(.mo-card-actions,.detail-actions,.order-actions,.vehicle-actions){
    gap:7px !important;
  }

  body:is(.kr-route-myorders,.kr-route-messages,.kr-route-masters,.kr-route-cabinet,.kr-route-parts)
  :where(.btn,.button,button){
    min-height:38px !important;
    padding-left:10px !important;
    padding-right:10px !important;
  }
}

/* Last overflow guard. */
body:is(.kr-route-myorders,.kr-route-messages,.kr-route-masters,.kr-route-cabinet,.kr-route-parts)
:where(h1,h2,h3,h4,p,span,small,b,strong,a,button,label,input,textarea,select){
  min-width:0 !important;
  overflow-wrap:anywhere !important;
}
