/* ==========================================================================
   Study Lab — quiz player. Follows the page theme (lab.css tokens); only the
   right/wrong colours are fixed, so green and red mean the same in both.
   ========================================================================== */

.lab-quiz { max-width: 700px; margin: 0 auto; padding: 20px 16px 60px; scroll-margin-top: 70px; }

.qz-empty { text-align: center; padding: 50px 16px; color: var(--muted); }
.qz-empty i { font-size: 34px; margin-bottom: 10px; color: var(--accent); }

.qz-top { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 15px; }
.qz-top small { color: var(--muted); font-weight: 600; }
.qz-tally { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.qz-tally .fa-check { color: #12a06a; }
.qz-tally .fa-xmark { color: #de3b2f; margin-left: 8px; }

.qz-track { height: 6px; margin: 10px 0 16px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.qz-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ff6a3d, #e8452f); transition: width .3s ease; }

.qz-card {
    padding: 20px 18px 18px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}
.qz-q { margin: 0 0 16px; font-size: 18px; line-height: 1.5; font-weight: 600; }
.qz-opts { display: flex; flex-direction: column; gap: 10px; }
.qz-opt {
    display: flex; align-items: center; gap: 12px;
    width: 100%; padding: 12px 14px; text-align: left;
    border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface-2);
    font-size: 16px; line-height: 1.4;
    transition: border-color .15s, background .15s, transform .1s;
}
.qz-opt:not(:disabled):hover { border-color: var(--brand); background: var(--brand-soft); }
.qz-opt:not(:disabled):active { transform: scale(.99); }
.qz-opt:disabled { cursor: default; }
.qz-letter {
    flex: none; display: grid; place-items: center;
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--surface); border: 1.5px solid var(--line);
    font-weight: 800; font-size: 13px; color: var(--muted);
}
.qz-opt.is-right { border-color: #12a06a; background: rgba(18, 160, 106, .13); }
.qz-opt.is-right .qz-letter { background: #12a06a; border-color: #12a06a; color: #fff; }
.qz-opt.is-wrong { border-color: #de3b2f; background: rgba(222, 59, 47, .12); }
.qz-opt.is-wrong .qz-letter { background: #de3b2f; border-color: #de3b2f; color: #fff; }
.qz-opt.is-dim { opacity: .55; }

.qz-explain {
    margin-top: 14px; padding: 12px 14px;
    border-radius: 14px; font-size: 15px; line-height: 1.5;
    animation: qz-in .2s ease;
}
.qz-explain.is-right { background: rgba(18, 160, 106, .1); border: 1px solid rgba(18, 160, 106, .35); }
.qz-explain.is-wrong { background: rgba(222, 59, 47, .08); border: 1px solid rgba(222, 59, 47, .3); }
.qz-explain b { display: flex; align-items: center; gap: 8px; }
.qz-explain.is-right b { color: #12a06a; }
.qz-explain.is-wrong b { color: #de3b2f; }
.qz-explain p { margin: 6px 0 0; color: var(--text-soft); }
.qz-link {
    margin-top: 10px; padding: 0; border: 0; background: none;
    color: var(--brand-ink); font-weight: 700; font-size: 14px;
}
@keyframes qz-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.qz mark { background: rgba(255, 220, 60, .45); color: inherit; padding: 0 2px; border-radius: 3px; }
.qz .red { color: #de3b2f; font-weight: 700; }

.qz-nav { display: flex; justify-content: flex-end; margin-top: 14px; }
.qz-next, .qz-ghost {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    padding: 13px 22px; border-radius: 14px; font-weight: 700; font-size: 15.5px;
}
.qz-next { border: 0; background: linear-gradient(135deg, #ff6a3d, #e8452f 55%, #c9324f); color: #fff; box-shadow: 0 8px 20px rgba(232, 69, 47, .25); }
.qz-ghost { border: 1.5px solid var(--line); background: var(--surface); }

/* ---------- result ---------- */
.qz-result { text-align: center; padding-top: 10px; }
.qz-ring {
    --p: 0; --c: #12a06a;
    width: 150px; height: 150px; margin: 0 auto 16px;
    display: grid; place-content: center; border-radius: 50%;
    background:
        radial-gradient(closest-side, var(--surface) 80%, transparent 81%),
        conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-2) 0);
}
.qz-ring.is-mid { --c: #e08600; }
.qz-ring.is-low { --c: #de3b2f; }
.qz-ring b { font-size: 36px; line-height: 1; }
.qz-ring b small { font-size: 18px; color: var(--muted); }
.qz-ring span { margin-top: 4px; font-weight: 700; color: var(--c); }
.qz-result h3 { margin: 0; font-size: 19px; }
.qz-sub { margin: 6px 0 18px; color: var(--muted); font-size: 14px; }
.qz-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

.qz-review-h { margin: 30px 0 12px; text-align: left; font-size: 16px; }
.qz-review {
    text-align: left; margin-bottom: 10px; padding: 14px 16px;
    border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
}
.qz-review .qz-q { margin-bottom: 8px; font-size: 16px; }
.qz-review p { margin: 4px 0; font-size: 14.5px; }
.qz-yours { color: #de3b2f; }
.qz-correct { color: #12a06a; font-weight: 600; }
.qz-yours i, .qz-correct i { width: 16px; }
.qz-why { color: var(--text-soft); }

/* ---------- Notes / Quiz switch in the toolbar ---------- */
.lab-views { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); flex: none; }
.lab-views button {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 14px; border: 0; border-radius: 999px;
    background: none; color: var(--muted); font-weight: 700; font-size: 14px;
}
.lab-views button.is-on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.lab-views button:disabled { opacity: .45; cursor: not-allowed; }
.lab-views small { font-weight: 700; color: var(--accent); }

@media (max-width: 560px) {
    .qz-q { font-size: 17px; }
    .qz-opt { font-size: 15.5px; }
    .qz-actions > * { width: 100%; }
    .lab-views button { padding: 7px 11px; }
    /* No room for the title beside the switch; page 1 of the notes carries it. */
    .lab-bar-title { display: none; }
    .lab-views { margin-right: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .qz-explain { animation: none; }
}
