/* THE QUICK QUIZ (job S5-17, 20 Nov 2026): its look, in one block. The behaviour is js/main/knowledge-check.js; the
   test-out (js/testout.js, "Already know this lesson?") hosts the same quiz. The warm-up and the quick recap on Home
   (js/warmup.js, job S5-10) are the same parts: the block at the end of this file gives them the frame a lesson gives.

   The parts, at every size: the head (title, count, a 44px close square, css/buttons.css), the question, the choices
   (rounded rectangles of one tap, never a pill; 44px, 48px on a touch screen), and the foot with the way on. A choice
   is marked when it is tapped: its tint and a small tick (right) or cross (wrong) on the choice itself, no words
   (Tom's answers 3 and 7, 18 Nov 2026). A miss may have one short line under the choices. The result lists the ones
   missed, each with its answer under the same small tick.
   On a phone (600px and less) the quiz fills the screen, the question reads larger, and the foot is the bar at the
   foot of the screen (css/bar.css: .kc-footer is a .sv-bar.sv-bar-in, the last row of a one-screen page). In the
   test-out the shell draws that bar (svBar) and the quiz's own foot is hidden. The page's own loading order: after
   css/reskin.css (whose quiz rules these outrank by order), before css/bar.css and css/buttons.css. */
.kc-quiz .kc-modal{ display:flex; flex-direction:column; max-height:calc(100vh - 3rem); max-height:calc(100dvh - 3rem); }
.kc-quiz .kc-header{ gap:8px; }
.kc-quiz .kc-step{ margin-left:auto; font-variant-numeric:tabular-nums; }
.kc-quiz .kc-x{ margin:-8px -10px -8px 0; }
.kc-quiz .kc-body{ flex:1 1 auto; min-height:0; overflow-y:auto; overscroll-behavior:contain; }
.kc-quiz .kc-footer{ flex:none; }
.kc-quiz .kc-sr{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

/* the choices */
body .kc-quiz :is(.kc-option, .kc-fill-btn){
  display:flex; align-items:center; justify-content:space-between; gap:10px; box-sizing:border-box;
  min-height:var(--sv-tap, 44px); padding:.6rem .9rem; border:1.5px solid var(--border-light, #e3ddd3); border-radius:10px;
  font-family:var(--font-ui, 'Schibsted Grotesk', system-ui, sans-serif); font-size:1rem; font-weight:500; line-height:1.35; text-align:left;
}
body .kc-quiz .kc-fill-options{ display:grid; grid-template-columns:repeat(auto-fill, minmax(118px, 1fr)); gap:8px; margin-top:1rem; }
body .kc-quiz .kc-fill-btn{ justify-content:center; }
body .kc-quiz .kc-fill-btn .kc-mark{ margin-left:2px; }
/* marked: right is green, wrong a soft brick, each with its small mark; the reader skin's "selected" never hides them */
body .kc-quiz :is(.kc-option, .kc-fill-btn, .kc-match-row).correct{
  border-color:#3e7d58; background:color-mix(in srgb, #3e7d58 10%, var(--bg-card, #fff)); color:#2c5940; }
body .kc-quiz :is(.kc-option, .kc-fill-btn, .kc-match-row).incorrect{
  border-color:#b06a5c; background:color-mix(in srgb, #a04848 7%, var(--bg-card, #fff)); color:#7c3434; }
body.dark-mode .kc-quiz :is(.kc-option, .kc-fill-btn, .kc-match-row).correct{ border-color:#5d9c78; background:#1c2f24; color:#9fd3b4; }
body.dark-mode .kc-quiz :is(.kc-option, .kc-fill-btn, .kc-match-row).incorrect{ border-color:#8a5a4e; background:#33231f; color:#f0b3a3; }
.kc-quiz .kc-mark{ flex:none; display:inline-flex; width:20px; height:20px; }
.kc-quiz .kc-mark svg{ width:100%; height:100%; }
.kc-quiz .kc-match-row .kc-mark{ margin-left:auto; }
body .kc-quiz .kc-match-select{ min-height:var(--sv-tap, 44px); font-size:1rem; }
/* a miss: one short line, where the lesson has one for the chosen option */
.kc-quiz .kc-why{ margin:1rem 0 0; font:400 1rem/1.5 var(--font-ui, 'Schibsted Grotesk', system-ui, sans-serif); color:var(--text-secondary, #5c574f); }

/* the result: the ones missed, each with its answer */
.kc-quiz .kc-missed{ list-style:none; margin:1.2rem 0 0; padding:0; display:flex; flex-direction:column; gap:8px; text-align:left; }
.kc-quiz .kc-missed li{ padding:.75rem .9rem; border:1px solid var(--border-light, #e3ddd3); border-radius:10px;
  background:color-mix(in srgb, var(--border-light, #e3ddd3) 30%, var(--bg-card, #fff)); }
.kc-quiz .kc-missed-q{ margin:0 0 .4rem; font:500 .95rem/1.45 var(--font-ui, 'Schibsted Grotesk', system-ui, sans-serif); color:var(--text-secondary, #5c574f); }
.kc-quiz .kc-missed-a{ margin:0; display:flex; align-items:flex-start; gap:8px; font:600 1rem/1.4 var(--font-ui, 'Schibsted Grotesk', system-ui, sans-serif); color:var(--text-primary, #2d2a26); }
.kc-quiz .kc-missed-a .kc-mark{ width:18px; height:18px; margin-top:2px; color:#3e7d58; }
body.dark-mode .kc-quiz .kc-missed-a .kc-mark{ color:#9fd3b4; }

/* a phone: the quiz fills the screen (the plain quiz; the test-out's own shell is already the screen) */
@media (max-width:600px){
  body > .kc-quiz.kc-overlay{ padding:0; align-items:stretch; background:var(--bg-body, #faf8f5); }
  body > .kc-quiz .kc-modal{ width:100%; max-width:none; height:100%; max-height:none; border:0; border-radius:0; box-shadow:none; }
  body > .kc-quiz .kc-header{ min-height:60px; padding:8px 12px 8px 16px; }
  .kc-quiz .kc-title{ font-size:1.1rem; }
  .kc-quiz .kc-body{ padding:20px 16px 24px; }
  body .kc-quiz .kc-question{ font-size:1.15rem; line-height:1.5; margin-bottom:1.1rem; }
  body .kc-quiz .kc-options{ grid-template-columns:1fr; gap:10px; }
  /* the question at the top, the choices at the thumb, just above the bar: no empty half under the choices */
  body > .kc-quiz .kc-body{ display:flex; flex-direction:column; }
  body > .kc-quiz :is(.kc-options, .kc-fill-options, .kc-match){ margin-top:auto; }
  body > .kc-quiz .kc-result{ margin-bottom:auto; }
  body .kc-quiz :is(.kc-option, .kc-fill-btn){ min-height:52px; font-size:1.05rem; }
  .kc-quiz .kc-result{ padding:.5rem 0 0; }
}

/* the test-out ("Already know this lesson?"): the two steps' lines readable (108.4), the way off a real button */
.sv-to-stages li .t small{ font-size:.9rem; color:#5c574f; }
.sv-to-stages li.locked, .sv-to-stages li.locked .t small{ color:#6b6156; }
body.dark-mode .sv-to-stages li.locked, body.dark-mode .sv-to-stages li.locked .t small{ color:#b3aea6; }
@media (min-width:601px){ .sv-to-bar{ display:none !important; } }
@media (max-width:600px){
  .sv-testout .sv-to-inner{ padding-bottom:calc(var(--sv-bar-room) + 1rem); }
  .sv-testout .sv-to-stages{ flex-direction:column; align-items:flex-start; width:fit-content; margin-inline:auto; gap:.6rem; }
  /* the bar presses these (js/testout.js) */
  .sv-testout .sv-to-s1 .kc-footer, .sv-testout .sv-to-foot, .sv-testout .sv-to-s2 .practice-actions{ display:none !important; }
}

/* THE QUIZ ON HOME: the warm-up and the quick recap (job S5-10, 20 Nov 2026; js/warmup.js). The same parts as the quick
   quiz above, on a page that does not load the lesson's style sheet (css/style.css), so the frame the lesson gives the
   quiz (the dimmed page, the card, its head and foot) is written here for .kc-home only. The choices, their marks, the
   miss line and the list of misses are the rules above. Under the session's clock and its "Time's up" note (z 900,
   as the warm-up was). After an answer the foot holds Next; the result leads with what the pupil knew, by subject. */
.kc-quiz.kc-home{ position:fixed; inset:0; z-index:900; display:flex; align-items:center; justify-content:center; padding:1.5rem;
  background:rgba(29, 28, 26, .45); font-family:var(--font-ui, 'Schibsted Grotesk', system-ui, sans-serif); color:#2d2a26; animation:kc-home-in .2s ease-out; }
.kc-home .kc-modal{ width:100%; max-width:480px; background:#fffdf8; border-radius:16px; box-shadow:0 20px 60px rgba(0, 0, 0, .3); overflow:hidden; }
.kc-home .kc-modal:focus{ outline:none; }
.kc-home .kc-header{ display:flex; align-items:center; justify-content:space-between; padding:.75rem .75rem .75rem 1.25rem; border-bottom:1px solid #ece6da; }
.kc-home .kc-title{ font-size:1.1rem; font-weight:700; }
.kc-home .kc-step{ font-size:.95rem; font-weight:600; color:#736e66; }
.kc-home .kc-body{ padding:1.25rem; }
.kc-home .kc-question{ margin:0 0 1rem; font-family:var(--font-read, var(--read, 'Literata', Georgia, serif)); font-size:1.15rem; line-height:1.5; font-weight:500; }
.kc-home .kc-options{ display:grid; grid-template-columns:1fr; gap:8px; }
.kc-home .kc-option{ width:100%; background:#fffdf8; color:#2d2a26; cursor:pointer; }
.kc-home .kc-option:hover:not(.locked){ border-color:#b9a98c; }
.kc-home .kc-option.locked{ cursor:default; }
.kc-home .kc-footer{ display:flex; justify-content:flex-end; gap:8px; padding:.75rem 1.25rem; border-top:1px solid #ece6da; background:#fffdf8; }
.kc-home .wu-load{ padding:2rem 0; text-align:center; color:#736e66; }
.kc-home .wu-why{ margin:0 0 .35rem; font-size:1rem; line-height:1.45; color:#5c574f; }
.kc-home .wu-from{ margin:0 0 .8rem; font-size:.95rem; font-weight:600; color:#736e66; }
.kc-home .wu-result{ text-align:left; }
.kc-home .wu-lead{ margin:.25rem 0 .9rem; font-size:1.5rem; font-weight:800; letter-spacing:-.01em; }
.kc-home .wu-subs{ list-style:none; margin:0; padding:0; border-top:1px solid #ece6da; }
.kc-home .wu-subs li{ display:flex; justify-content:space-between; gap:12px; padding:.7rem 0; border-bottom:1px solid #ece6da; font-size:1.05rem; }
.kc-home .wu-subs b{ flex:none; font-weight:700; font-variant-numeric:tabular-nums; }
.kc-home .wu-sec{ margin:1.4rem 0 0; font-size:.85rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:#736e66; }
.kc-home .wu-sec + .kc-missed{ margin-top:.6rem; }
.kc-home .ec-foot:empty{ display:none; }   /* the quick recap's end card: its way on is in the quiz's foot */
.kc-home .wu-card{ --ec-bg:#fffdf8; }
body.dark-mode .kc-quiz.kc-home{ background:rgba(0, 0, 0, .62); color:var(--sv-night-ink,#ece9e4); }
body.dark-mode .kc-home .kc-modal, body.dark-mode .kc-home .kc-footer, body.dark-mode .kc-home .kc-option{ background:var(--sv-night-card,#211f1c); color:var(--sv-night-ink,#ece9e4); }
body.dark-mode .kc-home .wu-card{ --ec-bg:var(--sv-night-card,#211f1c); }
body.dark-mode .kc-home :is(.kc-header, .kc-footer, .wu-subs, .wu-subs li){ border-color:var(--sv-night-line,#36332e); }
body.dark-mode .kc-home :is(.kc-step, .wu-from, .wu-load, .wu-sec){ color:var(--sv-night-mut,#a59f95); }
body.dark-mode .kc-home :is(.wu-why, .kc-why, .kc-missed-q){ color:var(--sv-night-sec,#b3aea6); }
body.dark-mode .kc-home .kc-option:not(.correct):not(.incorrect){ border-color:var(--sv-night-line,#3a3734); }
body.dark-mode .kc-home .kc-missed li{ background:var(--sv-night-linel,#262320); border-color:var(--sv-night-line,#36332e); }
body.dark-mode .kc-home .kc-missed-a{ color:var(--sv-night-ink,#ece9e4); }
@keyframes kc-home-in{ from{ opacity:0; } }
@media (max-width:600px){
  /* the phone: the quiz fills the screen (the rules above), on the page's own colour, the foot the bar at its foot */
  body > .kc-quiz.kc-home{ background:#faf8f5; --sv-bar-bg:#fffdf8; }
  body.dark-mode > .kc-quiz.kc-home{ background:var(--sv-night-page,#181614); --sv-bar-bg:var(--sv-night-card,#211f1c); }
  .kc-home .kc-modal{ border-radius:0; }
  .kc-home .kc-header{ padding-top:calc(.5rem + env(safe-area-inset-top, 0px)); }
  .kc-home .kc-footer{ padding:8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion:reduce){ .kc-quiz.kc-home{ animation:none; } }
