/* Marking, the diagnostic and the projector (polish W2a). Tokens only: no
   raw colours, sizes off the scale, weight 700 or zoom. docs/ui.md. */

/* ---- keys ------------------------------------------------------------------ */
kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: var(--r-sm); background: var(--track); color: var(--muted); box-shadow: inset 0 -1px 0 var(--line-strong);
  font: var(--t-caption); font-weight: var(--w-semibold); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.btn kbd { margin-left: var(--s-1); }
.btn kbd.on-primary { background: rgba(255, 255, 255, .16); color: var(--on-primary); box-shadow: none; }
.btn:disabled kbd { display: none; }
.mk-keys { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); margin: 0; padding: var(--s-3) var(--s-5) var(--s-4);
  border-top: 1px solid var(--line); font: var(--t-caption); color: var(--muted); }
.mk-keys > span { display: inline-flex; align-items: center; gap: 3px; }
.mk-keys kbd { min-width: 18px; height: 18px; padding: 0 4px; background: var(--surface-quiet); }

/* ---- the marking screens' layout ------------------------------------------- */
.mk-body { padding-top: var(--s-6); gap: var(--s-5); }
.mk-layout { display: grid; grid-template-columns: minmax(360px, 5fr) minmax(0, 6fr); gap: var(--s-6); align-items: start; }
.mk-side { display: flex; flex-direction: column; gap: var(--s-5); min-width: 0; }
.mk-solo { width: 100%; max-width: 920px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--s-4); }
.mk-flow { font: var(--t-label); color: var(--on-band-muted); }
.mk-ai { display: flex; justify-content: flex-end; align-items: center; gap: var(--s-2); }
/* what the AI made of the photo: marking, marked, not sure, unreadable, failed */
.mk-ai-note { display: flex; align-items: center; gap: var(--s-2); margin: 0 var(--s-3) var(--s-2); padding: var(--s-2) var(--s-3);
  border-radius: var(--r-md); background: var(--surface-quiet); color: var(--ink); font: var(--t-body); }
.mk-ai-note > svg { flex-shrink: 0; color: var(--primary); }
.mk-ai-note.unsure, .mk-ai-note.unreadable, .mk-ai-note.failed { background: var(--amber-bg); }
.mk-ai-note.unsure > svg, .mk-ai-note.unreadable > svg, .mk-ai-note.failed > svg { color: var(--amber-text); }
.mk-ai > .mk-ai-note { flex: 1; margin: 0; }
.mk-ai-said { display: inline-flex; align-items: center; height: 24px; padding: 0 var(--s-2); border-radius: var(--r-full); white-space: nowrap;
  font: var(--t-caption); font-weight: var(--w-semibold); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-strong); }
.mk-pages { display: inline-flex; align-items: center; gap: var(--s-1); font: var(--t-caption); color: var(--on-band-muted); margin-left: var(--s-2); }

/* the photo, on the brand's dark ground */
.mk-photo {
  position: sticky; top: calc(var(--topbar-h) + var(--s-4)); height: calc(100vh - var(--topbar-h) - var(--s-8));
  min-height: 420px; display: flex; flex-direction: column; overflow: hidden;
  background: var(--band); border-radius: var(--r-lg); box-shadow: var(--e2);
}
.mk-photo-bar { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-3) var(--s-3) var(--s-2) var(--s-5); color: var(--on-band); }
.mk-photo-label { display: inline-flex; align-items: center; gap: var(--s-2); font: var(--t-label); color: var(--on-band); }
.mk-photo-label svg { color: var(--green-400); }
.mk-photo-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 var(--s-3); border: 0; border-radius: var(--r-sm);
  background: rgba(211, 255, 233, .08); color: var(--on-band); font: var(--t-label); text-decoration: none;
  transition: background var(--dur-1) var(--ease);
}
.mk-photo-btn:hover { background: rgba(211, 255, 233, .16); color: var(--white); }
.mk-photo-btn kbd { min-width: 18px; height: 18px; background: rgba(211, 255, 233, .12); color: var(--on-band-muted); box-shadow: none; }
.mk-photo :focus-visible { box-shadow: var(--focus-ring-band); }
.mk-photo-view { flex: 1; min-height: 0; overflow: auto; display: grid; place-items: start center; padding: var(--s-2) var(--s-4) var(--s-4); }
.mk-photo-view img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--r-sm); cursor: zoom-in;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .35); }
.mk-photo.zoomed .mk-photo-view { place-items: start center; }
.mk-photo.zoomed .mk-photo-view img { max-width: none; max-height: none; width: 180%; cursor: zoom-out; }
.mk-photo.zoomed .mk-photo-view { place-items: start; }
.mk-photo-none { align-self: center; color: var(--on-band-muted); }

