/* ppqviewer shared stylesheet. All rules scoped under .ppq so the engine can be
   embedded into a host app without leaking styles (d009). Consumers re-skin by
   overriding the CSS variables on the .ppq root, never by touching structure. */

.ppq {
  --ppq-bg: #faf6ed;
  --ppq-paper: #fffdf6;
  --ppq-ink: #1a1a17;
  --ppq-ink2: #4d4943;
  --ppq-muted: #8c8579;
  --ppq-line: rgba(26, 26, 23, 0.10);
  --ppq-accent: #3182ce;
  --ppq-ok: #2d6a3f;
  --ppq-bad: #b03030;

  color: var(--ppq-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: block;
}

.ppq * { box-sizing: border-box; }

/* QoderWork 2026-07-23: sticky top bar — Smith: "the top bar shouldn't go up on
   scrolling." Stays pinned at the top with a z-index above the question content. */
.ppq-header {
  background: var(--ppq-paper);
  border-bottom: 1px solid var(--ppq-line);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.ppq-title { font-size: 1.35rem; font-weight: 800; }
.ppq-ver { font-size: 0.7rem; opacity: 0.6; margin-left: 0.4rem; font-weight: 600; }
.ppq-filters { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.ppq-select, .ppq-start {
  background: var(--ppq-paper);
  border: 1px solid var(--ppq-line);
  color: var(--ppq-ink);
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
}
.ppq-select:focus, .ppq-start:focus { border-color: var(--ppq-accent); }
.ppq-select-positive {
  color: var(--ppq-ok);
  border-color: rgba(45, 106, 63, 0.48);
  background: rgba(45, 106, 63, 0.07);
}
.ppq-start { width: 84px; }
.ppq-counter { font-weight: 700; color: var(--ppq-accent); font-size: 0.9rem; }
.ppq-finder { position: relative; min-width: 220px; }
.ppq-find-input {
  width: 100%;
  background: var(--ppq-paper);
  border: 1px solid var(--ppq-line);
  color: var(--ppq-ink);
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
}
.ppq-find-input:focus { border-color: var(--ppq-accent); box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.1); }
.ppq-find-results {
  position: absolute;
  z-index: 130;
  top: calc(100% + 0.3rem);
  left: 0;
  right: 0;
  min-width: 310px;
  max-height: 22rem;
  overflow: auto;
  padding: 0.35rem;
  background: var(--ppq-paper);
  border: 1px solid var(--ppq-line);
  border-radius: 9px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.16);
}
.ppq-find-result {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 6px;
  padding: 0.5rem 0.6rem;
  color: var(--ppq-ink);
  background: transparent;
  cursor: pointer;
}
.ppq-find-result:hover, .ppq-find-result:focus { background: rgba(49, 130, 206, 0.09); outline: none; }
.ppq-find-result span, .ppq-find-none { color: var(--ppq-muted); font-size: 0.76rem; }
.ppq-find-none { padding: 0.55rem; }

.ppq-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  align-items: start;
}
@media (max-width: 820px) { .ppq-layout { grid-template-columns: 1fr; } .ppq-dash { position: static; max-height: none; } }

