.table-wrap { overflow-x: auto; }
table.phr { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 620px; }
.phr th, .phr td { text-align: start; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.phr th { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.phr td.lat { font-family: var(--f-mono); font-size: 14px; white-space: nowrap; }
.phr td.ar { font-family: var(--f-naskh); font-size: 24px; line-height: 1.5; direction: rtl; text-align: end; white-space: nowrap; }
.phr td.en { color: var(--muted); }
.phr tr:hover td { background: var(--surface-2); }
.cp {
  font: 500 12.5px/1 var(--f-sans); padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap;
}
.cp:hover { border-color: var(--accent); }

.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.theme {
  display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); text-decoration: none;
}
.theme:hover { border-color: var(--accent); }
.theme h2 { font-size: 20px; }
.theme .en { color: var(--muted); font-size: 13px; margin-top: -6px; }
.theme ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.theme li { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font-size: 13.5px; color: var(--muted); }
.theme li .ar { font-size: 18px; color: var(--ink); }
.theme .count { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--gold); }

#search {
  width: 100%; max-width: 420px; font: 15px var(--f-sans); color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
#search:focus { outline: none; border-color: var(--accent); }
.pager { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.others { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.others a {
  display: inline-flex; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink); text-decoration: none; font-size: 14px;
}
.others a:hover { border-color: var(--accent); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Keep wide tables scrolling inside their card on phones */
.wrap > *, .card { min-width: 0; }
.table-wrap { width: 100%; max-width: 100%; }
.table-wrap, .phr th { position: relative; }
