/* Installed-app fixes (iPhone home-screen app draws under the status bar / home bar).
   env(safe-area-inset-*) is 0 in a normal browser tab, so this only changes the app. */
header.top,header.nav{padding-top:env(safe-area-inset-top)}
.jump{top:calc(76px + env(safe-area-inset-top))}
@media (max-width:600px){.jump{top:calc(68px + env(safe-area-inset-top))}}
.side{top:calc(96px + env(safe-area-inset-top))}
/* Slide-over panels: room for the status bar, and smooth touch scrolling that stays inside the panel */
.pdrawer,.drawer{padding-top:calc(28px + env(safe-area-inset-top));padding-bottom:calc(28px + env(safe-area-inset-bottom));overscroll-behavior:contain;-webkit-overflow-scrolling:touch;height:100%;max-height:100dvh}
@media (max-width:600px){.pdrawer,.drawer{padding-top:calc(20px + env(safe-area-inset-top));padding-bottom:calc(24px + env(safe-area-inset-bottom))}}
.sheet,dialog{overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
dialog[open]{max-height:calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}
html.panel-open{overflow:hidden}
.toast{bottom:calc(28px + env(safe-area-inset-bottom))}
/* Wide tables (clients, roster) scroll sideways instead of being cut off */
.sbody>*{min-width:0}
.tablecard{max-width:100%;-webkit-overflow-scrolling:touch}

/* ---------- Apple HIG polish (phase 1) ---------- */
/* Every tap target gets a hit region of at least 44x44 pt. Small controls keep their look;
   an invisible area around them catches the tap. */
:where(.linkbtn,.linkx,.bkcb,.clink,a.logo,a.back,.cclink,.vwd,.ax,.chipbtn,.bkf,.btn.small:not(.solid),
  [data-show],[data-all],[data-toggle],[data-ics],[data-cf],[data-tday],[data-mode],[data-svbtn],a.mail,nav>a){position:relative}
:where(.linkbtn,.linkx,.bkcb,.clink,a.logo,a.back,.cclink,.vwd,.ax,.chipbtn,.bkf,.btn.small:not(.solid),
  [data-show],[data-all],[data-toggle],[data-ics],[data-cf],[data-tday],[data-mode],[data-svbtn],a.mail,nav>a)::after{
  content:"";position:absolute;left:50%;top:50%;width:max(100%,44px);height:max(100%,44px);transform:translate(-50%,-50%)}
/* Form fields and option buttons: 44 pt tall */
:where(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]),select,button.opt,summary){min-height:44px}
:where(input[type=checkbox],input[type=radio]){position:relative}
/* Reduce Motion: honour the system setting everywhere */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
}
