/* Graded quiz in a quiz lesson (functions/_lib/course-quiz.ts, www/courses/quiz.js).
   Colours from b2-player.css: ink #1A2233, muted #5E6878, lines #E1E5EB / #CFD5DE, tint #ECEFF3; the course's own
   specialization colours come from .cp (--tint, --deep). Options are big tap targets for phones. */
.cq{margin:28px 0 8px;padding:24px;border:1px solid #CFD5DE;border-radius:16px;background:#FFFFFF;box-shadow:0 1px 2px rgba(26,34,51,.05);color:#1A2233;scroll-margin-top:84px}
.cp-body+.cq{margin-top:28px}
.cq-k{display:inline-block;font:600 11px/1 Inter,system-ui,sans-serif;letter-spacing:.08em;text-transform:uppercase;color:var(--deep,#3B4558);background:var(--tint,#ECEFF3);border-radius:999px;padding:6px 10px}
.cq h2{margin:12px 0 14px;font-family:'Inter Tight',Inter,sans-serif;font-weight:600;font-size:28px;line-height:1.2;color:#1A2233}
.cq-facts{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 14px;padding:0;list-style:none}
.cq-facts li{padding:7px 12px;border:1px solid #E1E5EB;border-radius:999px;background:#F5F7FA;font-size:14px;color:#3B4558}
.cq-facts b{color:#1A2233;font-weight:600}
.cq-how{margin:0 0 18px;padding-left:1.2em;color:#3B4558;font-size:15px;line-height:1.6}
.cq-how li{margin:0 0 4px}
.cq-how li::marker{color:#8A93A3}
.cq-past{margin:0 0 18px;padding:14px 0 0;border-top:1px solid #E1E5EB}
.cq-best{margin:0 0 10px;font-size:16px}
.cq-best b{font-size:20px}
.cq-hist{margin:0;padding:0;list-style:none}
.cq-hist li{display:grid;grid-template-columns:auto 1fr auto auto;align-items:center;gap:6px 14px;padding:9px 0;border-top:1px solid #ECEFF3;font-size:14.5px}
.cq-hist li:first-child{border-top:0}
.cq-hn{color:#5E6878}
.cq-hs small{color:#5E6878}
.cq-hd{color:#5E6878;font-size:13.5px}
.cq-link{border:0;background:none;padding:6px 0;color:#46557A;font:inherit;font-size:14px;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.cq-link:hover{color:#1A2233}
.cq-go{display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px}
.cq-start{min-width:220px}
.cq-start:disabled{opacity:.55;cursor:not-allowed}
.cq-note{margin:0;font-size:14px;color:#5E6878}
.cq-note:empty{display:none}

/* taking the quiz */
.cq-top{display:flex;align-items:center;gap:10px 14px;flex-wrap:wrap;margin:0 0 10px}
.cq-count{font:600 14px/1.2 Inter,system-ui,sans-serif;color:#1A2233}
.cq-m{font-size:13px;color:#5E6878}
.cq-timer{display:inline-flex;align-items:center;gap:6px;margin-left:auto;padding:6px 11px;border:1px solid #CFD5DE;border-radius:999px;background:#FFFFFF;
  font:600 14px/1 "JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-variant-numeric:tabular-nums;color:#1A2233}
.cq-timer.is-low{border-color:#E7B3A8;background:#FDF1EE;color:#9A3412}
.cq-bar{height:5px;margin:0 0 20px;border-radius:999px;background:#ECEFF3;overflow:hidden}
.cq-bar span{display:block;height:100%;border-radius:999px;background:var(--deep,#3B4558);transition:width .2s ease}
.cq-prompt{font-size:17px;line-height:1.6;color:#1A2233;outline:0;overflow-wrap:break-word}
/* the question and the result card take focus by script (for screen readers); no ring around them */
.cq .cq-prompt:focus-visible,.cq .cq-result:focus-visible{outline:none}
.cq-prompt>:first-child{margin-top:0}
.cq-prompt p{margin:0 0 12px}
.cq-hint{margin:6px 0 14px;font-size:13.5px;color:#5E6878}
.cq pre{margin:8px 0 14px;padding:12px 14px;border:1px solid #E1E5EB;border-radius:10px;background:#FBFCFD;overflow-x:auto;
  font:13.5px/1.6 "JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;white-space:pre;color:#1A2233;tab-size:4}
.cq code{padding:1px 5px;border-radius:4px;background:#ECEFF3;color:#1A2233;font-family:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.88em;overflow-wrap:anywhere}
/* after the inline rule: Graphy writes <pre><strong><code>, so a code block's code is not always pre's child */
.cq pre code{padding:0;border-radius:0;background:none;font:inherit;overflow-wrap:normal}
.cq pre strong{font-weight:inherit}
.cq img{max-width:100%;height:auto}
.cq math{font-size:1.08em}
.cq-prompt table,.cq-explain table{border-collapse:collapse;margin:6px 0 10px}
.cq-prompt td,.cq-explain td{padding:1px 4px;text-align:center;vertical-align:middle}
.cq-opts{display:grid;gap:10px}
.cq-opt{position:relative;display:flex;align-items:flex-start;gap:12px;min-height:52px;padding:13px 14px;border:1.5px solid #CFD5DE;border-radius:12px;background:#FFFFFF;cursor:pointer;
  transition:border-color .12s ease,background-color .12s ease}
.cq-opt:hover{border-color:#8A93A3}
.cq-opt input{position:absolute;opacity:0;width:1px;height:1px;pointer-events:none}
.cq-opt:focus-within{outline:2px solid var(--deep,#3B4558);outline-offset:2px}
.cq-opt.is-on{border-color:var(--deep,#3B4558);background:var(--tint,#ECEFF3)}
.cq-l{flex:none;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:1.5px solid #B4BCC8;border-radius:50%;
  font:600 13px/1 Inter,system-ui,sans-serif;color:#3B4558;background:#FFFFFF}
.cq-opt input[type=checkbox]~.cq-l{border-radius:7px}
.cq-opt.is-on .cq-l{border-color:var(--deep,#3B4558);background:var(--deep,#3B4558);color:#FFFFFF}
.cq-ot{flex:1;min-width:0;padding-top:3px;font-size:16px;line-height:1.5;overflow-wrap:break-word}
.cq-ot>:first-child{margin-top:0}
.cq-ot>:last-child{margin-bottom:0}
.cq-ot p{margin:0 0 6px}
.cq-ot pre{margin:4px 0}
.cq-pairs{display:grid;gap:10px}
.cq-pair{display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:10px 14px;padding:12px 14px;border:1.5px solid #CFD5DE;border-radius:12px}
.cq-pi{display:flex;align-items:center;gap:12px;min-width:0}
.cq-sel select{width:100%;min-height:46px;padding:8px 10px;border:1.5px solid #CFD5DE;border-radius:10px;background:#FFFFFF;color:#1A2233;font:inherit;font-size:15.5px}
.cq-sel select:focus{outline:2px solid var(--deep,#3B4558);outline-offset:1px}
.cq-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.cq-nav{display:flex;justify-content:space-between;gap:10px;margin:20px 0 0}
.cq-btn{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:0 20px;border:1px solid #CFD5DE;border-radius:10px;background:#FFFFFF;
  color:#1A2233;font:600 15px/1 Inter,system-ui,sans-serif;text-decoration:none;cursor:pointer}
.cq-btn:hover:not(:disabled){border-color:#1A2233}
.cq-btn:disabled{opacity:.45;cursor:default}
.cq-btn.cq-primary{background:#1A2233;border-color:#1A2233;color:#FFFFFF}
.cq-btn.cq-primary:hover:not(:disabled){background:#2A3447}
.cq-dots{display:flex;flex-wrap:wrap;gap:6px;margin:18px 0 0;padding:0;list-style:none}
.cq-dots button{width:34px;height:34px;border:1.5px solid #CFD5DE;border-radius:9px;background:#FFFFFF;color:#5E6878;font:600 13px/1 Inter,system-ui,sans-serif;cursor:pointer}
.cq-dots button.is-ans{border-color:transparent;background:var(--tint,#ECEFF3);color:var(--deep,#3B4558)}
.cq-dots button.is-part{border-style:dashed;border-color:var(--deep,#3B4558)}
.cq-dots button.is-cur{border-color:var(--deep,#3B4558);box-shadow:0 0 0 1.5px var(--deep,#3B4558) inset;color:#1A2233}
.cq-dots.is-big button{width:42px;height:42px;font-size:14px}
.cq-dots.is-big button:not(.is-ans){border-color:#E7B3A8;background:#FDF1EE;color:#9A3412}
.cq-check p{margin:0;font-size:16px;line-height:1.6}
.cq-saved{margin:12px 0 0;font-size:13px;color:#5E6878;min-height:1em}

/* the result and the review */
.cq-old{margin:0 0 10px;font-size:14px;color:#5E6878}
.cq-result{display:flex;align-items:center;gap:18px;padding:18px 20px;border-radius:14px;border:1px solid #E1E5EB;background:#F5F7FA;outline:0}
.cq-result.is-pass{background:#EAF4F1;border-color:#B9DACD}
.cq-result.is-fail{background:#FFF6E8;border-color:#F0D9AE}
.cq-score{flex:none;display:flex;flex-direction:column;align-items:center;justify-content:center;width:112px;height:112px;border-radius:50%;background:#FFFFFF;border:1px solid #E1E5EB}
.cq-score b{font:600 32px/1 Inter,system-ui,sans-serif;font-variant-numeric:tabular-nums;color:#1A2233}
.cq-score span{margin-top:6px;font-size:12px;color:#5E6878;text-align:center}
.cq-verdict{margin:0 0 4px;font-family:'Inter Tight',Inter,sans-serif;font-size:26px;line-height:1.2;font-weight:600}
.is-pass .cq-verdict{color:#245E49}
.is-fail .cq-verdict{color:#7A4B00}
.cq-rtext p:last-child{margin:0;font-size:15px;line-height:1.55;color:#3B4558}
.cq-rv-h{margin:26px 0 10px;font-family:'Inter Tight',Inter,sans-serif;font-weight:600;font-size:22px}
.cq-review{margin:0;padding:0;list-style:none;display:grid;gap:14px}
.cq-rv{padding:16px;border:1px solid #E1E5EB;border-left:4px solid #B9DACD;border-radius:12px}
.cq-rv.is-wrong{border-left-color:#E7B3A8}
.cq-rv-top{display:flex;align-items:center;gap:10px;margin:0 0 10px}
.cq-rv-n{font:600 14px/1 Inter,system-ui,sans-serif}
.cq-rv-top .cq-m{margin-left:auto}
.cq-chip{display:inline-block;padding:4px 9px;border-radius:999px;font:600 12px/1 Inter,system-ui,sans-serif}
.cq-chip.ok{background:#EAF4F1;color:#245E49;border:1px solid #B9DACD}
.cq-chip.no{background:#FDF1EE;color:#9A3412;border:1px solid #E7B3A8}
.cq-rv .cq-prompt{font-size:16px}
.cq-rv-opts{display:grid;gap:8px;margin:10px 0 0;padding:0;list-style:none}
.cq-rv-opts li{display:flex;flex-wrap:wrap;align-items:flex-start;gap:6px 12px;padding:10px 12px;border:1px solid #E1E5EB;border-radius:10px}
.cq-rv-opts li.is-mine{border-color:#8A93A3;background:#F5F7FA}
.cq-rv-opts li.is-key{border-color:#B9DACD;background:#EAF4F1}
.cq-rv-opts li.is-wrong{border-color:#E7B3A8;background:#FDF1EE}
.cq-rv-opts .cq-ot{font-size:15px}
.cq-why{flex-basis:100%;padding-left:40px;font-size:12.5px;font-weight:600;color:#3B4558}
.cq-rv-opts li.is-key .cq-why{color:#245E49}
.cq-rv-opts li.is-wrong .cq-why{color:#9A3412}
.cq-rv-match{width:100%;margin:10px 0 0;border-collapse:collapse;font-size:14.5px}
.cq-rv-match th{padding:8px 10px;text-align:left;font-weight:600;background:#F5F7FA;border-bottom:1px solid #E1E5EB}
.cq-rv-match td{padding:8px 10px;border-top:1px solid #ECEFF3;vertical-align:top}
.cq-rv-match td.is-ok{color:#245E49;font-weight:600}
.cq-rv-match td.is-no{color:#9A3412;font-weight:600}
.cq-mut{color:#8A93A3}
.cq-explain{margin:12px 0 0;padding:12px 14px;border-radius:10px;background:#F5F7FA;font-size:15px;line-height:1.6}
.cq-explain-h{margin:0 0 4px;font:600 12px/1.2 Inter,system-ui,sans-serif;letter-spacing:.05em;text-transform:uppercase;color:#5E6878}
.cq-explain p{margin:0 0 8px}
.cq-explain>:last-child{margin-bottom:0}
.cq-end{display:flex;flex-wrap:wrap;gap:10px;margin:20px 0 0}

html.dark .cq{background:#121a2e;border-color:#2c3b5f;color:#eef2fa}
html.dark .cq h2,html.dark .cq-prompt,html.dark .cq-count{color:#eef2fa}
html.dark .cq-how,html.dark .cq-note,html.dark .cq-hint,html.dark .cq-m{color:#9aa6c0}
html.dark .cq-opt,html.dark .cq-btn,html.dark .cq-dots button,html.dark .cq-sel select,html.dark .cq-timer{background:#0f1626;border-color:#2c3b5f;color:#eef2fa}
@media (max-width:640px){
  .cq{padding:16px;border-radius:14px}
  .cq h2{font-size:24px}
  .cq-start{width:100%}
  .cq-nav .cq-btn{flex:1 1 0;padding:0 12px}
  .cq-pair{grid-template-columns:1fr}
  .cq-result{flex-direction:column;align-items:flex-start}
  .cq-score{width:96px;height:96px}
  .cq-hist li{grid-template-columns:1fr auto}
  .cq-hd{grid-column:1}
  .cq-end .cq-btn{flex:1 1 100%}
}
@media (prefers-reduced-motion:reduce){.cq-bar span,.cq-opt{transition:none}}
