/* Fix101: only the five confirmed-failing coach sections own the vertical scroll. */
/* Fix103 - use one natural BODY scroller in coach subpages. Earlier 100dvh
   rules clipped controls below the mobile viewport. Keep game screens untouched. */
@media(max-width:900px){
  html:has(body.sa101CoachScroll),body.sa101CoachScroll{
    height:auto!important;min-height:100%!important;max-height:none!important;
    overflow-y:auto!important;overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch!important;touch-action:pan-y!important;
  }
  body.sa101CoachScroll #app{
    height:auto!important;min-height:100dvh!important;max-height:none!important;
    overflow:visible!important;box-sizing:border-box!important;
  }
  body.sa101CoachScroll #trainer,
  body.sa83Inner.sa99CoachSection.sa101CoachScroll #trainer.sa83Content{
    display:block!important;position:relative!important;
    height:auto!important;min-height:100dvh!important;max-height:none!important;
    overflow-y:visible!important;overflow-x:visible!important;
    touch-action:pan-y!important;overscroll-behavior:auto!important;
    padding-top:8px!important;
    padding-bottom:calc(140px + env(safe-area-inset-bottom))!important;
    box-sizing:border-box!important;
  }
  body.sa101CoachScroll #trainer .trSection:not(.hidden){
    height:auto!important;max-height:none!important;min-height:0!important;
    overflow:visible!important;touch-action:pan-y!important;
    padding-bottom:28px!important;
  }
  body.sa101CoachScroll #trainer .card,
  body.sa101CoachScroll #trainer .trainergrid,
  body.sa101CoachScroll #trainer .trainerFormGrid,
  body.sa101CoachScroll #trainer .toolbar{max-height:none!important;overflow:visible!important;}
  body.sa101CoachScroll #trainer .tablewrap,
  body.sa101CoachScroll #trainer .r59PreviewTable{
    max-width:100%!important;overflow-x:auto!important;
    overflow-y:visible!important;touch-action:pan-x pan-y!important;
  }
  body.sa101CoachScroll #trainer button{touch-action:manipulation!important;}
  /* Purchase stays independently scrollable even when opened from login. */
  #purchaseScreen:not(.hidden){height:100dvh!important;max-height:100dvh!important;
    overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;
    overscroll-behavior-y:contain!important;
    padding-bottom:calc(120px + env(safe-area-inset-bottom))!important;
    padding-inline:max(14px,env(safe-area-inset-right))!important;
    box-sizing:border-box!important;}
  #purchaseScreen .licenseRequestHero,#purchaseScreen .purchaseWrap{
    max-width:100%!important;min-width:0!important;overflow-wrap:anywhere!important;
  }
  #purchaseScreen h1,#purchaseScreen h2,#purchaseScreen h3{
    overflow-wrap:anywhere!important;max-width:100%!important;
  }
}
#sa101PurchaseGuide{margin:10px 0;padding:12px 14px!important;line-height:1.75;color:#244b43;background:#f6fbfa!important;border:1px solid #bbd8ce}
#sa101PurchaseGuide p{margin:7px 0;font-size:14px}
#sa101PurchaseStatus{padding:8px 11px;background:#eef7ff;border-radius:9px;color:#17426c;font-size:14px;font-weight:750}
#sa101PurchaseStatus[data-error="1"]{background:#fff0ea;color:#96331d}
#sa100RosterError{margin:8px 0;padding:10px;border:1px solid #e6bd96;border-radius:10px;background:#fff5e9;color:#784119}

/* Fix101: precise decimal-place columns; 97 aligns beneath 188 and 133. */
@media(max-width:900px){
 #r56ArenaPage .sa94QuestionArea .sa94Op{grid-template-columns:1.05em minmax(0,max-content)!important;column-gap:.36em;justify-content:center;}
 #r56ArenaPage .sa94QuestionArea .sa94OpNum.sa101AlignedDigits{display:grid!important;grid-template-columns:repeat(var(--sa101-cols),1ch)!important;width:max-content!important;min-width:0!important;max-width:100%!important;justify-items:center!important;text-align:center!important;direction:ltr!important;line-height:1.08!important;font-family:ui-monospace,monospace!important;font-variant-numeric:tabular-nums!important;}
 #r56ArenaPage .sa94QuestionArea .sa101DigitCell{min-width:0;width:1ch;text-align:center;display:inline-block;}
 #r56ArenaPage .sa94QuestionArea .sa101Blank{visibility:hidden;}
 #r56ArenaPage .sa101MatchPending{display:flex;align-items:center;justify-content:space-between;gap:6px;flex-wrap:wrap;padding:5px 8px;background:#fff8ed;border:1px solid #e1b979;border-radius:10px;color:#794620;font-size:12px;font-weight:750;}
 #r56ArenaPage .sa94DuelActive .sa101MatchPending{position:absolute;bottom:5px;left:6px;right:6px;z-index:5;padding:4px 6px;background:#fff9eaf2;}
 #r56ArenaPage .sa101MatchPending button{min-height:34px;font-size:12px}
}

@media(max-width:900px){#r56ArenaPage .sa94DuelActive .sa94MatchShell{position:relative!important}}
