/* Student-first shell. Loaded last; activity state and scoring stay in JS. */
:root { --muted:#536176; --line:#dce3ed; --student-action:#315da8; }
html, body { height:auto!important; min-height:100%; overflow-y:auto!important; }
.stage-footer [hidden] { display:none!important; }
.player-viewport, html.is-embedded-player .player-viewport { display:block!important; width:100%!important; height:auto!important; min-height:100dvh!important; }
.player-frame, html.is-embedded-player .player-frame { width:100%!important; max-width:1600px!important; height:auto!important; min-height:100dvh!important; max-height:none!important; margin-inline:auto!important; overflow:visible!important; font-size:16px; box-shadow:none; }
.learning-shell, .player-body, .stage-main { height:auto!important; max-height:none!important; overflow:visible!important; }
.learning-shell { min-height:100dvh; }
.player-header { height:auto; min-height:76px; flex:0 0 auto; padding:12px 24px; grid-template-columns:170px minmax(0,1fr) 140px auto; gap:20px; }
.compact-brand span { width:40px; height:40px; border-radius:12px; font-size:17px; }
.compact-brand b { font-size:12px; }
.article-identity { padding-left:16px; }
.article-identity b { white-space:normal; font-size:18px; line-height:1.4; }
.article-identity span, .header-progress > span { font-size:12px; }
.header-tools .change-article { font-size:14px; }
.player-body { grid-template-columns:212px minmax(0,1fr); align-items:stretch; }
.stage-rail { background:#f5f7fb; color:#263c59; border-right:1px solid var(--line); padding:20px 12px; gap:6px; overflow:visible; }
.rail-caption { padding:0 6px 12px; color:#536176; font-size:12px; letter-spacing:0; }
.rail-caption b, .rail-home-button, .rail-hide-button { color:#3e5270; font-size:12px; }
.rail-home-button, .rail-hide-button { min-height:36px; padding:4px; }
.rail-home-button:hover, .rail-hide-button:hover { color:#193e78; background:#e5ebf5; }
.stage-link { grid-template-columns:30px minmax(0,1fr) 12px; gap:8px; min-height:66px; padding:10px 8px; border:1px solid transparent; border-radius:10px; color:#354a66; }
.stage-link > span { width:30px; height:30px; border-radius:9px; background:#e7ecf5; font-size:12px; }
.stage-link b { color:#263c59; font-size:15px; line-height:1.4; word-break:keep-all; }
.stage-link small { color:#536176; font-size:12px; line-height:1.4; }
.stage-link > i { color:#536176; }
.stage-link:hover { color:#203c67; background:#e9eef7; }
.stage-link.active { background:#e7effc; border-color:#aac0e2; box-shadow:inset 3px 0 var(--student-action); }
.stage-link.active b, .stage-link.active small, .stage-link.active > i { color:#234b85; }
.stage-link.active > span { color:#fff; background:var(--student-action); }
.stage-link.complete:not(.active) > span { color:#17694f; background:#dcefe7; }
.rail-summary { margin-top:24px; padding:10px 6px; background:transparent; border-top:1px solid var(--line); border-radius:0; }
.rail-summary > span { color:#26466d; border-color:#adc4df; width:44px; height:44px; }
.rail-summary b { color:#314763; font-size:13px; }
.rail-summary small { color:#536176; font-size:12px; }
.stage-main { padding:24px clamp(16px,2.3vw,36px) 28px; background:#fff; }
.stage-titlebar { height:auto; flex:0 0 auto; min-height:0; display:block; margin-bottom:24px; }
.stage-titlebar > div { gap:12px; }
.stage-titlebar > div > span { color:#536d97; font-size:24px; }
.stage-titlebar small { color:#536176; font-size:12px; letter-spacing:.03em; }
.stage-titlebar h1 { margin:3px 0 0; font-size:26px; line-height:1.35; }
.stage-titlebar > p { width:auto!important; margin:10px 0 0; color:#46566e; font-size:16px; line-height:1.65; text-align:left!important; }
.stage-content, html.is-embedded-player .stage-main .stage-content:has(> .exam-shell) { height:auto!important; min-height:0!important; max-height:none!important; flex:1 0 auto!important; overflow:visible!important; padding-right:0; }
.stage-grid, .word-stage, .reading-layout, .discussion-layout, .listening-layout, .speaking-layout, .writing-layout { height:auto!important; min-height:0!important; max-height:none!important; gap:20px; align-items:start; }
.lesson-card { border-radius:16px; box-shadow:none; }
.stage-footer { position:static!important; height:auto!important; flex:0 0 auto!important; display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin-top:24px; padding:16px 0 max(8px,env(safe-area-inset-bottom)); border-top:1px solid var(--line); }
.stage-footer button { min-height:46px; height:auto; padding:10px 16px; font-size:14px; line-height:1.5; }
.footer-tools { margin-right:auto; }
.stage-footer .footer-next { margin-left:auto; background:var(--student-action); box-shadow:none; }
.completion-toggle { min-width:0; border-style:solid; color:#4e6078; }
.stage-main textarea { font-size:18px; line-height:1.7; resize:vertical; }
.stage-main :is(input,textarea,select) { max-width:100%; }
.stage-main :is(button,summary) { touch-action:manipulation; }
button:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline:3px solid #215bae; outline-offset:3px; }
.primary-action { min-height:46px; font-size:16px; }
.choice-option b { font-size:17px; line-height:1.55; }
.choice-option { min-height:60px; }
.activity-feedback { font-size:16px; line-height:1.65; }
.reading-choice { min-height:56px; padding:10px; }
.reading-choice p { display:block; overflow:visible; -webkit-line-clamp:unset; font-size:16px; line-height:1.6; }
.paragraph-tabs button { width:44px; height:44px; }
.open-discussion { max-width:1040px; margin-inline:auto; color:#20344e; font-size:17px; line-height:1.75; }
.open-discussion h2 { font-size:26px; line-height:1.45; }
.open-discussion h3 { font-size:21px; line-height:1.5; }
.open-discussion button { min-height:46px; padding:10px 18px; border:1px solid #b9c9df; border-radius:10px; background:#fff; color:#284e85; cursor:pointer; font-size:16px; }
.open-discussion button[aria-current="step"], .open-discussion button[aria-pressed="true"] { background:#e7effc; border-color:#7299ce; }
.open-discussion .practice-primary { color:white; background:var(--student-action); border-color:var(--student-action); }
.discussion-topic { padding:24px; border:1px solid #d6e2f2; border-radius:16px; background:#f4f8fe; margin-bottom:20px; }
.discussion-response { display:block; margin-top:20px; }
.discussion-response textarea, textarea.discussion-response { display:block; width:100%; min-height:220px; padding:18px; border:1px solid #aebed3; border-radius:12px; background:white; font-size:18px; line-height:1.8; }
.discussion-tools, .discussion-nav { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-block:16px; }
.discussion-tools { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); align-items:start; }
.discussion-tools details { min-width:0; margin:0!important; }
.discussion-tools details[open] { grid-column:1/-1; }
.discussion-response > label:first-child { font-size:20px; font-weight:700; }
.discussion-response > label:has(input) { display:flex; align-items:center; gap:10px; margin-top:16px; }
.discussion-response input[type="checkbox"] { width:22px; height:22px; flex:0 0 auto; }
.discussion-response > small { display:block; margin-top:8px; }
.open-discussion details { margin:16px 0; border:1px solid var(--line); border-radius:12px; padding:14px 18px; background:#fafbfd; }
.open-discussion summary { min-height:36px; cursor:pointer; font-weight:700; }
.open-discussion small { font-size:14px; color:#50627c; }
.conversation, .authored-comprehension { max-width:1040px; margin-inline:auto; color:#20344e; font-size:17px; line-height:1.75; }
.conversation h2, .authored-comprehension h2 { font-size:26px; line-height:1.45; }
.conversation h3, .authored-comprehension h3 { font-size:22px; line-height:1.5; }
.conversation :is(button,summary), .authored-comprehension button { min-height:46px; font-size:16px; cursor:pointer; }
.conversation button, .speaking-route-choice button { padding:10px 16px; border:1px solid #b9c9df; border-radius:10px; color:#284e85; background:#fff; }
.conversation button[aria-pressed="true"], .speaking-route-choice button[aria-pressed="true"] { background:#e7effc; border:2px solid #315da8; }
.conversation .practice-primary { color:white; background:var(--student-action); border-color:var(--student-action); }
.conversation-roles { padding:14px 18px; border:1px solid var(--line); border-radius:12px; display:flex; flex-wrap:wrap; gap:10px; margin:20px 0; }
.conversation-roles legend { font-weight:700; padding:0 8px; }
.conversation-turn { padding:24px; background:#f4f8fe; border:1px solid #c9d9ec; border-radius:16px; margin:16px 0; }
.conversation-turn.is-mine { background:#f0f9f5; border-color:#b9dacf; }
.conversation-line, .conversation-model [lang="en"] { font-size:24px; line-height:1.75; }
.conversation-turn > span, .conversation-progress { color:#49617e; font-size:15px; font-weight:700; }
.conversation details { margin:16px 0; padding:14px 18px; background:#fafbfd; border:1px solid var(--line); border-radius:12px; }
.conversation summary { display:list-item; font-weight:700; }
.conversation small { display:block; font-size:14px; color:#50627c; }
.conversation-note { margin-top:22px; }
.conversation-controls, .speaking-route-choice { display:flex; gap:10px; flex-wrap:wrap; margin:20px 0; }
.speaking-route-choice button { min-height:46px; font-size:16px; cursor:pointer; }
.conversation textarea, .authored-comprehension textarea { display:block; width:100%; padding:16px; border:1px solid #aebed3; border-radius:12px; font-size:18px; line-height:1.75; }
.authored-comprehension .comprehension-paragraph { padding:20px; margin:16px 0; background:#f4f8fe; border-left:4px solid #648bbb; font-size:21px; line-height:1.85; }
.authored-comprehension textarea { min-height:120px; }
.setup-shell { height:auto; min-height:100dvh; }
.setup-content, .article-grid { height:auto; overflow:visible; }
html[data-player-level="kids"] .stage-main :is(.choice-option,.primary-action,.chunk-chip) { min-height:52px; }
html[data-player-level="kids"] .stage-titlebar > p { font-size:18px; }
html[data-player-level="kinder"] .kp-title p { font-size:18px; line-height:1.6; }
html[data-player-level="kinder"] .kp-menu-copy small { font-size:14px; line-height:1.5; }
html[data-player-level="kinder"] .kp-menu-card { box-shadow:0 3px 0 #e4eaf3; }
html[data-player-level="kinder"] .kp-button { min-height:52px!important; }
/* Kinder writing: the child's one sentence leads; source and topic support follow. */
html[data-player-level="kinder"] .stage-writing .stage-content { display:flex; flex-direction:column; gap:20px; }
html[data-player-level="kinder"] .stage-writing .stage-content > .lesson-card { order:2; padding:20px 24px; font-size:17px; line-height:1.7; }
html[data-player-level="kinder"] .stage-writing .stage-content > .lesson-card h3 { margin:0 0 12px; font-size:21px; }
html[data-player-level="kinder"] .stage-writing .young-writing { order:0; display:flex!important; flex-direction:column; gap:20px; height:auto!important; max-width:920px!important; margin-inline:auto!important; width:100%!important; }
html[data-player-level="kinder"] .young-writing > .young-writing__draft { order:0; padding:24px!important; border-radius:18px; border-top:1px solid #bfd7c8; min-height:0!important; height:auto!important; background:#fff; }
html[data-player-level="kinder"] .young-writing > .young-writing__topics { order:1; padding:20px 24px!important; min-height:0!important; height:auto!important; border-top:1px solid #dce3ed; background:#f7faf8; }
html[data-player-level="kinder"] .young-writing__draft .section-heading > .step-badge { display:none; }
html[data-player-level="kinder"] .young-writing__draft .section-heading h3 { font-size:25px; }
html[data-player-level="kinder"] .young-writing__draft .section-heading p { font-size:17px; line-height:1.6; }
html[data-player-level="kinder"] .young-writing__selected-topic { margin:12px 0; padding:12px; }
html[data-player-level="kinder"] .young-writing__fields { padding:18px!important; gap:10px; box-shadow:none!important; }
html[data-player-level="kinder"] .young-writing__fields label { font-size:18px!important; }
html[data-player-level="kinder"] .young-writing__fields input { min-height:48px; font-size:20px!important; }
html[data-player-level="kinder"] .young-writing__fields textarea { min-height:130px!important; height:150px; font-size:24px!important; line-height:1.7!important; padding:16px!important; }
html[data-player-level="kinder"] .young-writing__topics h2 { font-size:20px!important; margin:12px 0!important; }
html[data-player-level="kinder"] .young-writing__guide { padding:0!important; margin:10px 0!important; font-size:16px!important; }
html[data-player-level="kinder"] .young-writing__topic-list { margin:12px 0; }
html[data-player-level="kinder"] .young-writing__idea-card { margin:12px 0 0; padding:16px; }
html[data-player-level="kinder"] .young-writing__idea-card b { font-size:17px; line-height:1.6; }
html[data-player-level="kinder"] .young-writing__idea-card i { font-size:17px; }
html[data-player-level="kinder"] .ai-proofread-result { padding:18px!important; }
html[data-player-level="kinder"] .ai-proofread-result p, html[data-player-level="kinder"] .ai-proofread-paper__draft { font-size:18px!important; line-height:1.7!important; }
html[data-player-level="kinder"] .ai-proofread-result button { min-height:48px; font-size:16px!important; }
html[data-player-level="kinder"] .writing-submit-row { margin-top:16px; }
html[data-player-level="kinder"] .writing-submit-row button { min-height:54px; font-size:19px!important; box-shadow:none; }
@media (max-width:1100px) {
 .player-header { grid-template-columns:140px minmax(0,1fr) auto; gap:12px; padding:12px 16px; }
 .header-progress { display:none; }
 .player-body { grid-template-columns:188px minmax(0,1fr); }
 .stage-rail { padding:16px 8px; }
 .stage-link { grid-template-columns:26px minmax(0,1fr); }
 .stage-link > i { display:none; }
 .stage-link b { font-size:14px; }
 .stage-main { padding:20px 16px; }
 .stage-grid, .reading-layout, .discussion-layout, .listening-layout, .speaking-layout, .writing-layout { grid-template-columns:minmax(0,1fr); }
}
@media (max-width:767px) {
 .player-header { display:grid!important; grid-template-columns:minmax(0,1fr) auto!important; gap:10px!important; padding:12px 16px!important; height:auto!important; }
 .compact-brand { display:none!important; }
 .article-identity { border:0; padding:0; }
 .article-identity b { font-size:16px; }
 .header-tools { gap:6px; }
 .header-tools button { min-width:44px; min-height:44px; }
 .header-tools .change-article { padding:8px; font-size:12px; }
 .player-body { min-height:0!important; }
 .stage-rail { background:#f5f7fb!important; border-right:0; border-bottom:1px solid var(--line); padding:8px 12px!important; scrollbar-width:thin; }
 .stage-rail .stage-link-strip { display:flex!important; position:relative; width:100%; min-width:0; overflow-x:auto; gap:8px; padding:2px 0 6px; scrollbar-width:thin; }
 .stage-rail .stage-link { flex-basis:136px!important; min-height:56px!important; }
 .stage-link small { font-size:11px; }
 .stage-main { background:white!important; padding:20px 16px!important; }
 .stage-titlebar { margin-bottom:16px!important; padding:0!important; }
 .stage-titlebar h1 { font-size:23px!important; }
 .stage-titlebar > p { margin-top:10px; font-size:16px; }
 .stage-footer { display:flex!important; gap:8px!important; }
 .footer-tools { flex:1 0 100%; }
 .stage-footer .footer-prev, .stage-footer .footer-next { flex:1; min-width:0; }
 .stage-footer .completion-toggle { flex:1 0 100%; order:-1; }
 .stage-main :is(textarea,input,select) { font-size:16px!important; }
 .discussion-tools { grid-template-columns:1fr; }
 .discussion-topic { padding:18px; }
 .conversation-turn { padding:18px; }
 .conversation-line, .conversation-model [lang="en"] { font-size:22px; }
 .conversation details { padding:12px; }
 .stage-main .lesson-card { border-radius:14px!important; }
 .setup-shell { grid-template-columns:1fr; }
 .setup-brand-panel { display:none; }
 .setup-content { padding:20px 16px; }
 .article-grid { grid-template-columns:1fr; }
 .player-body.rail-collapsed .stage-main { padding-left:48px!important; }
 html[data-player-level="kinder"] .kp-title p { font-size:16px; }
 html[data-player-level="kinder"] .kp-menu-copy small { font-size:12px; }
}
@media (prefers-reduced-motion:reduce) { .player-body,.stage-link,.stage-rail,.article-card { transition:none; } }