/* the question */
.mk-question { padding: var(--s-5) var(--s-6); border-bottom: 1px solid var(--line); }
.mk-q-head { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-4); }
.mk-q-head .tech-tag { margin-left: auto; }
.mk-q { display: flex; flex-direction: column; gap: var(--s-3); --math-k: 1.125; font: var(--t-body-lg); }
.mk-q .q-part > b { font: var(--t-body-lg); font-weight: var(--w-semibold); min-width: 2.2em; }

/* the card of rows */
.mk-card-head { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-5) var(--s-3); }
.mk-card-head h2 { font: var(--t-h3); }
.mk-count { font: var(--t-caption); font-weight: var(--w-semibold); color: var(--muted); background: var(--track); padding: 2px var(--s-2); border-radius: var(--r-full); }

/* ---- rows: one line of working each ------------------------------------------ */
.mk-rows { display: flex; flex-direction: column; gap: 2px; padding: 0 var(--s-3) var(--s-3); }
.mk-row {
  position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; column-gap: var(--s-3); align-items: center;
  min-height: 44px; padding: 3px var(--s-2) 3px var(--s-2); border-radius: var(--r-md);
  transition: background var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.mk-row:hover { background: var(--surface-quiet); }
.mk-row.is-cur { background: var(--surface-quiet); box-shadow: inset 3px 0 0 var(--green-400); }
.mk-row.crossed { background: var(--error-bg); }
.mk-row.crossed.is-cur { box-shadow: inset 3px 0 0 var(--error); }
.mk-n { font: var(--t-caption); font-weight: var(--w-semibold); color: var(--muted); text-align: right; }
.mk-row.is-cur .mk-n { color: var(--primary); }
.mk-line { min-width: 0; overflow-x: auto; display: flex; align-items: center; padding: var(--s-1) 0; }
.mk-marks { display: inline-flex; align-items: center; gap: 6px; }
.mk-btn {
  width: 34px; height: 34px; border-radius: var(--r-full); border: 0; padding: 0; display: grid; place-items: center;
  background: var(--surface); color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--control-line);
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease), transform var(--dur-1) var(--ease-spring);
}
.mk-btn:hover { color: var(--primary); box-shadow: inset 0 0 0 1.5px var(--primary); }
.mk-btn.no:hover { color: var(--error-text); box-shadow: inset 0 0 0 1.5px var(--error); }
.mk-btn:active { transform: scale(.9); }
.mk-btn.yes[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); box-shadow: none; }
.mk-btn.no[aria-pressed="true"] { background: var(--error); color: var(--white); box-shadow: none; }
.mk-row.ticked .mk-btn.no, .mk-row.crossed .mk-btn.yes { color: var(--control-line); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.mk-row.ticked .mk-btn.no:hover, .mk-row.crossed .mk-btn.yes:hover { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--control-line); }
.mk-part { font: var(--t-body); font-weight: var(--w-semibold); color: var(--ink); padding: var(--s-3) var(--s-2) var(--s-1); }
.mk-part:first-child { padding-top: var(--s-1); }
.mk-heading { padding: var(--s-3) var(--s-2) 2px calc(24px + var(--s-3) + var(--s-2)); }
.mk-part + .mk-heading { padding-top: 0; }

