/**
 * Standard public layout for all question paper detail pages (QuizCurrent).
 * OCR raw text is never styled here â€” public pages use metadata sections only.
 */

.qp-portal { max-width: 920px; margin: 0 auto; min-width: 0; }
.qp-portal .card { min-width: 0; max-width: 100%; }

.qp-bc {
    font-size: 0.88rem;
    margin-bottom: 14px;
    color: var(--qc-muted);
    line-height: 1.6;
}
.qp-bc a { color: var(--qc-primary); text-decoration: none; }
.qp-bc span { margin: 0 6px; color: var(--qc-muted); }

.qp-section-title {
    margin: 0 0 12px;
    font-size: 1.05rem;
    color: var(--qc-heading);
}

.qp-paper-header h1 {
    margin: 0 0 10px;
    font-size: clamp(1.2rem, 3vw, 1.45rem);
    color: var(--qc-heading);
    line-height: 1.35;
}

.qp-landing-hero {
    border-left: 4px solid var(--qc-primary);
    padding-left: 1.1rem;
}
.qp-landing-hero h1 {
    font-size: clamp(1.15rem, 2.8vw, 1.55rem);
    line-height: 1.4;
}
.qp-landing-meta {
    margin: 0;
    font-size: 0.82rem;
    color: var(--qc-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.qp-seo-intro {
    margin: 0 0 12px;
    font-size: 0.96rem;
    line-height: 1.7;
    color: var(--qc-text);
    max-width: 72ch;
}

.qp-muted { color: var(--qc-muted); }

/* Vertical stat highlights (reference layout) */
.qp-portal .qp-stat-highlights {
    list-style: none;
    margin: 0;
    padding: 0;
}
.qp-portal .qp-stat-highlight {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 11px 0;
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--qc-text);
    border-bottom: 1px solid var(--qc-border);
}
.qp-portal .qp-stat-highlight:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.qp-portal .qp-stat-highlight-icon {
    font-size: 1.15rem;
    line-height: 1;
    flex-shrink: 0;
    width: 1.5rem;
    text-align: center;
}
.qp-portal .qp-stat-highlight-label {
    font-weight: 700;
    color: var(--qc-heading);
    min-width: 8.5rem;
}
.qp-portal .qp-stat-highlight-value {
    font-weight: 500;
    color: var(--qc-text);
    flex: 1;
}

.qp-portal .qp-overview-divider {
    margin: 18px 0 20px;
    border: none;
    border-top: 1px solid var(--qc-border);
    opacity: 0.85;
}

.qp-portal .qp-exam-details-heading {
    margin: 0 0 14px;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--qc-heading);
    letter-spacing: -0.01em;
}

.qp-portal .qp-overview-table-wrap {
    margin-bottom: 0;
}
.qp-portal .qp-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.qp-portal table.qp-exam-details-table {
    display: table;
    width: 100%;
    min-width: 280px;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: fixed;
    font-size: 0.9rem;
}
.qp-portal table.qp-exam-details-table thead {
    display: table-header-group;
}
.qp-portal table.qp-exam-details-table tbody {
    display: table-row-group;
}
.qp-portal table.qp-exam-details-table tr {
    display: table-row;
}
.qp-portal table.qp-exam-details-table th,
.qp-portal table.qp-exam-details-table td {
    display: table-cell;
}
/* Clean exam details table â€” horizontal rules only */
.qp-portal table.qp-exam-details-table--clean thead th {
    background: transparent;
    color: var(--qc-heading);
    font-weight: 800;
    font-size: 0.92rem;
    text-transform: none;
    letter-spacing: 0;
    padding: 12px 4px;
    border: none;
    border-bottom: 1px solid var(--qc-border);
    vertical-align: bottom;
}
.qp-portal table.qp-exam-details-table--clean thead th:first-child {
    width: 42%;
    text-align: left;
    padding-left: 4px;
    padding-right: 1rem;
}
.qp-portal table.qp-exam-details-table--clean thead th:last-child {
    width: 58%;
    text-align: left;
    padding-left: 0.25rem;
}
.qp-portal table.qp-exam-details-table--clean tbody th {
    width: 42%;
    padding: 13px 1rem 13px 4px;
    border: none;
    border-bottom: 1px solid var(--qc-border);
    background: transparent;
    color: var(--qc-heading);
    font-weight: 700;
    font-size: 0.9rem;
    white-space: normal;
    text-align: left;
    vertical-align: top;
}
.qp-portal table.qp-exam-details-table--clean tbody td {
    width: 58%;
    padding: 13px 4px 13px 0.25rem;
    border: none;
    border-bottom: 1px solid var(--qc-border);
    background: transparent;
    color: var(--qc-text);
    font-weight: 400;
    font-size: 0.9rem;
    text-align: left;
    vertical-align: top;
}
.qp-portal table.qp-exam-details-table--clean tbody tr:last-child th,
.qp-portal table.qp-exam-details-table--clean tbody tr:last-child td {
    border-bottom: none;
}

