/* مركز الأبحاث (v10) — Apple-style, RTL, mobile first; builds on desk.css + research.css variables */
.rc .r-main { max-width: 1240px; }
.seg-wrap { overflow-x: auto; scrollbar-width: none; margin: 0 -2px; }
.seg-wrap::-webkit-scrollbar { display: none; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); white-space: nowrap; }
.seg a, .seg button { border: 0; background: transparent; color: var(--text); padding: 8px 14px; border-radius: 9px; font: inherit; font-size: 0.9rem; text-decoration: none; min-height: 38px; display: inline-flex; align-items: center; cursor: pointer; }
.seg a[aria-selected="true"], .seg button[aria-checked="true"] { background: var(--panel); box-shadow: 0 1px 3px rgba(0,0,0,.25); font-weight: 600; }
.small-seg button { padding: 6px 14px; min-height: 34px; }
.rc-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 0.88rem; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--accent); }
.rc-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .rc-grid.two { grid-template-columns: 1fr 1fr; } .rc-grid.three { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; min-width: 0; }
.card h2, .card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.card .rule { color: var(--muted); font-size: 0.8rem; margin: 0 0 10px; line-height: 1.7; }
.eyebrow { color: var(--muted); font-size: 0.75rem; letter-spacing: .02em; }
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rank li { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; padding: 9px 4px; border-top: 1px solid var(--line); }
.rank li:first-child { border-top: 0; }
.rank .n { color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; }
.rank a { color: var(--text); text-decoration: none; font-weight: 600; }
.rank .why { display: block; color: var(--muted); font-size: 0.76rem; line-height: 1.6; font-weight: 400; margin-top: 2px; }
.pill { display: inline-block; font-size: 0.72rem; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.pass { color: var(--up); border-color: currentColor; }
.pill.fail { color: var(--down); border-color: currentColor; }
.pill.review { color: var(--warn); border-color: currentColor; }
.score { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 44px; text-align: center; padding: 3px 8px; border-radius: 8px; background: var(--surface); }
.heat { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.heat .cell { border-radius: 12px; padding: 10px; border: 1px solid var(--line); min-height: 76px; }
.heat .cell b { display: block; font-size: 0.86rem; }
.heat .cell span { font-size: 0.76rem; color: var(--muted); display: block; }
.heat .cell .num { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.tbl-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.tbl-tools input { flex: 1 1 220px; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; }
.tbl-tools select { min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 0 10px; font: inherit; }
.rc-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.rc-table th, .rc-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: start; white-space: nowrap; }
.rc-table th { position: sticky; top: 0; background: var(--panel); color: var(--muted); font-weight: 600; font-size: 0.78rem; cursor: pointer; user-select: none; }
.rc-table th[aria-sort="ascending"]::after { content: " ▲"; }
.rc-table th[aria-sort="descending"]::after { content: " ▼"; }
.rc-table tbody tr { cursor: pointer; }
.rc-table tbody tr:hover { background: var(--surface); }
.rc-table td.name { white-space: normal; min-width: 130px; }
.rc-table td.name small { color: var(--muted); display: block; font-size: 0.72rem; }
.scroll-x { overflow: auto; max-height: 70vh; border-radius: 12px; border: 1px solid var(--line); }
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface); border-radius: 12px; padding: 10px 12px; }
.kpi span { display: block; color: var(--muted); font-size: 0.75rem; }
.kpi b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.range svg { width: 100%; height: auto; display: block; }
.methods { display: grid; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.methods li { background: var(--surface); border-radius: 10px; padding: 8px 10px; font-size: 0.82rem; line-height: 1.8; }
.bars { display: grid; gap: 8px; }
.bars .row { display: grid; grid-template-columns: 110px 1fr 40px; gap: 8px; align-items: center; font-size: 0.84rem; }
.bars svg { width: 100%; height: 10px; }
.rc-chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.78rem; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; margin-inline-end: 4px; }
.lg-a { background: var(--accent); } .lg-b { background: var(--muted); } .lg-c { background: var(--warn); }
.rcst { width: 100%; border-collapse: collapse; font-size: 0.82rem; margin-top: 8px; }
.rcst td, .rcst th { padding: 6px; border-bottom: 1px solid var(--line); text-align: start; }
.caveats { margin: 0; padding-inline-start: 18px; line-height: 1.9; font-size: 0.86rem; color: var(--muted); }
.note-box { white-space: pre-line; line-height: 2; }
.back { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); text-decoration: none; font-size: 0.88rem; }
.opt-cards { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .opt-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .opt-cards { grid-template-columns: repeat(3, 1fr); } }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 0.84rem; margin: 8px 0 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-variant-numeric: tabular-nums; }
.payoff svg { width: 100%; height: auto; }
.empty { padding: 20px; text-align: center; color: var(--muted); }
details.more summary { cursor: pointer; color: var(--accent); font-size: 0.86rem; margin-top: 8px; }
.rc .r-main > *, .rc-grid > * { min-width: 0; }
.rcst td { white-space: nowrap; padding: 6px 4px; font-size: 0.8rem; }
.rcst th { padding: 6px 4px; }
.rcst th { font-weight: 600; font-size: 0.76rem; color: var(--muted); }
.rcst-wrap { overflow-x: auto; }
.rc-chart { max-width: 760px; margin-inline: auto; }
.rc-chart svg { max-height: 280px; }
.payoff svg { max-height: 190px; }
.dl { grid-template-columns: minmax(96px, 42%) minmax(0, 1fr); }
.dl dd { overflow-wrap: anywhere; }
/* keep real tables on phones (desk.css turns tables into cards ≤560px) */
@media (max-width: 560px) {
  .rc table { white-space: nowrap; }
  .rc thead { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
  .rc tbody { display: table-row-group; }
  .rc tbody tr { display: table-row; border: 0; padding: 0; }
  .rc td, .rc th { padding: 8px 6px; border-bottom: 1px solid var(--line); overflow-wrap: normal; }
  .rc td:first-child { grid-column: auto; grid-row: auto; }
  .tbl-tools input, .tbl-tools select { min-height: 44px; }
}
.rc-table th:first-child, .rc-table td.name { position: sticky; right: 0; background: var(--panel); z-index: 1; }
.rc-table th:first-child { z-index: 2; }
