/* Wave Maker: the Wave Bench inside the practice shell's stage (about 1066 x 628 at 1366 x 768).
 * Foundations: every word in the play area is 18 px or more; every tap target is 48 px or more.
 * Pictures sit on a lit slide that stays the same in light and dark (the art is drawn for it).
 * Amplitude is purple (#8e24aa), wavelength blue (#1f5fbf) everywhere: arrows, stepper icons, target card. */
.wm { position: absolute; inset: 0; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; padding: 10px 14px; color: #1b2733; font-size: 18px; line-height: 1.3;
  background: linear-gradient(#eef3f8, #dde6ee);
  --wm-panel: rgba(255, 255, 255, .96); --wm-line: #a9bccb; --wm-soft: #44525f; --wm-accent: #1f5fbf; --wm-accent-bg: #e1ebf8; --wm-slide: #fbfdff; --wm-ink: #1b2733;
  --wm-amp: #8e24aa; --wm-wl: #1f5fbf; }
html[data-theme="dark"] .wm { color: #eaf0f5; background: linear-gradient(#19202a, #12171e);
  --wm-panel: rgba(30, 37, 46, .97); --wm-line: #56677a; --wm-soft: #c9d5df; --wm-accent: #8fb8f0; --wm-accent-bg: #1d2c42; }
.wm *, .wm *::before, .wm *::after { box-sizing: border-box; }
.wm p, .wm figure, .wm figcaption, .wm ol { margin: 0; padding: 0; }
.wm button { font: inherit; color: inherit; }
.wm svg { display: block; }
.wm :focus-visible { outline: 4px solid #ffb000; outline-offset: 2px; }

/* ── picture (left) ── */
.wm .wm-scenebox { container: wmscene / inline-size; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 14px; background: var(--wm-panel); border: 1.5px solid var(--wm-line); }
.wm-scene-body { flex: 0 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--wm-slide); box-shadow: inset 0 0 0 1px rgba(40, 60, 80, .2); overflow: hidden; }
.wm-pic { width: 100%; }
.wm-pic svg { width: 100%; height: auto; border-radius: 8px; }
.wm p.wm-cap { flex: none; font-weight: 600; }
.wm.is-revealed .wm-scenebox { border-color: var(--wm-accent); box-shadow: 0 0 0 3px var(--wm-accent-bg); }
/* the lane picture is tall: cap its height so the caption stays on screen */
.wm--spot .wm-pic svg, .wm-ask--most .wm-pic svg { max-height: 470px; width: auto; max-width: 100%; margin: 0 auto; }
.wm--noise .wm-pic svg, .wm--signal .wm-pic svg { max-height: 470px; width: auto; max-width: 100%; margin: 0 auto; }

/* match: − / + steppers right under the board; a wider picture column */
.wm--match { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.wm-steps { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wm-step { display: flex; flex-direction: column; gap: 6px; padding: 6px 8px; border-radius: 12px; border: 2px solid var(--wm-line); background: var(--wm-panel); }
.wm-step--amplitude { border-left: 8px solid var(--wm-amp); }
.wm-step--wavelength { border-left: 8px solid var(--wm-wl); }
.wm-step-name { display: flex; align-items: center; gap: 8px; line-height: 1.15; }
.wm-step-words { display: flex; flex-direction: column; }
.wm-step-words span { color: var(--wm-soft); }
.wm-step-ic { flex: none; display: grid; place-items: center; width: 30px; height: 30px; }
.wm-step-ic svg { width: 26px; height: 26px; }
.wm-step-ctl { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
html .wm-step-btn { flex: none; width: 52px; height: 52px; border-radius: 12px; border: 2.5px solid var(--wm-line); background: var(--wm-slide); color: var(--wm-ink); font-size: 30px; font-weight: 800; line-height: 1; cursor: pointer; display: grid; place-items: center; }
html .wm-step-btn:hover:not(:disabled) { border-color: var(--wm-accent); background: var(--wm-accent-bg); }
html .wm-step-btn:disabled { opacity: .4; cursor: default; }
html .wm.is-revealed .wm-step-btn:disabled, html .wm--readonly .wm-step-btn:disabled { opacity: .55; }
.wm-step-v { flex: 1 1 auto; min-width: 0; text-align: center; font-weight: 800; font-size: 20px; }
.wm-step.is-right { border-color: #2f9a5c; box-shadow: 0 0 0 2px #2f9a5c; }
.wm-step.is-wrong { border-color: #c4473d; box-shadow: 0 0 0 2px #c4473d; }
.wm-step.is-wrong .wm-step-v { color: #a3241f; }
html[data-theme="dark"] .wm-step.is-wrong .wm-step-v { color: #ff8a80; }

/* ── task (right) ── */
.wm-task { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 10px; container-type: inline-size; }
.wm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; min-height: 48px; flex-wrap: wrap; }
.wm p.wm-title { min-width: 0; padding: 6px 14px; border-radius: 12px; background: var(--wm-panel); border: 1.5px solid var(--wm-line); }
.wm-title b { font-size: 20px; }
html .wm-say { flex: none; min-height: 48px; padding: 8px 14px; border-radius: 999px; border: 2px solid var(--wm-line); background: var(--wm-panel); font-weight: 700; cursor: pointer; white-space: nowrap; }
.wm-say[aria-pressed="true"] { border-color: var(--wm-accent); }
.wm-say:hover { background: var(--wm-accent-bg); }
.wm-k { flex: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.wm-k span { color: var(--wm-soft); }
.wm-msg { font-weight: 700; flex: none; }
.wm-msg:empty { display: none; }
.wm button:disabled { cursor: default; }
.wm-choice:disabled { opacity: 1; }

.wm-target { flex: none; display: flex; flex-direction: column; gap: 6px; padding: 10px 14px; border-radius: 12px; background: var(--wm-panel); border: 2px solid var(--wm-line); }
.wm p.wm-target-h { font-weight: 800; }
.wm-target-row { display: flex; align-items: center; gap: 10px; }
.wm-ghost { flex: none; width: 52px; height: 14px; border-radius: 7px; background: #b3bcc6; box-shadow: inset 0 0 0 2px #7d8a97; background-image: repeating-linear-gradient(90deg, transparent 0 6px, #fff 6px 12px); background-size: 100% 3px; background-position: center; background-repeat: no-repeat; }
.wm-howto { flex: none; padding-left: 26px !important; display: flex; flex-direction: column; gap: 6px; }

.wm-choices { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
html .wm-choice { position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 12px 8px 8px; border-radius: 14px; border: 2.5px solid var(--wm-line); background: var(--wm-panel); text-align: left; cursor: pointer; }
.wm-cpic { flex: none; display: grid; place-items: center; width: 150px; background: var(--wm-slide); border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(40, 60, 80, .2); overflow: hidden; }
.wm-cpic > svg { width: 100%; height: auto; }
.wm-cpic:has(.wm-lanebadge) { width: 56px; height: 56px; background: none; box-shadow: none; }
.wm-lanebadge { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 24px; border: 3px solid rgba(0, 0, 0, .35); }
.wm-lane--a { background: #c2562b; } .wm-lane--b { background: #2f6fb3; } .wm-lane--c { background: #3f8f4a; }
.wm-choice-t { flex: 1 1 auto; min-width: 0; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
html .wm-choice:hover:not(:disabled) { border-color: var(--wm-accent); background: var(--wm-accent-bg); }
html .wm-choice.is-chosen { border-color: var(--wm-accent); box-shadow: 0 0 0 3px var(--wm-accent); }

/* ✓ / ✗ after Check: at the end of the choice, never on a picture */
.wm-mark { display: none; }
.wm.is-revealed .wm-mark:not(:empty) { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; font-size: 20px; font-weight: 800; color: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
html .wm.is-revealed .wm-choice.is-right { border-color: #2f9a5c; box-shadow: 0 0 0 3px #2f9a5c; }
html .wm.is-revealed .wm-choice.is-wrong { border-color: #c4473d; box-shadow: 0 0 0 3px #c4473d; }
.wm.is-revealed .is-right .wm-mark { background: #17663a; }
.wm.is-revealed .is-wrong .wm-mark { background: #a3241f; }

/* ── Briefing example and Start art ── */
.wm-example { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.wm-example figure { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.wm-example figcaption { display: flex; flex-direction: column; gap: 6px; line-height: 1.35; }
.wm-ex-row { display: flex; align-items: flex-start; gap: 8px; }
.wm-ex-pic svg { width: 100%; height: auto; border-radius: 8px; }
.ps-brief--drawer .wm-example { grid-template-columns: 1fr; }
.wm-start { width: 100%; height: 100%; display: grid; place-items: center; background: #e8eef4; border-radius: 12px; overflow: hidden; }
.wm-start svg { width: 100%; height: 100%; }

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

/* narrower task column: smaller choice pictures */
@container (max-width: 420px) {
  .wm-cpic { width: 116px; }
  html .wm-choice { gap: 10px; }
}
@media (max-width: 1180px) and (min-width: 901px) {
  .wm { overflow-y: auto; align-items: start; }
}
@media (max-width: 900px) {
  .wm { position: relative; inset: auto; overflow: visible; grid-template-columns: minmax(0, 1fr); padding: 10px 10px 16px; }
  .wm-example { grid-template-columns: 1fr; }
}
/* a narrow picture panel: one stepper per row, name beside the − value + */
@container wmscene (max-width: 600px) {
  .wm-steps { grid-template-columns: minmax(0, 1fr); }
  .wm-step { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; }
  .wm-step-v { min-width: 104px; }
}
@media (prefers-reduced-motion: no-preference) {
  .wm-choice, .wm-step-btn { transition: border-color .12s, background-color .12s, box-shadow .12s; }
  .wm.is-revealed .wm-scenebox { animation: wm-pop .35s ease-out; }
  @keyframes wm-pop { 0% { transform: scale(.98); opacity: .6; } 100% { transform: scale(1); opacity: 1; } }
}