/* silly-error tags on a crossed line */
.mk-silly { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 2px 0 var(--s-2); }
.mk-silly .caption { color: var(--amber-text); margin-right: var(--s-1); }
.mk-tag {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 var(--s-2) 0 var(--s-3); border-radius: var(--r-full);
  border: 1px solid var(--amber); background: var(--amber-bg); color: var(--amber-text); font: var(--t-caption); font-weight: var(--w-semibold);
  transition: background var(--dur-1) var(--ease);
}
.mk-tag:not(:has(kbd)) { padding-right: var(--s-3); }
.mk-tag:hover { background: var(--surface); }
.mk-tag.on { background: var(--amber); color: var(--green-950); }
.mk-tag kbd { min-width: 18px; height: 18px; padding: 0 4px; background: rgba(255, 255, 255, .6); color: var(--amber-text); box-shadow: none; }

/* the marked working (practice, after marking) */
.mk-rows.view { padding: 0; gap: var(--s-1); }
.mk-rows.view .mk-row { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); min-height: 48px; padding: var(--s-1) var(--s-3); }
.mk-rows.view .mk-row.crossed { background: var(--error-bg); box-shadow: inset 0 0 0 1px rgba(196, 78, 56, .35); }
.mk-end { display: inline-flex; align-items: center; gap: var(--s-2); }
.mk-result { width: 26px; height: 26px; border-radius: var(--r-full); display: grid; place-items: center; color: var(--white); }
.mk-result.yes { background: var(--primary); }
.mk-result.no { background: var(--error); }
.mk-reason { display: inline-flex; align-items: center; gap: var(--s-1); height: 26px; padding: 0 var(--s-3); border-radius: var(--r-full);
  font: var(--t-caption); font-weight: var(--w-semibold); background: var(--surface); color: var(--error-text); white-space: nowrap; }
.mk-reason.silly { background: var(--amber-bg); color: var(--amber-text); box-shadow: inset 0 0 0 1px var(--amber); }
.mk-reason.carried { color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-strong); }
.mk-compare { grid-column: 2 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); padding: var(--s-2) 0 var(--s-3); }
.mk-compare h4 { color: var(--muted); margin-bottom: var(--s-2); }
.mk-sol { background: var(--surface); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); }
.mk-theirs { background: var(--surface); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); box-shadow: inset 0 0 0 1px rgba(196, 78, 56, .3); }
.mk-their-line { font-family: var(--font-math); font-size: 17px; padding: var(--s-2) 0; border-bottom: 1px dashed rgba(196, 78, 56, .3); }
.mk-their-line:last-child { border-bottom: 0; }
.mk-wrongpart { position: relative; display: inline-block; background: rgba(196, 78, 56, .16); border-radius: 4px; padding: 0 3px; box-shadow: inset 0 -2px 0 var(--error); }
.mk-wrongpart .fix { position: absolute; left: 0; right: 0; top: -1.15em; text-align: center; font-size: .8em; color: var(--primary); font-weight: var(--w-semibold); }

/* ---- before and after ------------------------------------------------------- */
.mk-effect { padding: var(--s-5) var(--s-6); }
.mk-effect h2 { font: var(--t-h3); margin-bottom: var(--s-2); }
.mk-moves { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(100px, 150px) 92px 56px minmax(0, auto); column-gap: var(--s-4); }
/* one set of columns for every row (subgrid), so the bars line up */
.mk-moves > * { grid-column: 1 / -1; }
.mk-moves-empty { padding: var(--s-2) 0; font: var(--t-body); color: var(--muted); }
.mk-move {
  display: grid; grid-template-columns: subgrid; align-items: center;
  padding: var(--s-3) 0; border-top: 1px solid var(--line);
}
.mk-move:first-child { border-top: 0; }
.mk-move-name { font-weight: var(--w-medium); min-width: 0; }
.mk-move-bar { position: relative; height: 8px; border-radius: var(--r-full); background: var(--track); }
.mk-move-was { position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--r-full); background: var(--green-200); }
.mk-move-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--r-full); background: var(--primary); transition: width var(--dur-4) var(--ease); }
.mk-move.is-mastered .mk-move-fill { background: var(--green-400); }
.mk-move-target { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--green-800); opacity: .45; }
.mk-move-nums { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; font: var(--t-label); }
.mk-move-nums .was { color: var(--muted); font-weight: var(--w-regular); }
.mk-move-nums svg { color: var(--muted); }
.mk-delta { justify-self: start; display: inline-flex; align-items: center; height: 22px; padding: 0 var(--s-2); border-radius: var(--r-full);
  font: var(--t-caption); font-weight: var(--w-semibold); background: var(--track); color: var(--muted); }
