/* BellPathOS v1.7 Universal Device Layout Guard
   Purpose: preserve full app value while preventing device-width overflow on phones/tablets/desktops. */
:root{
  --bp-safe-pad: clamp(14px, 3.5vw, 28px);
  --bp-card-radius: 22px;
  --bp-tap: 44px;
}
html{width:100%;max-width:100%;overflow-x:hidden;box-sizing:border-box;-webkit-text-size-adjust:100%;text-size-adjust:100%;}
*,*::before,*::after{box-sizing:inherit;}
body{width:100%;max-width:100%;min-width:0;overflow-x:hidden;margin-left:0;margin-right:0;}
img,svg,canvas,video,iframe,embed,object{max-width:100%;height:auto;}
pre,code,kbd,samp{white-space:pre-wrap;overflow-wrap:anywhere;}
table{max-width:100%;border-collapse:collapse;}
input,select,textarea,button{max-width:100%;font:inherit;}
a,button,[role="button"],input,select,textarea{touch-action:manipulation;}
.bp-device-wrap-table{display:block;width:100%;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;}
.bp-overflow-fixed{max-width:100%!important;min-width:0!important;}
@media (max-width: 900px){
  body{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right);}
  main,.main,.container,.page,.page-shell,.shell,.dashboard,.dashboard-shell,.command-shell,.content,.site-main,.bp-shell,.bp-page,.wrap,.wrapper,#app,#root{
    width:100%!important;max-width:100%!important;min-width:0!important;margin-left:auto!important;margin-right:auto!important;overflow-x:hidden!important;
  }
  .grid,.cards,.card-grid,.tiles,.tile-grid,.app-grid,.dashboard-grid,.command-grid,.product-grid,.bundle-grid,.pricing-grid,.feature-grid,.stats-grid,.kpi-grid,.panel-grid,.report-grid,
  [class*="grid"],[class*="Grid"]{
    grid-template-columns:1fr!important;max-width:100%!important;min-width:0!important;gap:clamp(12px,3vw,20px)!important;
  }
  .row,.columns,.cols,.split,.two-column,.three-column,.layout,.dashboard-layout,.command-layout,[class*="row"],[class*="Row"]{
    flex-wrap:wrap!important;max-width:100%!important;min-width:0!important;
  }
  .card,.tile,.panel,.module,.widget,.section,.box,.stat,.kpi,.feature,.app-card,.product-card,.bundle-card,.report-card,
  [class*="card"],[class*="Card"],[class*="tile"],[class*="Tile"],[class*="panel"],[class*="Panel"]{
    max-width:100%!important;min-width:0!important;overflow-wrap:anywhere;
  }
  aside,.sidebar,.side-nav,.side-rail,.siderail,.desktop-nav,.desktop-sidebar,[class*="side-rail"],[class*="SideRail"]{
    max-width:100%!important;min-width:0!important;
  }
  nav,header,footer{max-width:100%!important;min-width:0!important;}
  .bp-mobile-drawer,.mobile-menu,.mobile-nav,.drawer,.nav-drawer,[data-mobile-menu]{
    max-width:100vw!important;min-width:0!important;
  }
  .bp-shell-pad{padding-left:var(--bp-safe-pad)!important;padding-right:var(--bp-safe-pad)!important;}
  a.button,button,.btn,.cta,.pill,[class*="button"],[class*="Button"]{min-height:var(--bp-tap);white-space:normal;}
}
@media (max-width: 640px){
  html,body{position:relative;}
  h1{font-size:clamp(2rem,9vw,3.4rem)!important;line-height:1.05!important;}
  h2{font-size:clamp(1.45rem,6vw,2.4rem)!important;line-height:1.12!important;}
  h3{font-size:clamp(1.1rem,4.5vw,1.55rem)!important;}
  p,li,label,input,select,textarea,button{font-size:clamp(.96rem,3.8vw,1.05rem);}
  section,main,.section,.hero,.panel,.card,.tile{padding-left:min(var(--bp-safe-pad),20px)!important;padding-right:min(var(--bp-safe-pad),20px)!important;}
  .hero,.header-hero,.landing-hero{overflow:hidden;}
  .bottom-nav,.mobile-bottom-nav{width:100vw!important;max-width:100vw!important;left:0!important;right:0!important;}
}