/* Study guide block */
.qp-portal .qp-study-guide {
    line-height: 1.65;
}
.qp-portal .qp-study-summary {
    margin: 0 0 22px;
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--qc-text);
}
.qp-portal .qp-study-heading {
    margin: 22px 0 10px;
    font-size: 1rem;
    font-weight: 800;
    color: var(--qc-heading);
}
.qp-portal .qp-study-heading:first-of-type {
    margin-top: 0;
}
.qp-portal .qp-study-list {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.92rem;
    color: var(--qc-text);
}
.qp-portal .qp-study-list li {
    margin-bottom: 8px;
    line-height: 1.55;
}
.qp-portal .qp-study-list li:last-child {
    margin-bottom: 0;
}
.qp-portal .qp-study-list--resources a {
    color: var(--qc-primary);
    font-weight: 600;
    text-decoration: none;
}
.qp-portal .qp-study-list--resources a:hover {
    text-decoration: underline;
}

/* Table of contents */
.qp-toc-card { padding-bottom: 0.85rem; }
.qp-toc-list {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.9rem;
    line-height: 1.8;
}
.qp-toc-list a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--qc-primary);
    text-decoration: none;
    font-weight: 600;
}
.qp-toc-list a:hover { text-decoration: underline; }
.qp-toc-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    border-radius: 4px;
    background: var(--qc-accent-soft);
    font-size: 0.75rem;
    color: var(--qc-primary);
}

/* Related papers widget */
.qp-related-papers-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.qp-related-papers-list li {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--qc-border);
    background: var(--qc-card-hover);
    font-size: 0.9rem;
    font-weight: 600;
}
.qp-related-papers-list a {
    color: var(--qc-primary);
    text-decoration: none;
}
.qp-related-papers-list a:hover { text-decoration: underline; }

/* Topic chips */
.qp-topic-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.qp-topic-chips li {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--qc-accent-soft);
    color: var(--qc-primary);
    border: 1px solid var(--qc-border);
}

.qp-section-lead {
    margin: 0 0 12px;
    font-size: 0.85rem;
    color: var(--qc-muted);
    line-height: 1.55;
}

/* Instructions â€” professional layout */
.qp-instructions-card { padding-bottom: 1rem; }
.qp-instructions-notice {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--qc-border);
    background: var(--qc-card-hover);
}
.qp-instructions-notice-text {
    margin: 0;
    flex: 1 1 220px;
    font-size: 0.86rem;
    line-height: 1.6;
    color: var(--qc-text);
}
.qp-lang-badge {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--qc-accent-soft);
    color: var(--qc-primary);
    border: 1px solid var(--qc-border);
}
.qp-instruction-group { margin-bottom: 18px; }
.qp-instruction-group:last-child { margin-bottom: 0; }
.qp-instruction-group-title {
    margin: 0 0 10px;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--qc-heading);
}
.qp-instruction-steps {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.qp-instruction-step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--qc-border);
    background: var(--qc-card);
}
.qp-instruction-num {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.65rem;
    height: 1.65rem;
    border-radius: 6px;
    background: var(--qc-primary);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
}
.qp-instruction-text {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--qc-text);
}

