.idx-core { margin-block: 20px; scroll-margin-top: 80px; }
.idx-card { padding: clamp(16px, 3vw, 30px); border: 1px solid var(--line-2); border-radius: 20px; background: var(--card); min-width: 0; }
.idx-card h2 { margin: 0 0 10px; font-size: clamp(22px, 3vw, 32px); }
.idx-card p { margin-block: 6px; }
.idx-facts { margin-block: 16px 22px; }
.idx-facts .ca-table { min-width: 0; width: 100%; }
.idx-facts .ca-table :is(th, td) { overflow-wrap: anywhere; }
.idx-items { display: grid; gap: 12px; padding-inline-start: 22px; }
.idx-item, .idx-roleplay { padding: 12px 16px; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; }
.idx-item h4, .idx-roleplay h4 { margin: 0 0 8px; }
.idx-options { list-style: none; padding-inline-start: 0; }
.idx-core summary { cursor: pointer; min-height: 44px; padding-block: 10px; font-weight: 650; }
.idx-local-extra { margin-block-start: 12px; }
.idx-links { display: flex; flex-wrap: wrap; gap: 4px 16px; list-style: none; padding: 0; margin: 10px 0; }
.idx-links a { display: inline-flex; align-items: center; min-height: 44px; }
[data-index-context] { margin-block: 16px; }
#oet-practice-roleplay { scroll-margin-top: 80px; }
/* A protected page appends bytes before </main>; keep its original heading first. */
main:has(> [data-idx-first]) { display: flex; flex-direction: column; }
main:has(> [data-idx-first]) > * { order: 2; }
main:has(> [data-idx-first]) > :is(.page-h, .hero) { order: 0; }
main:has(> [data-idx-first]) > [data-idx-first] { order: 1; }

.idx-facts th:first-child { width: 25%; }
.idx-facts :is(th, td):last-child { width: 20%; }
.idx-facts .ca-table td:last-child { font-size: .88em; }
main:has(> [data-idx-first][lang="ar"]) > .page-h,
main:has(> [data-idx-first][lang="ar"]) > .page-h > .wrap { display: contents; }
main:has(> [data-idx-first][lang="ar"]) > .page-h > .wrap > * {
  order: 2;
  width: min(calc(100% - 2 * var(--gut)), calc(var(--wrap) - 2 * var(--gut)));
  margin-inline: auto;
}
main:has(> [data-idx-first][lang="ar"]) > .page-h > .wrap > :is(.crumbs, h1) { order: 0; }
main:has(> [data-idx-first][lang="ar"]) > .page-h > .wrap > .crumbs { margin-top: 16px; }
main:has(> [data-idx-first][lang="ar"]) > .page-h > .wrap > h1 { font-size: clamp(27px, 5vw, 44px); }
main:has(> [data-idx-first][lang="ar"]) > .page-h > .glow { display: none; }

@media (max-width: 960px) {
  main:has(> [data-index-home]) > .hero,
  main:has(> [data-index-home]) > .hero > .hero-grid { display: contents; }
  main:has(> [data-index-home]) > .hero > .hero-grid > :first-child,
  main:has(> [data-index-home]) > .hero > .hero-grid > .home-try {
    width: calc(100% - 2 * var(--gut));
    margin-inline: auto;
  }
  main:has(> [data-index-home]) > .hero > .hero-grid > :first-child { order: 0; padding-block-start: 18px; }
  main:has(> [data-index-home]) > .hero > .hero-grid > :first-child h1 { margin-top: 12px; }
  main:has(> [data-index-home]) > .hero > .hero-grid > .home-try { order: 2; margin-block: 12px; }
  main:has(> [data-index-home]) > .hero > :is(.glow, .grid-dots) { display: none; }
}
