/* Revision 360: the few things the rest of the site has no use for.
   Everything else - the task window, the options, the feedback box, the chips,
   the ordered list - is the course's own, so a revision question looks like a
   lesson question because it is drawn with the same rules. */

.revise .box.huge.plain { max-width: 900px; }
.revise #modal { background: rgba(6, 11, 22, .55); }

/* The line above every question: what it is, and what it is worth. */
.qmeta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
         margin: 0 0 12px; font-size: 14px; color: var(--soft); }
.qmeta .tag { background: var(--bg2); border: 1px solid var(--line);
              border-radius: var(--r-pill); padding: 3px 11px; }
.qmeta .marks { background: var(--highlight); color: var(--highlight-fg); font-weight: 800;
                border: 0; border-radius: var(--r-pill); padding: 3px 13px; font-size: 15px; }
.qmeta .exam { border-color: var(--highlight); color: var(--highlight-text); }
.qmeta .star { margin-left: auto; background: none; border: 0; color: var(--soft);
               font-size: 20px; line-height: 1; padding: 0 2px; }
.qmeta .star[aria-pressed="true"] { color: var(--highlight-text); }

/* A written answer. Big enough to write a three-mark explanation in without
   scrolling, which is what a learner is being asked for. */
.answer { width: 100%; background: var(--bg2); color: var(--fg); font: inherit;
          font-size: 17px; line-height: 1.5; border: 2px solid var(--line);
          border-radius: var(--r-card); padding: 12px 14px; resize: vertical; min-height: 96px; }
.answer:focus { border-color: var(--accent); outline: none; }
.answer.one { min-height: 52px; }
.saved { font-size: 13px; color: var(--soft); margin: 6px 0 0; min-height: 18px; }

/* A short exact answer: a number, a binary pattern, a line of output. */
.exact { background: var(--field-bg); color: var(--fg); border: 2px solid var(--line-strong);
         border-radius: var(--r-control); padding: 12px 14px; font-size: 20px; width: 100%;
         max-width: 340px; }
.exact.mono { font-family: var(--font-mono); letter-spacing: .06em; }
.unit { color: var(--soft); margin-left: 10px; font-size: 16px; }

/* Mark points, after marking. Earned and missed, in the question's own order. */
.points { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.points li { display: grid; grid-template-columns: 24px 1fr; gap: 8px;
             font-size: 16px; line-height: 1.4; }
.points li i { font-style: normal; font-weight: 800; }
.points li.got i { color: var(--ok); }
.points li.lost i { color: var(--soft); }
.points li.lost { color: var(--soft); }

/* Where to go and look it up again. */
.revisit { display: block; margin-top: 14px; background: var(--raise);
           border: 2px solid var(--info); border-radius: var(--r-card); padding: 12px 16px;
           color: var(--fg); text-decoration: none; }
.revisit b { display: block; color: var(--info); font-size: 14px;
             letter-spacing: .04em; text-transform: uppercase; margin-bottom: 4px; }
.revisit:hover { border-color: var(--accent); }

/* How sure are you? Offered, never demanded. */
.confid { display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
          margin: 14px 0 0; font-size: 14px; color: var(--soft); }
.confid .seg button { padding: 6px 12px; font-size: 14px; }

/* The topic picker. */
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
          gap: 8px; margin: 10px 0; }
.picker button { text-align: left; background: var(--bg2); color: var(--fg);
                 border: 2px solid var(--line); border-radius: var(--r-card);
                 padding: 10px 12px; font-size: 15px; }
.picker button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.picker button b { display: block; color: var(--accent); font-size: 13px; }
.picker button span { color: var(--soft); font-size: 13px; }
.modes { display: grid; gap: 6px; margin: 8px 0; }
.modes button { text-align: left; background: var(--bg2); color: var(--fg);
                border: 2px solid var(--line); border-radius: var(--r-card); padding: 10px 13px;
                font-size: 15px; }
.modes button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.modes button:disabled { opacity: .55; }
.modes .why { display: block; font-size: 13px; color: var(--soft); margin-top: 3px; }
/* The note under a mode's name: what it is, in a learner's terms. */
.modes .note { display: block; font-size: 13px; color: var(--soft); margin-top: 3px; }
/* The four a pupil should see first, given the room to be read at a glance.
   Two across on anything wider than a phone, one on a phone, because the notes
   are sentences and two sentences side by side in 160px is neither. */
.modes.primary { gap: 8px; }
.modes.primary button { padding: 11px 13px; }
.modes.primary button[aria-pressed="true"] { background: var(--bg3, var(--bg2)); }
@media (min-width: 540px) { .modes.primary { grid-template-columns: 1fr 1fr; } }
/* A mode whose turn has not come yet should read as "not yet", not as broken. */
.modes button:disabled { opacity: .55; cursor: not-allowed; }

/* A grid answer: a truth table or a trace table. */
.gridq { border-collapse: collapse; margin: 4px 0 12px; font-size: 16px; }
.gridq th, .gridq td { border: 1px solid var(--line); padding: 4px; text-align: center; }
.gridq th { background: var(--raise); padding: 7px 12px; }
.gridq td.given { background: var(--bg2); color: var(--soft); padding: 7px 12px; }
.gridq input { width: 76px; background: var(--field-bg); color: var(--fg);
               border: 2px solid var(--line-strong); border-radius: var(--r-control); padding: 6px;
               font-size: 16px; text-align: center; }