/* BellPathOS v2.5 Landscape / tablet guard
   Keeps desktop, tablet-landscape, and phone-landscape usable without stripping app features. */
:root{--bp-vh:1vh;--bp-landscape-pad:clamp(8px,1.6vw,18px);--bp-landscape-gap:clamp(8px,1.4vw,14px)}
html.bp-landscape-active,html.bp-landscape-active body{overflow-x:hidden!important;max-width:100%!important;}
html.bp-landscape-active body{min-height:calc(var(--bp-vh,1vh) * 100)!important;}
html.bp-landscape-active .bp-landscape-hide{display:none!important}
@media (orientation: landscape) and (max-height: 760px), (max-width: 1180px) and (max-height: 760px){
  html,body{overflow-x:hidden!important;-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}
  body{font-size:clamp(13px,1.35vw,15px)!important;}
  .wrap,.wrapper,.main,.main-content,.container,.page,.page-shell,.shell,.dashboard,.dashboard-shell,.command-shell,.content,.site-main,.bp-shell,.bp-page,#app,#root{
    width:100%!important;max-width:100%!important;min-width:0!important;padding-left:var(--bp-landscape-pad)!important;padding-right:var(--bp-landscape-pad)!important;padding-top:8px!important;padding-bottom:calc(76px + env(safe-area-inset-bottom))!important;margin-left:auto!important;margin-right:auto!important;overflow-x:hidden!important;
  }
  header,.top,.app-header,.hdr,.site-header,.page-header,.bp-header{
    min-height:44px!important;padding:6px var(--bp-landscape-pad)!important;gap:8px!important;align-items:center!important;max-width:100%!important;overflow-x:hidden!important;
  }
  .logo,.header-logo,.hdr-logo,img.logo,.brand-logo{max-height:48px!important;width:auto!important;max-width:120px!important;object-fit:contain!important;}
  h1{font-size:clamp(26px,4.2vw,46px)!important;line-height:1.02!important;margin-top:6px!important;margin-bottom:8px!important;letter-spacing:-.035em!important;}
  h2{font-size:clamp(20px,2.8vw,30px)!important;line-height:1.1!important;margin-bottom:6px!important;}
  h3{font-size:clamp(16px,2vw,22px)!important;line-height:1.15!important;}
  p,.lead,li,label,input,select,textarea,button,.btn{font-size:clamp(12px,1.45vw,15px)!important;line-height:1.35!important;}
  .lead{max-width:100%!important;margin-bottom:8px!important;}
  .hero,.header-hero,.landing-hero,.feature,.card,.tile,.panel,.module,.widget,.section,.box,.stat,.kpi,.feature-card,.app-card,.product-card,.bundle-card,.report-card,.metric-card,.kpi-card,.tool-card,.action-card,.chart-card{
    min-width:0!important;max-width:100%!important;min-height:0!important;padding:clamp(10px,1.5vw,16px)!important;margin-top:8px!important;margin-bottom:8px!important;border-radius:clamp(14px,2vw,22px)!important;overflow-wrap:anywhere!important;
  }
  .hero{display:block!important;}
  .grid,.cards,.card-grid,.tiles,.tile-grid,.app-grid,.dashboard-grid,.command-grid,.product-grid,.bundle-grid,.pricing-grid,.feature-grid,.stats-grid,.kpi-grid,.panel-grid,.report-grid,.metric-row,.metric-grid,.module-grid,.tool-grid,.chart-grid,.result-grid,.valuation-grid,.quick-grid,.choice-grid{
    display:grid!important;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr))!important;gap:var(--bp-landscape-gap)!important;align-items:stretch!important;max-width:100%!important;min-width:0!important;
  }
  .two,.three,.split,.split-fields,.columns,.cols,.dashboard-layout,.command-layout,.pay-layout,.pro-shell,.profit-shell{
    display:grid!important;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr))!important;gap:var(--bp-landscape-gap)!important;max-width:100%!important;min-width:0!important;align-items:start!important;
  }
  .btnrow,.row,.hero-actions,.footer-actions,.header-actions,.nav,.tabs,.tabbar,.toolbar,.action-row,.export-actions{
    gap:8px!important;max-width:100%!important;overflow-x:auto!important;scrollbar-width:thin!important;display:flex!important;flex-wrap:wrap!important;align-items:center!important;
  }
  .tabs,.tabbar{position:sticky!important;top:0!important;z-index:45!important;background:rgba(7,16,11,.96)!important;backdrop-filter:blur(10px)!important;}
  .tab,.tabs button,.tabbtn,.btn,a.btn,button.btn,input[type="button"],input[type="submit"],button,[role="button"]{
    min-height:36px!important;padding:7px 11px!important;border-radius:12px!important;width:auto!important;max-width:100%!important;white-space:normal!important;line-height:1.18!important;
  }
  .btnrow .btn,.hero-actions .btn,.footer-actions .btn{flex:0 1 auto!important;}
  .kpi-card .num,.metric-card .n,.metric,.kpi,.stat-number,.value,.big-number{font-size:clamp(22px,4vw,44px)!important;line-height:1!important;margin-bottom:4px!important;}
  .table-wrap,.bp-device-wrap-table{max-width:100%!important;overflow-x:auto!important;}
  table{min-width:min(760px,100%)!important;width:100%!important;}
  textarea{min-height:72px!important;}
  input,select,textarea{min-height:36px!important;padding:8px 10px!important;}
  .ai-fab,.bp-ai-fab{width:auto!important;min-width:44px!important;min-height:44px!important;left:auto!important;right:12px!important;bottom:calc(12px + env(safe-area-inset-bottom))!important;padding:10px 13px!important;border-radius:999px!important;}
  .ai-panel,.bp-ai-panel{max-height:calc((var(--bp-vh,1vh) * 100) - 82px)!important;bottom:66px!important;left:12px!important;right:12px!important;width:auto!important;overflow:auto!important;}
  .mobile-bottom-nav,.bottom-nav,.bp-bottom-nav{height:auto!important;min-height:48px!important;padding:6px 8px calc(6px + env(safe-area-inset-bottom))!important;}
  .mobile-bottom-nav a,.bottom-nav a,.bp-bottom-nav a{font-size:11px!important;padding:5px 7px!important;min-height:36px!important;}
  .side,.sidebar,.side-nav,.side-rail,.siderail,.desktop-nav,.desktop-sidebar{max-width:100%!important;min-width:0!important;overflow-x:hidden!important;}
  .side a,.sidebar a,.side-nav a{min-height:38px!important;padding:8px 10px!important;}
  iframe,.app-frame{width:100%!important;max-width:100%!important;height:min(620px,calc((var(--bp-vh,1vh) * 100) - 140px))!important;min-height:360px!important;}
  .modal,.dialog,.drawer,.mobile-menu,.bp-mobile-drawer,[data-bp-mobile-menu]{max-height:calc((var(--bp-vh,1vh) * 100) - 20px)!important;overflow:auto!important;}
}
@media (orientation: landscape) and (max-height:520px){
  .hero,.feature{padding:10px 12px!important;}
  h1{font-size:clamp(24px,3.2vw,36px)!important;}
  h2{font-size:clamp(18px,2.2vw,26px)!important;}
  .card,.tile,.panel,.module,.widget,.metric-card,.kpi-card{padding:9px 11px!important;margin-top:6px!important;margin-bottom:6px!important;}
  .grid,.cards,.kpi-grid,.metric-row,.dashboard-grid,.command-grid,.tool-grid{gap:8px!important;}
  .btn,a.btn,button,.tab,.tabbtn{min-height:32px!important;padding:6px 9px!important;font-size:12px!important;}
  .logo,.header-logo,.hdr-logo,img.logo{max-height:40px!important;max-width:96px!important;}
}
@media (orientation: landscape) and (min-width: 900px) and (max-height: 760px){
  .kpi-grid,.metric-row,.metric-grid,.stats-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;}
  .dashboard-grid,.command-grid,.cards,.card-grid{grid-template-columns:repeat(auto-fit,minmax(260px,1fr))!important;}
}
/* Extra protection for downloaded/direct-upload landscape tests. */
html.bp-landscape-active .card,html.bp-landscape-active .tile,html.bp-landscape-active .panel,html.bp-landscape-active .module{min-height:0!important;}
html.bp-landscape-active .bp-landscape-grid{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr))!important;gap:var(--bp-landscape-gap)!important;}
