/* ============================================================
   LEGAL CENTRE — WORKSPACE INTEGRITY MASTER V6
   Loaded after legacy workspace styles. This is the authoritative mobile
   flow/sizing layer for Client Home + workspace child pages.
   ============================================================ */

@media(max-width:900px){
  html,body{max-width:100%!important;overflow-x:hidden!important}

  body.lc-mobile-os-v2 .lcws,
  body.lc-mobile-os-v2 .lcav5{
    width:100%!important;
    max-width:100%!important;
    padding-top:10px!important;
    overflow:visible!important;
  }

  body.lc-mobile-os-v2 .lcws-shell,
  body.lc-mobile-os-v2 .lcav5-shell{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-auto-flow:row!important;
    align-items:start!important;
    width:calc(100% - 20px)!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0 auto!important;
    padding:0!important;
    gap:0!important;
    overflow:visible!important;
  }

  body.lc-mobile-os-v2 .lcws-main,
  body.lc-mobile-os-v2 .lcav5-main{
    position:relative!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0!important;
    padding-top:var(--lcw6-main-repair,0px)!important;
    transform:none!important;
    translate:none!important;
    overflow:visible!important;
    z-index:auto!important;
  }

  /* Never show page text through the workspace selector. */
  body.lc-mobile-os-v2 .lcmv5-slot,
  body.lc-mobile-os-v2 .lcmv5-trigger{
    opacity:1!important;
    filter:none!important;
    -webkit-filter:none!important;
    -webkit-backdrop-filter:none!important;
    backdrop-filter:none!important;
  }

  /* First content blocks may not climb behind the sticky selector. */
  body.lc-mobile-os-v2 .lcws-main>:first-child,
  body.lc-mobile-os-v2 .lcav5-main>:first-child{
    margin-top:0!important;
    transform:none!important;
    translate:none!important;
  }

  body.lc-mobile-os-v2 .lcwm-head,
  body.lc-mobile-os-v2 .lcav5-head,
  body.lc-mobile-os-v2 .lcav5-focus,
  body.lc-mobile-os-v2 .lcw-hero,
  body.lc-mobile-os-v2 .lcp-top,
  body.lc-mobile-os-v2 .lbi-top,
  body.lc-mobile-os-v2 .lcbr-top,
  body.lc-mobile-os-v2 .lcv-hero{
    position:relative!important;
    top:auto!important;
    margin-top:0!important;
    transform:none!important;
    translate:none!important;
    z-index:1!important;
  }

  /* Workspace management header: stable, no clipped kicker/title/actions. */
  body.lc-mobile-os-v2 .lcwm-head{
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    gap:14px!important;
    width:100%!important;
    max-width:100%!important;
    margin:0 0 18px!important;
    padding:2px 2px 0!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
    overflow:visible!important;
  }
  body.lc-mobile-os-v2 .lcwm-head-copy{min-width:0!important;overflow:visible!important}
  body.lc-mobile-os-v2 .lcwm-k{
    display:block!important;
    margin:0 0 7px!important;
    color:#087443!important;
    font-size:9px!important;
    line-height:1.2!important;
    font-weight:800!important;
    letter-spacing:.085em!important;
    text-transform:uppercase!important;
    white-space:normal!important;
    overflow:visible!important;
  }
  body.lc-mobile-os-v2 .lcwm-head h1{
    margin:0!important;
    max-width:100%!important;
    color:#1c1c1e!important;
    font-size:clamp(32px,9vw,42px)!important;
    line-height:1.02!important;
    font-weight:760!important;
    letter-spacing:-.05em!important;
    overflow-wrap:anywhere!important;
  }
  body.lc-mobile-os-v2 .lcwm-head p{
    margin:8px 0 0!important;
    max-width:100%!important;
    color:#6b6b70!important;
    font-size:13.5px!important;
    line-height:1.48!important;
  }
  body.lc-mobile-os-v2 .lcwm-actions{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
    width:100%!important;
    min-width:0!important;
    justify-content:stretch!important;
  }
  body.lc-mobile-os-v2 .lcwm-actions .lcwm-primary,
  body.lc-mobile-os-v2 .lcwm-actions .lcwm-secondary{
    width:100%!important;
    min-width:0!important;
    min-height:46px!important;
    padding:0 14px!important;
    border-radius:14px!important;
    font-size:12px!important;
    white-space:normal!important;
  }

  /* Cards */
  body.lc-mobile-os-v2 .lcwm-card{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0 0 12px!important;
    padding:16px!important;
    border-radius:20px!important;
    box-shadow:none!important;
    overflow:hidden!important;
  }
  body.lc-mobile-os-v2 .lcwm-card-head{
    display:flex!important;
    flex-wrap:wrap!important;
    align-items:flex-start!important;
    justify-content:space-between!important;
    gap:8px 12px!important;
    min-width:0!important;
    margin-bottom:14px!important;
  }
  body.lc-mobile-os-v2 .lcwm-card-head>div{min-width:0!important;flex:1 1 210px!important}
  body.lc-mobile-os-v2 .lcwm-card-head h2{
    margin:0!important;font-size:18px!important;line-height:1.2!important;overflow-wrap:anywhere!important
  }
  body.lc-mobile-os-v2 .lcwm-card-head p{margin:5px 0 0!important;font-size:12px!important;line-height:1.45!important}
  body.lc-mobile-os-v2 .lcwm-count{
    flex:0 0 auto!important;
    min-width:max-content!important;
    max-width:100%!important;
    white-space:nowrap!important;
    word-break:keep-all!important;
    overflow-wrap:normal!important;
    min-height:30px!important;
    padding:0 10px!important;
    font-size:10px!important;
    line-height:30px!important;
  }

  body.lc-mobile-os-v2 .lcwm-empty{
    width:100%!important;max-width:100%!important;padding:28px 16px!important;border-radius:16px!important;
    font-size:13px!important;line-height:1.6!important;overflow-wrap:anywhere!important
  }
  body.lc-mobile-os-v2 .lcwm-empty b{font-size:12px!important}
  body.lc-mobile-os-v2 .lcwm-empty .lcwm-primary{
    display:inline-flex!important;max-width:100%!important;min-height:44px!important;margin-top:12px!important;padding:0 14px!important;
    white-space:normal!important
  }

  /* Forms: every input stays inside the viewport. */
  body.lc-mobile-os-v2 .lcwm-form-grid{
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:12px!important;width:100%!important;min-width:0!important
  }
  body.lc-mobile-os-v2 .lcwm-full{grid-column:auto!important}
  body.lc-mobile-os-v2 .lcwm-form-grid label{min-width:0!important;max-width:100%!important}
  body.lc-mobile-os-v2 .lcwm-form-grid input,
  body.lc-mobile-os-v2 .lcwm-form-grid select,
  body.lc-mobile-os-v2 .lcwm-form-grid textarea{
    width:100%!important;max-width:100%!important;min-width:0!important
  }
  body.lc-mobile-os-v2 .lcwm-form-grid input[type=file]{height:auto!important;min-height:46px!important;padding:9px!important}
  body.lc-mobile-os-v2 .lcwm-form-foot{
    display:grid!important;grid-template-columns:1fr!important;gap:8px!important;width:100%!important
  }
  body.lc-mobile-os-v2 .lcwm-form-foot>*{width:100%!important;min-height:44px!important}

  /* Tables: card conversion if Mobile OS V2 applies; otherwise internal scroll only. */
  body.lc-mobile-os-v2 .lcwm-table-wrap,
  body.lc-mobile-os-v2 .tablewrap,
  body.lc-mobile-os-v2 .tblwrap,
  body.lc-mobile-os-v2 .table-wrap{
    width:100%!important;max-width:100%!important;min-width:0!important;
    overflow-x:auto!important;overflow-y:hidden!important;-webkit-overflow-scrolling:touch!important;
    overscroll-behavior-x:contain!important;scrollbar-width:none!important
  }
  body.lc-mobile-os-v2 .lcwm-table-wrap::-webkit-scrollbar,
  body.lc-mobile-os-v2 .tablewrap::-webkit-scrollbar,
  body.lc-mobile-os-v2 .tblwrap::-webkit-scrollbar,
  body.lc-mobile-os-v2 .table-wrap::-webkit-scrollbar{display:none!important}

  /* Action groups never get clipped or force page side-scroll. */
  body.lc-mobile-os-v2 .lcwm-row-actions,
  body.lc-mobile-os-v2 .lcav5-card-actions,
  body.lc-mobile-os-v2 .actions{
    display:flex!important;flex-wrap:wrap!important;gap:7px!important;max-width:100%!important
  }
  body.lc-mobile-os-v2 .lcwm-row-actions>*{min-width:0!important;max-width:100%!important}

  /* Generic workspace overflow safety. */
  body.lc-mobile-os-v2 .lcws-main *,
  body.lc-mobile-os-v2 .lcav5-main *{box-sizing:border-box;min-inline-size:0}
  body.lc-mobile-os-v2 .lcws-main img,
  body.lc-mobile-os-v2 .lcav5-main img{max-width:100%!important;height:auto}
  body.lc-mobile-os-v2 .lcws-main :where(p,li,dd,dt,span,strong,b,small),
  body.lc-mobile-os-v2 .lcav5-main :where(p,li,dd,dt,span,strong,b,small){
    overflow-wrap:anywhere
  }

  /* Anchor jumps land below fixed header + sticky workspace control. */
  body.lc-mobile-os-v2 .lcws-main [id],
  body.lc-mobile-os-v2 .lcav5-main [id]{scroll-margin-top:142px!important}
}

@media(max-width:480px){
  body.lc-mobile-os-v2 .lcws,
  body.lc-mobile-os-v2 .lcav5{padding-top:8px!important}
  body.lc-mobile-os-v2 .lcwm-head h1{font-size:34px!important}
  body.lc-mobile-os-v2 .lcwm-card{padding:15px!important}
  body.lc-mobile-os-v2 .lcwm-card-head>div{flex-basis:190px!important}
}

@media print{
  .lcmv5-slot,.lcmv5-overlay{display:none!important}
  .lcws-main,.lcav5-main{padding-top:0!important}
}
