/* Study-guide quiz. Scoped under form.study-quiz so the theme's input, label and legend rules do not leak in. */
form.study-quiz{--sq-accent:#004c6b;--sq-accent-soft:#eaf2f6;--sq-right:#1b6e2e;--sq-right-soft:#eaf6ed;--sq-wrong:#b3261e;--sq-wrong-soft:#fcecea;--sq-line:#d5dbe0;--sq-text:#222;margin:0;font-size:max(1em,16px);line-height:1.5;color:var(--sq-text)}
form.study-quiz *,form.study-quiz *::before,form.study-quiz *::after{box-sizing:border-box}

/* question */
form.study-quiz .study-quiz__q{border:0;border-top:1px solid #e3e7ea;margin:0;padding:24px 0 20px;min-width:0}
form.study-quiz .study-quiz__q:first-of-type{border-top:0;padding-top:4px}
form.study-quiz .study-quiz__text{display:block;float:left;width:100%;margin:0 0 14px;padding:0;font-size:1.05em;font-weight:700;line-height:1.45;color:var(--sq-text)}
form.study-quiz .study-quiz__text + *{clear:both}

/* choice: input, text and mark centred on one axis */
form.study-quiz .study-quiz__choice{display:flex;align-items:center;gap:14px;margin:0 0 10px;padding:13px 16px;min-height:52px;border:1px solid var(--sq-line);border-radius:10px;background:#fff;cursor:pointer;font-weight:400;line-height:1.45;transition:border-color .15s,background-color .15s,box-shadow .15s}
form.study-quiz .study-quiz__choice:last-of-type{margin-bottom:0}
form.study-quiz .study-quiz__choice:hover{border-color:var(--sq-accent);background:#f7fafb}
form.study-quiz .study-quiz__choice:has(input:checked){border-color:var(--sq-accent);background:var(--sq-accent-soft);box-shadow:inset 0 0 0 1px var(--sq-accent)}
form.study-quiz .study-quiz__choice:focus-within{outline:2px solid var(--sq-accent);outline-offset:2px}
form.study-quiz .study-quiz__choice input{flex:none;width:20px;height:20px;margin:0;padding:0;position:static;vertical-align:middle;accent-color:var(--sq-accent);cursor:pointer}
form.study-quiz .study-quiz__label{flex:1 1 auto;min-width:0;margin:0;padding:0;line-height:1.45}
form.study-quiz .study-quiz__mark{flex:none;align-self:center;display:inline-flex;align-items:center;gap:4px;padding:3px 10px;border-radius:999px;font-size:.8em;font-weight:700;line-height:1.3;white-space:nowrap}
form.study-quiz .study-quiz__mark:empty{display:none}

/* after checking (these outrank the ticked state above) */
form.study-quiz.is-checked .study-quiz__choice{cursor:default}
form.study-quiz.is-checked .study-quiz__choice:hover{border-color:var(--sq-line);background:#fff}
form.study-quiz.is-checked .study-quiz__choice:has(input:checked){box-shadow:none}
form.study-quiz.is-checked .study-quiz__choice input{cursor:default;opacity:1}
form.study-quiz.is-checked .study-quiz__choice.is-answer,form.study-quiz.is-checked .study-quiz__choice.is-answer:hover{border-color:var(--sq-right);background:var(--sq-right-soft);box-shadow:inset 0 0 0 1px var(--sq-right)}
form.study-quiz .study-quiz__choice.is-answer .study-quiz__mark{background:var(--sq-right);color:#fff}
form.study-quiz.is-checked .study-quiz__choice.is-wrong,form.study-quiz.is-checked .study-quiz__choice.is-wrong:hover{border-color:var(--sq-wrong);background:var(--sq-wrong-soft);box-shadow:inset 0 0 0 1px var(--sq-wrong)}
form.study-quiz .study-quiz__choice.is-wrong .study-quiz__mark{background:var(--sq-wrong);color:#fff}
form.study-quiz .study-quiz__verdict{display:inline-flex;align-items:center;margin:12px 0 0;padding:4px 12px;border-radius:999px;font-size:.9em;font-weight:700;line-height:1.3}
form.study-quiz .study-quiz__verdict[hidden]{display:none}
form.study-quiz .study-quiz__verdict.is-right{color:var(--sq-right);background:var(--sq-right-soft)}
form.study-quiz .study-quiz__verdict.is-wrong,form.study-quiz .study-quiz__verdict.is-missing{color:var(--sq-wrong);background:var(--sq-wrong-soft)}
form.study-quiz .study-quiz__q.is-missing .study-quiz__choice{border-color:var(--sq-wrong)}

/* result and buttons */
form.study-quiz .study-quiz__result{margin:20px 0 0;padding:16px 20px;border-radius:10px;background:var(--sq-accent-soft);border-left:4px solid var(--sq-accent);font-size:1.1em;font-weight:700;line-height:1.4}
form.study-quiz .study-quiz__result[hidden]{display:none}
form.study-quiz .study-quiz__result.is-problem{background:var(--sq-wrong-soft);border-left-color:var(--sq-wrong)}
form.study-quiz .study-quiz__actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:20px}
form.study-quiz .study-quiz__actions button{display:inline-flex;align-items:center;justify-content:center;min-height:48px;margin:0;padding:12px 28px;border-radius:8px;border:2px solid var(--sq-accent);background:var(--sq-accent);color:#fff;font:inherit;font-weight:700;line-height:1.2;cursor:pointer}
form.study-quiz .study-quiz__actions button:hover{filter:brightness(1.12)}
form.study-quiz .study-quiz__actions button[hidden]{display:none}
form.study-quiz .study-quiz__actions button[disabled]{opacity:.6;cursor:wait}
form.study-quiz .study-quiz__actions .study-quiz__again{background:#fff;color:var(--sq-accent)}
form.study-quiz .study-quiz__actions button:focus-visible{outline:2px solid var(--sq-text);outline-offset:2px}

/* phones: the mark moves under the text, lined up with it */
@media (max-width:600px){
  form.study-quiz .study-quiz__choice{display:grid;grid-template-columns:20px 1fr;align-items:center;column-gap:12px;row-gap:8px;padding:12px 14px}
  form.study-quiz .study-quiz__mark{grid-column:2;justify-self:start}
  form.study-quiz .study-quiz__actions button{width:100%}
}