/* Question paper instruction sheet */
.qp-paper-sheet {
    margin-top: 4px;
    padding: 16px 18px;
    border-radius: 10px;
    border: 2px solid var(--qc-border);
    background: #fff;
    color: #1a1a1a;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}
html.dark .qp-paper-sheet {
    background: var(--qc-card-hover);
    color: var(--qc-text);
    border-color: var(--qc-border);
}
.qp-paper-opening {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px dashed #b45309;
    background: #fffbeb;
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.6;
    text-align: center;
    color: #92400e;
}
.qp-paper-exam-banner {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: linear-gradient(180deg, #f1f5f9 0%, #fff 100%);
    border: 1px solid #cbd5e1;
}
html.dark .qp-paper-exam-banner {
    background: var(--qc-card);
    border-color: var(--qc-border);
}
.qp-paper-exam-banner .qp-paper-sheet-row--exam {
    margin-bottom: 0;
}
.qp-paper-meta-strip {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
html.dark .qp-paper-meta-strip {
    background: var(--qc-card-hover);
    border-color: var(--qc-border);
}
.qp-paper-meta-strip .qp-paper-sheet-row--split {
    margin-bottom: 0;
}
.qp-ins-label {
    color: #1e3a5f;
    font-weight: 800;
}
html.dark .qp-ins-label { color: var(--qc-primary); }
.qp-ins-warn {
    display: block;
    font-weight: 800;
}
html.dark .qp-paper-opening {
    background: rgba(245, 158, 11, 0.12);
    color: var(--qc-text);
    border-color: var(--qc-yellow);
}
/* Instruction sheet â€” exactly 4 header rows */
.qp-paper-sheet-header {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 2px solid #1e3a5f;
}
html.dark .qp-paper-sheet-header { border-bottom-color: var(--qc-border); }
.qp-paper-sheet-row {
    margin: 0 0 10px;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.5;
    color: #0f172a;
}
html.dark .qp-paper-sheet-row { color: var(--qc-heading); }
.qp-paper-sheet-row--center {
    text-align: center;
}
.qp-paper-sheet-header--upsc-mains {
    text-align: center;
    padding-bottom: 18px;
    margin-bottom: 18px;
}
.qp-paper-sheet-row--upsc-line1 {
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    margin-bottom: 12px;
    text-transform: none;
}
.qp-paper-sheet-row--upsc-line2 {
    font-size: 0.98rem;
    font-weight: 700;
    margin-bottom: 10px;
}
.qp-paper-sheet-row--upsc-line3 {
    font-size: 0.96rem;
    font-weight: 700;
    margin-bottom: 0;
}
.qp-paper-subject-prefix {
    font-weight: 700;
}
.qp-paper-subject-sep {
    font-weight: 400;
    opacity: 0.85;
}
.qp-paper-subject-value {
    font-weight: 700;
}
.qp-paper-sheet-row--exam {
    font-size: 0.92rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 8px;
}
.qp-paper-sheet-row--paper {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 12px;
}
.qp-paper-sheet-right--series {
    line-height: 1.35;
    white-space: pre-line;
}
.qp-text-english {
    font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}
.qp-paper-section-title--center {
    text-align: center;
}
.qp-paper-sheet-row--split {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 12px;
    margin-bottom: 10px;
}
.qp-paper-sheet-row--meta {
    margin-bottom: 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: #475569;
}
html.dark .qp-paper-sheet-row--meta { color: var(--qc-muted); }
.qp-paper-sheet-left {
    flex: 1 1 auto;
    text-align: left;
}
.qp-paper-sheet-right {
    flex: 1 1 auto;
    text-align: right;
    margin-left: auto;
}
.qp-paper-sheet-row--booklet {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    font-size: 0.9rem;
    font-weight: 700;
}
.qp-paper-sheet-row--booklet .qp-paper-sheet-left {
    grid-column: 1;
    text-align: left;
}
.qp-paper-sheet-row--booklet .qp-paper-sheet-center {
    grid-column: 2;
    text-align: center;
    justify-self: center;
    white-space: nowrap;
}

.qp-paper-header-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 18px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 2px solid #1e3a5f;
}
html.dark .qp-paper-header-grid { border-bottom-color: var(--qc-border); }
.qp-paper-header-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.qp-paper-header-cell--full {
    grid-column: 1 / -1;
}
.qp-paper-header-cell--center {
    align-items: center;
    text-align: center;
}
.qp-paper-header-cell--left {
    align-items: flex-start;
    text-align: left;
}
.qp-paper-header-cell--right {
    align-items: flex-end;
    text-align: right;
}
.qp-paper-header-cell--meta .qp-paper-header-label,
.qp-paper-header-cell--meta .qp-paper-header-value {
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
}
html.dark .qp-paper-header-cell--meta .qp-paper-header-label,
html.dark .qp-paper-header-cell--meta .qp-paper-header-value {
    color: var(--qc-muted);
}
.qp-paper-header-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}
html.dark .qp-paper-header-label { color: var(--qc-muted); }
.qp-paper-header-value {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.35;
    color: #0f172a;
}
html.dark .qp-paper-header-value { color: var(--qc-heading); }
.qp-paper-section { margin-bottom: 16px; }
.qp-paper-section:last-of-type { margin-bottom: 0; }
.qp-paper-section-title {
    margin: 0 0 10px;
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #1e3a5f;
    text-align: center;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--qc-border);
}
.qp-paper-section-title--instructions {
    font-size: 1.08rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: none;
    margin-top: 6px;
}
html.dark .qp-paper-section-title { color: var(--qc-heading); }
.qp-paper-section-intro {
    margin: 0 0 8px;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.55;
}
.qp-paper-rules {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.qp-paper-rule {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 0.88rem;
    line-height: 1.65;
}
.qp-paper-rules--numbered .qp-paper-rule {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}
html.dark .qp-paper-rules--numbered .qp-paper-rule {
    background: var(--qc-card);
    border-color: var(--qc-border);
}
.qp-paper-rules--numbered .qp-paper-rule { padding-left: 12px; }
.qp-paper-rule-num {
    flex-shrink: 0;
    min-width: 1.65rem;
    height: 1.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.78rem;
    color: #fff;
    background: #1e3a5f;
}
html.dark .qp-paper-rule-num {
    color: #fff;
    background: var(--qc-primary);
}
.qp-paper-rule-text {
    flex: 1;
}
.qp-paper-rule-text strong.qp-ins-label {
    margin-right: 0.15em;
}
.qp-paper-footer {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--qc-border);
}
.qp-paper-footer-note {
    margin: 0 0 6px;
    font-size: 0.78rem;
    line-height: 1.5;
    color: #64748b;
}
.qp-paper-footer-note--en { font-style: italic; }
.qp-text-hindi {
    font-family: 'Noto Sans Devanagari', 'Mangal', 'Nirmala UI', sans-serif;
    line-height: 1.75;
}
.qp-text-punjabi {
    font-family: 'Noto Sans Gurmukhi', 'Raavi', 'Nirmala UI', sans-serif;
    line-height: 1.75;
}

