/* Fix76 — dedicated mobile activity surface. No changes outside flash / sequence. */
@media(max-width:720px){
 body.sa76ActivityFocused #safeR10Bottom,
 body.sa76ActivityFocused .safeR10Bottom {display:none!important}
 body.sa76ActivityFocused{overflow:hidden!important;overscroll-behavior:none!important}
 #fun.sa76FlashMode #activityArea,#fun.sa76SequenceMode #activityArea,
 #fun.safeR27ActivityMode.sa76FlashMode #activityArea,
 #fun.safeR27ActivityMode.sa76SequenceMode #activityArea{
  height:100dvh!important;max-height:100dvh!important;overflow:hidden!important;
  padding:0 7px!important;box-sizing:border-box!important;overscroll-behavior:none!important;
 }
 #fun.sa76FlashMode .safeR27ActivityBar,#fun.sa76SequenceMode .safeR27ActivityBar{
  position:relative!important;top:0!important;z-index:10!important;margin:0 -7px 5px!important;
  padding:5px 9px!important;min-height:51px!important;flex:0 0 51px!important;
  display:flex!important;align-items:center!important;gap:5px!important;
 }
 #fun.sa76FlashMode .safeR27ActivityBar b,#fun.sa76SequenceMode .safeR27ActivityBar b{flex:1;font-size:clamp(16px,4.9vw,20px)!important}
 #fun.sa76FlashMode .safeR27ActivityBar .status,#fun.sa76SequenceMode .safeR27ActivityBar .status{
  flex:0 0 auto!important;margin:0!important;font-size:13px!important;padding:4px 7px!important;
 }
 #fun.sa76FlashMode .safeR27ActivityBack,#fun.sa76SequenceMode .safeR27ActivityBack{
  min-height:40px!important;flex:0 0 auto!important;padding:5px 9px!important;font-size:12px!important;
 }
 #fun.sa76FlashMode #activityArea>.activitypanel,#fun.sa76SequenceMode #activityArea>.activitypanel{
  height:calc(100dvh - 61px)!important;max-height:calc(100dvh - 61px)!important;
  min-height:0!important;overflow:hidden!important;display:flex!important;flex-direction:column!important;
  padding:7px!important;margin:0!important;border-radius:15px!important;
 }
 #fun.sa76FlashMode .activitypanel>.kidActivityTop,#fun.sa76SequenceMode .activitypanel>.kidActivityTop,
 #fun.sa76FlashMode .activitypanel>.note,#fun.sa76SequenceMode .activitypanel>.note{display:none!important}
 #fun.sa76FlashMode .activitypanel>.head,#fun.sa76SequenceMode .activitypanel>.head{display:none!important}
 #fun.sa76FlashMode .activitypanel>.actTimerTrack,#fun.sa76SequenceMode .activitypanel>.actTimerTrack{
  min-height:4px!important;height:4px!important;flex:0 0 4px!important;margin:2px 3px 5px!important;
 }
 #fun.sa76FlashMode #actFeedback,#fun.sa76SequenceMode #actFeedback{
  min-height:0!important;max-height:38px!important;overflow:hidden!important;margin:2px 0!important;
  font-size:12px!important;line-height:1.3!important;flex:0 0 auto!important;
 }
 /* FLASH: card / input share one row when the memorization phase ends. */
 #fun.sa76FlashMode .v17FlashStage{
  flex:1 1 0!important;min-height:0!important;height:auto!important;max-height:clamp(150px,40dvh,390px)!important;
  display:grid!important;place-items:center!important;margin:3px 0 5px!important;padding:5px!important;
 }
 #fun.sa76FlashMode .v17FlashCard{
  width:100%!important;min-width:0!important;max-width:100%!important;
  min-height:0!important;height:100%!important;padding:6px!important;border-radius:16px!important;
  font-size:clamp(40px,12vw,72px)!important;box-sizing:border-box!important;
 }
 #fun.sa76FlashMode #flashBox{min-height:0!important;display:flex!important;flex-direction:column!important;gap:5px!important;flex:0 0 auto!important}
 #fun.sa76FlashMode #flashBox.hidden{display:none!important}
 #fun.sa76FlashMode #sa76FlashRecallRow{
  display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  align-items:stretch!important;gap:8px!important;min-height:80px!important;height:clamp(80px,16dvh,144px)!important;
 }
 #fun.sa76FlashMode #sa76FlashRecallRow .v17FlashStage{
  width:100%!important;height:100%!important;max-height:100%!important;min-height:0!important;
  margin:0!important;padding:0!important;
 }
 #fun.sa76FlashMode #sa76FlashRecallRow .v17FlashCard{min-height:0!important;max-height:100%!important;height:100%!important}
 #fun.sa76FlashMode #v17FlashWrite,#fun.sa76FlashMode #sa76FlashSelectedValue{
  width:100%!important;min-width:0!important;min-height:0!important;height:100%!important;
  padding:5px!important;border:2px solid #a6d7c4!important;border-radius:16px!important;
  font-size:clamp(23px,7vw,38px)!important;background:#f5fcf9!important;
  color:#164d42!important;box-sizing:border-box!important;text-align:center!important;
  direction:ltr!important;outline:none!important;overflow:hidden!important;
 }
 #fun.sa76FlashMode #flashPicked{max-height:34px!important;min-height:0!important;overflow:hidden!important}
 #fun.sa76FlashMode #sa76FlashRecallRow #flashPicked{display:none!important}
 #fun.sa76FlashMode #flashBox>.choices{display:none!important}
 #fun.sa76FlashMode #v17FlashPad{
  position:fixed!important;z-index:5001!important;bottom:0!important;left:0!important;right:0!important;
  width:100%!important;height:calc(clamp(195px,28dvh,244px) + env(safe-area-inset-bottom,0px))!important;
  margin:0!important;padding:6px 8px calc(7px + env(safe-area-inset-bottom,0px))!important;
  border-top:1px solid #b8dace!important;background:#e8f4ee!important;
  box-shadow:0 -5px 18px #184d3c20!important;box-sizing:border-box!important;
 }
 #fun.sa76FlashMode #v17FlashPad .sa76FlashKeys{
  display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;
  grid-template-rows:repeat(4,minmax(0,1fr))!important;gap:5px!important;height:100%!important;direction:ltr!important;
 }
 #fun.sa76FlashMode .sa76FlashKeys button{
  min-width:0!important;min-height:0!important;height:100%!important;
  border-radius:11px!important;padding:0 2px!important;font-weight:900!important;
  font-size:clamp(15px,4.5vw,24px)!important;touch-action:manipulation!important;
  color:#155344!important;background:#fff!important;border:1px solid #c7dcd4!important;
 }
 #fun.sa76FlashMode .sa76FlashKeys .sa76Action{background:#fff6e6!important;color:#82652d!important;border-color:#ebd3a5!important;font-size:clamp(13px,3.5vw,19px)!important}
 #fun.sa76FlashMode .sa76FlashKeys button[data-sa76-key="تحقق"]{background:#0c755d!important;color:white!important}
 #fun.sa76FlashMode:not(.sa76FlashReady) .sa76FlashKeys{opacity:.5!important;pointer-events:none!important}
 #fun.sa76FlashMode #activityArea>.activitypanel{padding-bottom:calc(clamp(195px,28dvh,244px) + env(safe-area-inset-bottom,0px) + 8px)!important}
 /* SEQUENCE: compact hero and large math prompt, no vertical scroll. */
 #fun.sa76SequenceMode #activityArea>.activitypanel{
  padding-bottom:calc(196px + env(safe-area-inset-bottom,0px))!important;
 }
 #fun.sa76SequenceMode .v171SeqWrap{display:flex!important;flex-direction:column!important;gap:5px!important;min-height:0!important;overflow:hidden!important;flex:1 1 auto!important}
 #fun.sa76SequenceMode .v171SeqWrap>.note{display:none!important}
 #fun.sa76SequenceMode .v171SeqHero{padding:8px!important;flex:0 0 auto!important;min-height:0!important;border-radius:15px!important}
 #fun.sa76SequenceMode .v171SeqTop{flex-wrap:nowrap!important;align-items:center!important;gap:7px!important}
 #fun.sa76SequenceMode .v171SeqStart{font-size:15px!important}
 #fun.sa76SequenceMode .v171SeqStart b{font-size:clamp(25px,7vw,38px)!important}
 #fun.sa76SequenceMode .v171SeqProgress{margin:6px 0!important;height:6px!important}
 #fun.sa76SequenceMode .v171SeqStrip{display:flex!important;flex-wrap:nowrap!important;gap:5px!important;overflow:hidden!important;margin:4px 0 0!important;min-height:35px!important}
 #fun.sa76SequenceMode .v171SeqChip{flex:1 1 0!important;min-width:0!important;margin:0!important;padding:5px 3px!important;font-size:clamp(13px,3.8vw,18px)!important;text-align:center!important}
 #fun.sa76SequenceMode .v171SeqChip.sa76OffStrip{display:none!important}
 #fun.sa76SequenceMode .v171SeqQuestion{
  flex:1 1 auto!important;min-height:90px!important;max-height:clamp(115px,23dvh,200px)!important;
  padding:7px!important;margin:0!important;display:flex!important;flex-direction:column!important;
  align-items:center!important;justify-content:center!important;gap:3px!important;border-radius:15px!important;
 }
 #fun.sa76SequenceMode .v171SeqQuestion small{font-size:clamp(12px,3.5vw,16px)!important}
 #fun.sa76SequenceMode .v171SeqQuestion strong{font-size:clamp(36px,12vw,68px)!important;line-height:1.05!important}
 #fun.sa76SequenceMode .v171SeqCurrent{font-size:clamp(12px,3.4vw,16px)!important;line-height:1.25!important}
 #fun.sa76SequenceMode .v171SeqAnswer{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:6px!important;margin:0!important;flex:0 0 auto!important}
 #fun.sa76SequenceMode #seqA{min-width:0!important;width:100%!important;min-height:47px!important;height:47px!important;font-size:clamp(19px,5vw,27px)!important;text-align:center!important}
 #fun.sa76SequenceMode .v171SeqAnswer button{min-width:90px!important;min-height:47px!important;height:47px!important;padding:4px!important}
 #fun.sa76SequenceMode #v171SeqHistory{display:none!important}
 #fun.sa76SequenceMode .v171SeqPad{z-index:5001!important}
}
@media(max-width:720px) and (max-height:670px){
 #fun.sa76SequenceMode #activityArea>.activitypanel{padding-bottom:calc(152px + env(safe-area-inset-bottom,0px))!important}
 #fun.sa76SequenceMode .v171SeqPad{height:calc(145px + env(safe-area-inset-bottom,0px))!important;grid-auto-rows:minmax(0,1fr)!important}
 #fun.sa76FlashMode #v17FlashPad{height:calc(175px + env(safe-area-inset-bottom,0px))!important}
 #fun.sa76FlashMode #activityArea>.activitypanel{padding-bottom:calc(182px + env(safe-area-inset-bottom,0px))!important}
}
@media(max-width:720px){
 #fun.sa76FlashMode.sa76FlashReady #flashBox{
  margin-top:auto!important;margin-bottom:auto!important;
 }
}