.mk-delta.up { background: var(--surface-mint); color: var(--green-800); }
.mk-delta.down { background: var(--amber-bg); color: var(--amber-text); }
.mk-move-cards { display: inline-flex; gap: 4px; }
.mk-move-cards .pip.served { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--green-400); }
.mk-more { justify-self: start; display: inline-flex; align-items: center; gap: var(--s-1); margin-top: var(--s-2); padding: var(--s-1) 0;
  border: 0; background: none; color: var(--primary); font: var(--t-label); }
.mk-moves.compact { flex: 1; min-width: 0; grid-template-columns: minmax(120px, 1fr) 120px 92px 56px auto; column-gap: var(--s-3); }
.mk-moves.compact .mk-move { padding: var(--s-1) 0; border: 0; }
.mk-moves.compact .mk-move-name { font: var(--t-label); font-weight: var(--w-medium); }

/* the save bar stays in reach */
.mk-savebar {
  position: sticky; bottom: var(--s-4); z-index: 5; display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-2) var(--s-2) var(--s-2) var(--s-5); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-lg); box-shadow: var(--e3);
}
.mk-savebar .btn-big { --btn-h: 48px; }
.mk-save-state { flex: 1; font: var(--t-label); color: var(--muted); }
/* the keys ride in the save bar, so they are never hidden under it */
.mk-save-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s-1); }
.mk-save-info .mk-save-state { flex: none; color: var(--ink); }
.mk-savebar .mk-keys { padding: 0; border-top: 0; gap: 2px var(--s-3); }
/* The bar never covers content: while a save bar is on screen (markFlow.js
   useSaveBarRoom) the page's scroll area is padded at the bottom by the bar's
   height and its gap, so a row the keyboard brings into view, a focused
   control or a page of Space stops clear of it; a canvas-coloured skirt (a solid
   shadow under the bar) hides what would peek out below it. */
html.has-savebar { scroll-padding-bottom: calc(var(--savebar-room, 72px) + var(--s-4) * 2); }
.mk-savebar { box-shadow: var(--e3), 0 var(--s-6) 0 var(--s-2) var(--canvas); }
.mk-rows .mk-row { scroll-margin: calc(var(--topbar-h) + var(--s-4)) 0 var(--s-2); }

/* what was just saved, on the screen the save led to */
.mk-saved {
  display: flex; align-items: center; gap: var(--s-4); padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4);
  background: var(--surface-quiet); border: 1px solid var(--green-200); border-radius: var(--r-lg); animation: rise var(--dur-3) var(--ease);
}
.mk-saved .ed-tile { transform: rotate(-4deg); }
.mk-saved-text { display: flex; flex-direction: column; min-width: 220px; max-width: 360px; }
.mk-saved-text b { font-weight: var(--w-semibold); }
.mk-saved-text > span { font: var(--t-caption); color: var(--muted); }

