/* MARKS (mk-): figures set like an account book, a red pen on a passage, variant readings as an apparatus, and a
   chain of marked steps. The options, verdicts and action rows borrow the quiz's own classes (study.css), so a step
   in a chain reads like a question in the quiz. Figures and code are in the data font; what is read is in Fraunces. */

/* ---------- a figure: working lines, then the total, double-ruled ---------- */
.mk-fig { border-top: 1px solid var(--ink); }
.mk-k { margin: 10px 0 0; font: 600 0.65625rem/1.3 var(--font-ui); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.mk-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 9.5em) 14px; gap: 10px; align-items: center; min-height: 46px; padding: 5px 0 5px 8px; border-bottom: 1px solid var(--rule-2); }
.mk-lab { min-width: 0; font: 400 0.96875rem/1.35 var(--font-serif); color: var(--ink-2); text-wrap: pretty; }
.mk-kv { display: block; margin-top: 2px; font: 500 0.71875rem/1.3 var(--font-data); color: var(--ink-3); }
.mk-in {
  width: 100%; height: 36px; padding: 0 8px; background: var(--paper); border: 1px solid var(--rule); border-radius: 3px;
  font: 500 1rem/1 var(--font-data); color: var(--ink); text-align: right; font-variant-numeric: tabular-nums;
  transition: border-color 120ms var(--ease-out), box-shadow 120ms var(--ease-out);
}
.mk-in:hover { border-color: var(--ink-3); }
.mk-in:focus-visible { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--wash); }
.mk-in.is-read { display: flex; align-items: center; justify-content: flex-end; overflow-wrap: anywhere; background: transparent; border-color: transparent; }
.mk-in.is-read i { font: italic 0.875rem/1 var(--font-serif); color: var(--ink-4); }
.mk-mk { font: 600 0.875rem/1 var(--font-ui); text-align: center; color: var(--verdigris); }
.mk-mk.is-no { color: var(--rubric); }
/* the first working line that is off, set as the quiz sets a wrong pick */
.mk-row.is-off { box-shadow: inset 2px 0 0 var(--rubric); background: var(--wash); }
.mk-row.is-off .mk-lab { color: var(--ink); }
/* the total: a rule of ink above and two below, as a ledger closes a sum */
.mk-total { margin-top: 10px; border-top: 1px solid var(--ink); border-bottom: 3px double var(--ink); }
.mk-total:first-child { margin-top: 0; border-top: 0; }   /* no working: the figure's own rule is the one above */
.mk-total .mk-lab { font: 600 0.96875rem/1.35 var(--font-serif); color: var(--ink); }
.mk-echo { margin: 7px 0 0; font: 0.75rem/1.4 var(--font-ui); color: var(--ink-3); }
.mk-slip { margin: 9px 0 0; font: italic 400 1rem/1.45 var(--font-serif); color: var(--rubric); text-wrap: pretty; }

