/* CSAT English Lab V4.1 — grammar AI voice tutor */
body.grammar-v41-open{overflow:hidden}
.grammar-v41-shell[hidden]{display:none!important}
.grammar-v41-shell{position:fixed;inset:0;z-index:10100;background:rgba(18,36,56,.38);backdrop-filter:blur(5px);display:grid;place-items:center;padding:14px}
.grammar-v41-app{width:min(1240px,100%);height:min(900px,calc(100vh - 28px));background:#f8fbfe;border:1px solid #d6e4ef;border-radius:26px;box-shadow:0 30px 90px rgba(24,52,82,.26);display:flex;flex-direction:column;overflow:hidden;color:#18334c}
.g41-header{display:grid;grid-template-columns:auto 1fr auto;gap:14px;align-items:center;padding:17px 20px;background:linear-gradient(135deg,#edf8ff,#fff9ed);border-bottom:1px solid #dce8f2}
.g41-header .eyebrow{font-size:.78rem;font-weight:900;color:#39709b;letter-spacing:.04em}
.g41-header h2{margin:3px 0 0;font-size:clamp(1.3rem,2.3vw,1.8rem);line-height:1.25;color:#15344e}
.g41-close{width:42px;height:42px;border:1px solid #c9d9e6;background:#fff;border-radius:50%;font-size:1.55rem;color:#345;cursor:pointer}
.g41-header-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.g41-header-actions button,.g41-audio-actions button,.g41-navigation button,.g41-input button,.g41-levels button,.g41-course-actions button,.g41-course-item button{font:inherit;cursor:pointer;border-radius:13px;border:1px solid #c6d8e6;background:#fff;color:#294862;padding:10px 14px;font-weight:800}
.g41-header-actions button:hover,.g41-audio-actions button:hover,.g41-course-item button:hover{border-color:#76afd4;background:#f4fbff}
.g41-levels{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:12px 18px;background:#fff;border-bottom:1px solid #dde8f1}
.g41-levels button{text-align:left;padding:12px 14px;background:#f8fbfd}
.g41-levels button b{display:block;color:#22425d;font-size:.96rem}
.g41-levels button span{display:block;margin-top:4px;font-size:.78rem;line-height:1.45;color:#718392}
.g41-levels button.on{border-color:#3d91c9;background:#eaf6ff;box-shadow:inset 0 0 0 1px #3d91c9}
.g41-layout{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(360px,.85fr);min-height:0;flex:1}
.g41-lesson-pane{display:flex;flex-direction:column;min-width:0;border-right:1px solid #dbe7f0;background:#fff}
.g41-section-head{display:flex;justify-content:space-between;gap:14px;align-items:center;padding:15px 19px;background:#fbfdff}
.g41-section-head span{font-size:.78rem;font-weight:900;color:#4680aa}
.g41-section-head h3{margin:3px 0 0;font-size:1.18rem;color:#183b58}
.g41-audio-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.g41-audio-actions button{padding:9px 12px;background:#f7fbfe}
.g41-progress{height:7px;background:#e9eff4}
.g41-progress>div{height:100%;background:linear-gradient(90deg,#3e9bd3,#67bd91);transition:width .22s ease}
.g41-lesson-pane>main{flex:1;overflow:auto;padding:22px;outline:none}
.g41-navigation{display:grid;grid-template-columns:auto 1fr auto;gap:10px;padding:14px 18px;background:#f7fbfd;border-top:1px solid #dce8f1}
.g41-navigation .primary,.g41-input .primary,.g41-course-actions .primary,.g41-course-item .primary,.g41-finish-actions .primary{background:#2b82c1;color:#fff;border-color:#2b82c1}
.g41-navigation .soft{background:#fff8e8;border-color:#ead5a2;color:#74571a}
.g41-navigation button:disabled{opacity:.45;cursor:not-allowed}
.g41-teacher,.g41-why,.g41-memory,.g41-warning,.g41-repair,.g41-diagnostic{border-radius:18px;padding:19px 20px;margin-bottom:15px;line-height:1.78}
.g41-teacher{background:#edf7ff;border:1px solid #c9e4f5}
.g41-teacher.closing{background:#eefaf3;border-color:#c6e6d2}
.g41-teacher b,.g41-why b,.g41-memory b,.g41-warning b,.g41-repair b,.g41-diagnostic b{display:block;margin-bottom:7px;color:#24506f}
.g41-teacher p,.g41-why p,.g41-memory p,.g41-warning p,.g41-repair p{margin:5px 0}
.g41-why{background:#fffaf0;border:1px solid #eddcb6}
.g41-why small{display:block;margin-top:9px;color:#7b6b4d}
.g41-long-copy{font-size:1.04rem;line-height:1.88;color:#2c465c}
.g41-long-copy p{margin:0 0 17px;padding:0 2px}
.g41-memory{background:#f0fbf5;border:1px solid #c8e8d5}
.g41-steps{list-style:none;padding:0;margin:0;display:grid;gap:12px}
.g41-steps li{display:grid;grid-template-columns:45px 1fr;gap:13px;align-items:start;border:1px solid #d8e5ee;background:#fbfdff;border-radius:16px;padding:14px 16px}
.g41-steps li>span{display:grid;place-items:center;width:38px;height:38px;border-radius:50%;background:#dff0fb;color:#246991;font-weight:900}
.g41-steps li b{color:#20445e;line-height:1.55}
.g41-steps li p{margin:6px 0 0;color:#63798a;line-height:1.6}
.g41-example{border:1px solid #d9e5ed;background:#fffdf7;border-radius:19px;padding:20px}
.g41-example.csat{background:#f3f8ff;border-color:#cfe0ef}
.g41-example .en{font-size:1.2rem;font-weight:850;line-height:1.7;color:#15344e}
.g41-example .ko{margin-top:10px;color:#50687a;line-height:1.68}
.g41-example .analysis{margin-top:16px;padding:15px 17px;background:rgba(255,255,255,.85);border-radius:13px;line-height:1.78}
.g41-example .analysis b{color:#2d5b7c}
.g41-example .analysis p{margin:7px 0}
.g41-example .analysis ol{margin:9px 0 0;padding-left:22px}
.g41-audio-inline{margin-top:14px;padding:9px 13px;border-radius:12px;border:1px solid #a9cbe1;background:#edf8ff;color:#245f86;font-weight:850;cursor:pointer}
.g41-warning{background:#fff3ec;border:1px solid #f0cfbc}
.g41-repair{background:#eef9f2;border:1px solid #c5e4cf}
.g41-diagnostic{background:#fff;border:1px solid #cfdde8}
.g41-diagnostic h3{font-size:1.12rem;line-height:1.65;color:#1c3e58}
.g41-diagnostic details{margin-top:12px;border-top:1px solid #e0e8ee;padding-top:12px}
.g41-diagnostic summary{cursor:pointer;font-weight:850;color:#2e6b95}
.g41-diagnostic details p{line-height:1.72}
.g41-finish-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}
.g41-finish-actions button{padding:11px 15px;border-radius:13px;font-weight:850;border:1px solid #c8d8e4;background:#fff;cursor:pointer}
.g41-ai-pane{display:flex;flex-direction:column;min-width:0;background:#f7fafc}
.g41-ai-title{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;padding:15px 16px;background:#edf7ff;border-bottom:1px solid #d2e5f2}
.g41-ai-title span{display:block;color:#39759f;font-size:.78rem;font-weight:900}
.g41-ai-title b{display:block;margin-top:3px;color:#173a55;line-height:1.4}
.g41-ai-title label{font-size:.76rem;color:#61798a;white-space:nowrap}
.g41-chat{flex:1;overflow:auto;padding:14px;display:flex;flex-direction:column;gap:10px;min-height:180px}
.g41-message{max-width:92%;padding:13px 14px;border-radius:16px;line-height:1.68;font-size:.94rem;box-shadow:0 3px 10px rgba(37,65,89,.05)}
.g41-message b{display:block;margin-bottom:5px;font-size:.75rem;letter-spacing:.02em}
.g41-message.user{align-self:flex-end;background:#2e84c1;color:#fff;border-bottom-right-radius:5px}
.g41-message.assistant{align-self:flex-start;background:#fff;border:1px solid #d6e3ec;color:#2b4559;border-bottom-left-radius:5px}
.g41-message.assistant b{color:#32749e}
.g41-message button{margin-top:9px;border:1px solid #b9d3e3;background:#f1f8fc;color:#2e6689;border-radius:10px;padding:6px 9px;font-size:.76rem;font-weight:800;cursor:pointer}
.g41-quick{display:flex;gap:7px;overflow:auto;padding:10px 12px;border-top:1px solid #dce7ef;background:#fff}
.g41-quick button{flex:0 0 auto;max-width:230px;border:1px solid #c8dbe8;background:#f7fbfd;color:#3c5e75;border-radius:999px;padding:8px 11px;font-size:.78rem;cursor:pointer;white-space:nowrap}
.g41-input{padding:12px;border-top:1px solid #d8e4ed;background:#fff}
.g41-input textarea{width:100%;resize:vertical;min-height:72px;max-height:150px;border:1px solid #bfd1df;border-radius:13px;padding:11px 12px;font:inherit;line-height:1.55;color:#264257;box-sizing:border-box}
.g41-input>div{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}
.g41-input button{padding:9px 12px}
.g41-course-hero{padding:26px;border:1px solid #cfe2f0;border-radius:24px;background:linear-gradient(135deg,#eaf7ff 0%,#fff8ec 100%);box-shadow:0 14px 36px rgba(41,94,132,.1)}
.g41-course-hero .eyebrow{font-size:.8rem;font-weight:900;color:#3277a6}
.g41-course-hero h2{margin:7px 0 10px;font-size:clamp(1.65rem,3vw,2.25rem);color:#173c59}
.g41-course-hero>p{max-width:820px;margin:0;color:#516d80;line-height:1.8;font-size:1.03rem}
.g41-course-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}
.g41-course-actions button{padding:12px 17px}
.g41-course-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:20px}
.g41-course-stats>div{padding:14px;background:rgba(255,255,255,.75);border:1px solid rgba(190,214,230,.8);border-radius:15px}
.g41-course-stats b{display:block;font-size:1.25rem;color:#246b9b}
.g41-course-stats span{display:block;margin-top:3px;font-size:.8rem;color:#698091}
.g41-course-tools{margin-top:15px;padding:15px;border:1px solid #d6e3ec;background:#fff;border-radius:18px}
.g41-course-tools label span{display:block;margin-bottom:6px;font-size:.8rem;font-weight:850;color:#4b6a80}
.g41-course-tools input{width:100%;border:1px solid #c5d6e2;border-radius:12px;padding:11px 13px;font:inherit;box-sizing:border-box}
.g41-module-tabs{display:flex;gap:7px;overflow:auto;margin-top:12px;padding-bottom:2px}
.g41-module-tabs button{flex:0 0 auto;border:1px solid #cbdbe6;background:#f8fbfd;color:#4b687d;border-radius:999px;padding:8px 12px;font-weight:800;cursor:pointer}
.g41-module-tabs button.on{background:#2e83be;color:#fff;border-color:#2e83be}
.g41-module-title{padding:18px 4px 9px}
.g41-module-title span{font-size:.78rem;font-weight:900;color:#4a82a8}
.g41-module-title h3{margin:5px 0;color:#1c3d56}
.g41-module-title p{margin:0;color:#6c7f8e;line-height:1.6}
.g41-course-list{display:grid;gap:10px}
.g41-course-item{display:grid;grid-template-columns:52px minmax(0,1fr) auto;gap:14px;align-items:center;padding:16px;border:1px solid #d4e1ea;background:#fff;border-radius:17px}
.g41-course-item.done{background:#f1fbf5;border-color:#bfe1ca}
.g41-course-item .no{display:grid;place-items:center;width:46px;height:46px;border-radius:14px;background:#e8f3fb;color:#2d709d;font-weight:900}
.g41-course-item.done .no{background:#d8f0e1;color:#287247}
.g41-course-item .copy b{display:block;color:#1f3d54;font-size:1.02rem}
.g41-course-item .copy p{margin:6px 0;color:#637889;line-height:1.55;font-size:.88rem;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.g41-course-item .copy small{color:#81919e}
.g41-course-item .actions{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}
.g41-course-item .actions button{padding:9px 12px;font-size:.82rem}
@media(max-width:900px){
 .grammar-v41-shell{padding:0;place-items:stretch}
 .grammar-v41-app{height:100%;border-radius:0;border:0}
 .g41-layout{grid-template-columns:1fr;overflow:auto}
 .g41-lesson-pane{min-height:72vh;border-right:0;border-bottom:1px solid #dbe7f0}
 .g41-ai-pane{min-height:65vh}
 .g41-course-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
 .g41-course-item{grid-template-columns:46px minmax(0,1fr)}
 .g41-course-item .actions{grid-column:1/-1;justify-content:stretch}
 .g41-course-item .actions button{flex:1}
}
@media(max-width:620px){
 .g41-header{grid-template-columns:auto 1fr;padding:13px}
 .g41-header-actions{grid-column:2;justify-content:flex-start}
 .g41-header-actions button{padding:7px 9px;font-size:.76rem}
 .g41-levels{grid-template-columns:1fr;padding:10px 12px}
 .g41-levels button span{display:none}
 .g41-section-head{align-items:flex-start;padding:13px}
 .g41-audio-actions{flex-direction:column}
 .g41-audio-actions button{padding:7px 9px;font-size:.76rem}
 .g41-lesson-pane>main{padding:15px}
 .g41-navigation{grid-template-columns:1fr 1fr;padding:11px}
 .g41-navigation .soft{grid-column:1/-1;grid-row:1}
 .g41-course-hero{padding:20px}
 .g41-course-stats{grid-template-columns:1fr 1fr}
 .g41-course-item{padding:13px;gap:10px}
}
@media(prefers-reduced-motion:reduce){.g41-progress>div{transition:none}}
