/*
 * RRS Examviora 20.17.0 — Candidate typography system
 * All selectors are plugin-scoped; site-theme typography remains untouched.
 */
:is(
    .cf-exam-app,
    .cf-suite,
    .cf-basic-public,
    .cf-login-shell,
    .cf-exam-login-gate,
    .cf-student-dashboard,
    .cf-result-wrap,
    .cf-paid-exam-card,
    .cf-pricing-experience,
    .cf-ims-portal,
    .rrs-basic-login-gate,
    .cf-teacher-dashboard,
    .cf-unified-dashboard,
    .cf-category-hub
) {
    --cf-public-ui: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    --cf-public-body: 16px;
    --cf-public-small: 12px;
    --cf-public-label: 11px;
    --cf-public-line: 1.62;
    font-family: var(--cf-public-ui);
    font-size: var(--cf-public-body);
    line-height: var(--cf-public-line);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

:is(
    .cf-exam-app,
    .cf-suite,
    .cf-basic-public,
    .cf-login-shell,
    .cf-exam-login-gate,
    .cf-student-dashboard,
    .cf-result-wrap,
    .cf-paid-exam-card,
    .cf-pricing-experience,
    .cf-ims-portal,
    .rrs-basic-login-gate,
    .cf-teacher-dashboard,
    .cf-unified-dashboard,
    .cf-category-hub
) :is(button, input, select, textarea) {
    font-family: var(--cf-public-ui);
}

:is(.cf-exam-app, .cf-suite, .cf-basic-public, .cf-login-shell, .cf-exam-login-gate) :is(input, select, textarea) {
    font-size: 16px;
    line-height: 1.55;
}

/* Never let functional labels collapse to the legacy 5–10px range. */
:is(.cf-exam-app, .cf-suite, .cf-login-shell, .cf-exam-login-gate, .cf-paid-exam-card) :is(
    .cf-exam-eyebrow,
    .cf-paper-label,
    .cf-question-type,
    .cf-question-type-badge,
    .cf-writing-panel-label,
    .cf-writing-task-header > div:first-child > span,
    .cf-question-candidate-instruction > span,
    .cf-writing-response-locked-header > span,
    .cf-writing-global-instruction > strong,
    .cf-reading-toolbar-kicker,
    .cf-reading-passage-section > header span,
    .cf-reading-question-section-head span,
    .cf-reading-question-group-head strong,
    .cf-reading-question-group .cf-question-heading em,
    .cf-reading-source-range,
    .cf-recorder-label,
    .cf-paid-eyebrow,
    .cf-paid-tags span,
    .cf-paid-offer-label,
    .cf-paid-payment-note
) {
    font-size: var(--cf-public-label) !important;
    line-height: 1.35;
    letter-spacing: .08em;
}

:is(.cf-exam-app, .cf-suite, .cf-login-shell, .cf-exam-login-gate, .cf-paid-exam-card) small {
    font-size: var(--cf-public-small);
    line-height: 1.45;
}

/* Core exam hierarchy */
.cf-exam-app .cf-exam-topbar h1 {
    font-size: clamp(18px, 1.45vw, 24px) !important;
    line-height: 1.25;
}

.cf-exam-app .cf-question-heading,
.cf-exam-app .cf-question-text,
.cf-exam-app .cf-question-content {
    font-size: 16px;
    line-height: 1.62;
}

.cf-exam-app .cf-option,
.cf-exam-app .cf-mcq-option,
.cf-exam-app .cf-tf-option,
.cf-exam-app .cf-matching-option {
    font-size: 15px;
    line-height: 1.45;
}

.cf-exam-app .cf-progress-copy,
.cf-exam-app .cf-save-status,
.cf-exam-app .cf-section-tab small {
    font-size: 12px !important;
}

.cf-exam-app .cf-section-tab span {
    font-size: 14px;
}

/* Reading workspace: passage and questions use related, not competing, sizes. */
.cf-reading-workspace .cf-reading-passage-copy,
.cf-reading-workspace .cf-reading-passage-copy :is(p, li, blockquote, td) {
    font-size: 17px !important;
    line-height: 1.78 !important;
}

.cf-reading-workspace .cf-reading-passage-copy :is(h1, h2) {
    font-size: clamp(24px, 2.2vw, 31px) !important;
    line-height: 1.25 !important;
}

.cf-reading-workspace .cf-reading-passage-copy h3 {
    font-size: 21px !important;
    line-height: 1.32 !important;
}

.cf-reading-workspace .cf-reading-question-section-head h2 {
    font-size: clamp(23px, 2vw, 29px);
    line-height: 1.25;
}

.cf-reading-workspace .cf-reading-question-group .cf-question-heading,
.cf-reading-workspace .cf-reading-question-group .cf-question-text {
    font-size: 15.5px;
    line-height: 1.58;
}

.cf-reading-evidence-note {
    font-size: 12px;
    line-height: 1.4;
}

/* Writing workspace and practice cards. */
.cf-writing-task-header h2 {
    font-size: clamp(20px, 1.65vw, 25px) !important;
}

.cf-writing-task-badges b,
.cf-writing-practice-zone b {
    font-size: 12px;
    line-height: 1.25;
}

.cf-writing-panel-label,
.cf-writing-practice-part-head small,
.cf-writing-practice-part-head em,
.cf-writing-practice-model > span,
.cf-writing-practice-response-head small,
.cf-writing-practice-response .cf-word-count,
.cf-writing-practice-source figure + figure::before {
    font-size: 11px !important;
    line-height: 1.35;
}

.cf-writing-practice-part-head strong,
.cf-writing-practice-response-head label {
    font-size: 13px !important;
    line-height: 1.4;
}

.cf-writing-practice-prompt,
.cf-writing-practice-model,
.cf-writing-practice-model > div,
.cf-writing-practice-box-header,
.cf-writing-practice-repeat,
.cf-writing-practice-source .cf-writing-candidate-instruction,
.cf-writing-practice-source .cf-paper-content-block {
    font-size: 13px !important;
    line-height: 1.55 !important;
}

.cf-writing-practice-editor,
.cf-writing-editor,
.cf-candidate-answer-space {
    font-size: 16px !important;
    line-height: 1.65 !important;
}

/* Writing Coach uses the same UI rhythm in candidate and author workflows. */
.cf-language-toolbar,
.cf-language-panel,
.cf-language-issue {
    font-size: 13px;
    line-height: 1.5;
}

.cf-language-actions button,
.cf-language-issue-actions button,
.cf-language-replacements button {
    font-size: 12px;
    line-height: 1.25;
}

/* Long imported titles and translated labels wrap cleanly in both workflows. */
:is(.cf-exam-app, .cf-suite, .cf-basic-public, .cf-login-shell, .cf-exam-login-gate) :is(h1, h2, h3, h4, p, label, button, a, span) {
    overflow-wrap: break-word;
    word-break: normal;
}

/* v20.17: a consistent professional exam scale. Inline paste colour,
   emphasis and highlighting are retained, while accidental 28–40px body
   text from external documents cannot break the candidate layout. */
.cf-exam-app .cf-question-prompt,
.cf-exam-app .cf-question-prompt :is(p, li, blockquote, td, th, span),
.cf-exam-app .cf-question-candidate-instruction,
.cf-exam-app .cf-question-candidate-instruction :is(p, li, span),
.cf-exam-app .cf-paper-content-copy,
.cf-exam-app .cf-paper-content-copy :is(p, li, blockquote, td, th, span) {
    font-size: 16px !important;
    line-height: 1.62 !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

.cf-reading-workspace .cf-reading-passage-copy :is(p, li, blockquote, td, th) *,
.cf-exam-app .cf-question-prompt :is(p, li, blockquote, td, th) * {
    font-size: inherit !important;
    line-height: inherit !important;
}

.cf-exam-app .cf-paper-content-block {
    font-size: 16px;
    line-height: 1.62;
}

.cf-exam-app .cf-paper-content-block > h2 {
    margin: 0 0 7px;
    font-size: 18px !important;
    line-height: 1.35 !important;
}

.cf-exam-app .cf-answer-options label,
.cf-exam-app .cf-answer-options label span {
    font-size: 15.5px !important;
    line-height: 1.5 !important;
}

.cf-exam-app .cf-reading-question-group .cf-question-heading span {
    font-size: 13px !important;
    line-height: 1.35 !important;
}

.cf-exam-app .cf-reading-question-group .cf-question-card {
    font-size: 16px;
}

:is(.cf-exam-app, .cf-suite, .cf-basic-public) button {
    min-height: 40px;
}

/* Paid cards, login, dashboards and result pages. */
.cf-paid-exam-main h2 {
    font-size: clamp(29px, 3vw, 39px);
}

.cf-paid-exam-main > p,
.cf-paid-exam-offer li {
    font-size: 14px;
    line-height: 1.55;
}

.cf-paid-stats span,
.cf-paid-stats strong,
.cf-paid-secondary {
    font-size: 12px;
}

.cf-login-copy h1,
.cf-exam-login-visual h2 {
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.12;
}

.cf-login-form-side h2,
.cf-exam-login-action h3 {
    font-size: clamp(24px, 2.3vw, 31px);
    line-height: 1.2;
}

.cf-login-form label,
.cf-exam-inline-login label,
.cf-auth-terms,
.cf-login-register {
    font-size: 13px;
    line-height: 1.5;
}

.cf-result-card h2,
.cf-result-hero h2,
.cf-student-welcome h1 {
    font-size: clamp(27px, 3vw, 38px);
    line-height: 1.18;
}

/* Legacy Basic English single-question player. */
.cf-basic-public .cf-basic-public-head span,
.cf-basic-public .cf-basic-feedback h4 {
    font-size: 18px;
    line-height: 1.35;
}

.cf-basic-public .cf-basic-public-head b {
    font-size: 12px;
}

.cf-basic-public .cf-basic-public-question,
.cf-basic-public .cf-basic-explanation,
.cf-basic-public .cf-basic-model {
    font-size: 16px;
    line-height: 1.65;
}

@media (max-width: 700px) {
    :is(.cf-exam-app, .cf-suite, .cf-basic-public, .cf-login-shell, .cf-exam-login-gate) {
        --cf-public-body: 15px;
        --cf-public-small: 12px;
    }

    .cf-reading-workspace .cf-reading-passage-copy,
    .cf-reading-workspace .cf-reading-passage-copy :is(p, li, blockquote, td) {
        font-size: 16px !important;
        line-height: 1.72 !important;
    }

    .cf-reading-workspace .cf-reading-question-group .cf-question-heading,
    .cf-reading-workspace .cf-reading-question-group .cf-question-text {
        font-size: 15px;
    }

    .cf-paid-exam-main h2 {
        font-size: 29px;
    }
}

/* v20.17.5 — mobile launch isolation for every public candidate player.
   Prevents the surrounding theme/header/landing content from appearing inside
   the execution viewport on phones. */
@media (max-width:760px) {
  html:has(.cf-exam-app),
  body:has(.cf-exam-app),
  html:has(.cf-suite),
  body:has(.cf-suite),
  html:has(.cf-basic-public),
  body:has(.cf-basic-public) {
    overflow:hidden!important;
    overscroll-behavior:none!important;
  }

  .cf-suite,
  .cf-basic-public {
    position:fixed!important;
    inset:0!important;
    z-index:2147482990!important;
    width:100vw!important;
    max-width:none!important;
    height:100dvh!important;
    min-height:100vh!important;
    margin:0!important;
    border-radius:0!important;
    overflow:auto!important;
    overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch;
    background:#f4f8f5!important;
  }

  .cf-suite .cf-suite-player,
  .cf-basic-public > * {
    max-width:none!important;
  }
}
