/* Quiz, exam, map status and glossary drill. Uses only the variables of styles.css, so both themes work. */

/* ---------- the unit quiz ---------- */
.quiz-draft { background: var(--draft-bg); border: 1px solid var(--draft-line); border-left-width: 6px; border-radius: var(--radius); padding: .6rem 1rem; font-size: .95rem; }
.qz-items { list-style: none; margin: 0 0 1rem; padding: 0; counter-reset: qz; }
.qz-items > li { counter-increment: qz; margin: 0 0 1rem; }
.qz-item { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 1rem 1rem 1rem 3rem; box-shadow: var(--shadow); }
.qz-item::before { content: counter(qz); position: absolute; left: .8rem; top: 1rem; width: 1.7rem; height: 1.7rem; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .9rem; }
.qz-form { margin: 0; }

.qz-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.qz-stem { padding: 0; margin: 0 0 .7rem; font-weight: 600; line-height: 1.45; max-width: 100%; }
.qz-hint { margin: 0 0 .7rem; font-size: .9rem; color: var(--muted); }
.qz-opts, .qz-sels { display: grid; gap: .5rem; }
.qz-opt { display: flex; align-items: flex-start; gap: .65rem; border: 1px solid var(--line); border-radius: 8px; padding: .5rem .7rem; background: var(--bg); }
.qz-opt:hover { border-color: var(--accent); }
.qz-opt input { flex: 0 0 auto; width: 1.5rem; height: 1.5rem; margin: 0; accent-color: var(--accent); }
.qz-opt label { flex: 1 1 auto; min-width: 0; cursor: pointer; padding: .1rem 0; }
.qz-opt.qz-idk { margin-top: .2rem; border-style: dashed; color: var(--muted); }
.qz-body > .qz-opt { margin-top: .7rem; }
.qz-selrow { display: grid; gap: .25rem; border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem; background: var(--bg); }
.qz-selrow label { font-weight: 600; }
.qz-selrow select, .qz-fieldset select, .exam-card select { width: 100%; max-width: 100%; min-height: 2.5rem; font: inherit; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }
.qz-selrow select:disabled { opacity: .6; }

.qz-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .9rem; align-items: center; }
.qz-actions .button { padding: .5rem 1rem; }
.button:disabled { opacity: .55; cursor: not-allowed; }

.qz-feedback { margin-top: .8rem; }
.qz-feedback:empty { display: none; }
.qz-feedback:focus { outline: none; }
.qz-feedback:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.qz-result { margin: 0 0 .6rem; padding: .5rem .8rem; border-radius: 8px; border: 2px solid currentColor; font-size: 1.02rem; background: var(--surface); }
.qz-ok { color: var(--flag-rt); }
.qz-no, .qz-warn { color: var(--focus); }
.qz-result strong { color: inherit; }
.qz-result .qz-icon + * { color: inherit; }
.qz-icon { display: inline-grid; place-items: center; width: 1.35rem; height: 1.35rem; border-radius: 50%; font-weight: 800; font-size: .85rem; line-height: 1; vertical-align: middle; flex: 0 0 auto; }
.qz-icon-ok { background: var(--flag-rt); color: var(--surface); }
.qz-icon-no { background: var(--focus); color: var(--surface); }
.qz-icon-skip { border: 2px solid var(--muted); color: var(--muted); }
.qz-whys { list-style: none; padding: 0; margin: 0 0 .7rem; display: grid; gap: .4rem; }
.qz-whys li { margin: 0; padding: .4rem .7rem; border-left: 4px solid var(--line); background: var(--surface-2); border-radius: 0 6px 6px 0; font-size: .95rem; }
.qz-why-label { color: var(--muted); font-weight: 600; }
.qz-keytitle { margin: 0 0 .3rem; font-weight: 600; }
.qz-list { margin: 0 0 .7rem; padding-left: 1.4rem; }
.qz-explain { margin: 0 0 .5rem; }
.qz-read { margin: 0; font-weight: 600; }
.qz-muted { color: var(--muted); }
.qz-none { color: var(--muted); margin: 0 0 .7rem; }
.qz-banner { background: var(--accent-soft); border-left: 5px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; padding: .7rem 1rem; }
.qz-tag { display: block; font-size: .8rem; font-weight: 600; margin-top: .15rem; }
.qz-tag-ok { color: var(--flag-rt); }
.qz-tag-no { color: var(--focus); }
.qz-tag .qz-icon { width: 1.1rem; height: 1.1rem; font-size: .7rem; margin-right: .15rem; }

