/* Keep the platform-neutral copy in app/assets/custom/rich-text-tables.css in sync. */
:is(.rudraa-rich-text, .case-study-content, .question-preview-text,
    #questionExplanationBody .accordion-body, .practice-question-stem,
    .practice-chart-exhibit > div, .practice-answer-feedback__explanation > div,
    .student-test-review-rationale > div, .student-case-study__panel,
    .assessment-card__instructions > div, .policy-content, .policy-document-body) {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-wrap: anywhere;
    -webkit-overflow-scrolling: touch;
}

:is(table.rudraa-content-table, .rudraa-rich-text table, .case-study-content table,
    .question-preview-text table, #questionExplanationBody .accordion-body table,
    .practice-question-stem table, .practice-chart-exhibit > div table,
    .practice-answer-feedback__explanation > div table, .student-test-review-rationale > div table,
    .student-case-study__panel table, .assessment-card__instructions > div table,
    .policy-content table, .policy-document-body table) {
    --content-table-border: var(--rudraa-rich-table-border, #b9cddd);
    display: table;
    width: 100%;
    max-width: 100%;
    margin: 1rem 0;
    border: 1px solid var(--content-table-border) !important;
    border-collapse: collapse !important;
    border-spacing: 0;
    background: var(--rudraa-surface, #fff);
    color: var(--rudraa-text, #273041);
    font: inherit;
    line-height: 1.6;
    text-align: start;
}

:is(table.rudraa-content-table, .rudraa-rich-text table, .case-study-content table,
    .question-preview-text table, #questionExplanationBody .accordion-body table,
    .practice-question-stem table, .practice-chart-exhibit > div table,
    .practice-answer-feedback__explanation > div table, .student-test-review-rationale > div table,
    .student-case-study__panel table, .assessment-card__instructions > div table,
    .policy-content table, .policy-document-body table) > :is(thead, tbody, tfoot) > tr > :is(th, td) {
    border: 1px solid var(--content-table-border) !important;
    padding: .75rem 1rem !important;
    vertical-align: top;
    overflow-wrap: anywhere;
    line-height: 1.6;
}

:is(table.rudraa-content-table, .rudraa-rich-text table, .case-study-content table,
    .question-preview-text table, #questionExplanationBody .accordion-body table,
    .practice-question-stem table, .practice-chart-exhibit > div table,
    .practice-answer-feedback__explanation > div table, .student-test-review-rationale > div table,
    .student-case-study__panel table, .assessment-card__instructions > div table,
    .policy-content table, .policy-document-body table) > thead > tr > :is(th, td) {
    background: var(--rudraa-primary, #0067a9) !important;
    color: #fff !important;
    font-weight: 700;
    text-align: start;
}

:is(table.rudraa-content-table, .rudraa-rich-text table, .case-study-content table,
    .question-preview-text table, #questionExplanationBody .accordion-body table,
    .practice-question-stem table, .practice-chart-exhibit > div table,
    .practice-answer-feedback__explanation > div table, .student-test-review-rationale > div table,
    .student-case-study__panel table, .assessment-card__instructions > div table,
    .policy-content table, .policy-document-body table) > tbody > tr:nth-child(even) > :is(th, td) {
    background: var(--rudraa-primary-soft, #eaf5fb);
}

:is(table.rudraa-content-table, .rudraa-rich-text table, .case-study-content table,
    .question-preview-text table, #questionExplanationBody .accordion-body table,
    .practice-question-stem table, .practice-chart-exhibit > div table,
    .practice-answer-feedback__explanation > div table, .student-test-review-rationale > div table,
    .student-case-study__panel table, .assessment-card__instructions > div table,
    .policy-content table, .policy-document-body table) > caption {
    caption-side: top;
    padding: .5rem 0;
    color: inherit;
    font-weight: 600;
    text-align: start;
}

.dark {
    --rudraa-rich-table-border: #52627a;
}