/* Page-2 OCR: break long unspaced tokens (Tamil / OCR glue) */
.qp-portal .qp-page2-ocr,
.qp-portal .qp-page2-ocr p {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* MCQ preview: normal wrapping â€” avoid break-all (one-line / huge gaps) */
.qp-portal .qp-mcq-item,
.qp-portal .qp-mcq-q,
.qp-portal .qp-mcq-options,
.qp-portal .qp-mcq-options li,
.qp-portal .qp-descriptive-parts,
.qp-portal .qp-descriptive-parts li,
.qp-portal .qp-math-content,
.qp-portal .qp-paper-rule-text,
.qp-portal .qp-paper-header-value,
.qp-portal .qp-text-hindi,
.qp-portal .qp-text-punjabi {
    overflow-wrap: break-word;
    word-break: normal;
}

/* Objective MCQ preview */
.qp-mcq-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 100%;
    min-width: 0;
}
#objective-questions-preview,
#page-2-questions {
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
}
.qp-page2-ocr {
    display: flex;
    flex-direction: column;
    gap: 14px;
    line-height: 1.7;
    max-width: 100%;
    min-width: 0;
}
.qp-page2-ocr p {
    margin: 0;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--qc-border);
    background: var(--qc-card-hover);
    max-width: 100%;
    min-width: 0;
    font-weight: 400;
    color: var(--qc-text);
}
.qp-mcq-item {
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--qc-border);
    background: var(--qc-card-hover);
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
}
.qp-mcq-item--subjective .qp-mcq-q {
    margin-bottom: 0;
}
.qp-descriptive-part {
    margin: 0 0 4px;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--qc-text);
    line-height: 1.55;
    max-width: 100%;
    min-width: 0;
}
.qp-descriptive-part:last-child {
    margin-bottom: 0;
}
.qp-descriptive-compact {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--qc-text);
    line-height: 1.55;
    max-width: 100%;
    min-width: 0;
}
.qp-descriptive-section,
.qp-descriptive-section-label {
    margin: 14px 0 10px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    color: var(--qc-primary);
}
.qp-mcq-item > .qp-descriptive-section:first-child {
    margin-top: 0;
}
.qp-descriptive-page > .qp-descriptive-section-label {
    margin-top: 18px;
    margin-bottom: 12px;
}
.qp-descriptive-parts {
    margin: 8px 0 0;
    padding: 0 0 0 1.1rem;
    list-style: none;
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.65;
    color: var(--qc-text);
}
.qp-descriptive-parts li {
    margin-bottom: 10px;
    padding-left: 0.25rem;
}
.qp-descriptive-parts li:last-child { margin-bottom: 0; }
.qp-mcq-q {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--qc-heading);
    line-height: 1.55;
    white-space: normal;
    max-width: 100%;
    min-width: 0;
}
.qp-mcq-item--subjective > .qp-mcq-q .qp-math-content {
    font-weight: 400;
    color: var(--qc-text);
}
.qp-mcq-num {
    color: var(--qc-primary);
    margin-right: 6px;
    white-space: nowrap;
}
.qp-mcq-options {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--qc-text);
    max-width: 100%;
    min-width: 0;
}
.qp-mcq-options li {
    margin-bottom: 4px;
    max-width: 100%;
    min-width: 0;
}
.qp-mcq-opt-label { font-weight: 600; margin-right: 4px; white-space: nowrap; }
.qp-math-content {
    max-width: 100%;
    min-width: 0;
    white-space: normal;
}
.qp-math-content mjx-container {
    font-size: 110% !important;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
}
.qp-math-content mjx-container[display="true"] {
    display: block;
    margin: 0.45em 0;
    overflow-x: auto;
    text-align: center;
    max-width: 100%;
}
.qp-mcq-q .qp-math-content,
.qp-page2-ocr .qp-math-content {
    display: block;
    max-width: 100%;
    min-width: 0;
    white-space: normal;
    line-height: 1.55;
}
.qp-mcq-options .qp-math-content,
.qp-descriptive-parts .qp-math-content {
    display: inline;
    max-width: 100%;
    min-width: 0;
    white-space: normal;
    line-height: inherit;
}
.qp-descriptive-part .qp-math-content,
.qp-descriptive-compact .qp-math-content {
    white-space: normal;
}
.qp-mcq-q i, .qp-mcq-options i { font-style: italic; }