.qz-footer { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: .9rem; }
.qz-footer .qz-actions { margin: 0; }
.qz-score { margin: 0; font-weight: 700; font-size: 1.05rem; }

/* ---------- the exam ---------- */
#exam-app, #drill-app { max-width: 48rem; }
.exam-note { background: var(--surface-2); border-radius: var(--radius); padding: .8rem 1rem; }
.exam-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin: 0 0 1.2rem; }
.exam-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.exam-card h3 { margin: 0; }
.exam-card p { margin: 0; }
.exam-card .button { margin-top: auto; text-align: center; }
.exam-head h2 { margin: 0 0 .2rem; }
.exam-head h2:focus { outline: none; }
.exam-head h2:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.exam-meta { margin: 0 0 .6rem; color: var(--muted); font-weight: 600; }
.exam-progress { display: grid; gap: .2rem; margin: 0 0 1rem; }
.exam-progress label { font-size: .9rem; color: var(--muted); }
.exam-progress progress { width: 100%; height: .9rem; accent-color: var(--accent); }
.exam-nav { margin-top: 1.1rem; }
.exam-confirm { margin-top: 1rem; border: 2px solid var(--draft-line); background: var(--draft-bg); border-radius: var(--radius); padding: .8rem 1rem; }
.exam-confirm[hidden] { display: none; }
.exam-confirm h3 { margin: 0 0 .4rem; font-size: 1.05rem; }
.exam-confirm h3:focus { outline: none; }
.exam-confirm h3:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.exam-extra { margin-top: 1.2rem; }
#exam-app h2:focus, #drill-app h2:focus { outline: none; }
#exam-app h2:focus-visible, #drill-app h2:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.exam-table { font-size: .95rem; }
.exam-table th, .exam-table td { padding: .55rem .7rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.exam-advice { padding-left: 1.2rem; }
.exam-review { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.exam-review > li { margin: 0; }
.exam-review-item { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.exam-review-item summary { cursor: pointer; padding: .6rem .8rem; font-weight: 600; display: flex; gap: .5rem; align-items: flex-start; }
.exam-review-title { min-width: 0; }
.exam-review-body { padding: 0 1rem 1rem; }
.exam-review-body h4 { margin: .8rem 0 .3rem; font-size: .9rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.qz-stem-copy { font-weight: 600; }
@media (max-width: 600px) {
  .exam-table, .exam-table tbody, .exam-table tr, .exam-table th, .exam-table td { display: block; width: 100%; }
  .exam-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .exam-table tr { border-bottom: 1px solid var(--line); padding: .3rem 0; }
  .exam-table th, .exam-table td { border: 0; padding: .25rem .8rem; }
  .exam-table td[data-label]::before { content: attr(data-label); display: block; font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
  .qz-item { padding: 1rem .8rem; }
  .qz-item::before { position: static; margin-bottom: .5rem; }
}

/* ---------- the map ---------- */
.map-note { margin: 0 0 1rem; }
.map-note-text { margin: 0; padding: .6rem .9rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.map-status { display: block; font-size: .8rem; font-weight: 700; line-height: 1.3; }
.map-status:empty { display: none; }
.map-status-good { color: var(--flag-rt); }
.map-status-review { color: var(--focus); }
.map-icon { display: inline-block; min-width: 1em; text-align: center; }

/* ---------- the glossary drill ---------- */
.drill-def { font-size: 1.1rem; margin: 0 0 .3rem; padding: .7rem 1rem; background: var(--surface-2); border-radius: var(--radius); }
.drill-options { display: grid; gap: .5rem; margin-top: .7rem; }
.drill-option { display: block; width: 100%; text-align: left; font: inherit; color: var(--ink); background: var(--surface); border: 2px solid var(--line); border-radius: 8px; padding: .6rem .9rem; min-height: 2.75rem; cursor: pointer; overflow-wrap: anywhere; }
.drill-option:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.drill-option:disabled { cursor: default; color: var(--ink); opacity: 1; }
.drill-option.is-correct { border-color: var(--flag-rt); }
.drill-option.is-wrong { border-color: var(--focus); }
.drill-mark { display: block; font-size: .85rem; font-weight: 700; margin-top: .15rem; }
.is-correct .drill-mark { color: var(--flag-rt); }
.is-wrong .drill-mark { color: var(--focus); }