/* ---- the quiz ---------------------------------------------------------------- */
.mk-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); background: var(--surface-quiet); }
.mk-tab {
  display: inline-flex; align-items: center; gap: var(--s-2); height: 40px; padding: 0 var(--s-3) 0 5px; border-radius: var(--r-full);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted);
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.mk-tab:hover { border-color: var(--primary); }
.mk-tab.at { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91, 210, 154, .4); color: var(--ink); }
.mk-tab-n { width: 30px; height: 30px; border-radius: var(--r-full); display: grid; place-items: center; background: var(--track); color: var(--ink); font: var(--t-label); }
.mk-tab.full .mk-tab-n { background: var(--primary); color: var(--on-primary); }
.mk-tab.part .mk-tab-n { background: var(--green-200); color: var(--green-800); }
.mk-tab-score { font: var(--t-caption); font-weight: var(--w-semibold); }
.mk-total { font: var(--t-h3); color: var(--ink); padding-right: var(--s-2); }
.mk-total span { color: var(--muted); font-weight: var(--w-regular); }
.mk-quiz-q { display: grid; grid-template-columns: 36px minmax(0, 1fr); grid-template-areas: "tile tech" "tile q"; gap: var(--s-2) var(--s-4); align-items: start; padding: var(--s-5) var(--s-6); border-bottom: 1px solid var(--line); }
/* the tech tag above the question, as on the printed sheet: beside it, it squeezed the question's text small */
.mk-quiz-q > .ed-tile { grid-area: tile; transform: rotate(-4deg); }
.mk-quiz-q > .tech-tag { grid-area: tech; justify-self: start; }
.mk-quiz-q .mk-q { grid-area: q; }

/* how to mark a quiz: photo or by hand */
.mk-choose { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--s-12); align-items: start; padding: var(--s-4) 0 var(--s-8); }
.mk-sheet { margin: 0; justify-self: end; width: 100%; max-width: 500px; background: var(--white); border-radius: var(--r-md); overflow: hidden;
  box-shadow: var(--e3); transform: rotate(-1.5deg); }
.mk-sheet img { display: block; width: 100%; }
.mk-choose-side { display: flex; flex-direction: column; gap: var(--s-4); max-width: 520px; padding-top: var(--s-16); }
.mk-choose-side h2 { font: var(--t-h2); }
.mk-choose-side > p { margin-bottom: var(--s-2); }
.mk-option {
  display: flex; align-items: center; gap: var(--s-5); padding: var(--s-5) var(--s-6) var(--s-5) var(--s-5); text-align: left; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: var(--e1);
  transition: box-shadow var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.mk-option:hover { box-shadow: var(--e3); border-color: var(--green-300); transform: translateY(-1px); }
.mk-option .ed-tile { transform: rotate(-4deg); }
.mk-option > svg { color: var(--muted); }
.mk-option:hover > svg { color: var(--primary); }
.mk-option-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.mk-option-text b { font: var(--t-h3); }
.mk-option-text span { color: var(--muted); }

@media (max-width: 1360px) {
  .mk-moves:not(.compact) { grid-template-columns: minmax(140px, 1fr) 120px 88px 56px auto; }
  .mk-move-cards { display: none; }
}

/* ======================================================= the diagnostic == */
/* notes and the how-it-works steps (also on Plan the term, TermPlan.js) */
.dg-note { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-md);
  background: var(--surface-quiet); color: var(--ink); margin: var(--s-1) 0 var(--s-2); }
.dg-note svg { color: var(--primary); flex-shrink: 0; margin-top: 3px; }
.dg-note.attention { background: var(--amber-bg); color: var(--amber-text); }
.dg-note.attention svg { color: var(--amber-text); }
.dg-key { display: flex; flex-direction: column; gap: var(--s-2); padding-top: var(--s-4); border-top: 1px solid var(--line); font: var(--t-caption); color: var(--ink); }
.dg-key > span { display: inline-flex; align-items: center; gap: var(--s-2); }
.dg-key.small { flex-direction: row; flex-wrap: wrap; gap: var(--s-2) var(--s-4); padding: var(--s-3) var(--s-5) var(--s-4); color: var(--muted); }