/* Page preview */
.qp-first-page-preview { overflow: hidden; }
.qp-paper-preview-pages { display: flex; flex-direction: column; gap: 20px; }
.qp-paper-preview-caption {
    margin: 0 0 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--qc-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.qp-paper-preview-figure { margin: 0; }
.qp-image-full-link {
    display: block;
    max-width: 100%;
    margin: 0 auto;
    border-radius: 10px;
}
.qp-first-page-img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--qc-border);
    border-radius: 8px;
    background: #fff;
}

/* FAQ */
.qp-faq-list { display: flex; flex-direction: column; gap: 8px; }
.qp-faq-item {
    border: 1px solid var(--qc-border);
    border-radius: 8px;
    padding: 0 12px;
    background: var(--qc-card-hover);
}
.qp-faq-item summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--qc-heading);
    padding: 12px 0;
    list-style: none;
}
.qp-faq-item summary::-webkit-details-marker { display: none; }
.qp-faq-item p {
    margin: 0 0 12px;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--qc-text);
}

/* PDF download block */
.qp-pdf-download-card {
    margin: 0 0 14px;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, #fff5f5 0%, #ffffff 42%, #fafafa 100%);
    border: 1px solid #f5c6c6;
    box-shadow: 0 8px 32px rgba(180, 24, 24, 0.12);
}
.qp-pdf-download-card::before {
    content: '';
    display: block;
    height: 4px;
    background: linear-gradient(90deg, #b30b00, #e5252a, #ff4d4d);
}
.qp-pdf-download-inner {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 24px 22px 22px;
}
.qp-pdf-doc {
    position: relative;
    width: 72px;
    height: 88px;
    background: linear-gradient(160deg, #ffffff 0%, #f8f8f8 100%);
    border: 2px solid #e5252a;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qp-pdf-doc-label { font-size: 1.35rem; font-weight: 900; color: #e5252a; }
.qp-pdf-doc-fold {
    position: absolute;
    top: 0;
    right: 0;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #ffe8e8 50%, #e5252a 50%);
}
.qp-pdf-download-content { flex: 1; min-width: 0; }
.qp-pdf-eyebrow {
    margin: 0 0 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #b30b00;
}
.qp-pdf-download-title {
    margin: 0 0 12px;
    font-size: clamp(1.1rem, 3.2vw, 1.4rem);
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.35;
}
.qp-pdf-meta-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}
.qp-pdf-meta-chips li {
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: #fff;
    color: #7f1d1d;
    border: 1px solid #fecaca;
}
.qp-pdf-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 320px;
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: linear-gradient(180deg, #ff3b3b 0%, #e5252a 45%, #b30b00 100%);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
}
.qp-pdf-download-btn:disabled { opacity: 0.65; cursor: wait; }
.qp-pdf-filename-hint { margin: 12px 0 0; font-size: 0.82rem; color: #6b7280; }
.qp-pdf-official-link {
    display: inline-flex;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--qc-primary);
    color: #fff !important;
    font-weight: 700;
    text-decoration: none;
}
.qp-download-toast {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(26, 10, 10, 0.55);
}
.qp-download-toast[hidden] { display: none !important; }
.qp-toast-inner.qp-toast-pdf {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 22px;
    border-radius: 16px;
    background: #fff;
    border: 2px solid #fecaca;
    width: min(440px, 100%);
}
.qp-timer-ring { position: relative; width: 56px; height: 56px; flex-shrink: 0; }
.qp-ring-svg { width: 56px; height: 56px; display: block; }
.qp-ring-bg { stroke: #fecaca; }
.qp-ring-progress { stroke: #e5252a; stroke-dasharray: 113.1; transition: stroke-dashoffset 0.35s linear; }
.qp-ring-num {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: #e5252a;
}
.qp-toast-badge {
    display: inline-block;
    margin: 0 0 4px;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 800;
    color: #fff;
    background: #e5252a;
    border-radius: 4px;
}
.qp-toast-heading { margin: 0; font-weight: 700; }
.qp-toast-sub { margin: 4px 0 0; font-size: 0.82rem; color: #6b7280; }
.qp-toast-cancel {
    padding: 8px 14px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff5f5;
    color: #991b1b;
    cursor: pointer;
}
html.dark .qp-pdf-download-card {
    background: linear-gradient(135deg, #1a0a0a 0%, #111827 45%, #0f172a 100%);
    border-color: #7f1d1d;
}
html.dark .qp-pdf-download-title { color: #f8fafc; }
html.dark .qp-pdf-meta-chips li {
    background: #1e293b;
    color: #fecaca;
    border-color: #991b1b;
}
html.dark .qp-toast-inner.qp-toast-pdf {
    background: #111827;
    color: #f8fafc;
    border-color: #7f1d1d;
}

/* â€”â€” Category listing (region / job role) â€”â€” */
.qp-cat-page { max-width: 920px; margin: 0 auto; }

.qp-cat-hero {
    border-left: 4px solid var(--qc-primary);
    padding: 14px 16px 14px 18px;
    margin-bottom: 12px;
}
.qp-cat-hero h1 {
    margin: 0 0 10px;
    font-size: clamp(1.25rem, 3.2vw, 1.55rem);
    line-height: 1.3;
    color: var(--qc-heading);
}
.qp-cat-eyebrow {
    margin: 0 0 4px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--qc-primary);
}
.qp-cat-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
.qp-cat-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.82rem;
    color: var(--qc-muted);
    background: var(--qc-accent-soft);
    border: 1px solid var(--qc-border);
    border-radius: 999px;
}
.qp-cat-stat strong {
    color: var(--qc-heading);
    font-weight: 800;
}
.qp-cat-lead {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--qc-muted);
    max-width: 52ch;
}

.qp-cat-filter-wrap {
    padding: 12px 14px;
    margin-bottom: 10px;
}
.qp-cat-filter-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--qc-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.qp-cat-filter {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--qc-input-border);
    border-radius: 10px;
    background: var(--qc-input-bg);
    color: var(--qc-text);
    font-size: 0.95rem;
    font-family: inherit;
}
.qp-cat-filter:focus {
    outline: 2px solid var(--qc-primary);
    outline-offset: 1px;
}

.qp-cat-jump {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 2px 12px;
    margin-bottom: 4px;
    scroll-snap-type: x proximity;
    position: sticky;
    top: 52px;
    z-index: 30;
    background: var(--qc-bg);
    mask-image: linear-gradient(to right, transparent, #000 8px, #000 calc(100% - 8px), transparent);
}
.qp-cat-jump-pill {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 220px;
    padding: 8px 12px;
    border: 1px solid var(--qc-border);
    border-radius: 999px;
    background: var(--qc-card);
    color: var(--qc-text);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    scroll-snap-align: start;
    box-shadow: var(--qc-shadow);
    transition: border-color 0.15s ease, background 0.15s ease;
}
.qp-cat-jump-pill:hover {
    border-color: var(--qc-primary);
    background: var(--qc-accent-soft);
    color: var(--qc-heading);
}
.qp-cat-jump-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.qp-cat-jump-count {
    flex-shrink: 0;
    min-width: 1.25rem;
    padding: 1px 6px;
    font-size: 0.72rem;
    font-weight: 800;
    text-align: center;
    color: var(--qc-primary);
    background: var(--qc-accent-soft);
    border-radius: 999px;
}

.qp-cat-exam {
    margin-bottom: 10px;
    padding: 0;
    overflow: hidden;
    scroll-margin-top: 72px;
}
.qp-cat-exam[hidden] { display: none; }
.qp-cat-exam-head {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    user-select: none;
}
.qp-cat-exam-head::-webkit-details-marker { display: none; }
.qp-cat-exam-head::marker { content: ''; }
.qp-cat-exam-title {
    display: block;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--qc-heading);
}
.qp-cat-exam-meta {
    display: block;
    margin-top: 2px;
    font-size: 0.78rem;
    color: var(--qc-muted);
    font-weight: 500;
}
.qp-cat-chevron {
    flex-shrink: 0;
    font-size: 1.35rem;
    line-height: 1;
    color: var(--qc-muted);
    transition: transform 0.2s ease;
}
.qp-cat-exam[open] .qp-cat-chevron {
    transform: rotate(90deg);
    color: var(--qc-primary);
}

.qp-cat-papers {
    list-style: none;
    margin: 0;
    padding: 0 8px 8px;
    border-top: 1px solid var(--qc-border);
}
.qp-cat-paper-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
}
.qp-cat-paper-link:hover {
    background: var(--qc-accent-soft);
}
.qp-cat-papers li + li {
    border-top: 1px solid var(--qc-border);
}
.qp-cat-thumb-wrap {
    flex-shrink: 0;
    width: 56px;
    height: 78px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--qc-border);
    background: #fff;
}
html.dark .qp-cat-thumb-wrap { background: var(--qc-surface); }
.qp-cat-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}
.qp-cat-paper-body {
    flex: 1;
    min-width: 0;
}
.qp-cat-paper-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--qc-heading);
}
.qp-cat-paper-link:hover .qp-cat-paper-title {
    color: var(--qc-primary);
}
.qp-cat-paper-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}
.qp-cat-year,
.qp-cat-adv {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--qc-muted);
}
.qp-cat-pdf-badge {
    padding: 1px 6px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #fff;
    background: var(--qc-primary);
    border-radius: 4px;
}
.qp-cat-arrow {
    flex-shrink: 0;
    font-size: 1.1rem;
    color: var(--qc-muted);
    transition: transform 0.15s ease, color 0.15s ease;
}
.qp-cat-paper-link:hover .qp-cat-arrow {
    color: var(--qc-primary);
    transform: translateX(3px);
}

