/* Chunking workflow v2: encapsulated flat UI, respects PeakFour themes. */
.pfv2-content{font-family:Inter,system-ui,-apple-system,sans-serif;min-height:380px;max-width:760px;margin-inline:auto;color:var(--pf-text,#e6ebf8);font-synthesis:none;line-height:1.5}
.pfv2-content *{box-sizing:border-box;min-width:0}
.pfv2-kicker{font-size:11px;letter-spacing:.09em;text-transform:uppercase;font-weight:750;color:#24b8a8;text-align:center;margin:12px 0 10px}
.pfv2-title{font-size:clamp(19px,2.5vw,24px);font-weight:780;letter-spacing:-.035em;text-align:center;color:inherit;margin:5px 0 24px}
.pfv2-card,.pfv2-option-preview{border:1px solid var(--pf-border,#2a2f4c);border-radius:15px;padding:17px;background:var(--pf-surface,#1c213d);margin:10px 0}
.pfv2-option-preview{display:flex;align-items:center;justify-content:space-between;gap:12px}
.pfv2-option-text{font-size:16px;font-weight:720;margin:0}
.pfv2-eyebrow{font-size:11px;color:var(--pf-muted,#96a6bd);font-weight:760;letter-spacing:.07em;margin:10px 0}
.pfv2-english,.pfv2-en{font-size:clamp(21px,3vw,28px);font-weight:790;line-height:1.43;letter-spacing:-.02em}
.pfv2-phrase{margin:20px auto 8px;max-width:730px;text-align:center;font-size:clamp(22px,4vw,32px);font-weight:770;line-height:1.55;letter-spacing:-.02em}
.pfv2-highlight{color:#14b8a6}.pfv2-muted{color:#9aa5b4;font-weight:650}.pfv2-masked{color:#9ba6b5;letter-spacing:.06em}
.pfv2-hint{color:var(--pf-muted,#9daac1);font-size:13px;text-align:center;margin:10px 0 18px}
.pfv2-translation{color:var(--pf-muted,#adbace);font-size:18px;text-align:center;line-height:1.7;margin:12px 0 18px}
.pfv2-final-translation{color:inherit;max-width:620px;text-align:center;font-size:clamp(21px,3vw,28px);font-weight:670;line-height:1.6;margin:50px auto 28px}
.pfv2-ipa{text-align:center;color:#73bcb1;font-family:Inter,system-ui,sans-serif;font-size:14px}
.pfv2-choices{display:grid;gap:11px;max-width:610px;margin:28px auto}
.pfv2-choice{min-height:62px;padding:15px 17px;text-align:center;background:var(--pf-surface,#1c213d);border:1px solid var(--pf-border,#2a2f4c);color:inherit;font-weight:720;border-radius:13px;cursor:pointer;font:inherit}
.pfv2-choice.is-correct{background:rgba(16,185,129,.14);border-color:#23a883;color:#34d399}.pfv2-choice.is-wrong{background:rgba(244,63,94,.11);border-color:#e7687c;color:#fb7185}
.pfv2-choice-feedback{text-align:center;font-size:13px;font-weight:740}.pfv2-choice-feedback.is-good{color:#34d399}.pfv2-choice-feedback.is-bad{color:#fb7185}
.pfv2-controls{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:14px;margin:25px auto}
.pfv2-audio{background:var(--pf-surface,#242a43);border:1px solid var(--pf-border,#2a2f4c);border-radius:12px;color:inherit;padding:11px 15px;cursor:pointer;font:inherit}
.pfv2-mic,.pfv2-primary{background:#0b998b;color:#fff;border:0;border-radius:13px;padding:13px 19px;cursor:pointer;font:700 14px Inter,system-ui,sans-serif}
.pfv2-mic{background:linear-gradient(135deg,#34a0ff,#2454de);box-shadow:0 14px 32px rgba(36,84,222,.24)}
.pfv2-mic{min-height:55px;min-width:150px}.pfv2-primary:disabled{opacity:.42;cursor:not-allowed}
.pfv2-secondary{color:inherit;background:transparent;border:1px solid var(--pf-border,#2a2f4c);border-radius:12px;padding:12px 16px;cursor:pointer}
.pfv2-link{background:transparent;color:var(--pf-muted,#9daac1);border:0;padding:12px;cursor:pointer}
.pfv2-art{width:min(100%,560px);height:auto;aspect-ratio:420 / 248;object-fit:contain;border-radius:16px;border:1px solid var(--pf-border,#2a2f4c);background:white;display:block;margin:17px auto}
.pfv2-chat{display:flex;align-items:center;gap:14px;padding:13px 17px;border-radius:16px;background:var(--pf-surface,#1c213d);border:1px solid var(--pf-border,#2a2f4c);max-width:700px;margin:auto}.pfv2-question{font-size:17px;font-weight:750;margin:0}
.pfv2-content .pf96-feedback,.pfv2-content .pf-chunk-native-feedback{max-width:100%;overflow-wrap:break-word}
#chunk-session-actions:has(.pfv2-primary){display:flex;flex-wrap:wrap;justify-content:center;gap:10px}
:root[data-pf-theme="light"] .pfv2-content{color:#162c45}
:root[data-pf-theme="light"] .pfv2-highlight{color:#098e83}
:root[data-pf-theme="light"] .pfv2-card,:root[data-pf-theme="light"] .pfv2-option-preview,:root[data-pf-theme="light"] .pfv2-choice,:root[data-pf-theme="light"] .pfv2-chat,:root[data-pf-theme="light"] .pfv2-audio{background:#f5f7fa;border-color:#e2e8ef;color:#243853}
:root[data-pf-theme="light"] .pfv2-muted{color:#8a96a3}
:root[data-pf-theme="light"] .pfv2-translation,:root[data-pf-theme="light"] .pfv2-hint{color:#657586}
@media(max-width:560px){.pfv2-content{min-height:300px}.pfv2-phrase{font-size:23px}.pfv2-controls{gap:9px}.pfv2-choice{min-height:56px}.pfv2-chat{flex-direction:column;align-items:flex-start}.pfv2-final-translation{margin-top:28px}}

.pfv2-last-feedback{margin:20px auto;padding:18px;max-width:400px;border-radius:16px;border:1px solid #2c796e;background:rgba(19,153,139,.07);text-align:center}.pfv2-feedback-score{color:#14b8a6;font-weight:800;font-size:22px;margin:0}

/* Picture activity: the exact Vietnamese translation of the English scoring target is directly BELOW the illustration. */
.pfv2-content .pfv2-picture-vi-block{width:min(100%,700px);margin:0 auto 12px;padding:15px 20px;text-align:center;background:var(--pf-surface,#1c213d);border:1px solid var(--pf-border,#2a2f4c);border-radius:14px;overflow-wrap:anywhere}
.pfv2-content .pfv2-picture-vi-eyebrow{margin:0 0 8px;color:var(--pf-muted,#adbace);font-size:11px;font-weight:750;letter-spacing:.065em}
.pfv2-content .pfv2-picture-vi-text{margin:0;color:var(--pf-text,#e6ebf8);font-size:clamp(18px,2.4vw,24px);font-weight:700;line-height:1.5}
:root[data-pf-theme="light"] .pfv2-content .pfv2-picture-vi-block{background:#f5f7fa;border-color:#e2e8ef}
:root[data-pf-theme="light"] .pfv2-content .pfv2-picture-vi-text{color:#162c45}
:root[data-pf-theme="light"] .pfv2-content .pfv2-picture-vi-eyebrow{color:#607188}

/* Focused recall: mark only a semantic English subphrase, never a correct MCQ option. */
.pfv2-focus-line{max-width:690px;margin:12px auto 18px;text-align:center;overflow-wrap:break-word}
.pfv2-focus-token{display:inline;color:#44d8c6;background:transparent;border:0;border-radius:0;padding:0;box-shadow:none;text-decoration:none;font-size:calc(1em + 3px);font-weight:800}
.pfv2-target-vi{max-width:660px;margin:14px auto 20px;color:#84e1d6;font-weight:780;line-height:1.65;letter-spacing:.004em;background:transparent;border:0;box-shadow:none}
.pfv2-reveal-label{color:#42d8bc;text-align:center;margin-top:15px}
:root[data-pf-theme="light"] .pfv2-focus-token{color:#067e89;background:transparent;box-shadow:none}
:root[data-pf-theme="light"] .pfv2-target-vi{color:#087b94;background:transparent;border:0;box-shadow:none}
@media(prefers-reduced-motion:reduce){.pfv2-focus-token{transition:none}}

/* Adaptive Vocabulary / Completion. Consistent with dark/light PeakFour tokens. */
.pfv2-prefix-text{max-width:690px;margin:8px auto 16px;color:var(--pf-text,#e6ebf8);font-size:clamp(22px,3.1vw,33px);font-weight:700;letter-spacing:-.02em;text-align:center}
.pfv2-vocab-headword{font-size:clamp(30px,5vw,49px);font-weight:820;letter-spacing:-.03em}
.pfv2-vocab-example{font-size:clamp(19px,2.8vw,27px);max-width:720px;text-align:center;color:var(--pf-text,#e6ebf8);margin:10px auto 15px}
.pfv2-vocab-context,.pfv2-completed-context{max-width:730px;font-size:clamp(20px,3.1vw,30px);overflow-wrap:anywhere}
.pfv2-example-vi{font-size:clamp(14px,1.6vw,19px);opacity:.84;margin:8px auto 22px}
.pfv2-question-vi{font-size:clamp(14px,1.6vw,18px);opacity:.82;text-align:center;margin:0 auto 15px}
.pfv2-masked-suffix{font-size:clamp(28px,4vw,42px);font-weight:700;letter-spacing:.05em;color:var(--pf-muted,#a8b6d1);text-align:center;margin:12px auto}
.pfv2-continuation-focus .pfv2-focus-token{font-size:1.08em}
.pfv2-choices .pfv2-choice{overflow-wrap:anywhere}
:root[data-pf-theme="light"] .pfv2-prefix-text,:root[data-pf-theme="light"] .pfv2-vocab-example{color:#1e3a54}

.pfv2-completion-prompt{display:flex;flex-wrap:wrap;gap:8px;align-items:baseline;justify-content:center;margin:14px auto 17px;max-width:680px}
.pfv2-completion-prompt .pfv2-prefix-text{margin:0;max-width:100%}
.pfv2-completion-ellipsis{font-size:clamp(26px,3vw,34px);line-height:1;color:#7d91ab}

/* Chunking focus: foreground only, +3px. No mark box, background, borders or underline. */
#page-chunking .pfv2-focus-token, #page-chunking .pfv2-highlight {
  color:#44d8c6 !important; font-size:calc(1em + 3px) !important;
  background:transparent !important; background-color:transparent !important;
  border:0 !important; border-bottom:0 !important; border-radius:0 !important;
  box-shadow:none !important; outline:none !important; text-decoration:none !important;
  padding:0 !important; margin:0 !important; font-weight:800;
}
:root[data-pf-theme="light"] #page-chunking .pfv2-focus-token,
:root[data-pf-theme="light"] #page-chunking .pfv2-highlight {color:#10b981 !important;}
#page-chunking .pfv2-vocab-headword{font-size:clamp(34px,5vw,56px);text-align:center;margin:28px auto 6px;}
#page-chunking .pfv2-vocab-ipa{font-size:clamp(18px,2.3vw,24px);margin:0 auto 7px;line-height:1.55;}
#page-chunking .pfv2-vocab-meaning{font-size:clamp(19px,2.3vw,24px);margin:4px auto 16px;line-height:1.5;}

/* Chunking: one learning task per step, no fixed-height or merged vocabulary card. */
#page-chunking.pf100-chunking #chunk-session-content.pfv2-content{
 display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;
 width:100%;min-height:0;height:auto;max-height:none;overflow:visible;
 gap:0;overflow-wrap:anywhere;white-space:normal;
}
#page-chunking.pf100-chunking #chunk-session-content.pfv2-content > *{
 position:relative;flex:0 0 auto;max-width:100%;min-width:0;
}
#page-chunking.pf100-chunking .pfv2-content .pfv2-kicker{
 font-size:clamp(13px,1.4vw,16px);margin:0 auto 16px;line-height:1.4;
}
#page-chunking.pf100-chunking .pfv2-content .pfv2-title{
 font-size:clamp(24px,3.1vw,38px);line-height:1.22;
 margin:12px auto 24px;max-width:900px;overflow-wrap:anywhere;
}
#page-chunking.pf100-chunking .pfv2-content .pfv2-question{
 font-size:clamp(19px,2.4vw,27px);line-height:1.42;
 font-weight:720;text-align:center;margin:5px auto 5px;max-width:900px;
}
#page-chunking.pf100-chunking .pfv2-content .pfv2-question-vi{
 font-size:clamp(15px,1.8vw,20px);line-height:1.45;
 margin:0 auto 18px;max-width:900px;
}
#page-chunking.pf100-chunking .pfv2-content .pfv2-eyebrow{
 text-align:center;margin:12px auto 8px;line-height:1.45;
 font-size:clamp(12px,1.25vw,15px);font-weight:730;
}
#page-chunking.pf100-chunking .pfv2-content .pfv2-target-vi{
 font-size:clamp(20px,2.5vw,29px);font-weight:690;line-height:1.42;
 margin:6px auto 18px;max-width:790px;
}
#page-chunking.pf100-chunking .pfv2-content .pfv2-continuation-focus,
#page-chunking.pf100-chunking .pfv2-content .pfv2-completion-prompt{
 width:min(100%,850px);margin:8px auto 12px;line-height:1.35;
}
#page-chunking.pf100-chunking .pfv2-content .pfv2-choices{
 width:min(100%,790px);max-width:790px;margin:16px auto 12px;
 display:grid;grid-template-columns:minmax(0,1fr);gap:12px;
}
#page-chunking.pf100-chunking .pfv2-content .pfv2-choice{
 min-height:64px;height:auto;padding:13px 18px;
 line-height:1.4;font-size:clamp(16px,1.75vw,21px);
 white-space:normal;word-break:normal;overflow-wrap:anywhere;
}
#page-chunking.pf100-chunking .pfv2-content .pfv2-vocab-headword{
 color:#44d8c6;font-size:clamp(36px,5vw,55px);font-weight:820;
 line-height:1.2;text-align:center;margin:10px auto 6px;
}
#page-chunking.pf100-chunking .pfv2-content .pfv2-vocab-ipa{
 font-size:clamp(19px,2.1vw,24px);text-align:center;
 line-height:1.45;margin:0 auto 8px;
}
#page-chunking.pf100-chunking .pfv2-content .pfv2-vocab-meaning{
 font-size:clamp(19px,2.2vw,25px);line-height:1.45;
 margin:0 auto 20px;text-align:center;
}
#page-chunking.pf100-chunking .pfv2-content .pfv2-focus-token{
 color:#44d8c6;font-size:calc(1em + 3px);font-weight:800;
 background:none;border:0;box-shadow:none;text-decoration:none;
 border-radius:0;padding:0;
}
:root[data-pf-theme="light"] #page-chunking.pf100-chunking .pfv2-content :is(.pfv2-vocab-headword,.pfv2-focus-token){color:#10b981;}
@media(max-width:560px){
 #page-chunking.pf100-chunking .pfv2-content .pfv2-title{margin:10px auto 16px;}
 #page-chunking.pf100-chunking .pfv2-content .pfv2-choices{gap:9px;margin:12px auto;}
 #page-chunking.pf100-chunking .pfv2-content .pfv2-choice{min-height:54px;padding:11px 12px;}
 #page-chunking.pf100-chunking .pfv2-content .pfv2-target-vi{margin:6px auto 13px;}
}

/* Context-based knowledge review: a single objective per step; no repeated vocabulary block. */
#page-chunking .pfv2-knowledge-en,
#page-chunking .pfv2-infix-line {
  max-width:950px;width:100%;margin:12px auto 15px;
  font:750 clamp(25px,3vw,38px)/1.5 Inter,system-ui,sans-serif;
  letter-spacing:-.02em;text-align:center;color:var(--pf100-text,var(--pf-text,#e6ebf8));
  overflow-wrap:anywhere;white-space:normal;
}
#page-chunking .pfv2-knowledge-vi {
  max-width:900px;margin:8px auto 16px;
  color:var(--pf100-muted,var(--pf-muted,#adbace));
  font-size:clamp(17px,2vw,23px);line-height:1.6;text-align:center;
  overflow-wrap:anywhere;
}
#page-chunking .pfv2-knowledge-instruction {
  max-width:880px;margin:16px auto 14px;
  color:var(--pf100-text,var(--pf-text,#e6ebf8));
  text-align:center;font-size:clamp(14px,1.65vw,18px);line-height:1.65;font-weight:650;
}
#page-chunking .pfv2-knowledge-explanation {
  max-width:880px;margin:18px auto 12px;text-align:center;
  color:#39d5c4;line-height:1.65;font-size:clamp(14px,1.5vw,18px);
  overflow-wrap:anywhere;
}
#page-chunking .pfv2-knowledge-audio {
  display:flex;justify-content:center;align-items:center;margin:4px auto 18px;
}
#page-chunking .pfv2-infix-blank {
  color:#39d5c4;font-size:calc(1em + 3px);font-weight:850;
  background:none;border:0;box-shadow:none;text-decoration:none;
  letter-spacing:.035em;white-space:nowrap;
}
#page-chunking .pfv2-knowledge-en,
#page-chunking .pfv2-knowledge-vi,
#page-chunking .pfv2-infix-line,
#page-chunking .pfv2-knowledge-instruction,
#page-chunking .pfv2-knowledge-explanation {height:auto;min-height:0;position:static;max-height:none;}
:root[data-pf-theme="light"] #page-chunking .pfv2-knowledge-en,
:root[data-pf-theme="light"] #page-chunking .pfv2-infix-line,
:root[data-pf-theme="light"] #page-chunking .pfv2-knowledge-instruction{color:#173451}
:root[data-pf-theme="light"] #page-chunking .pfv2-knowledge-explanation,
:root[data-pf-theme="light"] #page-chunking .pfv2-infix-blank{color:#08796e}
@media(max-width:560px){
 #page-chunking .pfv2-knowledge-en,#page-chunking .pfv2-infix-line{font-size:clamp(21px,6vw,27px);line-height:1.5}
 #page-chunking .pfv2-knowledge-instruction{margin:12px auto}
 #page-chunking .pfv2-knowledge-audio{margin-bottom:12px}
}

/* Academic assessment & spaced retrieval: a separate, non-Knowledge review entry. */
#page-chunking .pf-chunk-review-btn{background:rgba(14,165,233,.12);border:1px solid rgba(14,165,233,.38);color:inherit;min-height:36px;border-radius:10px;padding:8px 12px;white-space:normal;}
#page-chunking .pf-chunk-review-btn[data-review-due="true"]{border-color:#34d399;background:rgba(16,185,129,.12);font-weight:750;}
#page-chunking .pfv2-recall-help{border-color:rgba(245,158,11,.45);background:rgba(245,158,11,.09);font-weight:650;}


/* Completion highlight: softer blue-lilac accent, easier to notice than body text without becoming neon. */
#page-chunking .pfv2-focus-token-soft{color:#44d8c6 !important;}
#page-chunking .pfv2-completion-prompt .pfv2-focus-token-soft{font-size:calc(1em + 4px) !important;font-weight:820;}
#page-chunking .pfv2-completed-context .pfv2-focus-token-soft{font-size:calc(1em + 3px) !important;font-weight:820;}
#page-chunking .pfv2-step-ipa{display:block;max-width:760px;margin:-6px auto 16px;text-align:center;color:#8ebdc8;font-size:clamp(14px,1.6vw,18px);line-height:1.55;letter-spacing:.01em;}
#page-chunking .pfv2-final-ipa{margin:-8px auto 24px;}
:root[data-pf-theme="light"] #page-chunking .pfv2-focus-token-soft{color:#10b981 !important;}
:root[data-pf-theme="light"] #page-chunking .pfv2-step-ipa{color:#557b97;}
@media(max-width:560px){#page-chunking .pfv2-step-ipa{margin:-4px auto 14px;font-size:clamp(13px,3.9vw,16px);}}


/* Clear prompts and light-mode choice surfaces without overriding answer feedback. */
:root[data-pf-theme="light"] #page-chunking.pf100-chunking .pfv2-content .pfv2-choice:not(.is-correct):not(.is-wrong){
 background:#fff !important;border:1px solid #d9e4f2 !important;color:#173451 !important;box-shadow:none !important;
}
:root[data-pf-theme="light"] #page-chunking.pf100-chunking .pfv2-content .pfv2-choice:hover:not(.is-correct):not(.is-wrong){
 background:#f8fbff !important;border-color:#b8caea !important;
}
:root[data-pf-theme="light"] #page-chunking .pfv2-question-vi{color:#41556f;}
:root[data-pf-theme="light"] #page-chunking .pfv2-content .pfv2-step-ipa{color:#5a7c97;}

/* Microphone uses the blue speech-analysis palette; recording/busy states keep their own colors. */
:root[data-pf-theme="light"] #page-chunking .pfv2-mic:not(.is-recording):not(.is-busy){background:linear-gradient(135deg,#34a0ff,#2454de) !important;box-shadow:0 14px 32px rgba(36,84,222,.18) !important;}
:root[data-pf-theme="dark"] #page-chunking .pfv2-mic:not(.is-recording):not(.is-busy){background:linear-gradient(135deg,#34a0ff,#2454de) !important;}


/* Chunking word-aligned IPA: each English word is paired with its own
   isolated-word eSpeak reference; no guessing word boundaries in linked IPA. */
#page-chunking .pfv2-ipa.pfv2-ipa-word-list{
  display:flex!important;flex-wrap:wrap;justify-content:center;align-items:flex-start;
  column-gap:clamp(14px,2.2vw,27px);row-gap:12px;
  white-space:normal;letter-spacing:normal;max-width:min(100%,920px);
  padding:4px 12px 3px;line-height:1.5;
}
#page-chunking .pfv2-ipa-word-unit{
  display:inline-flex;flex-direction:column;align-items:center;justify-content:flex-start;
  flex:0 0 auto;min-width:0;padding:1px 2px;
  white-space:nowrap;text-align:center;
}
#page-chunking .pfv2-ipa-word-en{
  display:block;color:var(--pf100-text,var(--pf-text,#e6ebf8));opacity:.86;
  font:600 clamp(12px,1.25vw,14px)/1.4 Inter,system-ui,sans-serif;
  letter-spacing:0;white-space:nowrap;
}
#page-chunking .pfv2-ipa-word-reading{
  display:block;color:inherit;font:500 clamp(15px,1.8vw,19px)/1.5 Inter,system-ui,sans-serif;
  letter-spacing:.005em;white-space:nowrap;
}
#page-chunking .pf-chunk-ipa.pfv2-ipa-word-list{
  display:flex;flex-wrap:wrap;justify-content:flex-start;align-items:flex-start;
  column-gap:clamp(14px,2vw,25px);row-gap:12px;
  width:100%;margin:13px 0 17px;padding:2px 0;
}
:root[data-pf-theme="light"] #page-chunking .pfv2-ipa-word-en{
  color:#345271;opacity:1;
}
@media(max-width:560px){
 #page-chunking .pfv2-ipa.pfv2-ipa-word-list{column-gap:16px;row-gap:11px;padding-inline:3px;}
 #page-chunking .pfv2-ipa-word-reading{font-size:15px;}
}
