html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #f1f5f9;
    color: #111827;
}

/* ── Quiz Layout ───────────────────────────────────── */
.ql-shell {
    min-height: 100vh;
    background: #f1f5f9;
    color: #111827;
    display: flex;
    flex-direction: column;
}
.ql-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 14px 28px;
    display: flex;
    align-items: baseline;
    gap: 16px;
    flex-shrink: 0;
}
.ql-brand {
    font-size: 1.15rem;
    font-weight: 700;
    color: #6366f1;
    letter-spacing: .02em;
}
.ql-subtitle {
    font-size: .8rem;
    color: #9ca3af;
}
.ql-body {
    flex: 1;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px 64px;
}

/* ── Start Screen ──────────────────────────────────── */
.qz-center {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 24px;
}

/* Home page layout */
.qz-home { display: flex; flex-direction: column; gap: 56px; padding-top: 8px; }

.qz-home-hero {
    display: grid;
    grid-template-columns: 520px 1fr;
    gap: 40px;
    align-items: start;
}

/* Intro panel (right of start card) */
.qz-home-intro { padding-top: 8px; }
.qz-intro-heading { font-size: 1.35rem; font-weight: 700; color: #111827; margin: 0 0 12px; }
.qz-intro-subheading { font-size: 1rem; font-weight: 700; color: #111827; margin: 20px 0 8px; }
.qz-intro-body { color: #374151; font-size: .95rem; line-height: 1.65; margin: 0 0 20px; }
.qz-intro-note { color: #6b7280; font-size: .875rem; line-height: 1.6; margin: 0 0 20px; background: #f8fafc; border-left: 3px solid #6366f1; padding: 10px 14px; border-radius: 0 8px 8px 0; }
.qz-how-list { margin: 0; padding-left: 20px; color: #374151; font-size: .9rem; line-height: 1.75; }
.qz-how-list li { margin-bottom: 6px; }

/* Exam fact pills */
.qz-exam-facts { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.qz-fact { background: #f0f0ff; border: 1px solid #c7d2fe; border-radius: 10px; padding: 10px 16px; text-align: center; min-width: 72px; }
.qz-fact-num { display: block; font-size: 1.4rem; font-weight: 800; color: #4f46e5; line-height: 1; }
.qz-fact-label { display: block; font-size: .7rem; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }

/* Section headings */
.qz-section-heading { font-size: 1.25rem; font-weight: 700; color: #111827; margin: 0 0 6px; }
.qz-section-sub { color: #6b7280; font-size: .875rem; margin: 0 0 24px; }

/* Domain cards grid */
.qz-domain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.qz-domain-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px 22px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.qz-domain-label { font-size: .72rem; font-weight: 700; color: #6366f1; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.qz-domain-name { font-size: .95rem; font-weight: 700; color: #111827; margin: 0 0 8px; }
.qz-domain-desc { font-size: .82rem; color: #6b7280; line-height: 1.6; margin: 0; }
.qz-domain-desc code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-size: .78rem; }

/* FAQ grid */
.qz-faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}
.qz-faq-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px 22px;
}
.qz-faq-q { font-size: .9rem; font-weight: 700; color: #111827; margin: 0 0 8px; }
.qz-faq-a { font-size: .85rem; color: #6b7280; line-height: 1.65; margin: 0; }

/* Responsive: collapse hero to single column below 900px */
@media (max-width: 900px) {
    .qz-home-hero { grid-template-columns: 1fr; }
    .qz-start-card { max-width: 100%; }
}

.qz-start-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 40px 44px;
    max-width: 520px;
    width: 100%;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.qz-logo { font-size: 3rem; margin-bottom: 12px; }
.qz-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px;
}
.qz-tagline { color: #6b7280; font-size: .9rem; margin-bottom: 28px; }

.qz-field-group { text-align: left; margin-bottom: 20px; }
.qz-label { display: block; font-size: .8rem; font-weight: 600; color: #6b7280; margin-bottom: 6px; letter-spacing: .05em; text-transform: uppercase; }
.qz-input {
    width: 100%;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #111827;
    padding: 10px 14px;
    font-size: .95rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color .15s;
}
.qz-input:focus { border-color: #6366f1; }
.qz-hint { font-size: .75rem; color: #9ca3af; margin-top: 5px; display: block; }

.qz-alert {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: .875rem;
    margin-bottom: 16px;
    text-align: left;
}

.qz-key-configured {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 8px;
}
.qz-key-ok { font-size: .85rem; color: #166534; font-weight: 600; }
.qz-link-btn {
    background: none;
    border: none;
    color: #6366f1;
    font-size: .8rem;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}
.qz-link-btn:hover { color: #4f46e5; }

.qz-count-options {
    display: flex;
    gap: 8px;
}
.qz-count-btn {
    background: #f9fafb;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    color: #374151;
    font-size: .95rem;
    font-weight: 600;
    padding: 8px 20px;
    cursor: pointer;
    transition: border-color .12s, color .12s, background .12s;
    flex: 1;
}
.qz-count-btn:hover { border-color: #6366f1; color: #111827; }
.qz-count-btn.active {
    border-color: #6366f1;
    background: #eef2ff;
    color: #4f46e5;
}

.qz-mode-options {
    display: flex;
    gap: 10px;
}
.qz-mode-btn {
    flex: 1;
    background: #f9fafb;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    color: #374151;
    padding: 12px 14px;
    cursor: pointer;
    text-align: left;
    transition: border-color .12s, background .12s;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.qz-mode-btn:hover { border-color: #6366f1; }
.qz-mode-btn.active { border-color: #6366f1; background: #eef2ff; }
.qz-mode-icon { font-size: 1.15rem; margin-bottom: 2px; }
.qz-mode-title { font-size: .9rem; font-weight: 700; color: #111827; }
.qz-mode-btn.active .qz-mode-title { color: #4f46e5; }
.qz-mode-desc { font-size: .73rem; color: #9ca3af; line-height: 1.4; }
.qz-mode-btn.active .qz-mode-desc { color: #6366f1; }

.qz-topics-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 28px;
}
.qz-topic-chip {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: .75rem;
    color: #374151;
}

/* ── Loading Screen ────────────────────────────────── */
.qz-loading-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 56px 44px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.qz-loading-title { color: #111827; font-size: 1.4rem; margin: 24px 0 8px; }
.qz-loading-msg { color: #6366f1; font-size: .9rem; min-height: 1.4em; }
.qz-loading-note { color: #9ca3af; font-size: .8rem; margin-top: 20px; line-height: 1.6; }
.qz-loading-note strong { color: #6b7280; }

.qz-gen-wrap { margin: 20px 0 4px; }
.qz-gen-bar-track {
    height: 8px;
    background: #f1f5f9;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
    border: 1px solid #e5e7eb;
}
.qz-gen-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #818cf8);
    border-radius: 6px;
    transition: width .4s ease;
    min-width: 4px;
}
.qz-gen-count { font-size: .82rem; color: #9ca3af; text-align: right; }

/* ── Question Navigator ────────────────────────────── */
/* Cells flex to fill one screen-wide row: they shrink for large counts (60 fit on one line)
   and cap their width for small counts so they don't stretch across the screen. */
.qz-nav-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-bottom: 14px;
}
.qz-nav-cell {
    flex: 1 1 0;
    min-width: 14px;
    max-width: 30px;
    height: 22px;
    padding: 0 1px;
    border-radius: 5px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #6b7280;
    font-size: .6rem;
    font-weight: 600;
    text-align: center;
    overflow: hidden;
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
}
.qz-nav-cell:hover:not(:disabled) { border-color: #6366f1; color: #4f46e5; }
.qz-nav-cell-answered { background: #eef2ff; border-color: #c7d2fe; color: #4f46e5; }
.qz-nav-cell-unanswered { background: #f9fafb; border-color: #e5e7eb; color: #9ca3af; }
.qz-nav-cell-tentative { background: #fff; border-color: #a5b4fc; border-style: dashed; color: #6366f1; }
.qz-nav-cell-skipped { background: #fef2f2; border-color: #fca5a5; color: #dc2626; font-weight: 700; }
.qz-nav-cell-skipped:hover:not(:disabled) { border-color: #dc2626; color: #b91c1c; }
.qz-nav-cell-pending { background: #f3f4f6; border-color: #e5e7eb; color: #d1d5db; cursor: default; }
.qz-nav-cell-current {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
    box-shadow: 0 0 0 2px rgba(99,102,241,.25);
}
.qz-nav-cell-flagged {
    background: #fff7ed;
    border-color: #f59e0b;
    color: #d97706;
}
.qz-nav-cell-flagged:hover:not(:disabled) { border-color: #d97706; color: #b45309; }
/* Flagged + current: orange fill so a flag is always obvious, even on the active cell */
.qz-nav-cell-current.qz-nav-cell-flagged {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #fff;
    box-shadow: 0 0 0 2px rgba(245,158,11,.3);
}

/* ── Question toolbar (flag) ───────────────────────── */
.qz-q-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.qz-q-toolbar-num { font-size: .78rem; font-weight: 700; color: #9ca3af; letter-spacing: .03em; }
.qz-flag-btn {
    background: #fff7ed;
    border: 1px solid #fdba74;
    border-radius: 7px;
    color: #d97706;
    font-size: .78rem;
    font-weight: 700;
    padding: 7px 14px;
    cursor: pointer;
    transition: border-color .12s, color .12s, background .12s;
}
.qz-flag-btn:hover { background: #ffedd5; border-color: #f59e0b; color: #b45309; }
.qz-flag-btn-active { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.qz-flag-btn-active:hover { background: #d97706; border-color: #d97706; color: #fff; }

/* ── In-question navigation row ────────────────────── */
.qz-nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.qz-nav-row-right { display: flex; align-items: center; gap: 12px; }
.qz-btn-secondary:disabled { opacity: .45; cursor: default; border-color: #e5e7eb; color: #d1d5db; }
.qz-btn-ghost {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: .82rem;
    font-weight: 600;
    padding: 11px 14px;
    cursor: pointer;
    transition: color .12s;
}
.qz-btn-ghost:hover { color: #ef4444; }

/* ── Progress Bar ──────────────────────────────────── */
.qz-progress-bar-wrap {
    height: 5px;
    background: #e5e7eb;
    border-radius: 4px;
    margin-bottom: 18px;
    overflow: hidden;
}
.qz-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #818cf8);
    border-radius: 4px;
    transition: width .35s ease;
}

/* ── Status Row ────────────────────────────────────── */
.qz-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}
.qz-qnum { font-size: .85rem; color: #6b7280; font-weight: 600; }
.qz-topic-badge {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    border-radius: 20px;
    padding: 3px 12px;
    font-size: .75rem;
    font-weight: 600;
}
.qz-score-live { font-size: .85rem; color: #6b7280; font-weight: 600; }
.qz-score-pts { color: #6366f1; }

/* ── Question Card ─────────────────────────────────── */
.qz-question-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 32px 40px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.qz-question-text {
    font-size: 0.74rem;
    line-height: 1.7;
    color: #111827;
    margin: 0 0 24px;
    white-space: pre-wrap;
}

/* ── Option Buttons ────────────────────────────────── */
.qz-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.qz-option {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    color: #111827;
    padding: 13px 18px;
    text-align: left;
    font-size: .74rem;
    line-height: 1.55;
    cursor: pointer;
    transition: border-color .12s, background .12s;
    width: 100%;
}
.qz-option:hover:not(:disabled) {
    border-color: #6366f1;
    background: #eef2ff;
}
.qz-option.opt-correct {
    background: #dcfce7 !important;
    border-color: #22c55e !important;
    color: #166534 !important;
    font-weight: 600;
}
.qz-option.opt-wrong {
    background: #fee2e2 !important;
    border-color: #ef4444 !important;
    color: #991b1b !important;
    font-weight: 600;
}
.qz-option.opt-selected {
    background: #eef2ff !important;
    border-color: #6366f1 !important;
    color: #4338ca !important;
    font-weight: 600;
}
.qz-option.opt-dim {
    opacity: .4;
}
.qz-exam-next {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}
.qz-option:disabled { cursor: default; }

/* ── Submit row (Practice mode) ────────────────────── */
.qz-submit-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
    flex-wrap: wrap;
}
.qz-submit-hint { font-size: .78rem; color: #9ca3af; }

/* ── Feedback Block ────────────────────────────────── */
.qz-feedback {
    margin-top: 20px;
    border-radius: 10px;
    padding: 18px 20px;
    border-left: 4px solid transparent;
}
.qz-feedback-correct {
    background: #f0fdf4;
    border-left-color: #22c55e;
}
.qz-feedback-wrong {
    background: #fef2f2;
    border-left-color: #ef4444;
}
.qz-feedback-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: .9rem;
    color: #111827;
}
.qz-verdict-icon { font-size: 1.1rem; }
.qz-explanation {
    font-size: .88rem;
    line-height: 1.6;
    color: #374151;
    margin: 0 0 14px;
}
.qz-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.qz-links-label { font-size: .78rem; color: #9ca3af; }
.qz-link {
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #4f46e5;
    font-size: .78rem;
    padding: 4px 10px;
    text-decoration: none;
    transition: border-color .12s;
}
.qz-link:hover { border-color: #6366f1; color: #4338ca; }
.qz-next-row { display: flex; justify-content: flex-end; margin-top: 4px; }

/* ── Results ───────────────────────────────────────── */
.qz-results { animation: fadeIn .3s ease; }
.qz-results-header {
    border-radius: 14px;
    padding: 36px 32px;
    text-align: center;
    margin-bottom: 28px;
}
.qz-pass { background: linear-gradient(135deg, #f0fdf4, #dcfce7); border: 2px solid #22c55e; }
.qz-fail { background: linear-gradient(135deg, #fef2f2, #fee2e2); border: 2px solid #ef4444; }
.qz-verdict { font-size: 1rem; font-weight: 800; letter-spacing: .25em; color: #6b7280; margin-bottom: 8px; }
.qz-pass .qz-verdict { color: #166534; }
.qz-fail .qz-verdict { color: #991b1b; }
.qz-big-score { font-size: 3.5rem; font-weight: 800; color: #111827; line-height: 1; margin-bottom: 8px; }
.qz-pct { font-size: 1rem; color: #6b7280; }
.qz-weighted-pct { font-size: .9rem; color: #4f46e5; font-weight: 600; margin-top: 6px; }
.qz-weighted-note { font-size: .75rem; color: #9ca3af; font-weight: 500; display: block; margin-top: 2px; }
.qz-exam-badge {
    margin-top: 10px;
    font-size: .8rem;
    color: #92400e;
    letter-spacing: .03em;
    opacity: .9;
}

.qz-results-body { background: #ffffff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 28px 32px; }
.qz-section-title { font-size: 1rem; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 16px; }

.qz-topic-table { width: 100%; border-collapse: collapse; font-size: .88rem; margin-bottom: 24px; }
.qz-topic-table th { text-align: left; color: #6b7280; font-weight: 600; padding: 6px 10px; border-bottom: 1px solid #e5e7eb; }
.qz-topic-table td { padding: 9px 10px; border-bottom: 1px solid #f3f4f6; color: #374151; }
.qz-topic-table .tr-ok td:last-child { color: #166534; font-weight: 600; }
.qz-topic-table .tr-fail td:last-child { color: #dc2626; font-weight: 600; }

.qz-wrong-section { margin-bottom: 24px; }
.qz-wrong-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px 20px;
    margin-top: 12px;
}

.qz-correct-card {
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.qz-wrong-topic { font-size: .75rem; color: #6366f1; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.qz-wrong-q { font-size: .9rem; color: #111827; margin: 0 0 10px; line-height: 1.5; }
.qz-wrong-yours { font-size: .85rem; color: #dc2626; margin: 0 0 4px; }
.qz-wrong-correct { font-size: .85rem; color: #166534; margin: 0 0 8px; }
.wrong-label { font-weight: 700; }
.correct-label { font-weight: 700; }
.qz-wrong-expl { font-size: .83rem; color: #6b7280; margin: 0 0 10px; line-height: 1.5; }

.qz-restart-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.qz-build-tag { margin-top: 18px; font-size: .68rem; color: #d1d5db; letter-spacing: .03em; }

/* ── Shared Buttons ────────────────────────────────── */
.qz-btn-primary {
    background: #6366f1;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: .9rem;
    font-weight: 600;
    padding: 11px 24px;
    cursor: pointer;
    transition: background .15s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.qz-btn-primary:hover:not(:disabled) { background: #4f46e5; }
.qz-btn-primary:disabled { opacity: .6; cursor: default; }
.qz-btn-secondary {
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #6b7280;
    font-size: .9rem;
    font-weight: 600;
    padding: 11px 24px;
    cursor: pointer;
    transition: border-color .15s, color .15s;
}
.qz-btn-secondary:hover { border-color: #6366f1; color: #4f46e5; }

/* ── Unofficial badge ──────────────────────────────── */
.qz-unofficial-badge {
    font-size: .75rem;
    color: #9ca3af;
    margin-top: -12px;
    margin-bottom: 20px;
    letter-spacing: .02em;
}

/* ── Footer Disclaimer ─────────────────────────────── */
.ql-footer {
    border-top: 1px solid #e5e7eb;
    padding: 32px 16px 48px;
    margin-top: 48px;
}
.ql-disclaimer-box {
    max-width: 1100px;
    margin: 0 auto;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px 28px;
}
.ql-disclaimer-title {
    font-size: .8rem;
    font-weight: 700;
    color: #d97706;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.ql-disclaimer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
    margin-bottom: 16px;
}
@media (max-width: 640px) {
    .ql-disclaimer-grid { grid-template-columns: 1fr; }
}
.ql-disc-item strong {
    display: block;
    font-size: .8rem;
    color: #374151;
    margin-bottom: 4px;
    letter-spacing: .02em;
}
.ql-disc-item p {
    font-size: .78rem;
    color: #6b7280;
    line-height: 1.55;
    margin: 0;
}
.ql-disc-item p strong { display: inline; color: #6b7280; }
.ql-disc-item a { color: #6366f1; text-decoration: none; }
.ql-disc-item a:hover { text-decoration: underline; }
.ql-disc-footer {
    font-size: .75rem;
    color: #9ca3af;
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
    line-height: 1.6;
}

/* ── Spinners ──────────────────────────────────────── */
.qz-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
.qz-big-spinner {
    display: inline-block;
    width: 52px;
    height: 52px;
    border: 4px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin .9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* ── Background generation strip ──────────────────────── */
.qz-gen-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .74rem;
    color: #9ca3af;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 14px;
    margin-bottom: 12px;
}
.qz-gen-strip-ready {
    color: #166534;
    background: #f0fdf4;
    border-color: #bbf7d0;
    font-weight: 600;
}
.qz-gen-strip-stopped {
    color: #92400e;
    background: #fffbeb;
    border-color: #fde68a;
    font-weight: 600;
}

/* Fixed-height slot so the question card never jumps when the strip appears/disappears */
.qz-gen-strip-slot {
    min-height: 34px;
    margin-bottom: 12px;
}
.qz-gen-strip-slot .qz-gen-strip {
    margin-bottom: 0;
}

/* Inline "Stop generating" button living inside the strip */
.qz-stop-gen-inline {
    margin-left: auto;
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 6px;
    color: inherit;
    font-size: .72rem;
    font-weight: 700;
    padding: 3px 10px;
    cursor: pointer;
    opacity: .8;
    transition: opacity .12s, background .12s;
}
.qz-stop-gen-inline:hover { opacity: 1; background: rgba(0,0,0,.05); }

/* Cancel button on the loading card */
.qz-stop-gen-btn { margin-top: 24px; }
.qz-gen-spin {
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 2px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    flex-shrink: 0;
}
.qz-gen-bar-wrap {
    flex: 1;
    height: 4px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    max-width: 120px;
}
.qz-gen-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #818cf8);
    border-radius: 4px;
    transition: width .4s ease;
    min-width: 4px;
}
.qz-gen-pct {
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

/* ── Waiting-for-next-question card ───────────────────── */
.qz-waiting-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 56px 40px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.qz-waiting-msg {
    color: #6366f1;
    font-size: .9rem;
    margin-top: 20px;
}

/* ── Timer ─────────────────────────────────────────────── */
.qz-timer-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.qz-timer {
    font-size: .85rem;
    font-weight: 700;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
    letter-spacing: .04em;
}
.qz-timer-urgent {
    color: #ef4444;
    animation: pulse 1s ease-in-out infinite;
}
.qz-pause-btn {
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #374151;
    font-size: .75rem;
    font-weight: 600;
    padding: 4px 10px;
    cursor: pointer;
    transition: border-color .12s, color .12s, background .12s;
}
.qz-pause-btn:hover { border-color: #6366f1; color: #4f46e5; }
.qz-pause-btn.paused {
    border-color: #f59e0b;
    color: #92400e;
    background: #fffbeb;
}

/* ── Promo Code ────────────────────────────────────────── */
.qz-promo-ok {
    font-size: .75rem;
    color: #166534;
    font-weight: 600;
    margin-top: 5px;
    display: block;
}
.qz-input-valid { border-color: #22c55e !important; }

/* ── Timeout badge in Results ──────────────────────────── */
.qz-timeout-badge {
    margin-top: 10px;
    font-size: .85rem;
    font-weight: 600;
    color: #dc2626;
    letter-spacing: .02em;
}

/* ── Persistent toolbar (reading list + saved) ─────────────── */
.qz-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.qz-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #374151;
    font-size: .8rem;
    font-weight: 600;
    padding: 6px 14px;
    cursor: pointer;
    transition: border-color .12s, color .12s, background .12s;
}
.qz-toolbar-btn:hover { border-color: #6366f1; color: #4f46e5; }
.qz-toolbar-btn.active { border-color: #6366f1; background: #eef2ff; color: #4338ca; }
.qz-toolbar-count {
    background: #6366f1;
    color: #fff;
    border-radius: 10px;
    font-size: .7rem;
    font-weight: 700;
    padding: 1px 7px;
    min-width: 18px;
    text-align: center;
}

/* ── Enhanced doc links (with pin + status) ────────────────── */
.qz-link-list { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.qz-link-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.qz-link-checking { opacity: .65; }
.qz-link-verified { }
.qz-link-broken {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 6px;
    color: #92400e;
    font-size: .78rem;
    padding: 4px 10px;
    cursor: default;
}
.qz-link-search {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}
.qz-link-search:hover { border-color: #3b82f6; color: #1e40af; }
.qz-link-status { font-size: .7rem; margin-left: 3px; }
.qz-link-ok { color: #16a34a; }
.qz-link-warn { color: #d97706; font-size: .8rem; }
.qz-pin-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: .85rem;
    cursor: pointer;
    padding: 3px 6px;
    line-height: 1;
    opacity: .45;
    transition: opacity .12s, border-color .12s, background .12s;
    flex-shrink: 0;
}
.qz-pin-btn:hover { opacity: 1; border-color: #d1d5db; background: #f9fafb; }
.qz-pin-btn-active { opacity: 1; border-color: #6366f1; background: #eef2ff; }

/* ── Save question button ───────────────────────────────────── */
.qz-save-row { margin-top: 10px; margin-bottom: 4px; }
.qz-save-btn {
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    color: #6b7280;
    font-size: .78rem;
    font-weight: 600;
    padding: 5px 12px;
    cursor: pointer;
    transition: border-color .12s, color .12s, background .12s;
}
.qz-save-btn:hover { border-color: #6366f1; color: #4f46e5; background: #eef2ff; }
.qz-save-btn-saved { border-color: #6366f1; color: #4338ca; background: #eef2ff; }

/* ── Modals ─────────────────────────────────────────────────── */
.qz-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 900;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 72px;
    backdrop-filter: blur(2px);
}
.qz-modal {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    width: 100%;
    max-width: 480px;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(0,0,0,.18);
    animation: fadeIn .18s ease;
}
.qz-modal-wide { max-width: 660px; }
.qz-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
}
.qz-modal-title { font-size: .95rem; font-weight: 700; color: #111827; }
.qz-modal-close {
    background: none;
    border: none;
    font-size: 1rem;
    color: #9ca3af;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color .12s, background .12s;
}
.qz-modal-close:hover { color: #111827; background: #f3f4f6; }
.qz-modal-body {
    overflow-y: auto;
    padding: 16px 20px 20px;
    flex: 1;
}
.qz-empty-state {
    color: #9ca3af;
    font-size: .88rem;
    line-height: 1.65;
    text-align: center;
    padding: 24px 0;
}

/* ── Reading list items ─────────────────────────────────────── */
.qz-pinned-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}
.qz-pinned-item:last-of-type { border-bottom: none; }
.qz-pinned-link {
    color: #4f46e5;
    font-size: .88rem;
    text-decoration: none;
    flex: 1;
    line-height: 1.4;
}
.qz-pinned-link:hover { text-decoration: underline; }
.qz-remove-btn {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: .8rem;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    transition: color .12s, background .12s;
}
.qz-remove-btn:hover { color: #ef4444; background: #fef2f2; }

/* ── Saved question cards ───────────────────────────────────── */
.qz-saved-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 8px;
    overflow: hidden;
}
.qz-saved-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 11px 14px;
    cursor: pointer;
    background: #f9fafb;
    user-select: none;
    transition: background .1s;
}
.qz-saved-header:hover { background: #f3f4f6; }
.qz-saved-topic {
    font-size: .7rem;
    font-weight: 700;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: .06em;
    flex-shrink: 0;
}
.qz-saved-q-preview {
    font-size: .82rem;
    color: #374151;
    flex: 1;
    line-height: 1.4;
}
.qz-saved-toggle { font-size: .7rem; color: #9ca3af; flex-shrink: 0; }
.qz-saved-body {
    padding: 14px;
    border-top: 1px solid #f3f4f6;
    background: #ffffff;
}
.qz-saved-full-q { font-size: .85rem; color: #111827; line-height: 1.6; margin: 0 0 12px; }
.qz-saved-option {
    font-size: .8rem;
    padding: 7px 10px;
    border-radius: 6px;
    margin-bottom: 5px;
    border: 1px solid #e5e7eb;
    color: #374151;
    background: #f9fafb;
}
.qz-saved-option.opt-correct { background: #dcfce7; border-color: #22c55e; color: #166534; font-weight: 600; }
.qz-saved-option.opt-wrong { background: #fee2e2; border-color: #ef4444; color: #991b1b; font-weight: 600; }
.qz-saved-expl { font-size: .82rem; color: #6b7280; line-height: 1.55; margin: 10px 0 0; }

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
