
/* HBA compact app shell r4 — scale and safe layout for all site pages. */
/* Never apply CSS zoom/transform to the document: it distorts hit targets. */
:root{--hba-compact-sidebar:210px}
@media(min-width:800px){
  /* Tailwind rem-based sizing in the React app; keeps cards/text proportional. */
  html:has(#root){font-size:14px!important}
  /* RAW uses the injected PhysioState sidebar, NOT the normal React menu. */
  body.physio-injected-rail #hba-rail.physio-unified-rail{
    position:fixed!important;inset:0 auto 0 0!important;
    left:0!important;right:auto!important;top:0!important;bottom:0!important;
    width:var(--hba-compact-sidebar)!important;min-width:var(--hba-compact-sidebar)!important;max-width:var(--hba-compact-sidebar)!important;
    height:100dvh!important;min-height:0!important;max-height:100dvh!important;
    margin:0!important;padding:0!important;
    border:0!important;border-right:1px solid rgba(210,223,236,.17)!important;
    border-radius:0!important;box-shadow:none!important;
  }
  body.physio-injected-rail #root{
    box-sizing:border-box!important;
    margin:0 0 0 var(--hba-compact-sidebar)!important;
    padding:0!important;width:calc(100% - var(--hba-compact-sidebar))!important;
    max-width:calc(100% - var(--hba-compact-sidebar))!important;min-width:0!important;
  }
  body.physio-injected-rail #root>div{box-sizing:border-box!important;min-width:0!important;max-width:100%!important}
  body.physio-injected-rail #root main{min-width:0!important;max-width:100%!important}
  /* All other normal React pages: compact their built-in sidebar as well. */
  body:not(.physio-injected-rail):has(#root) #root aside:not([role="dialog"]){
    box-sizing:border-box!important;
    width:210px!important;min-width:210px!important;max-width:210px!important;
    flex:0 0 210px!important;margin-left:8px!important;
    top:8px!important;height:calc(100dvh - 16px)!important;max-height:calc(100dvh - 16px)!important;
    border-radius:18px!important;
  }
  body:not(.physio-injected-rail):has(#root) #root main{min-width:0!important;flex:1 1 0%!important}
  body:has(#root) #root main h1{font-size:clamp(25px,2.65vw,36px)!important;line-height:1.12!important}
  body:has(#root) #root main h2{font-size:clamp(17px,1.7vw,24px)!important;line-height:1.23!important}
  body:has(#root) #root main>div{max-width:1600px!important}
}
/* Shared navigation proportions: applies to RAW injected rail and EAN static rail. */
#hba-rail.physio-unified-rail .hba-brand{
  padding:10px 12px!important;min-height:57px!important;box-sizing:border-box!important
}
#hba-rail.physio-unified-rail .hba-brand a{
  font:700 15px/1.15 system-ui,sans-serif!important;gap:9px!important
}
#hba-rail.physio-unified-rail .hba-brand small{
  font:700 8px/1.3 system-ui,sans-serif!important;letter-spacing:.9px!important;margin-top:3px!important
}
#hba-rail.physio-unified-rail .hba-logo,
#hba-rail.physio-unified-rail .hba-logo svg{width:31px!important;height:31px!important;flex:0 0 31px!important}
#hba-rail.physio-unified-rail nav{
  padding:11px 8px 14px!important;overflow-x:hidden!important;overflow-y:auto!important
}
#hba-rail.physio-unified-rail .hba-group{margin:0 0 13px!important}
#hba-rail.physio-unified-rail .hba-group>p{
  font:750 9px/1.35 system-ui,sans-serif!important;letter-spacing:1px!important;margin:4px 9px 5px!important
}
#hba-rail.physio-unified-rail .hba-link{
  font:600 12.5px/1.25 system-ui,sans-serif!important;
  min-height:36px!important;gap:9px!important;padding:6px 10px!important;
  border-radius:9px!important;box-sizing:border-box!important
}
#hba-rail.physio-unified-rail .hba-link svg{
  width:16px!important;height:16px!important;flex:0 0 16px!important
}
#hba-rail.physio-unified-rail .hba-footer{
  flex:0 0 auto!important;min-height:38px!important;padding:9px 13px!important;font-size:10px!important;
  white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important
}
@media(min-width:800px) and (max-width:1050px){
  :root{--hba-compact-sidebar:188px}
  body:not(.physio-injected-rail):has(#root) #root aside:not([role="dialog"]){
    width:188px!important;min-width:188px!important;max-width:188px!important;flex-basis:188px!important
  }
}
@media(max-width:799px){
  /* RAW mobile: compact horizontal navigation that does not cover the content. */
  body.physio-injected-rail #hba-rail.physio-unified-rail{
    position:relative!important;inset:auto!important;top:auto!important;left:auto!important;right:auto!important;bottom:auto!important;
    width:100%!important;max-width:100%!important;min-width:0!important;
    height:auto!important;max-height:none!important;margin:0!important;
    border:0!important;border-bottom:1px solid rgba(215,230,241,.16)!important;border-radius:0!important;box-shadow:none!important
  }
  body.physio-injected-rail{display:flex!important;flex-direction:column!important;min-width:0!important}
  body.physio-injected-rail #root{order:2!important;width:100%!important;max-width:100%!important;min-width:0!important;margin:0!important;padding:0!important}
  body.physio-injected-rail #hba-rail.physio-unified-rail{order:1!important}
  body.physio-injected-rail #hba-rail.physio-unified-rail .hba-brand{min-height:49px!important;padding:7px 12px!important}
  body.physio-injected-rail #hba-rail.physio-unified-rail nav{
    display:flex!important;flex-flow:row nowrap!important;align-items:center!important;
    overflow-x:auto!important;overflow-y:hidden!important;max-height:51px!important;
    gap:8px!important;padding:6px 10px!important;scrollbar-width:thin!important
  }
  body.physio-injected-rail #hba-rail.physio-unified-rail .hba-group{flex:0 0 auto!important;margin:0!important}
  body.physio-injected-rail #hba-rail.physio-unified-rail .hba-group>p{display:none!important}
  body.physio-injected-rail #hba-rail.physio-unified-rail .hba-group>div{display:flex!important;flex-direction:row!important;gap:6px!important}
  body.physio-injected-rail #hba-rail.physio-unified-rail .hba-link{white-space:nowrap!important;font-size:12px!important;min-height:36px!important}
  body.physio-injected-rail #hba-rail.physio-unified-rail .hba-footer{display:none!important}
}
/* Small safety: no horizontal viewport caused by fixed sidebar widths. */
body.physio-injected-rail{overflow-x:clip!important}