.qp-cat-back {
    margin: 16px 0 8px;
    font-size: 0.88rem;
}
.qp-cat-back a {
    color: var(--qc-primary);
    text-decoration: none;
    font-weight: 600;
}
.qp-cat-back a:hover { text-decoration: underline; }

@media (max-width: 560px) {
    .qp-cat-jump { top: 48px; }
    .qp-cat-paper-link { gap: 10px; padding: 10px 6px; }
    .qp-cat-thumb-wrap { width: 48px; height: 66px; }
}

/* Related links */
.qp-related-list {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.9rem;
    line-height: 1.6;
}
.qp-related-list a { color: var(--qc-primary); font-weight: 600; }

/* Details table */
.qp-details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.qp-details-table th,
.qp-details-table td {
    border: 1px solid var(--qc-border);
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
}
.qp-details-table th {
    width: 34%;
    background: var(--qc-card-hover);
    color: var(--qc-muted);
    font-weight: 600;
}

.qp-back-top { margin: 16px 0 0; font-size: 0.9rem; }
.qp-back-top a { color: var(--qc-primary); text-decoration: none; }

.qp-portal-placeholder {
    padding: 1rem;
    border-radius: 8px;
    border: 1px dashed var(--qc-border);
    color: var(--qc-muted);
    font-size: 0.9rem;
}

