/* Process Strips: the Storyboard Studio 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. */
.pst { 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;
  --pst-panel: rgba(255, 253, 248, .95); --pst-line: #b9a98e; --pst-soft: #4f4335; --pst-accent: #2f5d8a; --pst-accent-bg: #e3eef8;
  --pst-ok: #17663a; --pst-ok-bg: #e3f6e8; --pst-bad: #a3241f; --pst-bad-bg: #fde7e4; --pst-film: #2b2f3a; --pst-slide: #fffaf0; }
html[data-theme="dark"] .pst { color: #eef2f6; --pst-panel: rgba(30, 36, 46, .95); --pst-line: #56657a; --pst-soft: #c9d3de; --pst-accent: #9cc7ee; --pst-accent-bg: #1f3347;
  --pst-ok: #7fdca0; --pst-ok-bg: #173d27; --pst-bad: #ffb4a8; --pst-bad-bg: #4a1e1a; --pst-film: #12141a; }
.pst *, .pst *::before, .pst *::after { box-sizing: border-box; }
.pst p, .pst ol, .pst figure { margin: 0; padding: 0; }
.pst ol { list-style: none; }
.pst button { font: inherit; color: inherit; }
.pst-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pst-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
html[data-theme="dark"] .pst-bd-wall { fill: url(#pst-walldark); }
html[data-theme="dark"] .pst-bd-desk { fill: url(#pst-deskdark); }
html[data-theme="dark"] .pst-bd-lines, html[data-theme="dark"] .pst-bd-reel { opacity: .12; }
.pst > :not(.pst-backdrop) { position: relative; }

/* slides: every picture sits on a lit cream slide (the same in light and dark) */
.pst-slide { display: block; aspect-ratio: 16 / 10; background: var(--pst-slide, #fffaf0); border-radius: 8px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(60, 50, 36, .3), 0 1px 3px rgba(0, 0, 0, .14); flex: none; }
.pst-pic { display: block; width: 100%; height: 100%; }

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

.pst-main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.pst-k { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin-bottom: 6px; }
.pst-k b { font-size: 18px; letter-spacing: .01em; }
.pst-k span { color: var(--pst-soft); }
.pst-field > .pst-k { font-weight: 800; }
.pst-msg { min-height: 0; font-weight: 700; color: var(--pst-bad); }
.pst-msg:empty { display: none; }

/* ── the film strip ── */
.pst-film { padding: 8px 12px 12px; border-radius: 14px; background: var(--pst-film); color: #f3ecdf; box-shadow: 0 6px 16px rgba(0, 0, 0, .22);
  background-image: radial-gradient(circle, rgba(243, 236, 223, .5) 0 3px, transparent 3.5px), radial-gradient(circle, rgba(243, 236, 223, .5) 0 3px, transparent 3.5px);
  background-size: 22px 8px, 22px 8px; background-position: 4px 3px, 4px calc(100% - 3px); background-repeat: repeat-x; }
.pst-film .pst-k { margin: 4px 0 6px; }
.pst-film .pst-k span { color: #d9d0bf; }
.pst-strip { display: flex; align-items: stretch; gap: 4px; }
.pst-frame { position: relative; flex: 1 1 0; min-width: 0; max-width: 168px; border-radius: 10px; }
.pst-join { flex: none; align-self: center; width: 20px; text-align: center; font-size: 20px; font-weight: 800; color: #d9d0bf; }
.pst-strip--named .pst-join { align-self: flex-start; margin-top: 26px; }
.pst-join--loop { width: auto; display: flex; flex-direction: column; align-items: center; line-height: 1.05; padding-left: 2px; }
.pst-join--loop span { font-size: 18px; font-weight: 700; white-space: nowrap; }
.pst-frame.is-empty { aspect-ratio: 16 / 10; display: grid; place-items: center; border: 2.5px dashed rgba(243, 236, 223, .55); background: rgba(255, 255, 255, .06); min-height: 48px; }
.pst-frame.is-empty .pst-frame-n { position: static; background: none; color: #d9d0bf; font-size: 22px; box-shadow: none; }
html .pst-frame-btn { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; border-radius: 10px; cursor: grab; }
span.pst-frame-btn { cursor: default; }
.pst-frame-btn .pst-slide { width: 100%; border-radius: 10px; }
/* number and ✓/✗ sit in a bar above the picture, never on it */
.pst-frame-bar { display: flex; align-items: center; justify-content: space-between; gap: 4px; height: 28px; margin-bottom: 3px; }
.pst-frame-n { min-width: 26px; height: 26px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; background: #ffd54a; color: #14161c; font-size: 18px; font-weight: 800; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.pst-frame-name .pst-frame-n { display: inline-grid; vertical-align: middle; margin-right: 5px; }
.pst-frame-name { display: block; margin-top: 5px; font-size: 18px; font-weight: 700; line-height: 1.2; text-align: center; overflow-wrap: break-word; }
.pst-frame.is-over { outline: 4px solid #ffd54a; outline-offset: 2px; }
.pst-frame-btn:focus-visible, .pst-card:focus-visible, .pst-choice:focus-visible, .pst-say:focus-visible { outline: 4px solid #ffb000; outline-offset: 2px; }
.pst-mark { display: none; }
.pst-frame.is-ok .pst-mark, .pst-frame.is-bad .pst-mark { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 20px; font-weight: 800; color: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.pst-frame.is-ok .pst-mark { background: #17663a; }
.pst-frame.is-bad .pst-mark { background: #a3241f; }
.pst-frame.is-ok .pst-slide { box-shadow: 0 0 0 3.5px #5fd08a; }
.pst-frame.is-bad .pst-slide { box-shadow: 0 0 0 3.5px #ff8c80; }
.pst-frame.is-bad .pst-frame-btn { opacity: 1; }
/* a named strip of 7 or 8 cards runs in two rows of four so every name fits on whole words */
.pst--n7 .pst-strip--named, .pst--n8 .pst-strip--named { flex-wrap: wrap; justify-content: center; row-gap: 6px; }
.pst--n7 .pst-strip--named .pst-frame, .pst--n8 .pst-strip--named .pst-frame { flex: 0 0 calc((100% - 4 * 29px) / 4); max-width: none; }
.pst--n7 .pst-strip--named .pst-frame-btn, .pst--n8 .pst-strip--named .pst-frame-btn { width: min(128px, 100%); margin: 0 auto; }
/* out: the picked pair is bracketed (where they are, not whether they are right) */
.pst-frame.is-picked .pst-slide { box-shadow: 0 0 0 4px #ffd54a; }
.pst-frame.is-picked .pst-frame-name { color: #ffd54a; }
.pst-frame.is-fixed .pst-slide { box-shadow: 0 0 0 4px #5fd08a; }
.pst-frame.is-fixed .pst-frame-name { color: #9be8b6; }
.pst.is-locked .pst-frame-btn { cursor: default; opacity: 1; }

/* ── picture cards (the tray) ── */
.pst-table { flex: 1 1 auto; min-height: 0; padding: 8px 12px 10px; border-radius: 14px; background: var(--pst-panel); border: 1.5px solid var(--pst-line); display: flex; flex-direction: column; }
.pst-tray { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-content: start; grid-auto-rows: minmax(0, auto); }
html .pst-card { position: relative; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px; text-align: left; border-radius: 12px; border: 2px solid var(--pst-line); background: var(--tlg-surface, #fff); cursor: pointer; }
html[data-theme="dark"] .pst-card, html[data-theme="dark"] .pst-choice { background: #252c38; }
.pst-card .pst-slide { width: 58%; max-width: 230px; }
.pst-card-name { flex: 1 1 0; min-width: 0; font-size: 18px; font-weight: 700; line-height: 1.2; overflow-wrap: break-word; }
.pst-card:hover:not(:disabled) { border-color: var(--pst-accent); background: var(--pst-accent-bg); }
.pst-card.is-placed { border-style: dashed; }
.pst-card.is-placed .pst-slide { opacity: .45; }
.pst-card.is-placed .pst-card-name { color: var(--pst-soft); }
.pst-num { display: inline-grid; vertical-align: middle; margin-right: 6px; min-width: 28px; height: 28px; padding: 0 8px; place-items: center; border-radius: 999px; background: #ffd54a; color: #14161c; font-size: 20px; font-weight: 800; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.pst-card.is-dragging, .pst-frame-btn.is-dragging { opacity: .4; }
.pst--n7 .pst-tray, .pst--n8 .pst-tray { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pst--n7 .pst-card, .pst--n8 .pst-card { flex-direction: column; align-items: stretch; gap: 4px; padding: 6px 6px 4px; text-align: center; }
.pst--n7 .pst-card .pst-slide, .pst--n8 .pst-card .pst-slide { width: 70%; max-width: 172px; margin: 0 auto; }
.pst--n7 .pst-card .pst-card-name, .pst--n8 .pst-card .pst-card-name { flex: none; }
@media (pointer: fine), (min-width: 901px) { html .pst-card:not(:disabled), html .pst-frame-btn { touch-action: none; } }
html .pst-ghost { position: fixed; z-index: 1000; pointer-events: none; width: 150px; transform: translate(-50%, -50%) rotate(-3deg); padding: 5px; border-radius: 12px; background: #fff; box-shadow: 0 10px 24px rgba(0, 0, 0, .35); }
html .pst-ghost .pst-slide { display: block; aspect-ratio: 16 / 10; }
html .pst-ghost svg { display: block; width: 100%; height: 100%; }

/* ── next: big picture, then three picture choices ── */
.pst--next .pst-main { flex-direction: row; align-items: stretch; gap: 10px; }
.pst-now { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; padding: 8px 12px 10px; border-radius: 14px; background: var(--pst-panel); border: 1.5px solid var(--pst-line); }
.pst-bigslide { flex: 1 1 auto; min-height: 0; display: grid; place-items: center; background: #fbf7ee; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(60, 50, 36, .3); }
.pst-bigslide svg { display: block; width: 100%; height: 100%; max-height: 100%; }
.pst-caption { margin-top: 6px; text-align: center; font-size: 20px; font-weight: 800; }
.pst-then { flex: none; align-self: center; display: flex; flex-direction: column; align-items: center; font-size: 34px; font-weight: 800; color: var(--pst-accent); line-height: 1; padding: 6px 8px; border-radius: 12px; background: var(--pst-panel); }
.pst-then span { font-size: 18px; }
.pst-pick { padding: 8px 12px 10px; border-radius: 14px; background: var(--pst-panel); border: 1.5px solid var(--pst-line); }
.pst--next .pst-pick { flex: 0 0 400px; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.pst-choices { display: grid; gap: 8px; }
.pst-choices--out { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html .pst-choice { position: relative; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 7px 44px 7px 8px; text-align: left; border-radius: 12px; border: 2.5px solid var(--pst-line); background: var(--tlg-surface, #fff); cursor: pointer; }
.pst-choice .pst-slide { width: 136px; }
.pst-choice:hover:not(:disabled) { border-color: var(--pst-accent); }
.pst-choice[aria-checked="true"] { border-color: var(--pst-accent); background: var(--pst-accent-bg); box-shadow: 0 0 0 3px var(--pst-accent); }
.pst-choice[aria-checked="true"]::after { content: "●"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--pst-accent); }
.pst-choice.is-right, .pst-choice.is-wrong { box-shadow: none; }
.pst-choice.is-right::after, .pst-choice.is-wrong::after { content: none; }
.pst-choice.is-right { border-color: var(--pst-ok); background: var(--pst-ok-bg); }
.pst-choice.is-wrong { border-color: var(--pst-bad); background: var(--pst-bad-bg); border-style: dashed; }
.pst-choice.is-right .pst-mark, .pst-choice.is-wrong .pst-mark { display: grid; place-items: center; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; font-size: 20px; font-weight: 800; color: #fff; }
.pst-choice.is-right .pst-mark { background: #17663a; }
.pst-choice.is-wrong .pst-mark { background: #a3241f; }
.pst-choice:disabled { cursor: default; opacity: 1; }
.pst-pair { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pst-pair-n { color: var(--pst-soft); }
.pst-pair-names { font-weight: 700; line-height: 1.2; overflow-wrap: break-word; }

/* ── reveal: why each step leads to the next ── */
.pst-reveal { padding: 8px 12px 10px; border-radius: 14px; background: var(--pst-panel); border: 1.5px solid var(--pst-line); }
.pst--order .pst-reveal { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.pst--next .pst-reveal { padding: 0; border: 0; background: none; }
.pst-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; }
.pst-steps--one { grid-template-columns: minmax(0, 1fr); }
.pst-step { display: flex; align-items: flex-start; gap: 10px; }
.pst-step-pics { flex: none; display: flex; align-items: center; gap: 4px; }
.pst-step .pst-slide { width: 78px; }
.pst--order .pst-step-pics .pst-step-arrow, .pst--order .pst-step-pics .pst-slide + .pst-step-arrow + .pst-slide { display: none; }
.pst-step-arrow { font-weight: 800; color: var(--pst-soft); }
.pst-step-t { min-width: 0; font-size: 18px; line-height: 1.25; }
.pst-step-t b { display: block; }
.pst-step-n { display: inline-grid; place-items: center; min-width: 26px; height: 26px; margin-right: 6px; padding: 0 5px; border-radius: 999px; background: #ffd54a; color: #14161c; font-size: 18px; font-weight: 800; vertical-align: 1px; }
.pst--next .pst-step { flex-direction: column; gap: 6px; }
.pst--next .pst-step .pst-slide { width: 96px; }

/* ── Briefing example ── */
.pst-example { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: center; gap: 6px; }
.pst-example figure { margin: 0; flex: 1 1 130px; max-width: 190px; text-align: center; font-size: 16px; }
.pst-example .pst-slide { width: 100%; }
.pst-example .pst-slide svg { max-height: none; height: 100%; }
.pst-example figcaption { margin-top: 4px; line-height: 1.2; }
.pst-ex-arrow { align-self: center; font-size: 22px; font-weight: 800; margin-bottom: 30px; }
.ps-brief--drawer .pst-example figure { flex-basis: 40%; }
.ps-brief--drawer .pst-ex-arrow { display: none; }

/* ── Foundations: 18 px for the shell's words beside the play area too ── */
body[data-activity="process-strips"] .ps-bubble, body[data-activity="process-strips"] .ps-cust-detail, body[data-activity="process-strips"] .ps-feedback,
body[data-activity="process-strips"] .ps-hint, body[data-activity="process-strips"] .ps-gloss, body[data-activity="process-strips"] .ps-cust-who,
body[data-activity="process-strips"] .ps-nudge { font-size: 18px; line-height: 1.3; }
body[data-activity="process-strips"] .ps-cust-detail { color: var(--tlg-text); }
body[data-activity="process-strips"] .ps-say { width: 48px; height: 48px; font-size: 22px; margin: -2px -4px 4px 8px; }
body[data-activity="process-strips"] .ps-hint-btn { min-height: 48px; }
body[data-activity="process-strips"] .ps-hint .ps-hint-note { font-size: 16px; }

/* after Check the how-to line and the used hint are no longer needed: give their room to the feedback */
body[data-activity="process-strips"] .ps-side:has(.ps-feedback:not([hidden])) .ps-cust-detail,
body[data-activity="process-strips"] .ps-side:has(.ps-feedback:not([hidden])) .ps-hint { display: none; }

/* ── narrower screens: the shell stacks the page; the stage flows and may scroll ── */
@media (max-width: 1180px) and (min-width: 901px) {
  /* a narrower stage: the play area may scroll inside the stage instead of squeezing the pictures */
  .pst { overflow-y: auto; }
  .pst-main { flex: none; }
  .pst--order .pst-reveal { overflow: visible; }
  .pst--next .pst-main { min-height: 440px; }
  .pst-then { display: none; }
  .pst--next .pst-pick { flex-basis: 292px; }
  .pst-choice .pst-slide { width: 92px; }
  .pst-choice { padding-right: 40px; gap: 8px; }
  /* 7 or 8 frames in one row would be under 48 px tall here: two rows of four */
  .pst--n7 .pst-strip, .pst--n8 .pst-strip { flex-wrap: wrap; row-gap: 6px; }
  .pst--n7 .pst-strip > .pst-frame, .pst--n8 .pst-strip > .pst-frame { flex: 0 0 calc((100% - 4 * 29px) / 4); max-width: 150px; }
  .pst--n7 .pst-strip--named > .pst-frame, .pst--n8 .pst-strip--named > .pst-frame { max-width: none; }
}
@media (max-width: 900px) {
  .pst { position: relative; inset: auto; overflow: visible; padding: 10px 10px 16px; }
  .pst-backdrop { position: absolute; }
  .pst-head { flex-wrap: wrap; }
  .pst-strip { flex-wrap: wrap; row-gap: 8px; }
  .pst-frame { flex: 0 0 calc((100% - 4 * 29px) / 4); max-width: none; }
  .pst--n5 .pst-frame, .pst--n6 .pst-frame { flex-basis: calc((100% - 3 * 29px) / 3); }
  .pst-strip--named .pst-frame, .pst--n5 .pst-strip--named .pst-frame, .pst--n6 .pst-strip--named .pst-frame, .pst--n7 .pst-strip--named .pst-frame, .pst--n8 .pst-strip--named .pst-frame { flex: 0 0 calc((100% - 2 * 29px) / 2); max-width: none; }
  .pst--n7 .pst-strip--named .pst-frame-btn, .pst--n8 .pst-strip--named .pst-frame-btn { width: 100%; }
  .pst-tray, .pst--n7 .pst-tray, .pst--n8 .pst-tray { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pst-card { flex-direction: column; align-items: stretch; text-align: center; gap: 4px; }
  .pst-card .pst-slide, .pst--n7 .pst-card .pst-slide, .pst--n8 .pst-card .pst-slide { width: 100%; max-width: 220px; margin: 0 auto; }
  .pst-card .pst-card-name { flex: none; }
  .pst--next .pst-main { flex-direction: column; }
  .pst--next .pst-pick { flex: none; }
  .pst-bigslide svg { height: auto; }
  .pst-then { flex-direction: row; gap: 8px; font-size: 26px; transform: none; }
  .pst-choices--out { grid-template-columns: minmax(0, 1fr); }
  .pst-steps { grid-template-columns: minmax(0, 1fr); }
  .pst--order .pst-reveal { overflow: visible; }
  .pst--next .pst-step { flex-direction: row; }
}
@media (max-width: 520px) {
  .pst-strip:not(.pst-strip--named) > .pst-frame { flex-basis: calc((100% - 3 * 29px) / 3); }
  .pst--next .pst-step, .pst-step { flex-direction: column; gap: 6px; }
  .pst-choice .pst-slide { width: 112px; }
}
@media (min-width: 901px) and (max-width: 1100px) {
  .pst-card { gap: 8px; }
  .pst-card .pst-slide { width: 46%; }
}
@media (prefers-reduced-motion: no-preference) {
  .pst-card, .pst-choice { transition: border-color .12s, background-color .12s; }
  .pst-frame.is-fixed .pst-slide { animation: pst-pop .5s ease-out; }
  @keyframes pst-pop { 0% { transform: scale(.86); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
}