/* the status box: known, shaky, new (never red), not asked yet */
.dg-box { width: 18px; height: 18px; border-radius: 5px; flex-shrink: 0; display: inline-grid; place-items: center; }
.dg-box.known { background: var(--primary); color: var(--on-primary); }
.dg-box.shaky { background: var(--amber); }
.dg-box.new { background: var(--surface); box-shadow: inset 0 0 0 2px var(--green-800); }
.dg-box.open { background: var(--surface); border: 1.5px dashed var(--control-line); }

/* marking */
.dg-body { padding-top: var(--s-6); }
.dg-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: var(--s-6); align-items: start; }
.dg-skills { position: sticky; top: calc(var(--topbar-h) + var(--s-4)); max-height: calc(100vh - var(--topbar-h) - var(--s-8)); display: flex; flex-direction: column; }
.dg-skills-head { display: flex; flex-direction: column; gap: 2px; padding: var(--s-4) var(--s-5) var(--s-3); border-bottom: 1px solid var(--line); }
.dg-skills-head h2 { font: var(--t-h3); }
.dg-list { position: relative; list-style: none; margin: 0; padding: var(--s-2); overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.dg-skill { display: flex; align-items: center; gap: var(--s-3); padding: 7px var(--s-3); border-radius: var(--r-md); font: var(--t-body); font-size: 14px; line-height: 20px; }
.dg-skill-name { flex: 1; min-width: 0; }
.dg-skill.open { color: var(--muted); }
.dg-skill.current { background: var(--surface-mint); color: var(--green-800); font-weight: var(--w-semibold); box-shadow: inset 3px 0 0 var(--green-400); }
.dg-now { font: var(--t-caption); font-weight: var(--w-semibold); color: var(--on-primary); background: var(--primary); padding: 1px var(--s-2); border-radius: var(--r-full); }
.dg-status { font: var(--t-caption); color: var(--muted); text-transform: capitalize; }
.dg-skill.shaky .dg-status { color: var(--amber-text); }

.dg-main { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.dg-card { position: relative; }
.dg-card.is-busy .dg-q, .dg-card.is-busy .mk-rows { opacity: .35; transition: opacity var(--dur-2) var(--ease); }
.dg-q { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--s-4); padding: var(--s-6) var(--s-6) var(--s-5); border-bottom: 1px solid var(--line); }
.dg-q > .ed-tile { transform: rotate(-4deg); }
.dg-q-body { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.dg-q-meta { display: flex; align-items: center; gap: var(--s-3); justify-content: space-between; min-height: 24px; }
.dg-rows .dg-row { grid-template-columns: 24px minmax(0, 1fr) auto; }
.dg-row.crossed { background: var(--surface-quiet); }
.dg-row.crossed.is-cur { box-shadow: inset 3px 0 0 var(--green-400); }
.dg-mark { display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--r-full); background: var(--track); }
.dg-mark button { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 var(--s-3); border: 0; border-radius: var(--r-full);
  background: none; color: var(--muted); font: var(--t-caption); font-weight: var(--w-semibold); white-space: nowrap;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease); }
.dg-mark button:hover { color: var(--ink); background: var(--surface); }
.dg-mark .dg-mark-credited[aria-checked="true"] { background: var(--primary); color: var(--on-primary); }
.dg-mark .dg-mark-wrong_method[aria-checked="true"] { background: var(--error); color: var(--white); }
.dg-mark .dg-mark-not_shown[aria-checked="true"] { background: var(--amber); color: var(--green-950); }
.dg-mark kbd { min-width: 16px; height: 16px; padding: 0 3px; background: rgba(255, 255, 255, .7); color: var(--muted); box-shadow: none; }
.dg-mark button[aria-checked="true"] kbd { background: rgba(255, 255, 255, .22); color: inherit; }
.dg-mark .dg-mark-not_shown[aria-checked="true"] kbd { background: rgba(255, 255, 255, .45); }
.dg-drawing { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-5); border-radius: var(--r-full); background: var(--band); color: var(--on-band); font: var(--t-label); box-shadow: var(--e3);
  animation: fade var(--dur-2) var(--ease); }