/* Jump links + anchor scroll (sticky header offset) */
.jump-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 14px;
}
.jump-links--sticky {
    position: sticky;
    top: 56px;
    z-index: 40;
    padding: 10px 0;
    background: var(--qc-bg);
    border-bottom: 1px solid var(--qc-border);
}
.jump-link {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.85rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--qc-primary);
    background: var(--qc-accent-soft);
    border: 1px solid var(--qc-border);
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.jump-link:hover {
    background: var(--qc-primary);
    color: #fff;
    border-color: var(--qc-primary);
}

#exam-overview,
#study-guide,
#paper-instructions,
#objective-questions-preview,
#page-2-questions,
#page-2-portal-html,
#paper-preview,
#download-pdf,
#paper-faq,
#related-resources {
    scroll-margin-top: 76px;
}

.qp-download-pdf-block {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--qc-border);
}
.qp-pdf-official-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--qc-primary);
    color: #fff !important;
    font-weight: 700;
    text-decoration: none;
}
.qp-pdf-official-link:hover {
    background: var(--qc-primary-hover);
}

html.dark .qp-first-page-img {
    filter: invert(1);
    background: transparent;
    border-color: rgba(148, 163, 184, 0.35);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
html.dark .qp-paper-preview-figure {
    padding: 10px;
    border-radius: 10px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.qp-faq-list { display: flex; flex-direction: column; gap: 8px; }
.qp-faq-item {
    border: 1px solid var(--qc-border);
    border-radius: 8px;
    padding: 0 12px;
    background: var(--qc-card-hover);
}
.qp-faq-item summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--qc-heading);
    padding: 12px 0;
    list-style: none;
}
.qp-faq-item summary::-webkit-details-marker { display: none; }
.qp-faq-item p {
    margin: 0 0 12px;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--qc-text);
}


