/* Particle Picture Match: the Zoom Lab's viewing table inside the practice shell's stage (about 1066 x 628 at 1366 x 768).
 * Track F (Foundations): every word in the play area is 18 px or more; every tap target is 48 px or more. */
.ppm { position: absolute; inset: 0; overflow: hidden; display: flex; flex-direction: column; gap: 8px; padding: 10px 14px 8px; color: #1f2933; font-size: 18px; line-height: 1.3;
  --ppm-panel: rgba(255, 255, 255, .94); --ppm-line: #b8c6d4; --ppm-soft: #44515f; --ppm-accent: #1f6f78; --ppm-accent-bg: #def1f2;
  --ppm-ok: #17663a; --ppm-ok-bg: #e3f6e8; --ppm-bad: #a3241f; --ppm-bad-bg: #fde7e4;
  --ppm-win: #eef4fa; --ppm-edge: #20242a; --ppm-glass-edge: #6f8296; --ppm-motion: #8396ab; --ppm-ink: #1f2933; --ppm-arrow: #1d4f91;
  background: linear-gradient(180deg, #f3f7f9, #e4ecf1); }
html[data-theme="dark"] .ppm { color: #eef2f6; background: linear-gradient(180deg, #19212b, #121821);
  --ppm-panel: rgba(30, 38, 49, .96); --ppm-line: #4b5d72; --ppm-soft: #c3cfdb; --ppm-accent: #8fd3d9; --ppm-accent-bg: #173a3e;
  --ppm-ok: #7fdca0; --ppm-ok-bg: #173d27; --ppm-bad: #ffb4a8; --ppm-bad-bg: #4a1e1a;
  --ppm-win: #1d2733; --ppm-edge: #0b0d10; --ppm-glass-edge: #8ea3b9; --ppm-motion: #7287a0; --ppm-ink: #eef2f6; --ppm-arrow: #9cc8ff; }
.ppm *, .ppm *::before, .ppm *::after { box-sizing: border-box; }
.ppm p, .ppm ul, .ppm figure { margin: 0; padding: 0; }
.ppm ul { list-style: none; }
.ppm button { font: inherit; color: inherit; }
.ppm-pic { display: block; width: 100%; height: auto; }
.ppm-frame { display: block; border-radius: 12px; }

/* ── header row ── */
.ppm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; flex: none; }
.ppm p.ppm-title { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 6px 14px; border-radius: 12px; background: var(--ppm-panel); border: 1.5px solid var(--ppm-line); }
.ppm-title b { font-size: 20px; }
.ppm-title span { color: var(--ppm-soft); }
html .ppm-say { flex: none; min-height: 48px; padding: 8px 14px; border-radius: 999px; border: 2px solid var(--ppm-line); background: var(--ppm-panel); font-weight: 700; cursor: pointer; white-space: nowrap; }
.ppm-say[aria-pressed="true"] { border-color: var(--ppm-accent); }
.ppm-say:hover { background: var(--ppm-accent-bg); }
.ppm-say:focus-visible, .ppm-choice:focus-visible { outline: 4px solid #ffb000; outline-offset: 2px; }

.ppm-main { flex: 1 1 auto; min-height: 0; display: grid; gap: 12px; }
.ppm-k { margin-bottom: 6px; }
.ppm-k b { font-size: 18px; }
.ppm-msg { font-weight: 700; color: var(--ppm-bad); flex: none; }
.ppm-msg:empty { display: none; }
.ppm-figure { position: relative; min-width: 0; }
.ppm-cap { margin-top: 4px; text-align: center; }
.ppm-count { margin-top: 4px; text-align: center; font-weight: 800; color: var(--ppm-accent); }
.ppm-count[hidden] { display: none; }

/* ── the key ── */
.ppm-key { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; padding: 6px 12px; border-radius: 12px; background: var(--ppm-panel); border: 1.5px solid var(--ppm-line); }
.ppm-key li { display: flex; align-items: center; gap: 6px; }
.ppm-key .ppm-key-h { font-weight: 800; }
.ppm-swatch { width: 36px; height: 36px; flex: none; }

/* ── word: picture(s) on the left, three words + key on the right ── */
.ppm--word .ppm-main { grid-template-columns: minmax(0, 1fr) 300px; }
.ppm-view { min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px; border-radius: 16px; background: var(--ppm-panel); border: 1.5px solid var(--ppm-line); }
.ppm-figure--big { width: 100%; max-width: calc((100vh - 290px) * 420 / 270); }
.ppm-pairrow { width: 100%; display: flex; align-items: center; gap: 6px; }
.ppm-pairrow .ppm-figure { flex: 1 1 0; }
.ppm-arrow { flex: none; display: flex; flex-direction: column; align-items: center; font-size: 30px; font-weight: 800; color: var(--ppm-accent); line-height: 1; }
.ppm-arrow span { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.ppm--word .ppm-pick { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.ppm-choices--word { display: flex; flex-direction: column; gap: 10px; }
.ppm--word .ppm-key { flex-direction: column; align-items: flex-start; }

/* ── choices ── */
html .ppm-choice { position: relative; display: flex; align-items: center; justify-content: center; min-height: 64px; padding: 8px 14px; border-radius: 14px; border: 2.5px solid var(--ppm-line); background: var(--ppm-panel); cursor: pointer; text-align: center; box-shadow: 0 2px 5px rgba(0, 0, 0, .08); }
.ppm-choice:hover:not(:disabled) { border-color: var(--ppm-accent); background: var(--ppm-accent-bg); }
.ppm-choice[aria-checked="true"] { border-color: var(--ppm-accent); background: var(--ppm-accent-bg); box-shadow: 0 0 0 3px var(--ppm-accent); }
.ppm-word { font-size: 22px; font-weight: 800; }
.ppm-choice:disabled { cursor: default; opacity: 1; }
.ppm-mark { display: none; }
.ppm-choice.is-right, .ppm-choice.is-wrong { opacity: 1; }
.ppm-choice.is-right { border-color: var(--ppm-ok); background: var(--ppm-ok-bg); box-shadow: 0 0 0 3px var(--ppm-ok); }
.ppm-choice.is-wrong { border-style: dashed; border-color: var(--ppm-bad); background: var(--ppm-bad-bg); box-shadow: none; }
.ppm-choice.is-right .ppm-mark, .ppm-choice.is-wrong .ppm-mark { display: grid; place-items: center; position: absolute; right: 8px; top: 8px; width: 34px; height: 34px; border-radius: 50%; font-size: 22px; font-weight: 800; color: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.ppm-choice.is-right .ppm-mark { background: #17663a; }
.ppm-choice.is-wrong .ppm-mark { background: #a3241f; }
.ppm--word .ppm-choice .ppm-mark { position: static; margin-left: 10px; }

/* ── pick: before (and key) on top, three pictures below ── */
.ppm--pick .ppm-main { grid-template-rows: auto minmax(0, 1fr); }
.ppm--identity.ppm--pick .ppm-main { align-content: center; grid-template-rows: auto auto; gap: 18px; }
.ppm-before { display: flex; align-items: center; gap: 14px; min-height: 0; }
.ppm-before .ppm-figure { width: min(330px, 34%); flex: none; }
.ppm-before .ppm-cap { position: absolute; left: 8px; top: 6px; margin: 0; padding: 0 8px; border-radius: 8px; background: var(--ppm-panel); }
.ppm-then { font-size: 22px; font-weight: 800; color: var(--ppm-accent); white-space: nowrap; }
.ppm-then span { font-size: 28px; }
.ppm-before .ppm-key { flex: 1 1 auto; align-self: center; }
.ppm--identity .ppm-before .ppm-key { flex: 0 1 auto; }
.ppm--pick .ppm-pick { min-height: 0; display: flex; flex-direction: column; }
.ppm-choices--pick { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ppm-choices--pick .ppm-choice { flex-direction: column; justify-content: flex-start; gap: 4px; padding: 8px; }
.ppm-choices--pick .ppm-frame { width: 100%; }
.ppm-optlabel { font-weight: 800; font-size: 20px; }
.ppm-choices--pick .ppm-count { margin: 0; }

/* ── Briefing example ── */
.ppm-example { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 10px; font-size: 18px; }
.ppm-example figure { flex: 1 1 220px; max-width: 340px; margin: 0; text-align: center; }
.ppm-example .ppm-frame svg { display: block; width: 100%; height: auto; }
.ppm-ex-arrow { font-size: 30px; font-weight: 800; color: #1f6f78; }
.ppm-example .ppm-key { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; margin: 4px 0 0; padding: 6px 12px; border-radius: 12px; border: 1.5px solid #b8c6d4; width: 100%; justify-content: center; }
.ppm-example .ppm-key li { display: flex; align-items: center; gap: 6px; }
.ppm-example .ppm-swatch { width: 36px; height: 36px; }
.ppm-start { width: 100%; height: 100%; display: block; }
:root { --ppm-win: #eef4fa; --ppm-edge: #20242a; --ppm-glass-edge: #6f8296; --ppm-motion: #8396ab; --ppm-ink: #1f2933; --ppm-arrow: #1d4f91; }
html[data-theme="dark"] { --ppm-win: #1d2733; --ppm-edge: #0b0d10; --ppm-glass-edge: #8ea3b9; --ppm-motion: #7287a0; --ppm-ink: #eef2f6; --ppm-arrow: #9cc8ff; }

/* ── the shell's customer column at 18 px for Foundations (shell request filed) ── */
body[data-activity="particle-picture-match"] .ps-bubble, body[data-activity="particle-picture-match"] .ps-cust-detail, body[data-activity="particle-picture-match"] .ps-feedback,
body[data-activity="particle-picture-match"] .ps-hint, body[data-activity="particle-picture-match"] .ps-gloss, body[data-activity="particle-picture-match"] .ps-cust-who,
body[data-activity="particle-picture-match"] .ps-nudge { font-size: 18px; line-height: 1.3; }
body[data-activity="particle-picture-match"] .ps-cust-detail { color: var(--tlg-text); }
body[data-activity="particle-picture-match"] .ps-say { width: 48px; height: 48px; font-size: 22px; }
body[data-activity="particle-picture-match"] .ps-hint-btn { min-height: 48px; }
body[data-activity="particle-picture-match"] .ps-hint .ps-hint-note { font-size: 16px; }
/* after Check the feedback needs the room: the how-to line and the used hint step aside */
body[data-activity="particle-picture-match"] .ps-side:has(.ps-feedback:not([hidden])) .ps-cust-detail,
body[data-activity="particle-picture-match"] .ps-side:has(.ps-feedback:not([hidden])) .ps-hint { display: none; }

/* ── narrow screens: everything stacks and the page scrolls (shell behaviour under 900 px) ── */
@media (max-width: 899px) {
  .ppm { position: relative; inset: auto; overflow: visible; }
  .ppm--word .ppm-main, .ppm--pick .ppm-main { display: flex; flex-direction: column; }
  .ppm-figure--big { max-width: none; }
  .ppm-before { flex-wrap: wrap; }
  .ppm-before .ppm-figure { width: min(420px, 100%); }
  .ppm-then { display: none; }
}
@media (max-width: 599px) {
  .ppm-pairrow { flex-direction: column; }
  .ppm-arrow { transform: rotate(90deg); }
  .ppm-choices--pick { grid-template-columns: minmax(0, 1fr); }
  .ppm-title b { font-size: 18px; }
  .ppm-head { flex-wrap: wrap; }
}

/* ── state pictures are taller (a jar, 332 x 300): cap their height so a question still fits without scrolling ── */
@media (min-width: 900px) {
  .ppm--state .ppm-figure--big { max-width: calc((100vh - 310px) * 332 / 300); }
  .ppm--state .ppm-choices--pick .ppm-pic { width: auto; height: clamp(140px, calc(100vh - 570px), 240px); max-width: 100%; margin: 0 auto; }
  .ppm--state .ppm-before .ppm-figure { width: auto; }
  .ppm--state .ppm-before .ppm-pic { width: auto; height: clamp(130px, calc(100vh - 610px), 230px); }
}
