/* Gematrixx V138 — targeted mobile safety for Number Symbolism + Quran containment.
   Scope is intentionally narrow: no global page/card/table rules. */

/* Defensive containment: Quran platform UI must never render outside its active page. */
#pageQuran:not(.active),
#pageQuran:not(.active) > .hdr,
#pageQuran:not(.active) > .tabs,
#pageQuran:not(.active) > .body{
  display:none!important;
}
#quranExploreStickyHead83:not(.is-visible){display:none!important}
body:not(:has(#pageQuran.active)) #quranExploreStickyHead83{display:none!important}

/* Number Symbolism — mobile-only long-number containment.
   Long values use the full safe width of the phone and scale only as much as needed. */
@media (max-width:820px){
  #pageNumsym .nse-number-intro{
    width:100%;
    max-width:100%;
    padding-inline:.35rem;
    box-sizing:border-box;
    overflow:visible;
  }
  #pageNumsym .nse-number-seal{
    box-sizing:border-box!important;
    flex:0 0 auto;
    overflow:hidden!important;
  }
  #pageNumsym .nse-number-seal.nse-seal-long{
    width:min(92vw,360px)!important;
    max-width:calc(100vw - 1.25rem)!important;
    min-width:0!important;
    height:122px!important;
    min-height:122px!important;
    aspect-ratio:auto!important;
    border-radius:999px!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    gap:.18rem!important;
    padding:.75rem 1.2rem!important;
    text-align:center!important;
  }
  #pageNumsym .nse-number-seal.nse-seal-long::after{
    inset:10px!important;
    width:auto!important;
    height:auto!important;
    right:10px!important;
    left:10px!important;
    border-radius:999px!important;
    box-sizing:border-box!important;
  }
  #pageNumsym .nse-number-seal.nse-seal-long .nse-big-number{
    display:block!important;
    grid-row:auto!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0!important;
    padding:0 .1rem!important;
    box-sizing:border-box!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:clip!important;
    text-align:center!important;
    direction:ltr!important;
    unicode-bidi:isolate!important;
    line-height:1!important;
    font-variant-numeric:tabular-nums lining-nums!important;
  }
  #pageNumsym .nse-number-seal.nse-seal-long .nse-number-name,
  #pageNumsym .nse-number-seal.nse-seal-long .nse-number-term{
    align-self:center!important;
    text-align:center!important;
    max-width:100%!important;
    margin:0!important;
  }

  /* Conservative scale ladder, sized against the real mobile frame. */
  #pageNumsym .nse-big-number.nse-d4{font-size:2.85rem!important;letter-spacing:-.02em!important}
  #pageNumsym .nse-big-number.nse-d5{font-size:2.65rem!important;letter-spacing:-.025em!important}
  #pageNumsym .nse-big-number.nse-d6{font-size:2.45rem!important;letter-spacing:-.03em!important}
  #pageNumsym .nse-big-number.nse-d7{font-size:2.2rem!important;letter-spacing:-.035em!important}
  #pageNumsym .nse-big-number.nse-d8{font-size:2.02rem!important;letter-spacing:-.04em!important}
  #pageNumsym .nse-big-number.nse-d9plus{font-size:clamp(1.35rem,7vw,1.85rem)!important;letter-spacing:-.045em!important}

  /* Selector buttons for 4+ digit values remain pills and may scroll horizontally. */
  #pageNumsym .nse-number-switch{max-width:100%!important;overflow-x:auto!important;overflow-y:hidden!important;-webkit-overflow-scrolling:touch!important}
  #pageNumsym .nse-num-btn.nse-num-wide{flex:0 0 auto!important;width:auto!important;max-width:none!important;min-width:max-content!important;padding-inline:.62rem!important;border-radius:999px!important;white-space:nowrap!important}
}

@media (max-width:390px){
  #pageNumsym .nse-number-seal.nse-seal-long{
    width:calc(100vw - 1.2rem)!important;
    max-width:calc(100vw - 1.2rem)!important;
    padding-inline:1rem!important;
  }
  #pageNumsym .nse-big-number.nse-d9plus{font-size:clamp(1.18rem,6.4vw,1.55rem)!important}
}
