/* Post Listening: the accepted split composition, in the shared lesson system. */
body[data-spark-page=post] {
  --post-ink: #34382f;
  --post-muted: #62665b;
  --post-surface: #fffefa;
  --post-paper: #f7f5ec;
  --post-line: #e7e3d5;
  --post-selected: #fff2cc;
  --post-edge: #c6a15a;
  --post-focus: #8b6718;
  --post-green: #356948;
  --post-choice-surface: #fffdf7;
  --post-preview-surface: #ffffff;
  --post-scene-amber: #f6efd9;
  --post-scene-blue: #e9f1f5;
  --post-scene-sage: #edf3e7;
  --post-source-bg: #e9f0f3;
  --post-source-ink: #426474;
  --post-answer-bg: #fff7df;
  --post-correct-bg: #e7f1e2;
  --post-flow-idle-bg: #edf0e8;
  --post-flow-idle-ink: #59664e;
  --post-flow-active-bg: #ffdf7c;
  --post-flow-active-ink: #72531b;
  --post-flow-arrow: #9ba68e;
}
/* The library's .lesson-body defaults must not add card padding to the lesson shell. */
body[data-lesson-shell][data-spark-page=post] .lesson-body { padding: 0; }
body[data-lesson-shell][data-spark-page=post] .lesson-content>main {
  max-width: 1240px; padding: 28px 32px 32px; color: var(--post-ink);
}
body[data-spark-page=post] .post-studio {
  display: grid; grid-template-columns: minmax(0,.94fr) minmax(0,1.06fr); gap: 24px; min-height: 600px;
}
body[data-spark-page=post] .post-studio p { min-height: 0; }
.practice-choices,.practice-preview {
  min-width: 0; border: 0; border-radius: 16px;
  background: var(--post-surface); overflow: hidden;
}
.practice-choices { display: flex; flex-direction: column; padding: 28px; background: var(--post-choice-surface); }
.practice-choice-title { text-align: left; }
body[data-spark-page=post] .practice-choice-title h2 {
  margin: 0 0 8px; font-size: 28px; line-height: 1.4; letter-spacing: -.7px; font-weight: 650;
}
.practice-path {
  position: relative; display: flex; flex-direction: column; justify-content: space-evenly;
  gap: 12px; min-height: 354px; flex: 1; padding: 26px 0;
}
.practice-option {
  position: relative; display: flex; align-items: center; gap: 18px; align-self: center;
  width: 310px; max-width: 100%; min-height: 100px; padding: 14px 16px 18px;
  border: 1px solid transparent; border-radius: 16px; background: transparent; color: var(--post-muted);
  text-align: left; font: inherit; cursor: pointer;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.practice-option[data-choice=dictation] { --activity-surface: #fff2cc; --activity-ink: #8b6424; --activity-base: #e6ce94; }
.practice-option[data-choice=shadowing] { --activity-surface: #e8f0f4; --activity-ink: #416474; --activity-base: #c2d3dd; }
.practice-option[data-choice=conversation] { --activity-surface: #e7f0e2; --activity-ink: #40684c; --activity-base: #c6d7bb; }
.practice-option:nth-child(2) { align-self: flex-start; }
.practice-option:nth-child(3) { align-self: flex-end; }
.practice-option:hover { background: #f2efe3; color: var(--post-ink); }
.practice-option[aria-pressed=true] { color: #705320; background: var(--post-selected); border-color: #dcc48f; box-shadow: 0 4px 0 #e5d3a4, 0 8px 16px #6a572a08; }
.practice-option-copy { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.practice-option-hint { display: block; font-size: 12px; line-height: 1.65; font-weight: 400; color: var(--post-muted); }
.practice-option strong { font-size: 18px; line-height: 1.5; font-weight: 650; white-space: nowrap; }
/* Activity-specific vector artwork: listening + writing, voice, and turn-taking. */
.practice-art {
  display: grid; place-items: center; flex: none; width: 78px; height: 82px;
  transition: transform 200ms cubic-bezier(.16,1,.3,1);
}
.practice-art img { display: block; width: 78px; height: 82px; object-fit: contain; }
.practice-option { gap: 14px; padding-left: 12px; padding-right: 12px; }
.practice-option[aria-pressed=true] .practice-art { transform: translateY(-2px); }
.practice-option:active .practice-art { transform: translateY(0); }
body[data-spark-page=post] .activity-state {
  display: flex; align-items: center; gap: 4px; margin: 0; font-size: 11px; line-height: 1.5; color: var(--post-green);
}
.practice-option:not(.is-complete) .activity-state { color: var(--post-muted); }
body[data-spark-page=post] .activity-state[hidden] { display: none; }
.activity-state svg { width: 14px; height: 14px; }
.practice-launch { padding-top: 20px; border-top: 1px solid var(--post-line); text-align: center; }
body[data-spark-page=post] .practice-launch h3 { margin: 0 0 6px; font-size: 19px; line-height: 1.5; font-weight: 650; }
body[data-spark-page=post] .practice-launch p { margin: 0 0 20px; color: var(--post-muted); font-size: 13px; line-height: 1.65; }
.post-launch-action { display: flex; justify-content: center; padding-bottom: 5px; }
body[data-lesson-shell][data-spark-page=post] .post-launch-action .lesson-footer-button { width: auto; min-width: 0; margin: 0; }
.practice-preview { display: flex; flex-direction: column; gap: 16px; padding: 26px; background: var(--post-preview-surface); }
.preview-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
body[data-spark-page=post] .preview-heading h2 { font-size: 28px; line-height: 1.4; letter-spacing: -.7px; font-weight: 650; margin: 0 0 8px; }
.preview-scene {
  position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 16px; min-height: 282px; flex: 1; padding: 22px 20px 20px; border-radius: 12px; background: var(--post-scene-amber);
}
.preview-scene[data-method=shadowing] { background: var(--post-scene-blue); }
.preview-scene[data-method=conversation] { background: var(--post-scene-sage); }
.preview-visual { display: grid; place-items: center; width: 100%; min-height: 208px; }
body[data-spark-page=post] .preview-scene h3 { margin: 0; font-size: 18px; line-height: 1.5; font-weight: 600; text-align: center; }
.preview-visual [data-demo] { display: none; position: relative; width: 100%; min-height: 208px; }
[data-method=dictation] [data-demo=dictation], [data-method=shadowing] [data-demo=shadowing], [data-method=conversation] [data-demo=conversation] { display: block; }
/* These are illustrative fragments of the real exercises, never interactive form controls. */
.demo-workbook-surface { position: absolute; right: 0; bottom: 10px; width: calc(100% - 108px); padding: 18px; background: #fffefa; border-radius: 12px; box-shadow: 0 4px 14px #75623b08; }
.scene-spark { position: absolute; left: 0; top: 32px; width: 92px; height: 108px; object-fit: contain; }
.demo-workbook .demo-source { padding-left: 0; }
.demo-workbook .demo-source-icon { width: 30px; height: 30px; }
.demo-workbook .demo-source-icon svg { width: 18px; height: 18px; }
.demo-workbook .demo-source .demo-wave { gap: 3px; }
.demo-workbook .demo-source .demo-wave i { flex-basis: 2px; width: 2px; }
.demo-source { display: flex; align-items: center; gap: 14px; padding-bottom: 18px; }
.demo-source>div { min-width: 0; flex: 1; }
.demo-source-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 50%; background: var(--post-source-bg); color: var(--post-source-ink); }
.demo-source-icon svg { width: 21px; height: 21px; }
.demo-label { display: block; font-size: 11px; line-height: 1.6; color: var(--post-muted); }
.demo-source .demo-label { color: var(--post-source-ink); }
.demo-wave { display: flex; align-items: center; gap: 4px; height: 36px; overflow: hidden; color: #6a8790; }
.demo-wave i { display: block; flex: 0 0 3px; width: 3px; height: var(--bar); border-radius: 3px; background: currentColor; transform-origin: center; }
.demo-writing { border: 0; padding: 10px 12px; border-radius: 8px; background: var(--post-answer-bg); }
[data-step="2"] .demo-writing { background: var(--post-correct-bg); }
.demo-answer { display: flex; align-items: center; position: relative; min-height: 40px; gap: 3px; padding-top: 6px; font-size: 16px; font-weight: 550; line-height: 1.65; }
.demo-placeholder { display: none; font-size: 13px; font-weight: 400; color: var(--post-muted); }
#demo-text { display: inline-block; }
.demo-caret { display: none; flex: none; width: 2px; height: 20px; background: #9b762a; }
.demo-check { display: none; align-items: center; justify-content: center; width: 24px; height: 24px; flex: none; margin-left: auto; border-radius: 50%; background: #e7f1e2; color: var(--post-green); }
.demo-check svg { width: 17px; height: 17px; }
[data-step="0"] .demo-placeholder { display: block; }
[data-step="0"] :is(#demo-text,.demo-caret) { display: none; }
[data-step="1"] .demo-caret { display: block; }
[data-step="2"] .demo-check { display: flex; }
[data-step="2"] #demo-text { color: var(--post-green); }
.demo-speaking-source { min-height: 110px; padding: 8px 0 0 108px; }
.demo-speaking-source .demo-label { color: var(--post-source-ink); }
.demo-speaking-source>div { padding: 14px 18px; background: var(--post-surface); border-radius: 12px; box-shadow: 0 5px 18px #75623b0c; }
.demo-speaking-source img { position: absolute; left: 0; top: 26px; display: block; width: 92px; height: 108px; object-fit: contain; }
body[data-spark-page=post] .demo-speaking-source p { font-size: 17px; font-weight: 600; line-height: 1.65; margin: 5px 0 0; color: var(--post-ink); }
.demo-recording { display: flex; align-items: center; gap: 14px; width: calc(100% - 108px); padding: 10px 16px; margin: 6px 0 0 auto; background: var(--post-answer-bg); border: 0; box-shadow: 0 4px 14px #75623b08; border-radius: 12px; }
[data-step="2"] .demo-recording { background: var(--post-correct-bg); }
.demo-mic { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 50%; color: #6b705b; background: #f0f1e7; }
.demo-mic svg { width: 22px; height: 22px; }.demo-recording>div { flex: 1; min-width: 0; }
.demo-record-check { display: none; width: 19px; height: 19px; flex: none; color: var(--post-green); }
.demo-record-check svg { width: 100%; height: 100%; }
[data-step="0"] .demo-recording .demo-wave { opacity: .35; }
[data-step="1"] .demo-mic { background: var(--post-selected); color: #846222; }
[data-step="2"] .demo-record-check { display: block; }
.demo-chat-row { min-height: 62px; padding: 8px 0 0 108px; }
.demo-chat-row img { position: absolute; left: 0; top: 26px; display: block; object-fit: contain; width: 92px; height: 108px; }
.demo-chat-question,.demo-chat-answer { max-width: 286px; padding: 12px 16px; font-size: 15px; font-weight: 500; line-height: 1.6; }
.demo-chat-question { border: 0; border-radius: 12px 12px 12px 3px; background: var(--post-surface); box-shadow: 0 6px 18px #75623b0e; }
.demo-chat-answer { margin: 12px 0 0 auto; width: fit-content; border-radius: 12px 12px 3px 12px; background: var(--post-selected); color: #705320; }
.demo-chat-feedback { display: flex; align-items: center; gap: 7px; margin: 14px 0 0 108px; color: var(--post-green); }
.demo-chat-feedback>span { width: 17px; height: 17px; flex: none; }.demo-chat-feedback svg { width: 100%; height: 100%; }
body[data-spark-page=post] .demo-chat-feedback p { font-size: 12px; line-height: 1.65; margin: 0; color: inherit; }
[data-step="0"] :is(.demo-chat-answer,.demo-chat-feedback) { visibility: hidden; }
[data-step="1"] .demo-chat-feedback { visibility: hidden; }
body[data-spark-page=post] .post-studio .preview-description { min-height: 0; margin: 0; }
/* Three small nodes and directional connectors form the activity flow. */
.preview-steps { display: flex; align-items: flex-start; justify-content: space-between; list-style: none; margin: 0; padding: 6px 0 2px; }
.preview-steps li { position: relative; flex: 1; min-width: 0; }
.preview-steps button { display: flex; flex-direction: column; align-items: center; gap: 9px; position: relative; z-index: 1; width: 100%; min-height: 78px; padding: 4px 2px; border: 0; border-radius: 10px; background: transparent; color: var(--post-muted); font: inherit; font-size: 12px; cursor: pointer; }
.flow-symbol { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid transparent; border-radius: 50%; background: var(--post-flow-idle-bg); color: var(--post-flow-idle-ink); transition: background 180ms ease,color 180ms ease,border-color 180ms ease; }
.flow-symbol svg { width: 19px; height: 19px; }
.preview-steps strong { font-weight: 500; line-height: 1.5; }
.preview-steps button:hover .flow-symbol { border-color: #cbb77c; background: #f6f0dd; color: #846222; }
.preview-steps button[aria-pressed=true] { color: #705320; }
.preview-steps button[aria-pressed=true] .flow-symbol { border-color: #d6b45c; background: var(--post-flow-active-bg); color: var(--post-flow-active-ink); }
.preview-steps button[aria-pressed=true] strong { font-weight: 650; }
.flow-arrow { display: block; position: absolute; left: calc(50% + 28px); right: calc(-50% + 28px); top: 6px; height: 26px; color: var(--post-flow-arrow); pointer-events: none; }
.flow-arrow svg { display: block; width: 100%; height: 26px; }
.preview-steps li:has([aria-current=step]) .flow-arrow { color: #ba984f; }
body[data-spark-page=post] .post-end { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 22px; padding: 0; border: 0; }
body[data-spark-page=post] .post-end .lesson-footer-button { width: auto; flex: none; }
.post-back-link { display: inline-flex; align-items: center; gap: 7px; color: var(--post-muted); font-size: 12px; text-decoration: none; white-space: nowrap; }
.post-back-link svg { width: 20px; height: 20px; }
body[data-spark-page=post] #post-status { margin: 0 0 20px; padding: 14px 18px; border: 1px solid #d5e2cc; border-radius: 12px; background: #edf5e7; color: var(--post-green); font-size: 13px; line-height: 1.65; }
body[data-spark-page=post] #post-status[data-state=skipped] { background: var(--post-paper); border-color: var(--post-line); color: var(--post-muted); }
body[data-spark-page=post] :is(button,a):focus-visible { outline: 3px solid var(--post-focus)!important; outline-offset: 4px!important; }
body[data-spark-page=post] :is(.post-studio,.post-end) svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
body[data-spark-page=post] ::selection { background: #ffedb1; color: var(--post-ink); }
body[data-spark-page=post] { scrollbar-width: thin; scrollbar-color: #d5cba9 #f8f6ec; }
/* The restored-status notice uses the available desktop height without a trailing page scroll. */
body[data-lesson-shell][data-spark-page=post]:has(#post-status:not([hidden])) .lesson-content>main { padding-bottom: 10px; }

/* Only the active demonstration moves. Pausing freezes it; static steps remain fully legible. */
[data-playing=true][data-step="0"] .demo-source .demo-wave i,
[data-playing=true][data-step="1"] .demo-recording .demo-wave i { animation: post-wave 620ms ease-in-out var(--delay) infinite alternate; }
[data-playing=true][data-step="1"] .demo-caret { animation: post-caret 700ms steps(1) infinite; }
[data-playing=true][data-step="1"] .demo-chat-answer,
[data-playing=true][data-step="2"] .demo-chat-feedback { animation: post-arrive 240ms cubic-bezier(.16,1,.3,1); }
@keyframes post-wave { to { transform: scaleY(.35); } }
@keyframes post-caret { 50% { opacity: 0; } }
@keyframes post-arrive { from { opacity: .4; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
/* The rehearsal has a small physical response for listening, doing and checking. */
.demo-pen { display: none; position: absolute; left: 0; top: -7px; width: 19px; height: 19px; color: #a67a22; transform-origin: 50% 85%; }
.demo-pen svg { width: 100%; height: 100%; }
.demo-answer { padding-right: 22px; }
.demo-writing,.demo-recording { transition: background 240ms ease; }
.demo-source-icon { position: relative; }
.flow-arrow svg { overflow: visible; }
.flow-arrow .flow-curve { stroke-linecap: round; }
.preview-scene[data-playing=true][data-step="0"] .preview-spark { animation: preview-listen 1600ms ease-in-out infinite; }
.preview-scene[data-playing=true][data-step="1"] .preview-spark { animation: preview-working 1200ms ease-in-out infinite; }
.preview-scene[data-playing=true][data-step="2"] .preview-spark { animation: preview-cheer 620ms cubic-bezier(.16,1,.3,1); }
.preview-scene[data-playing=true][data-typing=true] .demo-pen { display: block; animation: preview-pen 180ms ease-in-out infinite alternate; }
.preview-scene[data-playing=true][data-step="2"] .demo-check { animation: preview-pop 420ms cubic-bezier(.16,1,.3,1); }
.preview-scene[data-playing=true][data-method=shadowing][data-step="1"] .demo-mic { animation: preview-mic 750ms ease-in-out infinite; }
.preview-scene[data-playing=true][data-method=conversation][data-step="0"] .demo-chat-question { animation: preview-bubble 460ms cubic-bezier(.16,1,.3,1); transform-origin: 0 100%; }
.preview-scene[data-playing=true][data-method=conversation][data-step="1"] .demo-chat-answer { animation: preview-bubble 460ms cubic-bezier(.16,1,.3,1); transform-origin: 100% 100%; }
.preview-scene[data-playing=true][data-step="2"] :is(.demo-check,.demo-chat-feedback) svg path { stroke-dasharray: 24; stroke-dashoffset: 0; animation: preview-check 420ms ease-out both; }
.preview-scene[data-voice=true][data-playing=true] .demo-source-icon { animation: preview-mic 650ms ease-in-out infinite; }
body[data-spark-page=post]:has(.preview-scene[data-playing=true]) .preview-steps [aria-current=step] .flow-symbol { animation: preview-node 420ms cubic-bezier(.16,1,.3,1); }
body[data-spark-page=post]:has(.preview-scene[data-playing=true]) .preview-steps li:has([aria-current=step]) .flow-curve { stroke-dasharray: 3 5; animation: preview-flow 1800ms linear infinite; }
@keyframes preview-listen { 0%,100% { transform: translateY(0) rotate(0); } 45% { transform: translateY(-4px) rotate(-3deg); } 70% { transform: translateY(-1px) rotate(2deg); } }
@keyframes preview-working { 0%,100% { transform: rotate(0); } 35% { transform: rotate(-4deg) translateY(-2px); } 70% { transform: rotate(2deg); } }
@keyframes preview-cheer { 0% { transform: translateY(0); } 30% { transform: translateY(-9px) rotate(-5deg) scale(1.04); } 60% { transform: translateY(1px) rotate(3deg); } 100% { transform: none; } }
@keyframes preview-pen { from { transform: rotate(-18deg); } to { transform: translateY(-1px) rotate(-8deg); } }
@keyframes preview-pop { 0% { opacity: .3; transform: scale(.6); } 70% { transform: scale(1.12); } 100% { opacity: 1; transform: scale(1); } }
@keyframes preview-mic { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes preview-bubble { 0% { opacity: .2; transform: translateY(10px) scale(.94); } 65% { opacity: 1; transform: translateY(-2px) scale(1.015); } 100% { transform: none; } }
@keyframes preview-check { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
@keyframes preview-node { 0% { transform: scale(.91); } 65% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes preview-flow { to { stroke-dashoffset: -16; } }
@media(prefers-reduced-motion:reduce) {
  body[data-spark-page=post] :is(.post-studio,.post-end) * { animation: none!important; transition: none!important; }
  .practice-option[aria-pressed=true] .practice-art { transform: none; }
}