.dg-spin { width: 16px; height: 16px; border-radius: var(--r-full); border: 2px solid rgba(211, 255, 233, .3); border-top-color: var(--green-400); animation: spin .8s linear infinite; }
.dg-foot { gap: var(--s-4); }
.dg-conf-label { font: var(--t-label); color: var(--ink); }
.dg-conf button { display: inline-flex; align-items: center; gap: var(--s-2); }
.dg-conf button[aria-pressed="true"]:hover { background: var(--primary); color: var(--on-primary); }
.dg-conf button[aria-pressed="true"] kbd { background: rgba(255, 255, 255, .2); color: var(--on-primary); box-shadow: none; }
.dg-done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s-3); padding: var(--s-12) var(--s-8); }
.dg-done .ed-tile { transform: rotate(-4deg); margin-bottom: var(--s-2); }
.dg-done p { max-width: 52ch; }
.dg-done .btn { margin-top: var(--s-3); }

/* the projector, in the hero */
.dg-proj {
  display: inline-flex; align-items: center; gap: var(--s-3); height: 52px; padding: 0 var(--s-4) 0 6px; border-radius: var(--r-md);
  border: 1px solid rgba(211, 255, 233, .25); background: rgba(211, 255, 233, .06); color: var(--on-band); text-align: left;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.dg-proj:hover { background: rgba(211, 255, 233, .12); border-color: var(--on-band); }
.dg-proj-screen { position: relative; width: 68px; height: 40px; border-radius: 4px; background: var(--white); overflow: hidden;
  display: grid; place-items: center; color: var(--muted); box-shadow: 0 0 0 2px var(--green-900); }
.dg-proj-screen .frag { width: 58px !important; height: auto; opacity: 1; }
.dg-proj-n { position: absolute; left: 3px; top: 2px; font: var(--t-caption); line-height: 12px; color: var(--primary); font-weight: var(--w-semibold); }
.dg-proj-text { display: flex; flex-direction: column; }
.dg-proj-text b { font: var(--t-label); color: var(--green-50); }
.dg-proj-text > span { display: inline-flex; align-items: center; gap: 6px; font: var(--t-caption); color: var(--on-band-muted); }
.dg-dot { width: 8px; height: 8px; border-radius: var(--r-full); background: var(--on-band-muted); opacity: .6; }
.dg-proj.live .dg-dot { background: var(--green-400); opacity: 1; box-shadow: 0 0 0 3px rgba(91, 210, 154, .25); animation: pulse 2s var(--ease) infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(91, 210, 154, 0); } }

@media (max-width: 1360px) {
  .dg-layout { grid-template-columns: 280px minmax(0, 1fr); }
}

/* ======================================================= the projector == */
/* projector.html: the brand band around a white sheet, sized to the wall
   (vh units), so it reads from the back of the room. */
.pj-body { min-width: 0; background: var(--band); overflow: hidden; }
.pj { position: relative; height: 100vh; display: flex; flex-direction: column; color: var(--on-band); }
.pj::after {   /* the large faint "ed" tile, as on the app's hero */
  content: ""; position: absolute; right: -6vh; bottom: -14vh; width: 62vh; height: 64vh; pointer-events: none;
  background: rgba(211, 255, 233, .04);
  clip-path: polygon(4.3% 20.6%, 83.5% 0%, 92.1% 5.4%, 100% 82.1%, 96% 87%, 27.5% 99.8%, 22.2% 95.7%, 0% 28.1%);
}
.pj-bar { position: relative; z-index: 1; display: flex; align-items: center; gap: 2vw; height: 9vh; padding: 0 4vw; }
.pj-mark { height: 3.6vh; width: auto; }
.pj-who { font: var(--t-body); font-size: 2.2vh; line-height: 1.2; color: var(--on-band-muted); }
.pj-offline { display: inline-flex; align-items: center; gap: 1vh; font: var(--t-label); font-size: 1.8vh; color: var(--amber); }
.pj-stage { position: relative; z-index: 1; flex: 1; min-height: 0; display: flex; padding: 0 4vw 5vh; }

