/* CSAT English Lab V4.1B — functional grammar level switching and movable AI tutor */
body.grammar-v41b-open{overflow:hidden}.grammar-v41b-shell[hidden]{display:none!important}.grammar-v41b-shell{position:fixed;inset:0;z-index:10200;background:rgba(17,34,51,.42);backdrop-filter:blur(5px)}
.grammar-v41b-app{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:min(1260px,calc(100vw - 28px));height:min(880px,calc(100vh - 28px));min-width:760px;min-height:560px;max-width:calc(100vw - 8px);max-height:calc(100vh - 8px);resize:both;overflow:hidden;background:#f7fbfe;border:1px solid #cadce9;border-radius:24px;box-shadow:0 28px 90px rgba(17,45,70,.3);display:flex;flex-direction:column;color:#19364e}
.g41b-header{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:13px;align-items:center;padding:14px 17px;background:linear-gradient(135deg,#eaf7ff,#fff8ea);border-bottom:1px solid #d5e5ef;cursor:move;user-select:none;touch-action:none}.g41b-header button{cursor:pointer}.g41b-header .close{width:42px;height:42px;border-radius:50%;border:1px solid #bdd1df;background:#fff;font-size:1.45rem}.g41b-header .title span{font-size:.76rem;font-weight:900;color:#3579a5}.g41b-header h2{margin:3px 0;font-size:clamp(1.2rem,2vw,1.65rem)}.g41b-header small{color:#718694}.window-actions{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}.window-actions button,.g41b-section-head button,.g41b-ai-title button,.g41b-input button,.g41b-navigation button,.g41b-level-banner button,.g41b-finish button,.g41b-confusion button,.g41b-course-hero button,.g41b-course-tabs button,.g41b-course-list button{border:1px solid #bfd2df;background:#fff;color:#284b63;border-radius:12px;padding:8px 11px;font:inherit;font-weight:800;cursor:pointer}.window-actions .stop,.g41b-ai-title button,.g41b-audio-dock button{border-color:#e0a2a2;background:#fff2f2;color:#9a3434}
.g41b-levels{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;padding:11px 16px;background:#fff;border-bottom:1px solid #dce7ef}.g41b-levels button{border:2px solid #d3e0e9;background:#f8fbfd;border-radius:15px;padding:10px 13px;text-align:left;cursor:pointer}.g41b-levels button b{display:block;color:#274b65}.g41b-levels button span{display:block;margin-top:3px;font-size:.78rem;line-height:1.4;color:#708391}.g41b-levels button.on{border-color:#2d8bc6;background:#eaf6ff;box-shadow:0 0 0 2px rgba(45,139,198,.12)}
.g41b-level-banner{display:flex;gap:10px;align-items:center;padding:9px 16px;background:#eef8ff;border-bottom:1px solid #cee3f1}.g41b-level-banner b{color:#1e6796}.g41b-level-banner span{flex:1;color:#536f82;font-size:.88rem}.g41b-level-banner.flash{animation:g41bFlash .7s ease}@keyframes g41bFlash{0%{background:#fff0b8}100%{background:#eef8ff}}
.g41b-mobile-tabs{display:none}.g41b-layout{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(350px,.85fr);min-height:0;flex:1}.g41b-lesson-pane,.g41b-ai-pane{min-width:0;min-height:0;display:flex;flex-direction:column}.g41b-lesson-pane{background:#fff;border-right:1px solid #d6e4ed}.g41b-section-head{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:13px 17px;background:#fbfdff}.g41b-section-head span{font-size:.78rem;font-weight:900;color:#4380a8}.g41b-section-head h3{margin:3px 0 0;font-size:1.15rem}.g41b-section-head>div:last-child{display:flex;gap:7px;flex-wrap:wrap}.g41b-progress{height:7px;background:#e9eff4}.g41b-progress>div{height:100%;background:linear-gradient(90deg,#3b94cc,#65b88b);transition:width .2s}.g41b-lesson-pane>main{flex:1;min-height:0;overflow:auto;padding:20px}.g41b-change-mark{display:inline-flex;margin-bottom:13px;padding:7px 11px;border-radius:999px;background:#e6f4ff;color:#226b98;font-weight:900;font-size:.82rem}
.g41b-narrative{font-size:1.03rem;line-height:1.86;color:#29465a}.g41b-narrative>p{margin:0 0 16px}.g41b-narrative aside,.g41b-narrative .question,.g41b-example .question{padding:15px 17px;border-radius:15px;background:#f0faf5;border:1px solid #c7e7d3;margin-top:14px}.g41b-narrative aside b{color:#26714c}.g41b-steps{list-style:none;padding:0;margin:0;display:grid;gap:11px}.g41b-steps li{display:grid;grid-template-columns:42px 1fr;gap:12px;padding:14px;border:1px solid #d5e4ed;border-radius:15px;background:#fbfdff}.g41b-steps li>span{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:#dff1fb;color:#246c98;font-weight:900}.g41b-steps p{margin:6px 0 0;line-height:1.65;color:#607789}.g41b-example{padding:19px;border:1px solid #d5e2eb;border-radius:18px;background:#fffdf6}.g41b-example .en{font-size:1.17rem;font-weight:850;line-height:1.7}.g41b-example .ko{margin-top:9px;line-height:1.65;color:#536b7d}.g41b-example .analysis{margin-top:15px;padding:15px;background:#fff;border-radius:13px;line-height:1.75}.g41b-example .analysis p{margin:8px 0}.g41b-example>button{margin-top:13px;border:1px solid #add0e5;background:#edf8ff;color:#24698f;border-radius:11px;padding:8px 11px;font-weight:850}.g41b-mistake,.g41b-repair,.g41b-check{padding:17px;border-radius:16px;margin-bottom:13px;line-height:1.75}.g41b-mistake{background:#fff1ea;border:1px solid #efc9b7}.g41b-repair{background:#eef9f2;border:1px solid #c7e4d1}.g41b-check{background:#f8fbfd;border:1px solid #cfdee8}.g41b-check h4{margin:0 0 10px}.g41b-finish{display:flex;gap:9px;flex-wrap:wrap;margin-top:14px}.primary{background:#2b82c1!important;color:#fff!important;border-color:#2b82c1!important}
.g41b-navigation{display:grid;grid-template-columns:auto 1fr auto;gap:9px;padding:12px 15px;background:#f6fafc;border-top:1px solid #d8e5ee}.g41b-navigation .confused{background:#fff7e4;border-color:#e5cd95;color:#79591c}.g41b-navigation button:disabled{opacity:.45}.g41b-confusion{max-height:45%;overflow:auto;padding:15px 18px;background:#fff9e9;border-top:2px solid #efcf83}.g41b-confusion .head{display:flex;justify-content:space-between;gap:10px;align-items:center}.g41b-confusion>p,.g41b-confusion li,.g41b-confusion .wrong p,.g41b-confusion .right p,.g41b-confusion .mini p{line-height:1.7}.g41b-confusion .wrong,.g41b-confusion .right,.g41b-confusion .mini{padding:12px 14px;border-radius:13px;margin:10px 0}.g41b-confusion .wrong{background:#fff0eb}.g41b-confusion .right{background:#edf9f1}.g41b-confusion .mini{background:#eef7ff}.g41b-confusion .mini span{display:block;color:#5e7586;margin-top:4px}
.g41b-ai-pane{background:#f6fafc}.g41b-ai-title{display:flex;justify-content:space-between;gap:10px;padding:13px 14px;background:#edf7ff;border-bottom:1px solid #d3e5f0}.g41b-ai-title span{display:block;font-size:.76rem;font-weight:900;color:#3b78a0}.g41b-ai-title b{display:block;margin-top:3px}.g41b-chat{flex:1;min-height:0;overflow:auto;padding:13px;display:flex;flex-direction:column;gap:9px}.g41b-chat article{max-width:94%;padding:12px 13px;border-radius:15px;line-height:1.65}.g41b-chat article.user{align-self:flex-end;background:#2e84c1;color:#fff}.g41b-chat article.assistant{align-self:flex-start;background:#fff;border:1px solid #d4e2eb}.g41b-chat article p{margin:5px 0}.g41b-chat article button{border:1px solid #bfd5e3;background:#f1f8fc;border-radius:9px;padding:5px 8px}.g41b-quick{display:flex;gap:6px;overflow-x:auto;padding:9px 11px;background:#fff;border-top:1px solid #d9e5ed}.g41b-quick button{flex:0 0 auto;max-width:240px;white-space:nowrap;border:1px solid #c7dbe8;background:#f7fbfd;border-radius:999px;padding:7px 10px}.g41b-input{padding:11px;background:#fff;border-top:1px solid #d7e3ec}.g41b-input textarea{width:100%;box-sizing:border-box;min-height:70px;max-height:140px;resize:vertical;border:1px solid #bdcfdd;border-radius:12px;padding:10px;font:inherit}.g41b-input>div{display:flex;justify-content:flex-end;gap:8px;margin-top:8px;flex-wrap:wrap}
.g41b-audio-dock{position:absolute;left:50%;bottom:14px;transform:translateX(-50%);z-index:5;display:flex;gap:15px;align-items:center;padding:10px 12px 10px 15px;border-radius:999px;background:#173d57;color:#fff;box-shadow:0 12px 28px rgba(14,44,65,.3)}.g41b-audio-dock[hidden]{display:none}.g41b-audio-dock span{display:flex;align-items:center;gap:8px}.g41b-audio-dock i{width:9px;height:9px;border-radius:50%;background:#72d9a0;animation:g41bPulse 1s infinite}@keyframes g41bPulse{50%{opacity:.35}}.g41b-audio-dock button{padding:7px 10px;border-radius:999px}.g41b-resize-hint{position:absolute;right:13px;bottom:4px;font-size:.68rem;color:#79909f;pointer-events:none}.grammar-v41b-app.fit{resize:none;border-radius:16px}
.g41b-course-hero{padding:24px;border-radius:22px;background:linear-gradient(135deg,#eaf7ff,#fff8e9);border:1px solid #cfe2ee}.g41b-course-hero span{font-size:.8rem;font-weight:900;color:#347ba6}.g41b-course-hero h2{margin:7px 0}.g41b-course-hero p{line-height:1.75;color:#526d7f}.g41b-course-tabs{display:flex;gap:7px;overflow:auto;margin:13px 0}.g41b-course-tabs button.on{background:#2c83bd;color:#fff}.g41b-course-list{display:grid;gap:10px}.g41b-course-list article{padding:15px;border:1px solid #d3e1ea;border-radius:15px;background:#fff}.g41b-course-list article p{line-height:1.6;color:#617788}
@media(max-width:900px){.grammar-v41b-app{position:fixed;inset:0!important;transform:none!important;width:100%!important;height:100%!important;min-width:0;min-height:0;max-width:none;max-height:none;resize:none;border:0;border-radius:0}.g41b-header{cursor:default;touch-action:auto}.g41b-header small,.g41b-resize-hint,.window-actions [data-g41b-reset-window],.window-actions [data-g41b-fit]{display:none}.g41b-layout{display:block;overflow:auto}.g41b-mobile-tabs{display:grid;grid-template-columns:1fr 1fr;padding:8px;background:#fff;border-bottom:1px solid #dae6ee}.g41b-mobile-tabs button{padding:10px;border:1px solid #cadbe6;background:#f7fafc;font-weight:850}.g41b-mobile-tabs button.on{background:#2c83bd;color:#fff}.grammar-v41b-shell[data-mobile-tab="lesson"] .g41b-ai-pane,.grammar-v41b-shell[data-mobile-tab="ai"] .g41b-lesson-pane{display:none}.g41b-lesson-pane,.g41b-ai-pane{height:calc(100vh - 185px);border:0}.g41b-ai-pane{min-height:0}.g41b-ai-title{position:sticky;top:0;z-index:2}.g41b-input{padding-bottom:max(11px,env(safe-area-inset-bottom))}.g41b-levels{grid-template-columns:repeat(3,minmax(0,1fr))}.g41b-levels button span{display:none}.g41b-level-banner button{display:none}.g41b-audio-dock{bottom:max(12px,env(safe-area-inset-bottom));max-width:calc(100vw - 24px)}}
@media(max-width:620px){.g41b-header{grid-template-columns:auto minmax(0,1fr);padding:10px}.window-actions{grid-column:1/-1;justify-content:flex-end}.window-actions button{padding:6px 8px;font-size:.75rem}.g41b-levels{padding:8px;gap:5px}.g41b-levels button{padding:9px 7px;text-align:center}.g41b-level-banner{padding:8px 10px}.g41b-level-banner span{font-size:.76rem}.g41b-section-head{align-items:flex-start;padding:11px}.g41b-section-head>div:last-child{flex-direction:column}.g41b-section-head button{padding:6px 8px;font-size:.74rem}.g41b-lesson-pane>main{padding:13px}.g41b-navigation{grid-template-columns:1fr 1fr;padding:9px}.g41b-navigation .confused{grid-column:1/-1;grid-row:1}.g41b-input>div button{flex:1}.g41b-ai-title{align-items:center}.g41b-ai-title b{font-size:.88rem}.g41b-audio-dock{border-radius:16px;left:12px;right:12px;transform:none;justify-content:space-between}}
@media(prefers-reduced-motion:reduce){.g41b-level-banner.flash,.g41b-audio-dock i,.g41b-progress>div{animation:none;transition:none}}