.gridq input.right { border-color: var(--ok); }
.gridq input.wrong { border-color: var(--bad); }

/* The session banner across the top of the room. */
.revise .hud b { font-size: 22px; }
.revise #where { font-size: 14px; color: var(--soft); max-width: 60vw; }
.revise #where b { color: var(--fg); }

.summary .stat b { font-size: 30px; }
.sourceline { font-size: 13px; color: var(--soft); margin-top: 10px; }
.selfcheck { display: grid; gap: 8px; margin: 10px 0; }
.selfcheck label { display: grid; grid-template-columns: 26px 1fr; gap: 8px;
                   align-items: start; background: var(--bg2); border: 2px solid var(--line);
                   border-radius: var(--r-card); padding: 10px 12px; font-size: 16px; line-height: 1.4; }
.selfcheck input { width: 20px; height: 20px; margin-top: 2px; }
.selfcheck .seen { color: var(--accent); font-size: 13px; font-style: normal; margin-left: 6px; }

/* Text that may hold a program keeps its line breaks and indentation. */
.pre { white-space: pre-wrap; }

/* A levels-of-response mark scheme: indicative content, then the level, then a
   mark inside it. */
.msh { font-size: 16px; margin: 16px 0 4px; }
.yours summary { cursor: pointer; color: var(--soft); font-size: 14px; }
.yours p { background: var(--bg2); border-radius: 10px; padding: 10px 12px; font-size: 15px; }
.levels { display: grid; gap: 8px; margin: 8px 0; }
.lvl { display: grid; grid-template-columns: auto auto 1fr auto; gap: 6px 12px; align-items: baseline;
       text-align: left; background: var(--bg2); color: var(--fg); border: 2px solid var(--line);
       border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 15px; cursor: pointer; }
.lvl .range { color: var(--soft); font-size: 14px; }
.lvl .why { grid-column: 1 / -1; color: var(--soft); font-size: 14px; line-height: 1.4; }
.lvl .sug { grid-row: 1; grid-column: 4; font-size: 12px; color: var(--accent-fg); background: var(--accent);
            border-radius: 999px; padding: 2px 8px; }
.lvl.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.lvl:focus-visible, .mk:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.marks { display: flex; gap: 8px; flex-wrap: wrap; }
.mk { min-width: 48px; min-height: 44px; font: inherit; font-size: 18px; font-weight: 700; color: var(--fg);
      background: var(--bg2); border: 2px solid var(--line); border-radius: 10px; cursor: pointer; }
.mk.on { border-color: var(--accent); background: var(--accent-soft); }
.ms ul { margin: 4px 0 8px 18px; }
.ms li { margin: 2px 0; }

/* The question window is open the whole time a learner is revising, so the
   controls and the panels have to sit above it rather than behind it. In a
   lesson a drawer and the task window are never open together and the order
   they appear in the document is enough; here they are, and it is not. */
.revise #modal { z-index: 4; }
.revise .drawer { z-index: 5; max-height: calc(100% - 180px); }
.revise .tools, .revise .hudbar { z-index: 6; }
.revise .toast { z-index: 7; }

/* The Quiz Mode entry bar.
 *
 * Anchored at the bottom of the view and nowhere near the walls, because the
 * room is what explains the feature and a panel over it would be the pop-up this
 * deliberately is not. It clears the toolbar above it, it does not follow the
 * head, and it is the only thing between arriving and a question. Sections 62
 * to 64. */
.startbar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 86px);
  z-index: 40; max-width: min(620px, calc(100vw - 32px));
  background: rgba(16, 24, 40, .92); color: var(--fg);
  border: 1px solid rgba(255, 255, 255, .16); border-radius: var(--r-window);
  padding: 14px 18px; text-align: center;
  box-shadow: var(--shadow-pop);
}
.startbar[hidden] { display: none; }
.startbar .sbhead { margin: 0 0 10px; font-size: 15px; line-height: 1.4; color: var(--fg2); }
.startbar .sbrow { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
/* A target big enough for a controller ray as well as a finger. Section 63. */
.startbar .btn { min-height: 48px; min-width: 190px; font-size: 17px; }
@media (max-width: 520px) {
  .startbar { bottom: calc(env(safe-area-inset-bottom, 0px) + 120px); padding: 12px 14px; }
  .startbar .btn { min-width: 150px; }
}

/* The tools stay above the question window in Quiz Mode, so the window ends
   above them rather than running underneath: on a phone the toolbar wraps to
   two rows and used to cover the window's own buttons. */
.revise #modal { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
.revise #modal .box.huge { max-height: 100%; }
@media (max-width: 700px) {
  .revise #modal { padding-top: 54px; padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }
}

/* The visitor's Quiz Mode sample says so, once, where they start. */
.sbnote { font-size: 14px; color: var(--soft); margin: 4px 0 8px; max-width: 46ch; }
.sbnote a { color: var(--link, var(--accent)); }
