/* Gematrixx V78 — Quran root morphology mobile result cards.
   Root search keeps every morphology section visible; each verse becomes one
   compact research card in the requested reading order. */
@media (max-width:700px){
  #pageQuran #pg-explore .root-morph-wrap{
    width:100%!important;
    max-width:100%!important;
    overflow:visible!important;
  }
  #pageQuran #pg-explore table.root-morph-table{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    table-layout:auto!important;
  }
  #pageQuran #pg-explore table.root-morph-table>thead{display:none!important}
  #pageQuran #pg-explore table.root-morph-table>#srchBody{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
  }

  /* Morphology section heading stays full width and separate from verse cards. */
  #pageQuran #pg-explore table.root-morph-table>#srchBody>tr.root-morph-section-row{
    display:block!important;
    width:100%!important;
    margin:1rem 0 .55rem!important;
    border:0!important;
    border-radius:0!important;
    overflow:visible!important;
    background:transparent!important;
  }
  #pageQuran #pg-explore table.root-morph-table>#srchBody>tr.root-morph-section-row>td{
    display:block!important;
    width:100%!important;
    padding:0!important;
    border:0!important;
    background:transparent!important;
  }
  #pageQuran #pg-explore table.root-morph-table .root-morph-section{
    width:100%!important;
    box-sizing:border-box!important;
  }

  /* One occurrence/verse = one readable card. */
  #pageQuran #pg-explore table.root-morph-table>#srchBody>tr.cr{
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    margin:0 0 .72rem!important;
    border:1px solid var(--bdr,var(--border))!important;
    border-radius:12px!important;
    overflow:hidden!important;
    background:var(--bg2,var(--bg-card))!important;
  }
  #pageQuran #pg-explore table.root-morph-table>#srchBody>tr.cr>td{
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:.7rem!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
    padding:.58rem .72rem!important;
    border:0!important;
    border-bottom:1px solid var(--bdr,var(--border))!important;
    background:transparent!important;
    white-space:normal!important;
    overflow:visible!important;
    text-overflow:clip!important;
    word-break:normal!important;
    overflow-wrap:anywhere!important;
    position:static!important;
    text-align:left!important;
    font-size:.9rem!important;
    line-height:1.55!important;
  }
  #pageQuran #pg-explore table.root-morph-table>#srchBody>tr.cr>td::before{
    color:var(--gold2,var(--gold))!important;
    font-size:.72rem!important;
    font-weight:800!important;
    white-space:nowrap!important;
    flex:0 0 auto!important;
    text-align:right!important;
    direction:rtl!important;
  }

  /* Research order requested for mobile root search:
     verse -> surah -> ayah -> gematria -> counts -> juz. */
  #pageQuran #pg-explore table.root-morph-table>#srchBody>tr.cr>td:nth-child(1),
  #pageQuran #pg-explore table.root-morph-table>#srchBody>tr.cr>td:nth-child(2){display:none!important}

  #pageQuran #pg-explore table.root-morph-table>#srchBody>tr.cr>td:nth-child(5){
    order:1!important;
    display:block!important;
    direction:rtl!important;
    text-align:right!important;
    font-family:'Amiri',var(--font-main),serif!important;
    font-size:1.18rem!important;
    line-height:2.05!important;
    padding:.82rem .78rem!important;
    background:var(--bg3)!important;
  }
  #pageQuran #pg-explore table.root-morph-table>#srchBody>tr.cr>td:nth-child(5)::before{
    content:"نص الآية"!important;
    display:block!important;
    margin-bottom:.22rem!important;
    color:var(--gold2)!important;
    font-family:var(--font-main)!important;
    font-size:.72rem!important;
  }
  #pageQuran #pg-explore table.root-morph-table>#srchBody>tr.cr>td:nth-child(3){order:2!important}
  #pageQuran #pg-explore table.root-morph-table>#srchBody>tr.cr>td:nth-child(4){order:3!important}
  #pageQuran #pg-explore table.root-morph-table>#srchBody>tr.cr>td:nth-child(6){order:4!important}
  #pageQuran #pg-explore table.root-morph-table>#srchBody>tr.cr>td:nth-child(7){order:5!important}
  #pageQuran #pg-explore table.root-morph-table>#srchBody>tr.cr>td:nth-child(8){order:6!important}
  #pageQuran #pg-explore table.root-morph-table>#srchBody>tr.cr>td:nth-child(9){order:7!important}
  #pageQuran #pg-explore table.root-morph-table>#srchBody>tr.cr>td:nth-child(10){order:8!important}
  #pageQuran #pg-explore table.root-morph-table>#srchBody>tr.cr>td:nth-child(11){order:9!important}
  #pageQuran #pg-explore table.root-morph-table>#srchBody>tr.cr>td:nth-child(12){order:10!important;border-bottom:0!important}

  #pageQuran #pg-explore table.root-morph-table>#srchBody>tr.cr>td:nth-child(3)::before{content:"السورة"!important}
  #pageQuran #pg-explore table.root-morph-table>#srchBody>tr.cr>td:nth-child(4)::before{content:"الآية"!important}
  #pageQuran #pg-explore table.root-morph-table>#srchBody>tr.cr>td:nth-child(6)::before{content:"جمل كبير"!important}
  #pageQuran #pg-explore table.root-morph-table>#srchBody>tr.cr>td:nth-child(7)::before{content:"جمل صغير"!important}
  #pageQuran #pg-explore table.root-morph-table>#srchBody>tr.cr>td:nth-child(8)::before{content:"هجائي ترتيبي"!important}
  #pageQuran #pg-explore table.root-morph-table>#srchBody>tr.cr>td:nth-child(9)::before{content:"هجائي تخفيضي"!important}
  #pageQuran #pg-explore table.root-morph-table>#srchBody>tr.cr>td:nth-child(10)::before{content:"كلمات"!important}
  #pageQuran #pg-explore table.root-morph-table>#srchBody>tr.cr>td:nth-child(11)::before{content:"حروف"!important}
  #pageQuran #pg-explore table.root-morph-table>#srchBody>tr.cr>td:nth-child(12)::before{content:"جزء"!important}

  #pageQuran #pg-explore table.root-morph-table .root-occ-badge{margin-inline-start:.4rem}
}
