/* Ranking direction: Persian interface/section copy stays RTL; English ranking data is LTR. */
.section-heading,
.provider-picker,
.toolbar,
.table-footer,
.pd-head,
.pd-section-head,
.pd-note,
.pd-citation,
.pd-loading,
.pd-error{
  direction:rtl;
  text-align:right;
}

/* Provider picker: prevent the source selector from overflowing or being clipped. */
.provider-picker{
  display:grid !important;
  grid-template-columns:minmax(240px,320px) minmax(0,1fr) !important;
  align-items:stretch !important;
  gap:18px !important;
  width:100%;
  max-width:100%;
  min-width:0;
  overflow:hidden;
  box-sizing:border-box;
}
.provider-picker > div{
  min-width:0;
  width:100%;
  max-width:100%;
  box-sizing:border-box;
}
.provider-picker > div:first-child{
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:7px;
  min-width:0 !important;
}
.provider-picker > div:first-child strong,
.provider-picker > div:first-child span{
  display:block;
  max-width:100%;
  white-space:normal;
  overflow-wrap:anywhere;
}
#darvareh-mode{
  width:100%;
  max-width:100%;
  min-width:0;
  height:auto;
  min-height:46px;
  padding:10px 14px;
  white-space:normal;
  line-height:1.7;
  text-align:center;
  box-sizing:border-box;
}
.provider-toggles{
  display:grid !important;
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  gap:8px;
  width:100%;
  max-width:100%;
  min-width:0;
}
.provider-toggle{
  width:100%;
  max-width:100%;
  min-width:0 !important;
  overflow:hidden;
  box-sizing:border-box;
}
.provider-toggle > span,
.provider-toggle small{
  min-width:0;
  max-width:100%;
  overflow-wrap:anywhere;
}

/* Standard Darvareh ranking table */
.table-wrap,
.table-wrap table,
.table-wrap thead,
.table-wrap tbody,
.table-wrap tr{
  direction:ltr;
}
.table-wrap th,
.table-wrap td{
  text-align:left;
}
.table-wrap th{
  unicode-bidi:plaintext;
}
.table-wrap .model,
.table-wrap .model strong,
.table-wrap .model small,
.table-wrap .metric,
.table-wrap .price,
.table-wrap .speed{
  direction:ltr;
  text-align:left;
}
.table-wrap .available,
.table-wrap .soon{
  direction:rtl;
  text-align:center;
}

/* Direct provider ranking data */
.pd-bars,
.pd-grid,
.pd-groups{
  direction:ltr;
}
.pd-bar,
.pd-card,
.pd-group p{
  direction:ltr;
  text-align:left;
}
.pd-bar strong,
.pd-bar b,
.pd-card strong,
.pd-card small,
.pd-card b,
.pd-group p > span,
.pd-group p > b{
  direction:ltr;
  text-align:left;
  unicode-bidi:plaintext;
}

/* Category headers and descriptions are Persian. */
.pd-group header{
  direction:rtl;
  text-align:right;
}
.pd-group header strong,
.pd-group header span{
  direction:rtl;
  text-align:right;
}

/* Keep section titles/copy firmly Persian/RTL even inside an LTR data container. */
.pd-section > .pd-section-head,
.pd-section > .pd-note{
  direction:rtl;
  text-align:right;
}

@media(max-width:1100px){
  .provider-picker{
    grid-template-columns:1fr !important;
  }
  .provider-toggles{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  }
}

@media(max-width:760px){
  .provider-picker{
    padding:16px !important;
    gap:14px !important;
    border-radius:14px;
  }
  .provider-toggles{
    grid-template-columns:1fr !important;
  }
  #darvareh-mode{
    min-height:50px;
    padding:12px 14px;
  }
  .table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
  .pd-bar,.pd-card,.pd-group p{direction:ltr}
}
