/* BellPath final mobile and layout polish */
:root{
  --bp-safe-bottom: max(18px, env(safe-area-inset-bottom));
}
html{
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body{
  overflow-x: hidden;
  padding-bottom: calc(176px + var(--bp-safe-bottom)) !important;
}
input,select,textarea,button,.btn,a.btn{
  font-size: 16px;
}
input[type="number"],
input[type="date"],
input[type="time"],
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea{
  min-height: 46px;
}
.bp-stacked-info{
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  max-width: min(620px, 100%) !important;
  align-items: stretch !important;
}
.bp-stacked-info > *{
  width: 100% !important;
}
.bp-setup-chip{
  border-color: rgba(81,194,120,.45) !important;
  color: #a7efbd !important;
}
#bellpath-nav-helper{
  position: static !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  max-width: 1240px !important;
  margin: 10px auto 14px !important;
  padding: 0 18px !important;
  z-index: auto !important;
}
#bellpath-nav-helper button,
#bellpath-nav-helper a{
  box-shadow: none !important;
}
#bpSyncMiniStatus{
  position: fixed !important;
  right: 14px !important;
  bottom: calc(78px + var(--bp-safe-bottom)) !important;
  left: auto !important;
  max-width: min(310px, calc(100vw - 28px)) !important;
  white-space: normal !important;
  border-radius: 16px !important;
  text-align: center !important;
}
.ai-fab{
  bottom: calc(18px + var(--bp-safe-bottom)) !important;
}
.ai-panel{
  bottom: calc(84px + var(--bp-safe-bottom)) !important;
}
.time-card,
.bp-clock-card{
  position: sticky;
  top: 86px;
}
.time-card .btnrow,
.bp-clock-card .btnrow{
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
.time-card .btnrow .btn,
.bp-clock-card .btnrow .btn{
  width: 100% !important;
  min-height: 52px !important;
}
.field-grid{
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)) !important;
}
.pay-layout{
  grid-template-columns: minmax(0,1.08fr) minmax(310px,.92fr) !important;
  align-items: start !important;
}
.card,.module,.tool-card,.action-card,.chart-card,.kpi-card,.metric-card{
  min-width: 0 !important;
}
h1,h2,h3,p,li,label,.lead,.fine,.btn,.card,.outbox,.ai-output{
  overflow-wrap: anywhere;
}
@media(max-width: 900px){
  .pay-layout{
    grid-template-columns: 1fr !important;
  }
  .time-card,
  .bp-clock-card{
    position: static !important;
  }
}
@media(max-width: 720px){
  body{
    padding-bottom: calc(236px + var(--bp-safe-bottom)) !important;
  }
  .wrap,.shell,.bp-shell-wrap{
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  .hero,.grid,.two,.result-grid,.kpi-grid,.metric-row,.module-grid,.tool-grid,.chart-grid{
    grid-template-columns: 1fr !important;
  }
  .btnrow,.row{
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .btn,a.btn,button.btn,input[type="button"],input[type="submit"]{
    width: 100% !important;
    min-height: 48px !important;
  }
  .time-card .btnrow,
  .bp-clock-card .btnrow{
    grid-template-columns: 1fr !important;
  }
  #bellpath-nav-helper{
    margin: 8px 0 10px !important;
    padding: 0 12px !important;
  }
  #bellpath-nav-helper button,
  #bellpath-nav-helper a{
    flex: 1 1 calc(50% - 8px) !important;
    min-height: 42px !important;
    text-align: center !important;
  }
  #bpSyncMiniStatus{
    left: 12px !important;
    right: 12px !important;
    bottom: calc(74px + var(--bp-safe-bottom)) !important;
    max-width: none !important;
    padding: 8px 10px !important;
  }
  .ai-fab{
    left: 12px !important;
    right: 12px !important;
    width: calc(100vw - 24px) !important;
    bottom: calc(14px + var(--bp-safe-bottom)) !important;
  }
  .ai-panel{
    left: 12px !important;
    right: 12px !important;
    bottom: calc(74px + var(--bp-safe-bottom)) !important;
    width: auto !important;
  }
}
@media print{
  #bpSyncMiniStatus,#bellpath-nav-helper,.ai-fab,.ai-panel{
    display: none !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;}