/* ---------- the budget line: a request's stops along a hairline, the p95 budget a rubric tick ---------- */
.mk-blw { margin: 14px 0 4px; }
.mk-bl { margin: 0; }
.mk-bl svg { display: block; width: 100%; height: 20px; overflow: visible; }
.mk-bl-base { stroke: var(--rule); stroke-width: 1; vector-effect: non-scaling-stroke; }
.mk-bl-s { fill: var(--ink); }
.mk-bl-s.is-alt { fill: var(--ink-3); }
.mk-bl-b { stroke: var(--rubric); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.mk-bl-u { fill: none; stroke: var(--rubric); stroke-width: 1.5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.mk-bl figcaption ol { display: flex; flex-wrap: wrap; gap: 3px 14px; margin: 8px 0 0; padding: 0; list-style: none; font: 0.75rem/1.45 var(--font-ui); color: var(--ink-2); }
.mk-bl figcaption b { font: 600 0.75rem/1 var(--font-serif); color: var(--rubric); font-variant-numeric: lining-nums; }
.mk-bl figcaption span { font: 500 0.71875rem/1 var(--font-data); color: var(--ink-3); }
.mk-bl figcaption p { margin: 6px 0 0; font: italic 400 0.90625rem/1.4 var(--font-serif); color: var(--ink-2); }
.mk-bl figcaption p b { font: inherit; font-style: normal; font-weight: 500; color: var(--rubric); }

/* ---------- red pen: each line a button; marked lines underlined by hand, numbered in the margin ---------- */
.mk-pass { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.mk-li { border-bottom: 1px solid var(--rule-2); }
.mk-line {
  position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr) 14px; gap: 8px; align-items: baseline; width: 100%;
  padding: 9px 2px 10px 0; text-align: left; font: 400 0.96875rem/1.5 var(--font-serif); color: var(--ink-2);
  -webkit-tap-highlight-color: transparent; transition: background 120ms var(--ease-out), color 120ms var(--ease-out);
}
@media (hover: hover) { .mk-line:not(:disabled):hover { background: var(--wash); color: var(--ink); } }   /* a hover left on a tapped line would read as a mark */
.mk-line:not(:disabled):active { background: var(--wash); }
.mk-line:disabled { cursor: default; }
.mk-line[aria-pressed="true"] { color: var(--ink); }
.mk-ln { font: 500 0.65625rem/1 var(--font-data); color: var(--ink-4); text-align: right; font-variant-numeric: tabular-nums; }
.mk-lt { min-width: 0; }
.mk-num { font: 600 0.8125rem/1 var(--font-serif); color: var(--rubric); text-align: center; font-variant-numeric: lining-nums; }
.mk-ink { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.mk-ink path { fill: none; stroke: var(--rubric); stroke-width: 1.5; stroke-linecap: round; }
/* code: one block, no rules between lines, the data font, wrapping on a phone */
.mk-pass.is-code { padding: 4px 0; background: var(--paper); border-bottom: 1px solid var(--rule-2); }
.mk-pass.is-code .mk-li { border-bottom: 0; }
.mk-pass.is-code .mk-line { padding: 3px 2px 5px 0; font: 400 0.78125rem/1.6 var(--font-data); }
.mk-pass.is-code .mk-lt { padding-left: 2ch; text-indent: -2ch; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2; }   /* a wrapped line hangs */
/* handed back: a fault marked is ruled verdigris, a fault missed rubric on a wash, a sound line marked goes grey */
.mk-li[data-st="hit"] { box-shadow: inset 2px 0 0 var(--verdigris); }
.mk-li[data-st="missed"] { box-shadow: inset 2px 0 0 var(--rubric); background: var(--wash); }
.mk-li[data-st="extra"] .mk-ink path { stroke: var(--ink-4); }
.mk-li[data-st="extra"] .mk-num { color: var(--ink-4); }
.mk-li[data-st] .mk-line { color: var(--ink); }
.mk-note { margin: -2px 0 0; padding: 0 10px 10px 30px; font: italic 400 0.90625rem/1.45 var(--font-serif); color: var(--ink-2); text-wrap: pretty; }
.mk-li[data-st="hit"] .mk-note::before, .mk-li[data-st="missed"] .mk-note::before { content: "✓ "; font: 600 0.75rem/1 var(--font-ui); font-style: normal; color: var(--verdigris); }
.mk-li[data-st="missed"] .mk-note::before { content: "✗ "; color: var(--rubric); }
.mk-tally { font-variant-numeric: tabular-nums; }

/* ---------- variant readings: the prompt, the fault seen, four edits as diffs ---------- */
.mk-prompt { margin: 0 0 10px; padding: 10px 12px; max-height: 15em; overflow: auto; background: var(--paper); border: 1px solid var(--rule-2); border-radius: 3px; font: 0.78125rem/1.55 var(--font-data); white-space: pre-wrap; overflow-wrap: anywhere; }
.mk-fail { margin: 0 0 14px; font: italic 400 0.96875rem/1.45 var(--font-serif); color: var(--ink-2); }
.mk-fail b { margin-right: 6px; font: 600 0.65625rem/1.3 var(--font-ui); font-style: normal; letter-spacing: 0.12em; text-transform: uppercase; color: var(--rubric); }
.mk-diff { margin: 0; font: 0.78125rem/1.55 var(--font-data); white-space: pre-wrap; overflow-wrap: anywhere; }
.mk-diff ins { text-decoration: none; background: var(--wash); color: var(--ink); }
.mk-diff del { color: var(--ink-3); }
.qz-opt.is-dim .mk-diff ins { background: transparent; }
.mk-runs { display: flex; flex-wrap: wrap; gap: 2px 0; margin: 12px 0 0; font: 500 0.8125rem/1.5 var(--font-data); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.mk-runs b { font: 600 0.78125rem/1 var(--font-serif); color: var(--ink-3); }
.mk-runs i { font-style: normal; color: var(--ink-4); white-space: pre; }
.mk-runs .is-key { color: var(--verdigris); }
.mk-runs .is-key b { color: var(--verdigris); }
.mk-col { margin: 4px 0 0; font: italic 400 0.84375rem/1.4 var(--font-serif); color: var(--ink-3); }

/* ---------- an erratum after its answer ---------- */
.mk-asof { margin: 10px 0 0; font: 400 1rem/1.5 var(--font-serif); color: var(--ink); text-wrap: pretty; }
.mk-asof b { font-weight: 600; color: var(--rubric); }
.mk-asof .link { font: 0.8125rem/1 var(--font-ui); white-space: nowrap; }

/* ---------- a chain: marked steps in order, one at a time ---------- */
.mk-step { scroll-margin: calc(var(--mast-h, 0px) + 16px) 0 72px; outline: none; }
.mk-step + .mk-step { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--rule-2); }
.mk-step .qz-q { font-size: 1.125rem; }
.mk-end { margin: 18px 0 0; padding-top: 12px; border-top: 1px solid var(--rule-2); font: italic 400 1rem/1.45 var(--font-serif); color: var(--ink-2); }

/* fingers need 44px; a pointer does not */
@media (pointer: coarse) {
  .mk-in { height: 44px; }
  .mk-line { min-height: 44px; align-items: center; }
  .mk-pass.is-code .mk-line { min-height: 44px; }
  .mk-asof .link { display: inline-flex; align-items: center; min-height: 44px; }
}
@media (max-width: 760px) {
  .mk-row { grid-template-columns: minmax(0, 1fr) minmax(0, 8.5em) 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .mk-in, .mk-line { transition: none; }
}