.ppq-card {
  background: var(--ppq-paper);
  border: 1px solid var(--ppq-line);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.ppq-meta {
  font-size: 0.78rem;
  color: var(--ppq-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.ppq-feedback-status {
  border-radius: 999px;
  padding: 0.16rem 0.58rem;
  font-weight: 900;
  text-transform: none;
  letter-spacing: 0;
}
.ppq-feedback-status-full {
  color: #245c36;
  background: rgba(45, 106, 63, 0.13);
  border: 1px solid rgba(45, 106, 63, 0.38);
}
.ppq-feedback-status-provisional {
  color: #805b0b;
  background: rgba(221, 165, 35, 0.13);
  border: 1px solid rgba(177, 126, 9, 0.35);
}
.ppq-feedback-status-pending {
  color: var(--ppq-muted);
  background: rgba(140, 133, 121, 0.08);
  border: 1px solid rgba(140, 133, 121, 0.28);
}
/* VSAFE-01: withheld (damaged/suppressed analysis) looks identical to pending
   for pupils; the distinct class exists for tests and reviewer tooling. */
.ppq-feedback-status-withheld {
  color: var(--ppq-muted);
  background: rgba(140, 133, 121, 0.08);
  border: 1px solid rgba(140, 133, 121, 0.28);
}
.ppq-classification-details { text-transform: none; letter-spacing: 0; }
.ppq-classification-more { position: relative; }
.ppq-classification-more summary {
  cursor: pointer;
  color: var(--ppq-accent);
  font-weight: 800;
  list-style-position: inside;
  white-space: nowrap;
}
.ppq-classification-panel {
  position: absolute;
  z-index: 30;
  right: 0;
  top: calc(100% + 0.35rem);
  width: min(34rem, 80vw);
  padding: 0.75rem 0.85rem;
  background: var(--ppq-paper);
  border: 1px solid var(--ppq-line);
  border-radius: 9px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.15);
}
.ppq-classification-group + .ppq-classification-group { margin-top: 0.6rem; }
.ppq-classification-group b { display: block; color: var(--ppq-ink2); margin-bottom: 0.16rem; }
.ppq-classification-group span { color: var(--ppq-muted); line-height: 1.45; }
.ppq-tag {
  background: #edf2f7;
  border-radius: 6px;
  padding: 0.1rem 0.5rem;
  margin-left: 0.3rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}
/* QoderWork 2026-07-23: "Out of Spec" — big and red (Smith). */
.ppq-tag-out {
  background: rgba(176, 48, 48, 0.12);
  color: var(--ppq-bad);
  font-size: 1.05rem;
  font-weight: 900;
  padding: 0.2rem 0.7rem;
  border: 1px solid rgba(176, 48, 48, 0.4);
}
.ppq-tag-in {
  background: rgba(45, 106, 63, 0.12);
  color: var(--ppq-ok);
  border: 1px solid rgba(45, 106, 63, 0.32);
}
.ppq-question-fired { animation: ppq-question-fired 1.2s ease-out; }
@keyframes ppq-question-fired {
  0% { box-shadow: 0 0 0 0 rgba(49, 130, 206, 0.55); }
  45% { box-shadow: 0 0 0 9px rgba(49, 130, 206, 0); }
  100% { box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
}

/* QoderWork 2026-07-22: optional exam timer (config.timer). Silent time capture is
   always on; this is the visible clock. "prominence" is the in-your-face-ness axis:
   subtle = small, tucked right, muted; prominent = large, centred, boxed; hidden is
   handled inline (no clock, still records). tight/forced warn as the clock runs out. */
.ppq-timer { font-variant-numeric: tabular-nums; font-weight: 800; letter-spacing: 0.04em; }
.ppq-timer--subtle { align-self: flex-end; font-size: 0.95rem; color: var(--ppq-muted); margin-top: -0.6rem; }
.ppq-timer--prominent { align-self: center; font-size: 1.9rem; color: var(--ppq-ink); padding: 0.25rem 1rem; border: 1px solid var(--ppq-line); border-radius: 12px; background: var(--ppq-bg); margin-top: -0.4rem; }
.ppq-timer--tight { color: var(--ppq-bad); }
.ppq-timer--forced { color: var(--ppq-bad); animation: ppq-timer-pulse 1s ease-in-out infinite; }

/* d013/VF-04: the timing system row (clock / ring / bank) + reveal state.
   VF-04r: STICKY — it must not scroll away with the question — and the digits
   get a reserved width so the ring never shifts left/right as numbers change. */
.ppq-timing { position: sticky; top: 4.6rem; /* JS pins it just below the measured sticky header (VF-04r3) */ z-index: 60; align-self: flex-end; display: flex; align-items: center; gap: 0.55rem; font-size: 0.95rem; color: var(--ppq-ink2); margin-top: -0.6rem; background: var(--ppq-paper); border: 1px solid var(--ppq-line); border-radius: 999px; padding: 0.28rem 0.8rem; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07); }
.ppq-timing--preview { position: static; margin-top: 0; box-shadow: none; }
.ppq-timing-display { font-variant-numeric: tabular-nums; min-width: 4.5ch; text-align: right; }
.ppq-timing--reveal { color: var(--ppq-ink2); font-weight: 700; }
.ppq-timing--paused .ppq-timing-display { opacity: 0.6; }
.ppq-timing--over .ppq-timing-display { color: var(--ppq-bad); }
.ppq-timing-ringwrap { display: inline-flex; width: 1.5rem; height: 1.5rem; }
.ppq-timing-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ppq-timing-ring-track { fill: none; stroke: var(--ppq-line); stroke-width: 3; }
.ppq-timing-ring-fill { fill: none; stroke: var(--ppq-accent); stroke-width: 3; stroke-linecap: round; }
.ppq-timing--over .ppq-timing-ring-fill { stroke: var(--ppq-bad); }
.ppq-timing-bank { font-weight: 800; color: var(--ppq-ok); }
.ppq-timing-bank.neg { color: var(--ppq-bad); }
.ppq-timing-pause { border: 1px solid var(--ppq-line); border-radius: 6px; background: var(--ppq-bg); color: var(--ppq-ink2); font-size: 0.7rem; padding: 0.15rem 0.45rem; cursor: pointer; }
.ppq-timing-pause:hover { border-color: var(--ppq-accent); }
/* Reset this question's clock (Smith, 2026-07-31): same weight as pause, since
   it is the same kind of "the clock is wrong for reasons off the page" act. */
.ppq-timing-reset { border: 1px solid var(--ppq-line); border-radius: 6px; background: var(--ppq-bg); color: var(--ppq-ink2); font-size: 0.8rem; line-height: 1; padding: 0.15rem 0.4rem; cursor: pointer; }
.ppq-timing-reset:hover { border-color: var(--ppq-accent); color: var(--ppq-accent); }
/* d018: the stem as printed. It leads the card, so it reads as the question
   rather than as an afterthought parked by the answer buttons. */
.ppq-stem-pages { border: 1px solid var(--ppq-line); border-radius: 8px; background: var(--ppq-paper); margin: 0.5rem 0 0.75rem; padding: 0.35rem 0.6rem; }
.ppq-stem-pages > summary { cursor: pointer; font-weight: 600; color: var(--ppq-ink2); font-size: 0.85rem; padding: 0.15rem 0; }
/* One rule for every question image on the card (Smith, 2026-08-02: "massive
   size issues between them"). NOT `width: 100%`: that was the first attempt and
   it made things worse, because a clipping of one short line was stretched to
   full width and so rendered in far bigger type than a clipping containing a
   whole part plus its diagram. Smith, seeing 0.18.0: "A1 is appearing more with
   a greater size than A1 and A2 together." Crops share a source DPI, so at
   natural size their type matches; capping without upscaling is what makes them
   agree. */
.ppq-stem-pages img.ppq-stem-page,
.ppq-stem .ppq-crop { display: block; width: auto; max-width: 100%; margin: 0.5rem auto; border: 1px solid var(--ppq-line); border-radius: 6px; }
.ppq-stem-partlead { font-weight: 700; color: var(--ppq-accent); font-size: 0.85rem; margin: 0.9rem 0 0.25rem; padding-top: 0.6rem; border-top: 1px dashed var(--ppq-line); }
/* The whole-question block as a MAP (rows, no second copy of every clipping)
   when the printed pages are already on the card. */
.ppq-wq-parts.ppq-wq-map { gap: 0.35rem; }
.ppq-wq-map .ppq-wq-part { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.4rem 0.6rem; }
.ppq-wq-map .ppq-wq-part-label { margin-bottom: 0; text-transform: none; font-size: 0.85rem; color: var(--ppq-ink2); }
.ppq-wq-map .ppq-wq-part.current .ppq-wq-part-label { color: var(--ppq-accent); }
/* d020: things a pupil must know before working, or while reading a scheme. */
.ppq-notice { border-radius: 7px; padding: 0.45rem 0.7rem; margin: 0 0 0.6rem; font-size: 0.88rem; line-height: 1.5; border: 1px solid; }
.ppq-notice-info { background: #eef5fb; border-color: #c7dcef; color: #24506f; }
.ppq-notice-warn { background: #fdf4e3; border-color: #ecd9ac; color: #7a5b16; }
.ppq-notice b { font-weight: 700; }
/* The OCR transcription, demoted below the printed pages it transcribes. */
.ppq-transcript { margin-top: 1rem; border-top: 1px dashed var(--ppq-line); padding-top: 0.5rem; }
.ppq-transcript > summary { cursor: pointer; font-size: 0.78rem; color: var(--ppq-muted); }
.ppq-transcript .ppq-qtext { margin-top: 0.5rem; }
/* Historical time deletion on the progress page. */
.ppq-progress-times td.ppq-progress-stem { text-align: left; color: var(--ppq-ink2); font-size: 0.85rem; max-width: 26rem; }
.ppq-time-del { white-space: nowrap; }
.ppq-time-del-all { margin-top: 0.6rem; }
.ppq-timing-discard { border: none; background: transparent; color: var(--ppq-muted); font-size: 0.72rem; text-decoration: underline dotted; cursor: pointer; padding: 0; }
.ppq-timing-discard.on { color: var(--ppq-accent); text-decoration: none; font-weight: 700; }
/* the preferences panel */
.ppq-timing-modes { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.ppq-timing-mode { text-align: left; border: 1px solid var(--ppq-line); border-radius: 9px; background: var(--ppq-bg); padding: 0.6rem 0.9rem; cursor: pointer; font: inherit; color: var(--ppq-ink); display: flex; flex-direction: column; gap: 0.15rem; }
.ppq-timing-mode span { font-size: 0.88rem; color: var(--ppq-muted); line-height: 1.45; }
.ppq-timing-mode:hover { border-color: var(--ppq-accent); }
.ppq-timing-mode.sel { border-color: var(--ppq-accent); box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.25); }
.ppq-timing-mode.off { opacity: 0.55; cursor: default; }
.ppq-timing-extra { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.ppq-timing-extra > span { flex-basis: 100%; font-size: 0.88rem; color: var(--ppq-muted); }
.ppq-timing-extra-input { width: 5rem; padding: 0.4rem 0.5rem; border: 1px solid var(--ppq-line); border-radius: 8px; background: var(--ppq-bg); color: var(--ppq-ink); font: inherit; }
.ppq-timing-session { margin-bottom: 1.1rem; display: flex; flex-direction: column; gap: 0.2rem; }
.ppq-timing-session span { color: var(--ppq-ink2); }
/* VF-04r: segmented axis controls + the live preview */
.ppq-timing-seg-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.55rem; }
.ppq-timing-seg-label { min-width: 10.5rem; font-weight: 700; font-size: 0.92rem; }
.ppq-timing-seg { display: inline-flex; border: 1px solid var(--ppq-line); border-radius: 9px; overflow: hidden; }
.ppq-timing-seg.off { opacity: 0.5; }
.ppq-timing-seg-btn { border: none; background: var(--ppq-bg); color: var(--ppq-ink2); font: inherit; font-size: 0.88rem; padding: 0.4rem 0.8rem; cursor: pointer; border-right: 1px solid var(--ppq-line); }
.ppq-timing-seg-btn:last-child { border-right: none; }
.ppq-timing-seg-btn.sel { background: var(--ppq-accent); color: #fff; font-weight: 700; }
.ppq-timing-preview { border: 1px dashed var(--ppq-line); border-radius: 9px; padding: 0.7rem 0.9rem; margin: 0.8rem 0 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.ppq-timing-preview-row { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.ppq-timing-preview-label { min-width: 10.5rem; font-size: 0.85rem; color: var(--ppq-muted); }
.ppq-timing-preview-note { font-size: 0.85rem; color: var(--ppq-muted); font-style: italic; }
@keyframes ppq-timer-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.ppq-draw-container { position: relative; display: block; max-width: var(--ppq-crop-width, 92%); margin: 0 auto; }
.ppq-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; cursor: crosshair; z-index: 10; touch-action: none; }
.ppq-stem { display: flex; flex-direction: column; gap: 0.75rem; }
.ppq-crop { max-width: 100%; border-radius: 8px; cursor: zoom-in; }

.ppq-draw-controls { display: none; gap: 0.5rem; align-items: center; background: #f8fafc; padding: 0.5rem; border-radius: 8px; border: 1px solid var(--ppq-line); }
.ppq-draw-controls.on { display: flex; }
.ppq-color { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; display: inline-block; }
.ppq-color.active { border-color: #000; }
.ppq-color[data-color="black"] { background: #000; }
.ppq-color[data-color="red"] { background: red; }
.ppq-color[data-color="blue"] { background: blue; }
.ppq-color[data-color="green"] { background: green; }

.ppq-options { display: flex; flex-direction: column; gap: 0.6rem; }
.ppq-option {
  background: #fdfdfd;
  border: 1px solid var(--ppq-line);
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.ppq-option:hover { background: #f0f4f8; }
.ppq-option.correct { background: #e6fffa; border-color: #48bb78; }
.ppq-option.incorrect { background: #fff5f5; border-color: #e53e3e; }
.ppq-option.chosen { outline: 2px solid var(--ppq-accent); }

.ppq-answer-line { display: none; font-weight: 700; }
.ppq-answer-line.show { display: block; }

.ppq-controls { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.ppq-btn {
  border: 1px solid var(--ppq-line);
  background: var(--ppq-paper);
  color: var(--ppq-ink);
  padding: 0.7rem 1.15rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
}
.ppq-btn:hover { background: #f1f5f9; }
.ppq-primary { background: var(--ppq-accent); color: #fff; border-color: var(--ppq-accent); }
.ppq-btn-mini {
  border: 1px solid var(--ppq-line);
  background: var(--ppq-paper);
  color: var(--ppq-accent);
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}

.ppq-competence { display: none; flex-direction: column; gap: 0.75rem; border-top: 1px solid var(--ppq-line); padding-top: 1rem; }
.ppq-competence.show { display: flex; }
.ppq-competence-prompt { font-weight: 700; text-align: center; }
.ppq-scale { display: flex; gap: 0.5rem; }
.ppq-scale-btn { flex: 1; background: #fff; border: 1px solid var(--ppq-line); color: var(--ppq-ink); padding: 0.9rem 0; border-radius: 8px; font-weight: 700; font-size: 1.15rem; cursor: pointer; }
.ppq-scale-btn.sel { background: var(--ppq-accent); color: #fff; border-color: var(--ppq-accent); }

.ppq-kb-hint { text-align: center; font-size: 0.78rem; color: var(--ppq-muted); }
.ppq-empty { text-align: center; margin-top: 3rem; color: var(--ppq-muted); }

/* dashboard */
.ppq-dash { background: var(--ppq-paper); border: 1px solid var(--ppq-line); border-radius: 12px; padding: 1rem; max-height: calc(100vh - 120px); overflow-y: auto; position: sticky; top: 1rem; }
.ppq-dash h3 { margin: 0 0 0.5rem; font-size: 1.05rem; border-bottom: 1px solid var(--ppq-line); padding-bottom: 0.5rem; color: var(--ppq-ink2); }
.ppq-dash-sub { font-size: 0.78rem; color: var(--ppq-muted); margin-bottom: 0.75rem; }
.ppq-cat { margin-bottom: 1rem; cursor: pointer; padding: 0.3rem; border-radius: 6px; }
.ppq-cat:hover { background: rgba(49,130,206,0.05); }
.ppq-cat-name { font-size: 0.8rem; font-weight: 700; line-height: 1.3; margin-bottom: 0.35rem; }
.ppq-cat-count { color: var(--ppq-muted); font-weight: 600; }
.ppq-ribbon { display: flex; gap: 2px; flex-wrap: wrap; margin-bottom: 0.35rem; font-size: 0.8rem; }
.ppq-tick { color: var(--ppq-ok); font-weight: 700; }
.ppq-cross { color: #e53e3e; font-weight: 700; }
.ppq-noattempt { color: var(--ppq-muted); font-size: 0.72rem; }
.ppq-heatrow { display: flex; gap: 2px; }
.ppq-heat { width: 14px; height: 14px; border-radius: 2px; background: var(--ppq-line); }
.ppq-dash-path { display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.55rem; font-size: 0.78rem; color: var(--ppq-muted); }
.ppq-dash-path strong { color: var(--ppq-ink2); }
.ppq-dash-back, .ppq-facet-clear { border: 0; padding: 0; background: transparent; color: var(--ppq-accent); font: inherit; font-weight: 700; cursor: pointer; text-align: left; }
.ppq-dash-back:hover, .ppq-facet-clear:hover { text-decoration: underline; }
.ppq-dash-back:focus-visible, .ppq-facet-clear:focus-visible, .ppq-facet-cat:focus-visible { outline: 2px solid var(--ppq-accent); outline-offset: 2px; }
.ppq-dash-overlap-note { margin-bottom: 0.7rem; padding: 0.55rem 0.65rem; border-radius: 7px; background: rgba(49,130,206,0.07); color: var(--ppq-muted); font-size: 0.75rem; line-height: 1.35; }
.ppq-facet-clear { display: block; margin: 0 0 0.7rem; font-size: 0.76rem; }
button.ppq-facet-cat { display: block; width: 100%; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; }
button.ppq-facet-cat:hover { background: rgba(49,130,206,0.05); }
button.ppq-facet-cat:disabled { opacity: 0.45; cursor: default; }
button.ppq-facet-cat:disabled:hover { background: transparent; }
.ppq-facet-empty { padding: 0.65rem 0; color: var(--ppq-muted); font-size: 0.78rem; }
.ppq-filter-nav-group { margin: 1rem 0; padding: .7rem .65rem .1rem; border: 1px solid var(--ppq-line); border-radius: 8px; }
.ppq-filter-nav-heading { margin: 0 0 .65rem; color: var(--ppq-ink2); font-size: .9rem; line-height: 1.4; overflow-wrap: anywhere; }
.ppq-filter-nav-subgroup { margin: .65rem 0; padding-left: .6rem; border-left: 2px solid var(--ppq-line); }
.ppq-filter-nav-subheading { margin: 0 0 .5rem; color: var(--ppq-muted); font-size: .8rem; line-height: 1.4; overflow-wrap: anywhere; }

/* floating toolbar */
.ppq-toolbar { position: fixed; bottom: 1.5rem; right: 1.5rem; display: flex; gap: 0.75rem; background: #fff; padding: 0.6rem; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.15); border: 1px solid var(--ppq-line); z-index: 50; }
.ppq-question-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.ppq-question-column > .ppq-centre { flex: 1 1 auto; min-height: 0; }
.ppq-toolbar.ppq-question-tools { position: static; flex: 0 0 auto; align-self: stretch; justify-content: flex-end; gap: .5rem; padding: .35rem .55rem; border-radius: 0 0 10px 10px; box-shadow: 0 -2px 6px rgba(0,0,0,.035); z-index: 2; }
.ppq-question-tools .ppq-btn-mini { min-height: 40px; padding: .35rem .6rem; }
/* Smith 2026-09-22, on the strip: "taking up way too much space at the bottom". Three
   equal thirds squeezed the report block into the middle third, so six short labels
   wrapped to three lines each and the strip grew tall. The two single tools now take
   their natural width and the report block takes everything between them. */
.ppq-compact-question-header .ppq-toolbar.ppq-question-tools { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: .75rem; }
.ppq-compact-question-header .ppq-question-tools > .ppq-teacher-help { grid-column: 1; justify-self: start; }
.ppq-compact-question-header .ppq-question-tools > .ppq-problem-report { grid-column: 2; justify-self: center; }
.ppq-compact-question-header .ppq-question-tools > .ppq-draw-toggle { grid-column: 3; justify-self: end; }
.ppq-compact-question-header .ppq-question-tools > button { grid-row: 1; max-width: 100%; white-space: normal; line-height: 1.3; }
/* d031: the report block is a box of small boxes, deliberately unlike the two single
   tools flanking it. Ask your teacher sends a message and Draw is a pencil; neither is
   a report, and all three looking alike is what made the strip unreadable. The lead
   line sits to the LEFT of the grid because height here is scarce and width is not. */
.ppq-compact-question-header .ppq-question-tools > .ppq-report-block { grid-column: 2; grid-row: 1; justify-self: stretch; }
.ppq-report-block { display: flex; align-items: center; gap: .5rem; padding: .3rem .45rem; border: 1px dashed var(--ppq-line); border-radius: 10px; background: rgba(49, 130, 206, 0.04); }
.ppq-report-lead { margin: 0; flex: 0 0 auto; max-width: 8rem; font-size: .64rem; line-height: 1.25; color: var(--ppq-muted); text-align: right; }
/* One row of six short boxes, wrapping only when the screen is too narrow for them. */
.ppq-report-groups { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; min-width: 0; }
.ppq-report-group { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; min-width: 0; }
.ppq-report-group + .ppq-report-group { padding-left: .6rem; border-left: 1px solid var(--ppq-line); }
.ppq-report-group-name { font-size: .58rem; letter-spacing: .02em; color: var(--ppq-muted); }
.ppq-report-grid { display: flex; flex-wrap: wrap; gap: .25rem; }
.ppq-report-reason { font: inherit; font-size: .66rem; line-height: 1.2; font-weight: 600; padding: .3rem .5rem; border: 1px solid var(--ppq-line); border-radius: 6px; background: var(--ppq-paper); color: var(--ppq-ink2); cursor: pointer; text-align: left; white-space: nowrap; }
.ppq-report-reason:hover { border-color: var(--ppq-accent); color: var(--ppq-accent); }
.ppq-report-reason:focus-visible { outline: 2px solid var(--ppq-accent); outline-offset: 1px; }
.ppq-problem-thanks { margin: .2rem 0 .4rem; font-weight: 600; }
.ppq-problem-hint { margin: 0 0 .5rem; color: var(--ppq-ink2); }
.ppq-problem-view { margin: 0 0 .4rem; font-size: .85rem; color: var(--ppq-muted); }
.ppq-progress-tools { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--ppq-line); font-size: .9rem; }
.ppq-progress-tools > summary { cursor: pointer; font-weight: 600; padding: .4rem 0; }
.ppq-progress-tools .ppq-reset { color: #854123; }
.ppq-facet-guidance { margin: .7rem 0 1.2rem; padding: .85rem; border: 1px solid #d5b78a; border-left: 4px solid #b4874c; border-radius: 8px; background: #faf2e5; color: #443828; line-height: 1.55; scroll-margin-top: 1rem; }
.ppq-facet-guidance > summary { font-weight: 750; font-size: 1rem; cursor: pointer; line-height: 1.4; }
.ppq-facet-guidance > summary:focus-visible { outline: 2px solid var(--ppq-accent); outline-offset: 4px; }
.ppq-facet-guidance p { margin: .8rem 0; font-size: .92rem; }
.ppq-facet-guidance ul { margin: .7rem 0 0; padding-left: 1.2rem; list-style: disc; }
.ppq-facet-guidance li { margin: .65rem 0; padding-left: .15rem; font-size: .92rem; }
.ppq-problem-form { display: grid; gap: 1rem; max-width: 680px; margin: auto; }
.ppq-problem-form label { display: grid; gap: .4rem; font-weight: 600; }
.ppq-problem-source { font-size: .9rem; line-height: 1.5; padding: .7rem; border-radius: 6px; background: #eaf3f8; overflow-wrap: anywhere; }
.ppq-problem-type, .ppq-problem-message { width: 100%; box-sizing: border-box; padding: .65rem; border: 1px solid var(--ppq-line); border-radius: 7px; font: inherit; color: var(--ppq-ink); background: var(--ppq-paper); }
.ppq-problem-message { min-height: 150px; resize: vertical; }
.ppq-problem-status { line-height: 1.5; font-size: .95rem; }
.ppq-problem-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .6rem; }
.ppq-problem-error { color: #923c25; font-weight: 600; }
.ppq-problem-note { margin: 0; font-size: .9rem; line-height: 1.5; }
.ppq-question-tools { flex-wrap: wrap; }
.ppq-teacher-help { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; white-space: normal; }
.ppq-help-unread { display: inline-flex; align-items: center; justify-content: center; min-width: 1.4em; min-height: 1.4em; padding: .08rem .3rem; border-radius: 999px; background: var(--ppq-accent); color: #fff; font-size: .75rem; font-weight: 750; line-height: 1.2; }
.ppq-help-unread[hidden], .ppq-help-unread:empty { display: none; }
.ppq-help-panel { display: grid; gap: 1rem; width: 100%; max-width: 760px; min-width: 0; margin: auto; box-sizing: border-box; }
.ppq-help-source { margin: 0; padding: .7rem; border-radius: 6px; background: #eaf3f8; font-size: .9rem; line-height: 1.5; overflow-wrap: anywhere; }
.ppq-help-note { margin: 0; font-size: .9rem; color: var(--ppq-muted); line-height: 1.5; }
.ppq-help-form { display: grid; gap: .9rem; min-width: 0; margin: 0; }
.ppq-help-field { display: grid; gap: .4rem; font-weight: 600; line-height: 1.4; }
.ppq-help-message { width: 100%; min-height: 110px; box-sizing: border-box; resize: vertical; padding: .65rem; border: 1px solid var(--ppq-line); border-radius: 7px; font: inherit; color: var(--ppq-ink); background: var(--ppq-paper); }
.ppq-help-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: .6rem; }
.ppq-help-send, .ppq-help-read { min-height: 44px; white-space: normal; overflow-wrap: anywhere; }
.ppq-help-status { margin: 0; font-size: .95rem; line-height: 1.5; overflow-wrap: anywhere; }
.ppq-help-status:empty { display: none; }
.ppq-help-error { color: #923c25; font-weight: 600; }
.ppq-help-history { display: grid; gap: .8rem; min-width: 0; }
.ppq-help-reply { padding: .85rem; border: 1px solid #c5d8df; border-left: 4px solid var(--ppq-accent); border-radius: 8px; background: #f4f8fa; overflow-wrap: anywhere; }
.ppq-help-reply h4 { margin: 0 0 .4rem; font-size: .95rem; line-height: 1.5; white-space: pre-wrap; }
.ppq-help-reply p { margin: .6rem 0 0; font-size: .95rem; line-height: 1.6; white-space: pre-wrap; }
.ppq-help-date { display: block; margin: .3rem 0; color: var(--ppq-muted); font-size: .8rem; line-height: 1.4; }
.ppq-help-empty { margin: 0; color: var(--ppq-muted); font-size: .9rem; line-height: 1.5; }
.ppq-help-inbox { min-width: 0; padding: .8rem; border: 1px solid var(--ppq-line); border-radius: 8px; }
.ppq-help-inbox > summary { cursor: pointer; font-weight: 650; line-height: 1.5; }
.ppq-help-inbox-item { display: grid; gap: .45rem; min-width: 0; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--ppq-line); overflow-wrap: anywhere; }
.ppq-help-read { justify-self: start; max-width: 100%; text-align: left; }
.ppq-help-message:focus-visible, .ppq-help-inbox > summary:focus-visible { outline: 2px solid var(--ppq-accent); outline-offset: 3px; }
@media (max-width: 520px) {
  .ppq-question-tools .ppq-teacher-help { flex: 0 1 auto; max-width: 100%; }
  .ppq-help-panel { gap: .8rem; }
  .ppq-help-actions > button { flex: 1 1 auto; }
  .ppq-help-reply, .ppq-help-inbox { padding: .7rem; }
}
.ppq-draw-toggle.active { background: #e2e8f0; }

/* modal */
.ppq-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: none; justify-content: center; align-items: center; z-index: 1000; padding: 2rem; }
.ppq-modal.show { display: flex; }
.ppq-modal-content { background: var(--ppq-paper); padding: 0; border-radius: 12px; width: 90vw; max-width: 1200px; max-height: 95vh; overflow: auto; position: relative; display: flex; flex-direction: column; }
/* QoderWork 2026-07-24 (handoff #1): sticky top bar with the minimise-bar reminder
   and the minimise/close buttons, so they stay reachable while the analysis scrolls. */
.ppq-modal-topbar { position: sticky; top: 0; z-index: 5; flex: none; display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; background: var(--ppq-paper); border-bottom: 1px solid var(--ppq-line); }
.ppq-modal-reminder { flex: 1; min-width: 0; font-size: 0.85rem; font-weight: 600; color: var(--ppq-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ppq-modal-feedback-status {
  flex: none;
  padding: 0.12rem 0.45rem;
  font-size: 0.7rem;
  line-height: 1.15;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.ppq-modal-min, .ppq-modal-close { flex: none; font-size: 1.05rem; font-weight: 700; cursor: pointer; background: #fff; border: 1px solid var(--ppq-line); border-radius: 50%; width: 30px; height: 30px; text-align: center; line-height: 1; box-shadow: 0 1px 3px rgba(0,0,0,0.15); padding: 0; }
.ppq-modal-min { color: var(--ppq-accent); }
.ppq-modal-min:hover, .ppq-modal-close:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.25); }
.ppq-modal-close { color: #b03030; }
.ppq-modal-body { padding: 1rem; }
/* QoderWork 2026-07-24 (handoff #1): minimised — the overlay goes transparent and
   click-through so the question shows behind; the content collapses to a slim bar
   pinned to the bottom (body hidden, top bar only). */
.ppq-modal.minimized { background: transparent; pointer-events: none; align-items: flex-end; justify-content: center; padding: 0 1rem 1rem 1rem; }
.ppq-modal.minimized .ppq-modal-content { pointer-events: auto; width: auto; max-width: 92vw; max-height: none; overflow: hidden; border: 1px solid var(--ppq-line); box-shadow: 0 4px 18px rgba(0,0,0,0.25); }
.ppq-modal.minimized .ppq-modal-topbar { position: static; border-bottom: none; padding: 0.4rem 0.8rem; }
.ppq-modal.minimized .ppq-modal-body { display: none; }
.ppq-modal-img { max-width: 100%; display: block; }
.ppq-modal-pdf { width: 100%; height: 80vh; border: none; }

/* Analysis stays beside the live question on a wide screen. The existing
   full-screen/minimise behaviour remains the mobile fallback and still applies
   to image/PDF zoom. */
@media (min-width: 1100px) {
  /* VF-13 (Smith 2026-07-29): "loads more real estate" — the analysis sheet
     takes most of the screen; the question column shrinks but stays visible
     (crop scales to its narrower column) so question + your answer + your
     declared split are all on screen at the same time. */
  .ppq.ppq-analysis-open .ppq-header,
  .ppq.ppq-analysis-open .ppq-layout {
    margin-right: min(1080px, 72vw);
  }
  .ppq.ppq-analysis-open .ppq-layout { grid-template-columns: 1fr; }
  .ppq.ppq-analysis-open { --ppq-crop-width: 97%; }
  .ppq.ppq-analysis-open .ppq-dash { display: none; }
  .ppq-modal.ppq-modal-analysis:not(.minimized) {
    background: transparent;
    justify-content: flex-end;
    align-items: stretch;
    padding: 0;
    pointer-events: none;
  }
  .ppq-modal.ppq-modal-analysis:not(.minimized) .ppq-modal-content {
    width: min(1080px, 72vw);
    max-width: 1080px;
    max-height: 100vh;
    height: 100vh;
    border-radius: 12px 0 0 12px;
    border-left: 1px solid var(--ppq-line);
    box-shadow: -8px 0 28px rgba(0,0,0,0.16);
    pointer-events: auto;
  }
  .ppq-modal.ppq-modal-analysis:not(.minimized) .ppq-iq { max-width: 940px; }
}

/* When embedded (host sets .ppq-embed on the root) drop the fixed toolbar into flow. */
.ppq-embed .ppq-toolbar { position: static; box-shadow: none; margin: 1rem 1.5rem; }

/* ---- v0.2 question types + modules ---- */
.ppq-qtext { font-size: 1.1rem; line-height: 1.6; }
.ppq-option-mcq { font-weight: 500; display: flex; align-items: center; gap: 0.75rem; }
.ppq-key { background: #edf2f7; border-radius: 6px; padding: 0.15rem 0.55rem; font-weight: 800; }

/* answer panel (flashcard markscheme + examiner) */
.ppq-answer-panel { display: none; flex-direction: column; gap: 0.85rem; padding: 1.1rem; background: #f7fafc; border-radius: 12px; border-left: 4px solid #48bb78; }
.ppq-answer-panel.show { display: flex; }
.ppq-ms-header { display: none; }
.ppq-answer-panel.show .ppq-ms-header { display: block; }
.ppq-markscheme { font-size: 0.98rem; line-height: 1.5; }
.ppq-ms-full { margin-top: 0.75rem; padding: 0.5rem; border: 1px solid var(--ppq-line); border-radius: 8px; }
.ppq-ms-full > summary { cursor: pointer; font-weight: 700; }
.ppq-ms-full img { max-width: 100%; margin-top: 0.75rem; border-radius: 8px; }
/* VF-15: complete markscheme pages — full-width, clearly page-like */
.ppq-ms-page { display: block; width: 100%; margin: 0.6rem 0; border: 1px solid var(--ppq-line); border-radius: 6px; background: #fff; }
.ppq-spoiler { color: #dc2626; font-weight: 400; }
.ppq-examiner { display: none; background: #fffaf0; border-left: 4px solid #dd6b20; padding: 0.75rem; border-radius: 0 8px 8px 0; font-size: 0.9rem; }
.ppq-answer-panel.has-examiner .ppq-examiner { display: block; }
.ppq-examiner-title { color: #dd6b20; font-weight: 800; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.35rem; }

/* structured paper: nav, chips, mode toggle, whole-question, original pages */
.ppq-struct { display: flex; flex-direction: column; gap: 0.75rem; }
.ppq-wq-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; padding: 0.5rem 0.6rem; background: #f1f5f9; border: 1px solid var(--ppq-line); border-radius: 8px; }
.ppq-wq-jump { font-size: 0.8rem; font-weight: 700; color: var(--ppq-ink2); margin-right: 0.2rem; }
.ppq-part-chip { background: var(--ppq-paper); border: 1px solid var(--ppq-line); color: var(--ppq-accent); padding: 0.2rem 0.55rem; border-radius: 6px; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.ppq-part-chip.current { background: var(--ppq-accent); color: #fff; border-color: var(--ppq-accent); cursor: default; }
/* d016: marks live on the chip so a pupil can see what each part is worth before choosing it. */
.ppq-part-chip-marks { display: inline-block; margin-left: 0.3rem; padding: 0 0.28rem; border-radius: 4px; background: rgba(0,0,0,0.08); font-size: 0.72rem; font-weight: 600; }
.ppq-part-chip.current .ppq-part-chip-marks { background: rgba(255,255,255,0.28); }
.ppq-mode-toggle { margin-left: auto; display: inline-flex; gap: 0.25rem; }
.ppq-mode-btn { border: 1px solid var(--ppq-line); background: var(--ppq-paper); color: var(--ppq-ink2); padding: 0.2rem 0.55rem; border-radius: 6px; font-size: 0.78rem; font-weight: 700; cursor: pointer; }
.ppq-mode-btn.on { background: var(--ppq-accent); color: #fff; border-color: var(--ppq-accent); }
.ppq-whole { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 0.5rem 0.6rem; }
.ppq-whole > summary { cursor: pointer; font-weight: 700; color: #d97706; }
.ppq-wq-parts { display: flex; flex-direction: column; gap: 1rem; margin-top: 0.75rem; }
.ppq-wq-part { border: 1px solid var(--ppq-line); border-radius: 8px; padding: 0.5rem; background: var(--ppq-paper); }
.ppq-wq-part.current { border-color: var(--ppq-accent); box-shadow: 0 0 0 2px rgba(49,130,206,0.25); }
.ppq-wq-part-label { font-size: 0.75rem; font-weight: 700; color: var(--ppq-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.35rem; }
.ppq-wq-part.current .ppq-wq-part-label { color: var(--ppq-accent); }
.ppq-wq-part img { max-width: var(--ppq-crop-width, 92%); display: block; margin: 0 auto; border-radius: 6px; }
.ppq-orig-pages { border: 1px solid var(--ppq-line); border-radius: 8px; padding: 0.5rem 0.6rem; }
.ppq-orig-pages > summary { cursor: pointer; font-weight: 600; color: var(--ppq-ink2); }
.ppq-op-pages { display: flex; flex-direction: column; gap: 1rem; margin-top: 0.75rem; }
.ppq-op-pages img { max-width: var(--ppq-crop-width, 92%); display: block; margin: 0 auto; border: 1px solid var(--ppq-line); border-radius: 8px; }
.ppq-booklet { margin-top: 0.5rem; background: #e0e7ff; color: #4338ca; border-color: #c7d2fe; }

/* split dashboard (chemistry) */
.ppq-dash-content.split { display: flex; flex-direction: column; gap: 1.25rem; }
.ppq-dash-col h4 { margin: 0 0 0.6rem; font-size: 0.92rem; color: var(--ppq-ink2); border-bottom: 1px solid var(--ppq-line); padding-bottom: 0.3rem; }
.ppq-lhs-row { display: flex; gap: 3px; flex-wrap: wrap; }
.ppq-lhs-box { width: 14px; height: 14px; border-radius: 2px; background: var(--ppq-line); }

/* QoderWork 2026-07-22: split dashboard = three columns (left mastery, centre
   question, right mastery), matching the original Chemistry viewer. The flanking
   panels inherit position:sticky from .ppq-dash, so scrolling the paper keeps the
   mastery in view while each panel still scrolls its own content independently. */
.ppq-layout-split { grid-template-columns: 280px minmax(0, 1fr) 280px; }
.ppq-layout-split .ppq-centre { min-width: 0; }
.ppq-dash-split-panel { align-self: start; }
@media (max-width: 980px) {
  .ppq-layout-split { grid-template-columns: 1fr; }
  /* Keep the question ahead of long mastery panels when columns stack. */
  .ppq-layout-split > .ppq-question-column,
  .ppq-layout-split > .ppq-centre { grid-row: 1; }
  .ppq-layout-split .ppq-dash-split-panel { position: static; max-height: none; }
}

/* QoderWork 2026-07-22: legend explaining what each point on the 1-6 scale means */
.ppq-scale-legend { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.74rem; color: var(--ppq-muted); line-height: 1.4; }
.ppq-scale-legend-item b { color: var(--ppq-ink2); font-weight: 800; margin-right: 0.25rem; }

/* QoderWork 2026-07-22: post-question interrogation (HALF-WORKING first pass).
   Sits between the markscheme and the 1-6 self-rating. Optional and non-blocking. */
.ppq-interrogation { display: none; margin-top: 1.25rem; padding: 1rem 1.1rem; background: var(--ppq-paper); border: 1px solid var(--ppq-line); border-left: 4px solid var(--ppq-accent); border-radius: 10px; }
.ppq-iq-title { font-weight: 800; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ppq-accent); margin-bottom: 0.6rem; }
.ppq-iq-subhead { font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ppq-ink2); margin: 0.9rem 0 0.45rem; }
.ppq-iq-probe { margin-bottom: 0.9rem; }
.ppq-iq-probe-text { font-size: 1rem; line-height: 1.6; color: var(--ppq-ink); }
.ppq-iq-chips { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.5rem; }
.ppq-iq-chip { font-size: 0.72rem; background: rgba(49, 130, 206, 0.08); border: 1px solid rgba(49, 130, 206, 0.25); color: var(--ppq-accent); border-radius: 5px; padding: 2px 7px; font-family: monospace; }
.ppq-iq-option { border: 1px solid var(--ppq-line); border-radius: 8px; padding: 0.8rem 1rem; margin-bottom: 0.9rem; }
/* QoderWork 2026-07-22 (v0.2.5): verdict styling restored — Smith corrected the
   v0.2.4 misread; pupils ARE told right/wrong, the verdict just leads the pop-up. */
.ppq-iq-option.wrong { border-left: 3px solid var(--ppq-bad); }
.ppq-iq-option.right { border-left: 3px solid var(--ppq-ok); }
.ppq-iq-option-head { font-weight: 700; font-size: 1rem; margin-bottom: 0.35rem; }
.ppq-iq-option.wrong .ppq-iq-option-head { color: var(--ppq-bad); }
.ppq-iq-option.right .ppq-iq-option-head { color: var(--ppq-ok); }
.ppq-iq-option-path { font-size: 0.95rem; line-height: 1.6; color: var(--ppq-ink2); }
.ppq-iq-slugs { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.5rem; }
.ppq-iq-slug { font-size: 0.7rem; background: rgba(176, 48, 48, 0.07); border: 1px solid rgba(176, 48, 48, 0.25); color: var(--ppq-bad); border-radius: 5px; padding: 1px 6px; font-family: monospace; }
.ppq-iq-method { border: 1px solid var(--ppq-line); border-radius: 8px; padding: 0.85rem 1rem; margin-bottom: 1rem; }
.ppq-iq-method-head { display: flex; gap: 0.5rem; align-items: baseline; flex-wrap: wrap; margin-bottom: 0.4rem; font-size: 1rem; }
/* Phase 1.5 (Smith 2026-07-28): a method with an attached authored prompt forms
   one continuous card with it — square off the join and hand the bottom edge
   to the prompt continuation. */
.ppq-iq-method-joined { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom: none; margin-bottom: 0; padding-bottom: 0.7rem; }
/* Phase 1.5: the foot-of-method ask — read the steps, answer right there. */
.ppq-iq-method-ask { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; margin-top: 0.75rem; padding-top: 0.65rem; border-top: 1px dashed var(--ppq-line); }
.ppq-iq-method-ask-text { font-weight: 700; font-size: 0.95rem; color: var(--ppq-ink); }
.ppq-iq-method-ask .ppq-iq-used { margin-left: 0; font-size: 0.88rem; padding: 0.4rem 0.95rem; border-radius: 999px; }
.ppq-iq-method-ask .ppq-iq-used::before, .ppq-iq-method-ask .ppq-iq-used.on::before { content: ""; }
.ppq-iq-method-ask .ppq-iq-used.no.on { background: var(--ppq-ink2); border-color: var(--ppq-ink2); }
.ppq-iq-kind { font-size: 0.72rem; font-family: monospace; background: var(--ppq-line); border-radius: 5px; padding: 1px 6px; color: var(--ppq-ink2); }
/* QoderWork 2026-07-22: method descriptions set out on MULTIPLE LINES — the
   one-line algebra was "quite hard to read" (Smith). "⇒ …" lines are results. */
.ppq-iq-method-desc { font-size: 0.98rem; line-height: 1.62; color: var(--ppq-ink2); }
.ppq-iq-method-line { display: block; padding: 0.24rem 0 0.24rem 1rem; position: relative; }
.ppq-iq-method-line::before { content: "·"; position: absolute; left: 0.25rem; color: var(--ppq-muted); }
.ppq-iq-method-line.result { color: var(--ppq-ink); font-weight: 600; }
.ppq-iq-method-line.result::before { content: ""; }
/* a little encouragement that there are other ways through (Smith) */
.ppq-iq-encourage { font-size: 0.8rem; font-style: italic; color: var(--ppq-muted); margin: -0.2rem 0 0.5rem; }
/* "used it" tickbox — one per method, multi-select (replaces the 6-state ladder
   and the one green "Use this" button) */
.ppq-iq-used { margin-left: auto; font-size: 0.78rem; padding: 0.28rem 0.7rem; border: 1px solid var(--ppq-line); border-radius: 7px; background: var(--ppq-bg); color: var(--ppq-ink2); cursor: pointer; }
.ppq-iq-used::before { content: "☐ "; }
.ppq-iq-used:hover { border-color: var(--ppq-accent); }
.ppq-iq-used.on { background: var(--ppq-accent); border-color: var(--ppq-accent); color: #fff; font-weight: 700; }
.ppq-iq-used.on::before { content: "☑ "; }
/* QoderWork 2026-07-22: the 1-6 self-rating, INSIDE the pop-up */
.ppq-iq-rate { margin-top: 1rem; padding-top: 0.9rem; border-top: 1px dashed var(--ppq-line); }
.ppq-iq-rate-prompt { font-weight: 700; text-align: center; margin-bottom: 0.6rem; }
.ppq-iq-scale { margin-bottom: 0.5rem; }
.ppq-iq-next { display: block; margin: 0.8rem auto 0; }
.ppq-iq-feedback { margin-top: 0.9rem; scroll-margin-block: 5rem; }
.ppq-iq-feedback-text { font-size: 1rem; line-height: 1.62; background: rgba(45, 106, 63, 0.07); border: 1px solid rgba(45, 106, 63, 0.3); border-radius: 8px; padding: 0.85rem 1rem; color: var(--ppq-ink); }
.ppq-iq-guesspage-leaving { opacity: 0.35; transform: translateY(-3px); transition: opacity 180ms ease, transform 180ms ease; pointer-events: none; }
.ppq-iq-rest-fired { animation: ppq-iq-rest-fired 360ms ease-out both; }
.ppq-iq-feedback-fired .ppq-iq-feedback-text { animation: ppq-iq-feedback-fired 900ms ease-out; }
.ppq-iq-response-fired {
  animation: ppq-iq-response-fired 700ms ease-out;
  outline: 2px solid rgba(49, 130, 206, 0.38);
  outline-offset: 4px;
  border-radius: 7px;
}
.ppq-iq-response-cue { display: inline-block; margin: 0.45rem 0 0 0.45rem; padding: 0.16rem 0.52rem; border-radius: 999px; background: rgba(45, 106, 63, 0.12); color: var(--ppq-ok); font-size: 0.76rem; font-weight: 800; }
@keyframes ppq-iq-rest-fired {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes ppq-iq-feedback-fired {
  0% { box-shadow: 0 0 0 0 rgba(45, 106, 63, 0.35); background: rgba(45, 106, 63, 0.15); }
  55% { box-shadow: 0 0 0 7px rgba(45, 106, 63, 0); }
  100% { box-shadow: none; background: rgba(45, 106, 63, 0.07); }
}
@keyframes ppq-iq-response-fired {
  0% { background: rgba(49, 130, 206, 0); }
  40% { background: rgba(49, 130, 206, 0.08); }
  100% { background: rgba(49, 130, 206, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .ppq-iq-guesspage-leaving { transition: none; }
  .ppq-iq-rest-fired,
  .ppq-iq-feedback-fired .ppq-iq-feedback-text,
  .ppq-iq-response-fired { animation: none; }
}

.ppq-cat-fired {
  outline: 3px solid rgba(45, 106, 63, 0.55);
  outline-offset: 2px;
  background: rgba(45, 106, 63, 0.12) !important;
  animation: ppq-cat-fired 1.2s ease-out;
}
@keyframes ppq-cat-fired {
  0% { box-shadow: 0 0 0 0 rgba(45, 106, 63, 0.55); }
  55% { box-shadow: 0 0 0 9px rgba(45, 106, 63, 0); }
  100% { box-shadow: none; }
}

/* One conditional question for the option actually selected. When only the
   generic any_wrong row matches, the picked letter's own high or plausible
   error_path follows the solution, as a reading for the pupil to confirm. */
.ppq-iq-selected-diagnostic:empty { display: none; }
.ppq-iq-diagnostic-card { border: 1px solid rgba(49, 130, 206, 0.28); border-left: 3px solid var(--ppq-accent); border-radius: 8px; padding: 0.75rem 0.9rem; margin: 0 0 0.75rem; background: rgba(49, 130, 206, 0.045); }
.ppq-iq-diagnostic-kicker { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ppq-accent); margin-bottom: 0.25rem; }
.ppq-iq-diagnostic-text { font-size: 1rem; line-height: 1.6; color: var(--ppq-ink); }
.ppq-iq-diagnostic-path { margin-top: 0.55rem; padding-top: 0.55rem; border-top: 1px dashed rgba(49, 130, 206, 0.3); }
.ppq-iq-diagnostic-question { font-size: 0.95rem; font-weight: 700; color: var(--ppq-ink2); margin: 0.75rem 0 0.5rem; }
.ppq-iq-diagnostic-controls { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.ppq-iq-diagnostic-choice { font-size: 0.88rem; padding: 0.42rem 0.85rem; border: 1px solid var(--ppq-line); border-radius: 999px; background: var(--ppq-bg); color: var(--ppq-ink2); cursor: pointer; }
.ppq-iq-diagnostic-choice:hover { border-color: var(--ppq-accent); color: var(--ppq-accent); }
.ppq-iq-diagnostic-choice.sel { background: var(--ppq-accent); border-color: var(--ppq-accent); color: #fff; font-weight: 700; }

/* QoderWork 2026-07-22: the interrogation opens as a pop-up inside the shared modal
   shell. Constrain the prose column so it reads comfortably inside the wide modal. */
.ppq-iq { max-width: 760px; margin: 0 auto; padding: 0.4rem 0.2rem 1.2rem; }

/* VSAFE-03 (Claude 2026-07-28): the old elimination pill chips are DELETED,
   not merely unused. Smith rejected pills, background boxes and struck-through
   letters for option evidence; legacy eliminations now render through the
   `.ppq-oev` letter rail below. Do not reintroduce a pill treatment here. */
.ppq-iq-elim { margin-top: 0.5rem; }
.ppq-iq-elim-prose { font-size: 0.85rem; line-height: 1.5; color: var(--ppq-muted); margin-top: 0.35rem; font-style: italic; }

/* QoderWork 2026-07-24 (handoff #3): complete fixed-position option-evidence rail.
   The LETTER ITSELF is coloured by relationship — no background, pill, border or
   strikethrough. A surviving option is "unaffected" (grey), not positive evidence. */
.ppq-oev-row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: baseline; margin-top: 0.35rem; }
.ppq-oev { font-weight: 800; font-size: 0.98rem; line-height: 1; }
.ppq-oev.ro,  .ppq-oev-swatch.ro  { color: var(--ppq-bad); }   /* rules_out: red */
.ppq-oev.ca,  .ppq-oev-swatch.ca  { color: #d98080; }          /* counts_against: light red */
.ppq-oev.dis, .ppq-oev-swatch.dis { color: #e08a2e; }          /* disfavours: orange */
.ppq-oev.un,  .ppq-oev-swatch.un  { color: #a3a8ad; }          /* unaffected: grey */
.ppq-oev.fav, .ppq-oev-swatch.fav { color: #6cb6e8; }          /* favours: light blue */
.ppq-oev.sup, .ppq-oev-swatch.sup { color: #7cc096; }          /* supports: light green */
.ppq-oev.di,  .ppq-oev-swatch.di  { color: var(--ppq-ok); }    /* directly_identifies: green */
.ppq-oev.di { font-weight: 900; }
/* one compact legend: word + colour swatch (never A–G letters as the key) */
.ppq-oev-legend { display: flex; gap: 0.85rem; flex-wrap: wrap; align-items: center; font-size: 0.72rem; color: var(--ppq-muted); margin: 0.2rem 0 0.6rem; }
.ppq-oev-legend-item { display: inline-flex; align-items: center; gap: 0.3rem; }
.ppq-oev-swatch { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }

/* QoderWork 2026-07-24 (handoff #2): presentation_kind styling. A quiet kind tag;
   route steps are numbered (each inference relies on the one before), independent
   checks and synthesis stay unnumbered peers. */
.ppq-iq-method-kind { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ppq-muted); border: 1px solid var(--ppq-line); border-radius: 5px; padding: 1px 6px; }
.ppq-iq-kind-synthesis { background: rgba(49, 130, 206, 0.05); }
.ppq-iq-method-line.numbered { padding-left: 1.6rem; }
.ppq-iq-method-line.numbered::before { content: ""; }
.ppq-iq-stepnum { position: absolute; left: 0.2rem; top: 0.12rem; font-weight: 700; color: var(--ppq-accent); font-size: 0.82rem; }
.ppq-iq-stepnum::after { content: "."; }

/* optional "come back / more like this" review flag */
/* VF-07: the flagged-view header toggle */
.ppq-flagged-toggle.on { background: var(--ppq-accent); border-color: var(--ppq-accent); color: #fff; font-weight: 700; }

/* d012: marks-based self-assessment — the marks bar and the what-went-wrong */
.ppq-marksbar { margin-top: 0.9rem; padding-top: 0.8rem; border-top: 1px dashed var(--ppq-line); }
.ppq-marksbar.done .ppq-mark-btn:not(.selected) { opacity: .55; }
.ppq-marksbar-prompt { font-weight: 700; font-size: 0.98rem; margin-bottom: 0.55rem; }
.ppq-marksbar-row { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.ppq-mark-btn { min-width: 2.6rem; padding: 0.5rem 0.75rem; font-size: 1rem; font-weight: 700; border: 1px solid var(--ppq-line); border-radius: 8px; background: var(--ppq-bg); color: var(--ppq-ink); cursor: pointer; }
.ppq-mark-btn:hover { border-color: var(--ppq-accent); }
.ppq-mark-btn.full { border-color: rgba(45, 106, 63, 0.55); color: var(--ppq-ok); font-weight: 800; }
.ppq-mark-btn.lo { background: var(--ppq-accent); border-color: var(--ppq-accent); color: #fff; }
.ppq-mark-btn.selected { background: #225f91; border-color: #225f91; color: #fff; box-shadow: 0 0 0 2px rgba(34,95,145,.2); opacity: 1; }
.ppq-attempt-history-column.current { outline: 2px solid #225f91; outline-offset: 2px; border-radius: 3px; }
.ppq-inline-rating { margin-top: .8rem; padding: .8rem; border: 1px solid #b9d1e1; border-radius: 10px; background: #f0f7fb; scroll-margin: .75rem; }
.ppq-inline-rating .ppq-scale-legend { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .45rem 1rem; font-size: .95rem; }
.ppq-inline-rating .ppq-scale-legend-item { line-height: 1.4; }
.ppq-inline-rating .ppq-scale-btn { min-height: 44px; }
@media (max-width: 600px) { .ppq-inline-rating .ppq-scale-legend { grid-template-columns: 1fr; } }
.ppq-marks-unsure { margin-top: 0.55rem; font-size: 0.85rem; padding: 0.35rem 0.8rem; border: 1px dashed var(--ppq-line); border-radius: 999px; background: transparent; color: var(--ppq-ink2); cursor: pointer; }
.ppq-marks-assisted { display: block; width: fit-content; max-width: 100%; white-space: normal; margin-top: 0.55rem; font-size: 0.85rem; padding: 0.35rem 0.8rem; border: 1px dashed var(--ppq-line); border-radius: 999px; background: transparent; color: var(--ppq-ink2); cursor: pointer; text-align: left; }
.ppq-marks-assisted:hover:not(:disabled) { border-color: rgb(52,96,196); color: rgb(52,96,196); }
.ppq-marks-assisted.selected { border-style: solid; border-color: rgb(52,96,196); background: rgb(52,96,196); color: #fff; font-weight: 700; }
.ppq-marksbar.done .ppq-marks-assisted:not(.selected) { display: none; }
/* In the marks row, beside full marks and nearly its size (Smith, 2026-10-09). */
.ppq-marksbar-row .ppq-marks-assisted { display: inline-block; margin-top: 0; font-size: 0.95rem; font-weight: 700; line-height: 1.25; padding: 0.5rem 0.85rem; max-width: 24rem; border: 1px solid rgba(52,96,196,.55); border-radius: 8px; background: var(--ppq-bg); color: rgb(52,96,196); }
.ppq-marksbar-row .ppq-marks-assisted.selected { background: rgb(52,96,196); border-color: rgb(52,96,196); color: #fff; }
/* d033: get-it-now sits beneath got-it-then in the same row style */
.ppq-nowbar { margin-top: 0.8rem; padding-top: 0.7rem; border-top: 1px dotted var(--ppq-line); }
.ppq-now-btn { min-width: 2.6rem; padding: 0.5rem 0.75rem; font-size: 1rem; font-weight: 700; border: 1px solid var(--ppq-line); border-radius: 8px; background: var(--ppq-bg); color: var(--ppq-ink); cursor: pointer; }
.ppq-now-btn:hover { border-color: var(--ppq-accent); }
.ppq-now-btn.full { border-color: rgba(45, 106, 63, 0.55); color: var(--ppq-ok); font-weight: 800; }
.ppq-now-btn.selected { background: #225f91; border-color: #225f91; color: #fff; box-shadow: 0 0 0 2px rgba(34,95,145,.2); }
.ppq-competence.ppq-rating-awaiting { display: none !important; }
.ppq-competence .ppq-scale-btn[hidden], .ppq-competence .ppq-scale-legend-item[hidden] { display: none !important; }
.ppq-qdot.assisted { border-radius: 50%; }
.ppq-progress-verdict.assisted { color: rgb(52,96,196); font-weight: 700; font-size: 0.8rem; }
.ppq-marks-unsure.on { border-style: solid; border-color: var(--ppq-accent); color: var(--ppq-accent); font-weight: 700; }
.ppq-ms-crop { display: block; max-width: 100%; margin: 0.5rem 0; border: 1px solid var(--ppq-line); border-radius: 6px; }
/* d012: full marks prompts the 4-6 band; others stay clickable */
.ppq-iq-scale-btn.ppq-band { border-color: var(--ppq-accent); box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.25); }
/* d012: what-went-wrong taxonomy */
.ppq-iq-errtax { margin: 0.9rem 0 0.4rem; padding: 0.85rem 1rem; border: 1px solid var(--ppq-line); border-left: 3px solid var(--ppq-accent); border-radius: 8px; background: var(--ppq-paper); }
.ppq-iq-errtax-head { font-weight: 800; font-size: 1rem; margin-bottom: 0.6rem; }
.ppq-iq-errtax-group { margin-bottom: 0.65rem; }
.ppq-iq-errtax-label { font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ppq-muted); margin-bottom: 0.35rem; }
.ppq-iq-errtax-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.ppq-iq-errtag.weak { border-color: rgba(221, 165, 35, 0.6); box-shadow: 0 0 0 2px rgba(221, 165, 35, 0.2); }
.ppq-iq-errtax-other { display: flex; gap: 0.5rem; align-items: flex-start; margin-top: 0.5rem; }
.ppq-iq-errtax-other-text { flex: 1; resize: vertical; padding: 0.5rem 0.6rem; border: 1px solid var(--ppq-line); border-radius: 8px; background: var(--ppq-bg); color: var(--ppq-ink); font: inherit; font-size: 0.92rem; }
.ppq-iq-errtax-propose { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.ppq-iq-errtax-propose-text { flex: 1; padding: 0.45rem 0.6rem; border: 1px solid var(--ppq-line); border-radius: 8px; background: var(--ppq-bg); color: var(--ppq-ink2); font: inherit; font-size: 0.88rem; }
.ppq-iq-errtax-save { font-size: 0.85rem; padding: 0.4rem 0.85rem; border: 1px solid var(--ppq-line); border-radius: 8px; background: var(--ppq-bg); color: var(--ppq-ink2); cursor: pointer; }
.ppq-iq-errtax-save:hover { border-color: var(--ppq-accent); color: var(--ppq-accent); }

/* VF-02: pupil progress page. Data-presentation house style: values centred
   both ways, headings wrapped (never widening columns), smooth zero-anchored
   two-tone shading computed per cell, one hue per quantity class, black text
   with capped darkness. Flag counts unshaded (thin-sliver range, stated). */
.ppq-modal.ppq-modal-progress .ppq-modal-content { max-width: 900px; }
.ppq-progress { max-width: 840px; margin: 0 auto; padding: 0.4rem 0.4rem 1.4rem; color: var(--ppq-ink); }
.ppq-progress-title { font-size: 1.35rem; font-weight: 800; margin-bottom: 0.9rem; }
.ppq-progress-empty { color: var(--ppq-muted); font-size: 1rem; padding: 1.2rem 0; }
.ppq-progress-totals { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1rem; }
.ppq-progress-stat { border: 1px solid var(--ppq-line); border-radius: 9px; padding: 0.55rem 0.95rem; background: var(--ppq-paper); display: flex; flex-direction: column; align-items: center; min-width: 6.4rem; }
.ppq-progress-stat b { font-size: 1.15rem; }
.ppq-progress-stat span { font-size: 0.78rem; color: var(--ppq-muted); }
.ppq-progress-subhead { font-weight: 800; font-size: 0.98rem; margin: 1.25rem 0 0.5rem; }
.ppq-progress-table { border-collapse: collapse; }
.ppq-progress-table th { font-size: 0.78rem; font-weight: 700; color: var(--ppq-ink2); border-bottom: 2px solid var(--ppq-line); padding: 0.3rem 0.6rem; max-width: 6.5rem; white-space: normal; overflow-wrap: break-word; text-align: center; vertical-align: bottom; }
.ppq-progress-table td { text-align: center; vertical-align: middle; padding: 0.36rem 0.65rem; border-bottom: 1px solid var(--ppq-line); font-size: 0.92rem; color: var(--ppq-ink); }
.ppq-progress-table td.ppq-progress-topic { text-align: left; font-weight: 600; max-width: 16rem; }
.ppq-progress-attempts { display: flex; flex-direction: column; gap: 0.45rem; }
.ppq-progress-attempt { text-align: left; border: 1px solid var(--ppq-line); border-radius: 8px; background: var(--ppq-bg); padding: 0.55rem 0.85rem; cursor: pointer; font: inherit; color: var(--ppq-ink); line-height: 1.55; }
.ppq-progress-attempt:hover { border-color: var(--ppq-accent); }
.ppq-progress-attempt[disabled] { opacity: 0.6; cursor: default; }
.ppq-progress-verdict { font-weight: 900; margin-right: 0.2rem; }
.ppq-progress-verdict.right { color: var(--ppq-ok); }
.ppq-progress-verdict.wrong { color: var(--ppq-bad); }
.ppq-progress-chip { display: inline-block; font-size: 0.75rem; border: 1px solid var(--ppq-line); border-radius: 999px; padding: 0.1rem 0.5rem; color: var(--ppq-ink2); margin-left: 0.3rem; }
.ppq-progress-reflection { font-style: italic; color: var(--ppq-muted); font-size: 0.88rem; margin-top: 0.3rem; }
/* d011: Learned so far — button state, tri-state boxes, tree, greyed groups */
.ppq-learned-btn.on { background: var(--ppq-accent); border-color: var(--ppq-accent); color: #fff; font-weight: 700; }
.ppq-learned-summary { font-size: 0.92rem; color: var(--ppq-ink2); margin-bottom: 0.7rem; }
.ppq-learned-enable { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.92rem; margin-bottom: 0.7rem; cursor: pointer; }
.ppq-learned-quick { display: flex; gap: 0.5rem; margin-bottom: 0.8rem; }
.ppq-learned-tree { margin-bottom: 1rem; }
.ppq-learned-topic { border: 1px solid var(--ppq-line); border-radius: 9px; margin-bottom: 0.5rem; padding: 0.15rem 0.6rem; }
.ppq-learned-topic > summary { cursor: pointer; padding: 0.45rem 0.2rem; display: flex; align-items: center; gap: 0.55rem; font-size: 0.98rem; }
.ppq-learned-sub { margin: 0.15rem 0 0.3rem 1.6rem; }
.ppq-learned-sub > summary { cursor: pointer; padding: 0.3rem 0.2rem; display: flex; align-items: center; gap: 0.5rem; font-size: 0.92rem; }
.ppq-learned-leafrow { display: flex; align-items: center; gap: 0.5rem; padding: 0.22rem 0.2rem 0.22rem 1.6rem; font-size: 0.88rem; color: var(--ppq-ink2); }
.ppq-ls-box { width: 1.05rem; height: 1.05rem; border-radius: 4px; border: 2px solid var(--ppq-line); background: var(--ppq-bg); cursor: pointer; padding: 0; flex: none; position: relative; }
.ppq-ls-box.all { background: var(--ppq-accent); border-color: var(--ppq-accent); }
.ppq-ls-box.all::after { content: "✓"; color: #fff; font-size: 0.75rem; font-weight: 900; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.ppq-ls-box.some { border-color: var(--ppq-accent); }
.ppq-ls-box.some::after { content: ""; position: absolute; inset: 3px; background: var(--ppq-accent); border-radius: 2px; }
.ppq-cat-unlearned { opacity: 0.42; }

/* VF-14r: the question cluster — one dot per available question in the
   category. Neutral until attempted; attempted dots carry the continuous
   performance colour (red 0 → pale yellow 0.2 → green 1), computed per value,
   never banded. */
.ppq-qcluster { display: inline-flex; flex-wrap: wrap; gap: 2px; max-width: 12.5rem; vertical-align: middle; }
.ppq-qdot { width: 7px; height: 7px; border-radius: 2px; }
.ppq-qdot.untried { background: var(--ppq-line); opacity: 0.5; }
.ppq-qcluster-more { font-size: 0.68rem; color: var(--ppq-muted); align-self: center; margin-left: 2px; }
.ppq-qcluster-count { font-size: 0.72rem; color: var(--ppq-muted); margin-top: 0.2rem; }
.ppq-dash-cluster { max-width: 100%; margin: 0.25rem 0 0.3rem; }
.ppq-progress-dots { min-width: 9rem; max-width: 13.5rem; }
.ppq-progress-more { font-size: 0.8rem; color: var(--ppq-muted); margin: 0.3rem 0 0.6rem; }

/* VF-03: review-previous-attempt affordance and the review-mode furniture */
.ppq-review-attempt { border-style: dashed; }
.ppq-iq-reviewing-note { font-size: 0.9rem; font-weight: 700; color: var(--ppq-accent); background: rgba(49, 130, 206, 0.07); border: 1px dashed rgba(49, 130, 206, 0.4); border-radius: 8px; padding: 0.55rem 0.9rem; margin-bottom: 0.9rem; }
.ppq-iq-declaration-recap { font-size: 0.95rem; line-height: 1.55; color: var(--ppq-ink2); font-style: italic; margin: -0.35rem 0 0.9rem; }

.ppq-iq-flag { display: block; margin-top: 1.1rem; font-size: 0.9rem; padding: 0.5rem 1rem; border: 1px dashed var(--ppq-line); border-radius: 8px; background: transparent; color: var(--ppq-ink2); cursor: pointer; }
.ppq-iq-flag:hover { border-color: var(--ppq-accent); color: var(--ppq-accent); }
.ppq-iq-flag.on { border-style: solid; border-color: var(--ppq-accent); background: rgba(49, 130, 206, 0.08); color: var(--ppq-accent); font-weight: 700; }

/* QoderWork 2026-07-22 (v0.2.4): answer line + "Actually, I wasn't sure" on one row
   (Smith: the option goes "to the right of that"). Tapping it opens letter chips —
   "I thought it was B or D" — so uncertainty is logged even on a right answer. */
.ppq-answer-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.ppq-unsure { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.ppq-unsure-btn { font-size: 0.8rem; padding: 0.35rem 0.8rem; border: 1px dashed var(--ppq-line); border-radius: 8px; background: transparent; color: var(--ppq-ink2); cursor: pointer; }
.ppq-unsure-btn:hover { border-color: var(--ppq-accent); color: var(--ppq-accent); }
.ppq-unsure-btn.on { border-style: solid; border-color: var(--ppq-accent); background: rgba(49, 130, 206, 0.08); color: var(--ppq-accent); font-weight: 700; }
.ppq-unsure-pick { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.ppq-unsure-q { font-size: 0.8rem; color: var(--ppq-ink2); font-weight: 600; }
.ppq-unsure-letter { display: inline-flex; align-items: center; justify-content: center; min-width: 1.9rem; height: 1.9rem; border: 1px solid var(--ppq-line); border-radius: 6px; background: var(--ppq-bg); font-weight: 800; font-size: 0.85rem; color: var(--ppq-ink2); cursor: pointer; }
.ppq-unsure-letter:hover { border-color: var(--ppq-accent); }
.ppq-unsure-letter.on { background: var(--ppq-accent); border-color: var(--ppq-accent); color: #fff; }
.ppq-unsure-done { font-size: 0.78rem; padding: 0.3rem 0.75rem; border: 1px solid var(--ppq-line); border-radius: 7px; background: var(--ppq-bg); color: var(--ppq-ink2); cursor: pointer; }
.ppq-unsure-done:hover { border-color: var(--ppq-accent); color: var(--ppq-accent); }

/* QoderWork 2026-07-22 (v0.2.6): pre-declare guesses — optional, sits above the
   answer row. Smith: "Do you wish to declare guesses? It's all optional." */
.ppq-guess { margin-top: 0.6rem; }
.ppq-guess-btn { font-size: 0.82rem; padding: 0.35rem 0.85rem; border: 1px dashed var(--ppq-line); border-radius: 7px; background: transparent; color: var(--ppq-muted); cursor: pointer; }
.ppq-guess-btn:hover { border-color: var(--ppq-accent); color: var(--ppq-accent); }
.ppq-guess-btn.open { border-style: solid; border-color: var(--ppq-accent); color: var(--ppq-accent); }
.ppq-guess-btn.done { border-style: solid; border-color: var(--ppq-ok); color: var(--ppq-ok); font-weight: 600; }
.ppq-guess-panel { margin-top: 0.5rem; padding: 0.7rem 0.9rem; border: 1px solid var(--ppq-line); border-radius: 8px; background: var(--ppq-paper); }
.ppq-guess-prompt { font-size: 0.82rem; font-weight: 600; color: var(--ppq-ink2); margin-bottom: 0.5rem; }
.ppq-guess-options { display: flex; flex-direction: column; gap: 0.35rem; }
.ppq-guess-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; color: var(--ppq-ink); cursor: pointer; }
.ppq-guess-row input[type="checkbox"] { width: 1rem; height: 1rem; accent-color: var(--ppq-accent); }
.ppq-guess-letter { font-weight: 700; min-width: 1.2rem; }
.ppq-guess-pct { width: 3.2rem; font-size: 0.85rem; padding: 0.2rem 0.35rem; border: 1px solid var(--ppq-line); border-radius: 5px; text-align: right; }
.ppq-guess-pct:disabled { opacity: 0.4; border-color: transparent; background: transparent; }
.ppq-guess-pctsign { font-size: 0.8rem; color: var(--ppq-muted); }
.ppq-guess-actions { display: flex; gap: 0.5rem; margin-top: 0.6rem; }
.ppq-guess-done { font-size: 0.8rem; padding: 0.3rem 0.8rem; border: 1px solid var(--ppq-accent); border-radius: 7px; background: var(--ppq-accent); color: #fff; cursor: pointer; font-weight: 600; }
.ppq-guess-done:hover { opacity: 0.85; }
.ppq-guess-skip { font-size: 0.8rem; padding: 0.3rem 0.8rem; border: 1px solid var(--ppq-line); border-radius: 7px; background: var(--ppq-bg); color: var(--ppq-ink2); cursor: pointer; }
.ppq-guess-skip:hover { border-color: var(--ppq-muted); }

/* QoderWork 2026-07-22 (analyst handoff): the shared guess picker (.ppq-gpick-*),
   used both pre-answer (in-card) and post-answer (in-modal). Percentages are
   pre-filled beside selected options; changing them is optional. */
.ppq-gpick { }
.ppq-gpick-prompt { font-size: 0.85rem; font-weight: 600; color: var(--ppq-ink2); margin-bottom: 0.5rem; }
.ppq-gpick-options { display: flex; flex-direction: column; gap: 0.35rem; }
.ppq-gpick-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; color: var(--ppq-ink); }
.ppq-gpick-choice { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.ppq-gpick-row input[type="checkbox"] { width: 1rem; height: 1rem; accent-color: var(--ppq-accent); }
.ppq-gpick-letter { font-weight: 700; min-width: 1.2rem; }
/* QoderWork 2026-07-23: percentage pulled in next to the letter (was margin-left:auto,
   floating way out on the right — Smith: "the percentages are too far apart"). */
.ppq-gpick-pctwrap { display: inline-flex; align-items: center; gap: 0.15rem; margin-left: 0.45rem; }
.ppq-gpick-pct { width: 3.4rem; font-size: 0.85rem; padding: 0.2rem 0.35rem; border: 1px solid var(--ppq-line); border-radius: 5px; text-align: right; }
.ppq-gpick-pct:disabled { opacity: 0.4; border-color: transparent; background: transparent; }
.ppq-gpick-pctsign { font-size: 0.8rem; color: var(--ppq-muted); }
.ppq-gpick-pcthint { margin-top: 0.45rem; font-size: 0.75rem; color: var(--ppq-muted); }
.ppq-gpick-msg { font-size: 0.8rem; color: var(--ppq-bad); margin-top: 0.45rem; }
.ppq-gpick-actions { display: flex; gap: 0.5rem; margin-top: 0.7rem; }
.ppq-gpick-done { font-size: 0.8rem; padding: 0.3rem 0.85rem; border: 1px solid var(--ppq-accent); border-radius: 7px; background: var(--ppq-accent); color: #fff; cursor: pointer; font-weight: 600; }
.ppq-gpick-done:hover { opacity: 0.85; }
.ppq-gpick-skip { font-size: 0.8rem; padding: 0.3rem 0.85rem; border: 1px solid var(--ppq-line); border-radius: 7px; background: var(--ppq-bg); color: var(--ppq-ink2); cursor: pointer; }
.ppq-gpick-skip:hover { border-color: var(--ppq-muted); }
.ppq-gpick-done.done,
.ppq-gpick-skip.done { border-color: var(--ppq-ok); background: rgba(45, 106, 63, 0.10); color: var(--ppq-ok); }
.ppq-iq-rest:focus { outline: none; }
.ppq-iq-fallback-note { margin: 0.75rem 0; color: var(--ppq-muted); font-size: 0.84rem; }

/* QoderWork 2026-07-23: the guess page — first page of the interrogation pop-up.
   The heading is the reworded prompt ("Want to declare a bit of a guess?"), the
   picker sits beneath. Enter accepts the visible defaults and advances. */
.ppq-iq-guesspage { padding: 0.5rem 0; }
.ppq-iq-guesspage-heading { font-size: 1.05rem; font-weight: 700; color: var(--ppq-ink); margin-bottom: 0.7rem; }
.ppq-iq-rest { }

/* QoderWork 2026-07-22 (analyst handoff): verdict wrapper + the in-modal
   post-answer guess correction that sits right after it. */
.ppq-iq-verdict { margin-bottom: 0.5rem; }
.ppq-iq-postguess { margin-bottom: 0.75rem; }
.ppq-iq-postguess-btn { font-size: 0.82rem; padding: 0.35rem 0.85rem; border: 1px dashed var(--ppq-line); border-radius: 7px; background: transparent; color: var(--ppq-muted); cursor: pointer; }
.ppq-iq-postguess-btn:hover { border-color: var(--ppq-accent); color: var(--ppq-accent); }
.ppq-iq-postguess-btn.open { border-style: solid; border-color: var(--ppq-accent); color: var(--ppq-accent); }
.ppq-iq-postguess-btn.done { border-style: solid; border-color: var(--ppq-ok); color: var(--ppq-ok); font-weight: 600; }
.ppq-iq-postguess-panel { margin-top: 0.5rem; padding: 0.7rem 0.9rem; border: 1px solid var(--ppq-line); border-radius: 8px; background: var(--ppq-paper); }

/* QoderWork 2026-07-22 (analyst handoff): the v2 pupil insight — three labelled
   lines (first notice / why it matters / next move), prose rendered faithfully. */
.ppq-iq-insight { border: 1px solid var(--ppq-line); border-left: 3px solid var(--ppq-accent); border-radius: 8px; padding: 0.8rem 1rem; margin-bottom: 1rem; background: var(--ppq-paper); }
.ppq-iq-insight-line { display: block; font-size: 0.98rem; line-height: 1.6; padding: 0.3rem 0; }
.ppq-iq-insight-label { display: block; font-size: 0.74rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ppq-accent); margin-bottom: 0.15rem; }
.ppq-iq-insight-text { color: var(--ppq-ink); }

/* QoderWork 2026-07-22 (analyst handoff): the structured self-report prompt and
   its tappable state chips (method-awareness + knowledge check). */
.ppq-iq-prompt { margin-bottom: 1rem; }
.ppq-iq-prompt-text { font-size: 1rem; font-weight: 600; line-height: 1.6; color: var(--ppq-ink); margin-bottom: 0.6rem; }
.ppq-iq-prompt-states { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.ppq-iq-state { font-size: 0.88rem; padding: 0.42rem 0.85rem; border: 1px solid var(--ppq-line); border-radius: 999px; background: var(--ppq-bg); color: var(--ppq-ink2); cursor: pointer; }
/* Phase 1.5 (Smith 2026-07-28): an attached prompt is the continuation of the
   method card above it — shared walls, dashed divider, faint tint — so the
   question is visibly ABOUT the steps just read and is answered in place. */
.ppq-iq-prompt-attached { border: 1px solid var(--ppq-line); border-top: 1px dashed var(--ppq-line); border-radius: 0 0 8px 8px; margin: 0 0 1rem; padding: 0.75rem 1rem 0.85rem; background: rgba(49, 130, 206, 0.035); }
/* VF-13: a group prompt's per-method slice; the authored combined wording shows
   to reviewers only. Consecutive attached blocks keep their card joined. */
.ppq-iq-prompt-permethod { border-radius: 0 0 8px 8px; }
.ppq-iq-method-joined + .ppq-iq-prompt-attached:not(:last-child) { margin-bottom: 1rem; }
.ppq-iq-permethod-authored { font-size: 0.8rem; font-style: italic; color: var(--ppq-muted); margin-bottom: 0.4rem; }
.ppq-iq-state:hover { border-color: var(--ppq-accent); color: var(--ppq-accent); }
.ppq-iq-state.sel { background: var(--ppq-accent); border-color: var(--ppq-accent); color: #fff; font-weight: 700; }

/* Bottom-of-review knowledge/technique audit. It is deliberately collapsed and
   visually quiet; Known is an implicit starting display until the pupil acts. */
.ppq-iq-things { margin-top: 1rem; border: 1px solid var(--ppq-line); border-radius: 9px; background: var(--ppq-paper); }
.ppq-iq-things > summary { cursor: pointer; padding: 0.75rem 0.9rem; font-size: 0.95rem; font-weight: 750; color: var(--ppq-ink2); }
.ppq-iq-things[open] > summary { border-bottom: 1px solid var(--ppq-line); }
.ppq-iq-things-intro { font-size: 0.85rem; line-height: 1.5; color: var(--ppq-muted); padding: 0.7rem 0.9rem 0.25rem; }
.ppq-iq-things-rows { padding: 0.4rem 0.9rem 0.25rem; }
.ppq-iq-thing { padding: 0.8rem 0; border-top: 1px solid var(--ppq-line); }
.ppq-iq-thing:first-child { border-top: none; }
.ppq-iq-thing-text { font-size: 0.95rem; line-height: 1.55; color: var(--ppq-ink); margin-bottom: 0.5rem; }
.ppq-iq-thing-states { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ppq-iq-thing-state { font-size: 0.82rem; padding: 0.36rem 0.7rem; border: 1px solid var(--ppq-line); border-radius: 999px; background: var(--ppq-bg); color: var(--ppq-ink2); cursor: pointer; }
.ppq-iq-thing-state:hover { border-color: var(--ppq-accent); color: var(--ppq-accent); }
.ppq-iq-thing-state.sel { background: var(--ppq-accent); border-color: var(--ppq-accent); color: #fff; font-weight: 700; }
.ppq-iq-thing-state.sel.implicit { background: rgba(49, 130, 206, 0.07); border-style: dashed; color: var(--ppq-accent); font-weight: 600; }
.ppq-iq-things-confirm { margin: 0.5rem 0.85rem 0.8rem; font-size: 0.76rem; padding: 0.35rem 0.7rem; border: 1px solid var(--ppq-line); border-radius: 7px; background: var(--ppq-bg); color: var(--ppq-ink2); cursor: pointer; }
.ppq-iq-things-confirm:hover { border-color: var(--ppq-accent); color: var(--ppq-accent); }
.ppq-iq-things-confirm.done { border-color: var(--ppq-ok); color: var(--ppq-ok); font-weight: 700; }

.ppq-iq-reflection { margin-top: 1rem; padding-top: 0.9rem; border-top: 1px dashed var(--ppq-line); }
.ppq-iq-reflection-label { display: block; font-size: 0.95rem; font-weight: 700; color: var(--ppq-ink); }
.ppq-iq-reflection-label > span { font-size: 0.7rem; font-weight: 500; color: var(--ppq-muted); margin-left: 0.35rem; }
.ppq-iq-reflection-text { display: block; width: 100%; resize: vertical; min-height: 4.2rem; margin-top: 0.5rem; padding: 0.6rem 0.7rem; border: 1px solid var(--ppq-line); border-radius: 8px; background: var(--ppq-bg); color: var(--ppq-ink); font: inherit; font-size: 0.95rem; line-height: 1.5; }
.ppq-iq-reflection-text:focus { outline: none; border-color: var(--ppq-accent); }
.ppq-iq-reflection-save { margin-top: 0.4rem; font-size: 0.75rem; padding: 0.3rem 0.7rem; border: 1px solid var(--ppq-line); border-radius: 7px; background: var(--ppq-bg); color: var(--ppq-ink2); cursor: pointer; }
.ppq-iq-reflection-save:hover { border-color: var(--ppq-accent); color: var(--ppq-accent); }

/* QoderWork 2026-07-23 (analyst request #1): "More quick checks" disclosure for
   secondary prompts, and the plain-text check_prompt line. */
.ppq-iq-morechecks { margin-top: 0.6rem; border: 1px solid var(--ppq-line); border-radius: 8px; padding: 0.5rem 0.8rem; }
.ppq-iq-morechecks summary { font-size: 0.82rem; font-weight: 600; color: var(--ppq-muted); cursor: pointer; }
.ppq-iq-morechecks summary:hover { color: var(--ppq-accent); }
.ppq-iq-morechecks[open] summary { margin-bottom: 0.5rem; }
.ppq-iq-checkprompt { border-left: 3px solid var(--ppq-muted); padding-left: 0.7rem; opacity: 0.9; }

/* QoderWork 2026-07-23 (analyst request #2): quiet analysis-state footer. */
.ppq-iq-state-label { margin-top: 1rem; padding-top: 0.5rem; border-top: 1px solid var(--ppq-line); font-size: 0.72rem; font-weight: 600; color: var(--ppq-muted); letter-spacing: 0.02em; }
.ppq-iq-state-by { font-weight: 400; opacity: 0.7; }

/* QoderWork 2026-07-23 (analyst request #4): reviewer-only strip (?review). */
.ppq-iq-reviewer-strip { font-family: "SF Mono", "Fira Code", monospace; font-size: 0.68rem; line-height: 1.4; padding: 0.4rem 0.6rem; margin-bottom: 0.7rem; border: 1px dashed rgba(140, 133, 121, 0.5); border-radius: 6px; background: rgba(140, 133, 121, 0.06); color: var(--ppq-muted); word-break: break-all; }
.ppq-iq-reviewer-details { margin-bottom: 0.75rem; border: 1px dashed rgba(140, 133, 121, 0.6); border-radius: 7px; background: rgba(140, 133, 121, 0.045); color: var(--ppq-ink2); }
.ppq-iq-reviewer-details > summary { cursor: pointer; padding: 0.5rem 0.65rem; font-family: "SF Mono", "Fira Code", monospace; font-size: 0.72rem; font-weight: 700; }
.ppq-iq-reviewer-taxonomy, .ppq-iq-reviewer-options, .ppq-iq-reviewer-notes { padding: 0.55rem 0.7rem; border-top: 1px dashed var(--ppq-line); font-size: 0.73rem; line-height: 1.45; }
.ppq-iq-reviewer-option { padding: 0.5rem 0; border-top: 1px solid var(--ppq-line); }
.ppq-iq-reviewer-option:first-child { border-top: none; }
.ppq-iq-reviewer-option-head { font-family: "SF Mono", "Fira Code", monospace; font-weight: 800; color: var(--ppq-ink); margin-bottom: 0.2rem; }
.ppq-iq-reviewer-error-path { color: var(--ppq-ink2); }
.ppq-iq-reviewer-bait, .ppq-iq-reviewer-tags { color: var(--ppq-muted); margin-top: 0.15rem; }
.ppq-iq-reviewer-notes ul { margin: 0.35rem 0 0 1.1rem; padding: 0; }

/* QoderWork 2026-07-22 (v0.2.4): multi-select dropdown filter (subject defaults to
   Maths + Physics on ESAT; the others are a tick away). */
.ppq-multifilter { position: relative; display: inline-block; }
.ppq-multi-btn { font-size: 0.85rem; padding: 0.35rem 0.7rem; border: 1px solid var(--ppq-line); border-radius: 7px; background: var(--ppq-bg); color: var(--ppq-ink); cursor: pointer; }
.ppq-multi-btn:hover { border-color: var(--ppq-accent); }
.ppq-multi-panel { position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; min-width: 180px; background: var(--ppq-paper); border: 1px solid var(--ppq-line); border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12); padding: 0.4rem; }
.ppq-multi-row { display: flex; align-items: center; gap: 0.45rem; font-size: 0.85rem; color: var(--ppq-ink); padding: 0.3rem 0.35rem; border-radius: 6px; cursor: pointer; }
.ppq-multi-row:hover { background: rgba(49, 130, 206, 0.07); }
.ppq-multi-all { border-bottom: 1px solid var(--ppq-line); margin-bottom: 0.25rem; padding-bottom: 0.45rem; font-weight: 700; }

/* QoderWork 2026-07-22 (v0.2.4): the active topic filter shown as a removable chip
   next to the counter — so a stuck filter is visible and one click undoes it. */
.ppq-filterchip { font-size: 0.78rem; font-weight: 700; padding: 0.2rem 0.6rem; border: 1px solid rgba(49, 130, 206, 0.5); border-radius: 999px; background: rgba(49, 130, 206, 0.1); color: var(--ppq-accent); cursor: pointer; }
.ppq-filterchip:hover { background: rgba(49, 130, 206, 0.2); }
/* d066: the open teacher's set, in the counter; its cross leaves the set. */
.ppq-setchip { font-size: 0.78rem; font-weight: 700; padding: 0.2rem 0.6rem; border: 1px solid rgba(47, 133, 90, 0.55); border-radius: 999px; background: rgba(47, 133, 90, 0.12); color: #276749; cursor: pointer; }
.ppq-setchip:hover { background: rgba(47, 133, 90, 0.22); }

/* QoderWork 2026-07-22 (v0.2.4): with revealCorrect off the mastery ribbon shows a
   neutral dot per attempt instead of ticks/crosses (no verdict leaks). */
.ppq-dot { color: var(--ppq-muted); font-size: 1rem; margin-right: 2px; }
.ppq-cat.active { background: rgba(49, 130, 206, 0.12); border-left: 4px solid var(--ppq-accent); padding-left: 0.5rem; box-shadow: inset 0 0 0 1px rgba(49, 130, 206, 0.35); }

/* QoderWork 2026-07-22: optional left options rail (config.optionsLeft). The letter
   picker sits in a sticky column to the LEFT of the question so there is no long
   scroll to answer. Used by MCQ subjects (ESAT); the question crop shows the printed
   options, the rail is just the picker. */
.ppq-qarea { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.ppq-qarea .ppq-options { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: 0.45rem; }
.ppq-qarea .ppq-option { justify-content: center; min-height: 2.4rem; font-size: 1.05rem; font-weight: 700; }
@media (max-width: 640px) {
  .ppq-qarea { grid-template-columns: 1fr; }
  .ppq-qarea .ppq-options { position: static; flex-direction: row; flex-wrap: wrap; }
}

/* Smith, 2026-10-08, on ESAT (config railTools): the report reasons, Draw and Reset
   leave the fixed bottom bar, which covered the foot of the question, and take the
   empty space beside the answer letters, level with the bottom of them. Previous
   and the clock share one row above the question. */
.ppq-card-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .75rem; }
.ppq-card-bar > .ppq-prev-top { margin: 0; }
.ppq-card-bar > .ppq-timing { position: static; margin: 0 0 0 auto; align-self: center; box-shadow: none; }
.ppq-qarea.ppq-qarea-rail { grid-template-columns: auto minmax(0, 1fr); }
.ppq-rail { position: sticky; top: 4.6rem; display: grid; grid-template-columns: 74px minmax(0, 11.5rem); column-gap: .8rem; align-items: end; }
.ppq-rail > .ppq-options { position: static; grid-column: 1; grid-row: 1; align-self: start; }
.ppq-toolbar.ppq-rail-tools { position: static; grid-column: 2; grid-row: 1; display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; z-index: auto; }
.ppq-rail-tools > .ppq-report-block, .ppq-rail-tools > .ppq-teacher-help, .ppq-rail-tools > .ppq-problem-report { grid-column: 1 / -1; }
.ppq-rail-tools > .ppq-btn-mini { width: 100%; min-height: 40px; padding: .35rem .4rem; }
.ppq-rail-tools .ppq-report-block { flex-direction: column; align-items: stretch; gap: .4rem; padding: .5rem; }
.ppq-rail-tools .ppq-report-lead { max-width: none; text-align: left; }
.ppq-rail-tools .ppq-report-groups { flex-direction: column; align-items: stretch; gap: .45rem; }
.ppq-rail-tools .ppq-report-group { flex-direction: column; align-items: stretch; gap: .25rem; }
.ppq-rail-tools .ppq-report-group + .ppq-report-group { padding: .45rem 0 0; border-left: 0; border-top: 1px solid var(--ppq-line); }
.ppq-rail-tools .ppq-report-grid { flex-direction: column; align-items: stretch; }
.ppq-rail-tools .ppq-report-reason { text-align: left; }
/* The "This question" label stays (Smith, 2026-08-02: every clipping says what it is), with less space around it. */
.ppq-qarea-rail .ppq-stem { gap: .3rem; }
.ppq-qarea-rail .ppq-stem-partlead { margin: 0; padding-top: 0; border-top: 0; }
.ppq-qarea-rail .ppq-stem .ppq-question-crop { margin-top: 0; }
/* cropFit: a fitted crop is sized by the engine; the blank tail and page footer are
   cut by aspect-ratio with the image pinned to its top. */
.ppq-stem .ppq-crop.ppq-crop-fitted { max-width: 100%; height: auto; }
@media (max-width: 640px) {
  /* Phone width: letters above the question, the tools after it. */
  .ppq-qarea.ppq-qarea-rail { grid-template-columns: 1fr; }
  .ppq-rail { display: contents; }
  .ppq-qarea-rail .ppq-draw-container { order: 1; }
  .ppq-toolbar.ppq-rail-tools { order: 2; grid-column: 1; grid-row: auto; }
}

/* QoderWork 2026-07-23: top Previous button — smaller and subtler than the
   bottom controls so it doesn't dominate the card header area. */
.ppq-prev-top { font-size: 0.78rem; padding: 0.25rem 0.6rem; margin-bottom: 0.4rem; opacity: 0.75; }
.ppq-prev-top:hover { opacity: 1; }

/* Opt-in presentation and catalogue integration. Kept at the end so newer
   shared card/printed-page rules continue to own the base composition. */
.ppq-centre { min-width: 0; }
.ppq-filter-toggle {
  display: none; min-height: 44px; padding: 0.55rem 0.75rem;
  border: 1px solid var(--ppq-line); border-radius: 8px;
  background: var(--ppq-bg); color: var(--ppq-ink); font: inherit;
  font-size: 0.82rem; font-weight: 750; cursor: pointer;
}
.ppq-filter-control, .ppq-multifilter {
  display: inline-flex; flex-direction: column; align-items: stretch; gap: 0.18rem;
}
.ppq-filter-label {
  color: var(--ppq-muted); font-size: 0.68rem; font-weight: 800;
  line-height: 1; letter-spacing: 0.04em; text-transform: uppercase;
}
.ppq-meta, .ppq-tags, .ppq-tag { min-width: 0; }
.ppq-tag { overflow-wrap: anywhere; }
.ppq-source-advisory {
  display: grid; gap: 0.32rem; padding: 0.85rem 1rem;
  border: 1px solid #c48708; border-left: 5px solid #b87300;
  border-radius: 10px; background: #fff4cf; color: #563b00;
  line-height: 1.5; overflow-wrap: anywhere;
}
.ppq-source-advisory-title { color: #744d00; font-size: 0.92rem; font-weight: 900; }
.ppq-source-advisory-message { font-size: 0.95rem; }
.ppq-source-advisory-review { margin: 0 0 1rem; }
.ppq-progress-table-scroll {
  max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}
.ppq-progress-table-scroll:focus { outline: 2px solid var(--ppq-accent); outline-offset: 2px; }

.ppq-presentation .ppq-prev-top { align-self: flex-start; width: auto; min-height: 44px; margin-bottom: 0; }
.ppq-presentation .ppq-meta { align-items: center; justify-content: flex-start; }
.ppq-presentation .ppq-qid { margin-right: auto; color: var(--ppq-ink2); font-weight: 800; }
.ppq-presentation .ppq-tags { flex: 1 1 100%; }
.ppq-presentation .ppq-option,
.ppq-presentation .ppq-btn,
.ppq-presentation .ppq-btn-mini,
.ppq-presentation .ppq-multi-btn,
.ppq-presentation .ppq-select,
.ppq-presentation .ppq-find-input,
.ppq-presentation .ppq-iq-state,
.ppq-presentation .ppq-iq-used,
.ppq-presentation .ppq-iq-thing-state,
.ppq-presentation .ppq-iq-things-confirm,
.ppq-presentation .ppq-iq-reflection-save,
.ppq-presentation .ppq-iq-diagnostic-choice,
.ppq-presentation .ppq-iq-flag,
.ppq-presentation .ppq-scale-btn,
.ppq-presentation .ppq-gpick-done,
.ppq-presentation .ppq-gpick-skip,
.ppq-presentation .ppq-timing-pause,
.ppq-presentation .ppq-timing-reset,
.ppq-presentation .ppq-timing-discard { min-height: 44px; }
.ppq-presentation .ppq-timing-pause,
.ppq-presentation .ppq-timing-reset { min-width: 44px; }
.ppq-presentation .ppq-modal-min, .ppq-presentation .ppq-modal-close { width: 44px; height: 44px; }
.ppq-presentation .ppq-gpick-choice {
  min-width: 44px; min-height: 44px; padding: 0.3rem 0.45rem;
  border: 1px solid var(--ppq-line); border-radius: 8px;
}
.ppq-presentation .ppq-gpick-row input[type="checkbox"] { width: 1.35rem; height: 1.35rem; }
.ppq-presentation .ppq-card { scroll-margin-top: 5.25rem; }

.ppq-compact-mobile-filters .ppq-header {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem; padding: 0.55rem 1rem; align-items: center;
}
.ppq-compact-mobile-filters .ppq-filter-toggle { display: inline-block; }
.ppq-compact-mobile-filters .ppq-filters {
  display: none; grid-column: 1 / -1; width: 100%; gap: 0.5rem; padding-top: 0.35rem;
}
.ppq-compact-mobile-filters .ppq-header.ppq-mobile-filters-open .ppq-filters { display: flex; }

.ppq-guided-review .ppq-iq-section { margin-top: 1.35rem; padding-top: 0.15rem; scroll-margin-top: 1rem; }
.ppq-guided-review .ppq-iq-section + .ppq-iq-section { padding-top: 1.15rem; border-top: 1px solid var(--ppq-line); }
.ppq-guided-review .ppq-iq-section-title { margin: 0 0 0.75rem; color: var(--ppq-ink); font-size: 1.22rem; line-height: 1.25; }
.ppq-guided-review .ppq-iq-section-intro { margin: -0.35rem 0 0.8rem; color: var(--ppq-muted); font-size: 0.88rem; line-height: 1.5; }
.ppq-guided-review .ppq-iq-method-disclosure { margin: 0 0 0.85rem; border: 1px solid var(--ppq-line); border-radius: 9px; background: var(--ppq-paper); }
.ppq-guided-review .ppq-iq-method-disclosure > summary { min-height: 44px; padding: 0.75rem 0.9rem; color: var(--ppq-ink2); cursor: pointer; font-weight: 750; line-height: 1.4; }
.ppq-guided-review .ppq-iq-method-disclosure[open] > summary { border-bottom: 1px solid var(--ppq-line); }
.ppq-guided-review .ppq-iq-method-disclosure-body { padding: 0.85rem 0.85rem 0; }
.ppq-guided-review .ppq-iq-method-disclosure-body > .ppq-iq-method:last-child { margin-bottom: 0.85rem; }
.ppq-guided-review .ppq-iq-things > summary { min-height: 44px; }

@media (max-width: 640px) {
  .ppq-header { padding: 0.75rem 0.6rem; align-items: flex-start; }
  .ppq-title, .ppq-filters, .ppq-finder, .ppq-find-results { min-width: 0; max-width: 100%; }
  .ppq-finder { flex: 1 1 100%; }
  .ppq-select, .ppq-start { max-width: 100%; }
  .ppq-filter-control, .ppq-multifilter { flex: 1 1 9rem; min-width: 0; max-width: 100%; }
  .ppq-filter-control .ppq-select, .ppq-multifilter .ppq-multi-btn { width: 100%; }
  .ppq-layout { padding: 0.75rem 0.45rem; gap: 0.75rem; min-width: 0; }
  .ppq-card, .ppq-dash { min-width: 0; width: 100%; }
  .ppq-card { padding: 0.9rem; border-radius: 12px; }
  .ppq-classification-group span { overflow-wrap: anywhere; }
  .ppq-compact-mobile-filters .ppq-header {
    grid-template-columns: minmax(0, 1fr);
    padding: 0.55rem 0.6rem;
  }
  .ppq-compact-mobile-filters .ppq-title { font-size: 1rem; line-height: 1.2; }
  .ppq-compact-mobile-filters .ppq-filter-toggle { width: 100%; }
  .ppq-compact-mobile-filters .ppq-ver { display: none; }
  .ppq-presentation .ppq-draw-container { max-width: 100%; }
  .ppq-presentation .ppq-card { gap: 0.8rem; }
  .ppq-presentation .ppq-source-advisory { padding: 0.7rem 0.75rem; }
  .ppq-presentation .ppq-source-advisory-message { font-size: 0.9rem; }
  .ppq-guided-review .ppq-iq-section-title { font-size: 1.08rem; }
  .ppq-guided-review .ppq-iq-method-disclosure-body { padding: 0.7rem 0.6rem 0; }
}

/* Opt-in compact practice workspace: the question and group list each own
   their scrolling. Other embedded consumers retain the document layout. */
.ppq-question-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .4rem 1rem; min-width: 0; }
.ppq-question-top > .ppq-meta { flex: 1 1 18rem; min-width: 0; }
.ppq-question-top-right { display: flex; flex-direction: column; align-items: flex-end; gap: .45rem; max-width: 100%; min-width: 0; }
.ppq-question-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .3rem; }
.ppq-question-badge { display: inline-block; padding: .2rem .45rem; border-radius: 5px; border: 1px solid #b9d1e1; background: #eaf3f8; color: #174d70; font-size: .75rem; font-weight: 700; }
.ppq-question-badge.ppq-question-badge-hl { background: #eee7fa; border-color: #b8a0d5; color: #55317b; }
.ppq-question-badge.ppq-question-badge-sl { background: #e2f1e8; border-color: #92b6a2; color: #205a39; }
.ppq-question-badge.ppq-question-badge-shared { background: #f0f0eb; border-color: #b9bcaf; color: #4b5143; }
/* QoderWork 2026-09-14: the "also studied" co-strand panel. Sits under the
   question meta and names every topic the part belongs to, main strand first
   and emphasised, so a part reached through a minor strand still says what it
   really assesses. The purple accent echoes the A5/HL colour already in use. */
.ppq-also-studied { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .5rem; margin: .1rem 0 .7rem; padding: .5rem .7rem; border: 1px solid #d8d6c9; border-left: 3px solid #b8a0d5; border-radius: 7px; background: #fbf9f2; font-size: .85rem; line-height: 1.45; color: #3a3d38; }
.ppq-also-studied[hidden] { display: none; }
.ppq-also-studied-label { font-weight: 700; color: #4b4436; }
.ppq-also-studied-item { display: inline-block; }
.ppq-also-studied-item + .ppq-also-studied-item::before { content: "·"; margin-right: .5rem; color: #a9a697; }
.ppq-also-studied-main { font-weight: 700; color: #2c2f2a; }
.ppq-learner-level-option { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin-bottom: .8rem; font-size: .95rem; }
.ppq-learner-level { min-height: 44px; padding: .5rem .7rem; border: 1px solid var(--ppq-line); border-radius: 7px; background: var(--ppq-paper); color: var(--ppq-ink); font: inherit; }
.ppq-timing-description { font-size: .9rem; line-height: 1.5; color: var(--ppq-ink2); }
.ppq-attempt-history { flex: 0 1 auto; max-width: min(100%, 22rem); min-width: 0; font-size: .72rem; line-height: 1.25; }
.ppq-attempt-history[hidden] { display: none; }
.ppq-attempt-history-title { margin-bottom: .25rem; color: var(--ppq-muted); font-size: .72rem; font-weight: 600; }
.ppq-attempt-history-list { display: flex; gap: .25rem; max-width: 100%; overflow-x: auto; padding: 0 0 .15rem; scrollbar-width: thin; }
.ppq-attempt-history-column { display: flex; flex: 0 0 auto; flex-direction: column; gap: .15rem; min-width: 2.15rem; text-align: center; border-radius: 4px; outline-offset: 2px; }
.ppq-attempt-outcome, .ppq-attempt-confidence { display: block; padding: .2rem .3rem; border: 1px solid rgba(33, 102, 56, .22); border-radius: 3px; color: #173b24; background: rgba(45, 148, 80, calc(.06 + var(--ppq-history-strength, 0) * .54)); font-size: .72rem; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ppq-attempt-confidence { padding-top: .15rem; padding-bottom: .15rem; }
.ppq-attempt-outcome.missing, .ppq-attempt-confidence.missing { background: #f1f2ee; border-color: #d7dbd5; color: var(--ppq-muted); }
.ppq-attempt-history-empty { color: var(--ppq-muted); font-weight: 400; }
.ppq-attempt-history-option, .ppq-include-attempted-option { display: flex; align-items: center; gap: .6rem; min-height: 44px; font-size: .95rem; }
.ppq-attempt-history-toggle, .ppq-include-attempted-toggle { width: 1.15rem; height: 1.15rem; accent-color: #2d9450; }
.ppq-practice-selection-option { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: .75rem 0; font-size: .95rem; }
.ppq-practice-selection { max-width: 100%; min-height: 44px; padding: .5rem .7rem; border: 1px solid var(--ppq-line); border-radius: 7px; background: var(--ppq-paper); color: var(--ppq-ink); font: inherit; }
.ppq-practice-selection-note { display: block; flex-basis: 100%; color: var(--ppq-muted); font-size: .85rem; line-height: 1.45; }
.ppq-practice-empty .ppq-btn { margin: .3rem; }
.ppq-compact-workspace { --ppq-crop-width: 100%; }
.ppq-compact-workspace .ppq-header { padding: .45rem .8rem; gap: .35rem .75rem; }
.ppq-compact-workspace .ppq-title { font-size: 1.15rem; }
.ppq-compact-workspace .ppq-layout { padding: .65rem; gap: .75rem; }
.ppq-compact-workspace .ppq-card { padding: .75rem 1rem; gap: .5rem; border-radius: 11px; }
.ppq-compact-workspace .ppq-meta { font-size: .74rem; letter-spacing: .025em; }
.ppq-compact-workspace .ppq-prev-top { display: none !important; }
.ppq-compact-workspace .ppq-draw-container { width: 100%; max-width: 100%; }
.ppq-compact-workspace .ppq-stem { gap: .35rem; }
.ppq-compact-workspace .ppq-stem > .ppq-crop,
.ppq-compact-workspace .ppq-ms-crop { width: auto; max-width: min(100%, 960px); max-height: min(55dvh, 520px); object-fit: contain; margin: .25rem auto; cursor: zoom-in; }
.ppq-compact-workspace .ppq-stem-partlead { font-size: 1.05rem; color: #174d70; padding: .55rem .75rem; margin: .4rem 0 .15rem; background: #eaf3f8; border: 1px solid #b9d1e1; border-radius: 7px; }
.ppq-compact-workspace .ppq-target-part { font-size: 1.15rem; font-weight: 800; line-height: 1.35; color: #174d70; background: #eaf3f8; border-left: 4px solid #3182ce; padding: .6rem .8rem; margin: 0; }
.ppq-compact-workspace .ppq-stem:not(:has(.physics-context)) > .ppq-target-part { display: none; }
.ppq-compact-workspace .physics-context { background: #f1f2ee; border: 1px solid #d2d8d2; border-radius: 8px; padding: .4rem .65rem; }
.ppq-compact-workspace .physics-context > summary { cursor: pointer; font-size: 1.04rem; font-weight: 750; padding: .25rem 0; color: #384b40; }
.ppq-compact-workspace .physics-context-images { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr)); gap: .65rem; align-items: start; padding: .3rem 0; }
.ppq-compact-workspace .physics-context-images > .ppq-crop { width: 100%; max-width: 520px; max-height: none; height: auto; margin: 0 auto; cursor: zoom-in; }
.ppq-compact-workspace .ppq-wq-nav { gap: .45rem; padding: .45rem .65rem; }
.ppq-compact-workspace .ppq-wq-jump { font-size: .9rem; }
.ppq-compact-workspace .ppq-part-chip { min-height: 36px; padding: .35rem .65rem; font-size: .94rem; }
.ppq-compact-workspace .ppq-struct:empty { display: none; }
/* Optional compact target row retains the exact part above its shared context.
   The crop separator below the context is deliberately a quiet landmark. */
.ppq-compact-question-header .ppq-question-target-row { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .85rem; padding: .3rem 0; border-bottom: 1px solid var(--ppq-line); }
.ppq-compact-question-header .ppq-question-target-row > .ppq-target-part { flex: 0 1 auto; display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .55rem; font-size: 1.02rem; line-height: 1.35; padding: 0; margin: 0; border: 0; background: none; color: #174d70; }
.ppq-compact-question-header .ppq-target-marks { color: var(--ppq-muted); font-size: .77rem; font-weight: 500; white-space: nowrap; }
.ppq-compact-question-header .ppq-question-target-row > .ppq-struct { flex: 0 1 auto; min-width: 0; }
.ppq-compact-question-header .ppq-question-target-row > .ppq-struct:empty { display: none; }
.ppq-compact-question-header .ppq-question-target-row .ppq-wq-nav { gap: .3rem; border: 0; border-radius: 0; background: none; padding: 0; }
.ppq-compact-question-header .ppq-question-target-row .ppq-wq-jump { font-size: .78rem; }
.ppq-compact-question-header .ppq-question-target-row .ppq-part-chip { min-height: 32px; padding: .25rem .45rem; font-size: .85rem; }
.ppq-compact-question-header .ppq-stem .ppq-current-part-label { font-size: .78rem; font-weight: 700; color: var(--ppq-ink2); border: 0; border-top: 1px solid var(--ppq-line); background: none; border-radius: 0; margin: .2rem 0 0; padding: .35rem 0 0; }
.ppq-question-loading { display: flex; align-items: center; gap: .6rem; padding: .7rem .85rem; border: 1px solid #b9d1e1; border-radius: 7px; background: #eaf3f8; color: #174d70; font-size: .88rem; font-weight: 650; line-height: 1.4; }
.ppq-question-loading[hidden] { display: none; }
.ppq-question-loading:not(.ppq-question-loading-error)::before { content: ""; flex: 0 0 auto; width: .95rem; height: .95rem; border: 2px solid #b9d1e1; border-top-color: #174d70; border-radius: 50%; animation: ppq-image-loading .8s linear infinite; }
.ppq-question-loading-error { background: #fff4e9; color: #784316; border-color: #d9bc9a; }
.ppq-stem .ppq-question-image-pending { visibility: hidden; min-height: 90px; }
.ppq-stem img[hidden] { display: none; }
.ppq-question-image-error { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .6rem; min-height: 90px; padding: .75rem; border: 1px dashed #d9bc9a; border-radius: 6px; background: #fff8ef; color: #784316; font-size: .85rem; }
@keyframes ppq-image-loading { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ppq-question-loading::before { animation: none !important; } }
.ppq-compact-workspace .ppq-options { flex-direction: row; gap: .5rem; margin: .25rem 0; }
.ppq-compact-workspace .ppq-option-mcq { flex: 1; min-width: 60px; justify-content: center; }
.ppq-compact-workspace .ppq-option-mcq > span:empty { display: none; }
.ppq-compact-workspace .ppq-scale-legend { font-size: .93rem; line-height: 1.5; gap: .3rem; }
.ppq-compact-workspace .ppq-competence { padding-top: .65rem; gap: .5rem; }
.ppq-compact-workspace .ppq-competence-prompt { font-size: 1.1rem; }
.ppq-compact-workspace .ppq-dash { padding: .8rem; }
.ppq-compact-workspace .ppq-dash h3 { font-size: 1rem; }
.ppq-right-column { min-width: 0; display: flex; flex-direction: column; gap: .65rem; }
.ppq-side-rating { padding: .75rem; border: 1px solid #b9d1e1; border-radius: 10px; background: var(--ppq-paper); }
.ppq-side-rating[hidden] { display: none; }
.ppq-side-rating-current { display: block; font-size: .85rem; color: #174d70; }
.ppq-side-rating .ppq-competence { border: 0; padding-top: .3rem; gap: .45rem; }
.ppq-side-rating .ppq-scale { gap: .25rem; }
.ppq-side-rating .ppq-scale-btn { min-width: 0; min-height: 44px; padding: .4rem 0; }
.ppq-side-rating .ppq-competence-prompt { text-align: left; }
.ppq-side-scale-help > summary { cursor: pointer; font-size: .85rem; font-weight: 600; padding: .25rem 0; }
.ppq-side-scale-help .ppq-scale-legend { margin-top: .25rem; font-size: .9rem; line-height: 1.35; color: var(--ppq-ink2); }
.ppq-side-rating .ppq-next { width: 100%; min-height: 44px; margin: 0; }
@media (min-width: 821px) {
  .ppq-compact-workspace { height: 100%; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
  .ppq-compact-workspace .ppq-header { flex: 0 0 auto; position: relative; max-height: 35dvh; overflow: visible; }
  .ppq-compact-workspace .ppq-filters { overflow: visible; }
  .ppq-compact-workspace .ppq-layout { flex: 1 1 auto; min-height: 0; overflow: hidden; grid-template-columns: minmax(0, 1fr) clamp(270px, 23vw, 350px); align-items: stretch; }
  .ppq-compact-workspace .ppq-centre,
  .ppq-compact-workspace .ppq-dash { min-height: 0; height: 100%; max-height: none; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; position: static; }
  .ppq-compact-workspace .ppq-centre { scroll-behavior: auto; }
  .ppq-compact-workspace .ppq-right-column { min-height: 0; height: 100%; overflow: hidden; }
  .ppq-compact-workspace .ppq-right-column > .ppq-side-rating { flex: 0 0 auto; max-height: 70%; overflow-y: auto; overscroll-behavior: contain; }
  .ppq-compact-workspace .ppq-right-column > .ppq-dash { flex: 1 1 auto; height: auto; }
}
@media (max-width: 820px) {
  .ppq-side-rating { position: fixed; bottom: 0; left: 0; right: 0; z-index: 140; max-height: 48dvh; overflow-y: auto; padding: .4rem .65rem; border-radius: 10px 10px 0 0; box-shadow: 0 -3px 14px rgba(0,0,0,.1); }
  .ppq-side-rating .ppq-competence { display: grid; grid-template-columns: 1fr auto; gap: .2rem .5rem; }
  .ppq-side-rating .ppq-competence-prompt { grid-column: 1; font-size: .85rem; }
  .ppq-side-rating .ppq-scale { grid-column: 1; grid-row: 2; }
  .ppq-side-rating .ppq-next { grid-column: 2; grid-row: 2; padding: .4rem .6rem; font-size: .85rem; }
  .ppq-side-scale-help { grid-column: 1 / -1; }
  .ppq-side-scale-help .ppq-scale-legend { max-height: 22dvh; overflow-y: auto; }
  .ppq-side-rating-open { padding-bottom: 165px; }
  .ppq-compact-workspace .ppq-card { padding: .65rem; }
  .ppq-compact-workspace .ppq-stem > .ppq-crop { max-height: 70dvh; }
  .ppq-compact-workspace .physics-context-images { grid-template-columns: minmax(0, 1fr); }
  .ppq-compact-workspace .ppq-part-chip { min-height: 44px; }
}
/* Smith, 2026-09-30: after Send, only the thanks and a Close remain. */
.ppq-problem-done { text-align: center; }
.ppq-problem-done .ppq-problem-final { font-size: 1.15rem; font-weight: 600; margin: .5rem 0 0; }
.ppq-problem-done .ppq-problem-actions { justify-content: center; }

/* Phone rules (d050, d051) sit last so they override the earlier workspace rules at equal specificity. */
/* Smith, 2026-10-10: on a phone the reason grid swallowed the question. Below 700px the
   strip is one slim row, "Report a problem" and Draw; the tap opens the reasons above it
   as a short two-column list, and choosing one (or tapping again) closes it. */
.ppq-report-toggle { display: none; }
@media (max-width: 700px) {
  .ppq-toolbar.ppq-question-tools, .ppq-compact-question-header .ppq-toolbar.ppq-question-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem; padding: .3rem .5rem; }
  .ppq-toolbar .ppq-btn-mini, .ppq-question-tools .ppq-btn-mini { min-height: 34px; padding: .25rem .65rem; font-size: .82rem; }
  .ppq-toolbar .ppq-report-toggle { display: inline-flex; align-items: center; color: var(--ppq-ink2); }
  .ppq-toolbar .ppq-report-toggle[aria-expanded="true"] { border-color: var(--ppq-accent); color: var(--ppq-accent); }
  .ppq-toolbar > .ppq-report-block { display: none; }
  .ppq-toolbar.ppq-report-open > .ppq-report-block { display: block; order: -1; flex: 1 0 100%; padding: .45rem .5rem; }
  .ppq-report-open .ppq-report-lead { max-width: none; margin-bottom: .35rem; font-size: .78rem; text-align: left; }
  .ppq-report-open .ppq-report-groups { display: block; }
  .ppq-report-open .ppq-report-group { display: block; }
  .ppq-report-open .ppq-report-group + .ppq-report-group { margin-top: .4rem; padding: .4rem 0 0; border-left: 0; border-top: 1px solid var(--ppq-line); }
  .ppq-report-open .ppq-report-group-name { display: block; margin-bottom: .25rem; font-size: .72rem; }
  .ppq-report-open .ppq-report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; }
  .ppq-report-open .ppq-report-reason { min-height: 36px; font-size: .8rem; white-space: normal; }
}

/* d051 (Smith, 2026-10-10: "Tighten everything else on the phone"). Below 700px:
   the header is one short block, an empty attempt history disappears, the three
   question buttons share one row without their keyboard keys, the keyboard hint
   goes, a picture opens full screen at its own size to pan and read, and a line
   under the pictures says so. Wider screens are unchanged. */
@media (max-width: 700px) {
  .ppq-compact-workspace .ppq-header { padding: .35rem .55rem; gap: .25rem .5rem; align-items: center; }
  .ppq-compact-workspace .ppq-title { flex: 1 1 auto; font-size: .92rem; line-height: 1.2; }
  .ppq-compact-workspace .ppq-title a { min-height: 0; }
  .ppq-compact-workspace .ppq-filter-toggle { min-height: 32px; padding: .2rem .55rem; font-size: .78rem; }
  .ppq-compact-workspace .ppq-header .physics-account { flex: 1 1 100%; flex-wrap: nowrap; justify-content: flex-start; gap: .5rem; padding: 0; border: 0; }
  .ppq-compact-workspace .physics-person { flex: 0 1 auto; min-width: 0; padding: .12rem .45rem; font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ppq-compact-workspace .physics-build { font-size: .62rem; }
  .ppq-compact-workspace .ppq-layout { padding: .4rem .3rem; }
  .ppq-compact-workspace .ppq-card { padding: .5rem .55rem; gap: .45rem; }
  .ppq-compact-workspace .ppq-meta { font-size: .66rem; }
  .ppq-attempt-history:has(.ppq-attempt-history-empty) { display: none; }
  .ppq-compact-question-header .ppq-question-target-row > .ppq-target-part { font-size: .95rem; }
  .ppq-key { display: none; }
  .ppq-card > .ppq-kb-hint { display: none; }
  .ppq-card > .ppq-controls { flex-wrap: nowrap; gap: .35rem; }
  .ppq-card > .ppq-controls .ppq-btn { flex: 0 1 auto; min-height: 44px; padding: .4rem .7rem; font-size: .92rem; white-space: nowrap; }
  .ppq-card > .ppq-controls .ppq-reveal { flex: 1 1 auto; }
  .ppq-stem:has(img)::after, .ppq-markscheme:has(img)::after { content: "Tap a picture to see it full size"; display: block; margin-top: .15rem; text-align: center; font-size: .7rem; color: var(--ppq-muted); }
  .ppq-marksbar-prompt { font-size: .98rem; }
  .ppq-modal:not(.minimized) { padding: 0; }
  .ppq-modal:not(.minimized) .ppq-modal-content { width: 100vw; max-width: none; height: 100dvh; max-height: none; border-radius: 0; }
  .ppq-modal-body { padding: .5rem; overflow: auto; }
  .ppq-modal-img { max-width: none; }
}