/* —— Index & region hub —— */
.qp-index-page { max-width: 920px; margin: 0 auto; }

.qp-index-hero {
    border-left: 4px solid var(--qc-primary);
    padding: 14px 16px 14px 18px;
    margin-bottom: 12px;
}
.qp-index-hero h1 {
    margin: 0 0 10px;
    font-size: clamp(1.25rem, 3.2vw, 1.55rem);
    line-height: 1.3;
    color: var(--qc-heading);
}
.qp-index-lead {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--qc-muted);
    max-width: 54ch;
}
.qp-index-heading {
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--qc-heading);
}
.qp-index-regions,
.qp-index-roles {
    padding: 14px 16px;
    margin-bottom: 12px;
}
.qp-index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 10px;
}
.qp-index-grid--roles {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.qp-index-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    min-height: 72px;
    border: 1px solid var(--qc-border);
    border-radius: 12px;
    background: var(--qc-card);
    text-decoration: none;
    color: inherit;
    position: relative;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.qp-index-card:hover {
    border-color: var(--qc-primary);
    background: var(--qc-accent-soft);
    box-shadow: var(--qc-shadow);
}
.qp-index-card-name {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--qc-heading);
    padding-right: 1.25rem;
}
.qp-index-card:hover .qp-index-card-name {
    color: var(--qc-primary);
}
.qp-index-card-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--qc-muted);
}
.qp-index-card-arrow {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 1rem;
    color: var(--qc-muted);
    transition: transform 0.15s ease, color 0.15s ease;
}
.qp-index-card:hover .qp-index-card-arrow {
    color: var(--qc-primary);
    transform: translateX(2px);
}
.qp-index-card--role .qp-index-card-name {
    font-size: 0.92rem;
}

@media (max-width: 560px) {
    .qp-index-grid,
    .qp-index-grid--roles {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .qp-index-card { min-height: 64px; padding: 10px 12px; }
    .qp-index-card-name { font-size: 0.88rem; }
}

@media (max-width: 380px) {
    .qp-index-grid,
    .qp-index-grid--roles {
        grid-template-columns: 1fr;
    }
}

.qp-index-region-block {
    padding: 14px 16px;
    margin-bottom: 10px;
    scroll-margin-top: 64px;
}
.qp-index-region-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 12px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--qc-border);
}
.qp-index-region-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--qc-heading);
}
.qp-index-region-meta {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--qc-muted);
}
.qp-index-back-top {
    margin: 10px 0 0;
    font-size: 0.82rem;
}
.qp-index-back-top a {
    color: var(--qc-primary);
    text-decoration: none;
    font-weight: 600;
}
.qp-index-back-top a:hover { text-decoration: underline; }
.qp-index-hero .qp-index-heading {
    margin-top: 1.1rem;
}

/* Static pages (about, contact, privacy, terms) */
.static-page { max-width: 720px; margin: 0 auto; }
.static-page-card h1 {
    margin: 0 0 0.75rem;
    font-size: clamp(1.3rem, 3vw, 1.6rem);
    color: var(--qc-heading);
}
.static-page-card h2 {
    margin: 1.25rem 0 0.5rem;
    font-size: 1.05rem;
    color: var(--qc-heading);
}
.static-page-lead {
    margin: 0 0 1rem;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--qc-text);
}
.static-page-muted {
    margin: 0 0 1rem;
    font-size: 0.85rem;
    color: var(--qc-muted);
}
.static-page-list {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
    line-height: 1.65;
    color: var(--qc-text);
}
.static-page-list li { margin-bottom: 0.35rem; }
.static-page-cta { margin: 1.25rem 0 0; }
.static-page-cta a {
    color: var(--qc-primary);
    font-weight: 700;
    text-decoration: none;
}
.static-page-cta a:hover { text-decoration: underline; }
.static-page-contact-box {
    margin: 1rem 0 1.25rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--qc-border);
    border-radius: 10px;
    background: var(--qc-accent-soft);
}
.static-page-contact-label {
    margin: 0 0 0.25rem;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--qc-muted);
}
.static-page-contact-box a {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--qc-primary);
    text-decoration: none;
}
.static-page-contact-box a:hover { text-decoration: underline; }