.pj-sheet {
  flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--white); color: var(--ink);
  border-radius: 2.4vh; box-shadow: 0 2vh 6vh rgba(0, 0, 0, .35); padding: 4vh 4.5vw 5vh; animation: pj-in var(--dur-3) var(--ease);
}
@keyframes pj-in { from { opacity: 0; transform: translateY(1.5vh) scale(.99); } to { opacity: 1; transform: none; } }
.pj-sheet-head { display: flex; align-items: center; gap: 2vw; margin-bottom: 3vh; }
.pj-sheet-head .ed-tile { --tile: 10vh !important; transform: rotate(-4deg); }
.pj-qword { font: var(--t-h2); font-size: 3.4vh; line-height: 1.2; color: var(--muted); font-weight: var(--w-medium); }
.pj-tag { display: inline-flex; transform: scale(1.7); transform-origin: right center; }
.pj-tag.small { transform: scale(1.3); transform-origin: left center; margin: 0 0 1.4vh; }
.pj-fit { flex: 1; min-height: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.pj-q { width: max-content; display: flex; flex-direction: column; align-items: flex-start; gap: calc(var(--k) * 10px); }
.pj-frag { display: block; max-width: none; height: auto; opacity: 0; transition: opacity var(--dur-2) var(--ease); }
.pj-frag.ready { opacity: 1; }
.pj-frag.graph { align-self: center; }
.pj-part { display: flex; gap: calc(var(--k) * 10px); align-items: flex-start; }
.pj-part > b { font-family: var(--font-ui); font-weight: var(--w-semibold); font-size: calc(var(--k) * 16px); line-height: 1.25; color: var(--primary); min-width: 2.2em; }
.pj-part-in { display: flex; flex-direction: column; align-items: flex-start; }

/* between questions */
.pj-wait { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2.4vh; padding-bottom: 6vh; }
.pj-wait h1 { font: var(--t-display); font-size: 6vh; line-height: 1.15; color: var(--green-50); letter-spacing: -.01em; }
.pj-wait p { font: var(--t-body-lg); font-size: 2.8vh; line-height: 1.4; color: var(--on-band-muted); max-width: 60ch; }
.pj-wait-art { position: relative; width: 22vh; height: 22vh; display: grid; place-items: center; margin-bottom: 2vh; }
.pj-wait-ed { width: 15vh; height: auto; animation: pj-float 4.8s var(--ease) infinite alternate; }
@keyframes pj-float { from { transform: translateY(1vh) rotate(-6deg); } to { transform: translateY(-1.4vh) rotate(-2deg); } }
.pj-bit { position: absolute; width: 2.6vh; height: 2.7vh; background: var(--green-400); opacity: .7;
  clip-path: polygon(4.3% 20.6%, 83.5% 0%, 92.1% 5.4%, 100% 82.1%, 96% 87%, 27.5% 99.8%, 22.2% 95.7%, 0% 28.1%);
  animation: pj-float 3.6s var(--ease) infinite alternate; }
.pj-bit.a { left: 0; top: 18%; }
.pj-bit.b { right: 2%; top: 6%; width: 1.8vh; height: 1.9vh; background: var(--green-200); animation-delay: -1.2s; }
.pj-bit.c { right: 8%; bottom: 8%; width: 2.2vh; height: 2.3vh; background: var(--green-100); opacity: .5; animation-delay: -2.4s; }
.pj-hint { position: fixed; left: 50%; bottom: 1.6vh; transform: translateX(-50%); z-index: 2; padding: .8vh 1.6vh; border-radius: var(--r-full);
  background: rgba(211, 255, 233, .1); color: var(--on-band-muted); font: var(--t-label); transition: opacity var(--dur-4) var(--ease); }
.pj-hint.gone { opacity: 0; }
.cam-view { background: var(--band); }   /* the photo on the brand dark, as in marking */

@media (prefers-reduced-motion: reduce) {
  .pj-wait-ed, .pj-bit, .dg-proj.live .dg-dot { animation: none; }
}
