/* Grammar uses the full reading area, with a compact course directory. */
.content-layout.grammar-mode{grid-template-columns:minmax(0,1fr);grid-template-areas:"book";max-width:1600px;margin:auto;gap:0;padding-top:30px}
.content-layout.grammar-mode>.book-column{grid-area:book;grid-row:1;min-width:0}
.content-layout.grammar-mode>.detail-column,.grammar-mode .page-heading{display:none}
.grammar-view{--grammar-soft:#eef2e9;animation:fadeIn .2s ease both}
.grammar-hero{display:flex;justify-content:space-between;gap:28px;align-items:center;margin-bottom:26px}
.grammar-hero h2{font:500 clamp(24px,2.4vw,34px)/1.6 var(--serif);margin:8px 0;color:#303c31;letter-spacing:-.7px}
.grammar-hero p{margin:0;max-width:620px;font:13px/1.9 var(--sans);color:#7c8377}
.grammar-primary,.grammar-secondary{border:1px solid #4d7053;border-radius:7px;padding:11px 16px;font:500 13px var(--sans);cursor:pointer;min-height:43px}
.grammar-primary{background:#4d7053;color:#fff}
.grammar-secondary{background:#fffefa;border-color:#dedfd4;color:#66715f}
.grammar-primary:hover{background:#3d5d43}.grammar-secondary:hover{border-color:#92a48a;background:#f2f5ed}
.grammar-view button:disabled{opacity:.45;cursor:default}
.grammar-view button:focus-visible,.grammar-view input:focus-visible,.grammar-view select:focus-visible,.grammar-view textarea:focus-visible,.grammar-view summary:focus-visible{outline:2px solid #749478;outline-offset:3px}
.grammar-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.grammar-stats>div{padding:14px 20px;background:#eeeee5;border-radius:9px;display:flex;flex-direction:column;gap:7px}
.grammar-stats strong{font:500 26px var(--mono);color:#45634a}
.grammar-stats small{font:12px var(--mono);color:#929887}
.grammar-stats span{font-size:12px;color:#7a8372}
.grammar-overall{display:flex;gap:15px;align-items:center;margin:17px 0 28px;color:#8a8e82;font-size:11px}
.grammar-overall-track{background:#e0e5d8;height:5px;border-radius:8px;flex:1;max-width:300px;overflow:hidden}
.grammar-overall-track i,.grammar-session-track i{display:block;background:#6f8b65;height:100%;transition:width .25s}
.grammar-workspace{display:grid;grid-template-columns:minmax(235px,280px) minmax(0,1fr);gap:25px;align-items:start}
.grammar-directory{background:#efeee6;border:1px solid #e2e2d7;border-radius:12px;padding:18px 12px 8px;position:sticky;top:20px}
.grammar-directory-heading{display:flex;align-items:center;justify-content:space-between;margin:0 6px 16px;gap:10px}
.grammar-directory-heading h2{margin:0;font-size:15px;font-weight:600;color:#4b5946}
.grammar-directory-heading>span{font:9px var(--sans);color:#8d9386;white-space:nowrap}
.grammar-search{display:flex;align-items:center;gap:8px;background:#fffefa;border:1px solid #ddded4;border-radius:7px;padding:0 10px;margin:0 4px 10px}
.grammar-search>span{font-size:21px;color:#9a9e91}
.grammar-search input{min-width:0;width:100%;height:36px;border:0;background:transparent;color:#424d3d;outline:0;font:12px var(--sans)}
.grammar-group-filter{display:flex;align-items:center;gap:12px;font-size:11px;color:#7d8575;margin:0 4px 12px}
.grammar-group-filter select,.grammar-practice-toolbar select{background:#fffefa;border:1px solid #ddded4;border-radius:6px;padding:8px;color:#586651;font:12px var(--sans);min-width:0}
.grammar-group-filter select{flex:1;width:100%}
.grammar-muted{font:11px/1.8 var(--sans);color:#929788}
#grammarUnitCount{display:block;margin:0 7px 9px}
.grammar-units{max-height:calc(100vh - 280px);min-height:300px;overflow:auto;scrollbar-width:thin;scrollbar-color:#c5cfbd transparent}
.grammar-group-title{font:500 10px var(--sans);color:#939c89;letter-spacing:1px;margin:18px 10px 8px}
.grammar-group-title:first-child{margin-top:8px}
.grammar-unit{width:100%;display:flex;align-items:center;gap:10px;padding:11px 9px;border:1px solid transparent;border-radius:8px;background:transparent;color:#515d4b;text-align:left;cursor:pointer;margin:3px 0;min-height:65px}
.grammar-unit:hover{background:#e6ebdf}
.grammar-unit.selected{background:#e0e8d9;border-color:#cbd8c2}
.grammar-unit-number{font:11px var(--mono);color:#8a977f}
.grammar-unit-copy{display:flex;flex:1;min-width:0;flex-direction:column;gap:5px}
.grammar-unit-copy strong{font:500 12px/1.6 var(--sans)}
.grammar-unit-copy small{font:10px/1.5 var(--sans);color:#929a88;overflow-wrap:anywhere}
.grammar-unit-bar{height:3px;border-radius:6px;background:#e1e5d9;display:block;margin-top:3px;overflow:hidden}
.grammar-unit-bar i{height:100%;display:block;background:#829b74}
.grammar-unit-status{font:9px var(--mono);color:#86937a}
.grammar-learning{min-width:0;scroll-margin-top:20px}
.grammar-mode-tabs{display:flex;gap:5px;background:#eaece1;padding:5px;border-radius:9px;margin-bottom:15px;width:max-content;max-width:100%;flex-wrap:wrap}
.grammar-mode-tabs button{border:0;background:transparent;border-radius:6px;padding:9px 12px;font:12px var(--sans);color:#7c8571;cursor:pointer}
.grammar-mode-tabs button.selected{background:#fffefa;color:#4b6b49;box-shadow:0 2px 5px #55663d0a}
.grammar-lesson-card,.grammar-practice-card{background:#fffefa;border:1px solid #e5e4d9;border-radius:12px;padding:27px 30px}
.grammar-lesson-card{margin-bottom:18px;background:#f3f5ed;border-color:#e0e7d8}
.grammar-lesson-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:15px}
.grammar-lesson-heading h2{font:500 22px/1.6 var(--serif);margin:8px 0 12px;color:#3b4b35}
.grammar-unit-nav{display:flex;gap:5px}
.grammar-unit-nav button{width:33px;height:33px;border:1px solid #dce4d4;border-radius:6px;background:#fafbf5;color:#788a6a;font-size:17px;cursor:pointer}
.grammar-focus{display:inline-block;border-radius:5px;color:#59764b;background:#e4ecd9;padding:7px 11px;font:13px var(--mono);max-width:100%;overflow-wrap:anywhere}
.grammar-rule{font:13px/2 var(--sans);color:#707c64;margin:14px 0 9px}
.grammar-lesson-notes{border-top:1px solid #e1e8d7;margin-top:15px;padding-top:13px}
.grammar-lesson-notes summary{font-size:12px;color:#7d8d6e;cursor:pointer}
.grammar-lesson-notes>p{font:12px/1.8 var(--sans);color:#848c76}
.grammar-examples{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:16px 0}
.grammar-examples p{font:15px/1.7 Georgia,serif;color:#506743;margin:0 0 5px}
.grammar-examples span{color:#8c977e;font-size:11px;line-height:1.8}
.grammar-practice-toolbar{display:flex;gap:15px;justify-content:space-between;align-items:center}
.grammar-practice-toolbar>div{display:flex;gap:13px;align-items:center;flex-wrap:wrap}
.grammar-practice-toolbar strong{font:500 12px var(--sans);color:#7e8b71}
.grammar-practice-toolbar>div>span{font:10px var(--mono);color:#a0a596}
.grammar-practice-toolbar label{display:flex;align-items:center;gap:8px;color:#919989;font-size:11px;white-space:nowrap}
.grammar-session-track{height:3px;background:#ecefe5;border-radius:5px;margin:17px 0 16px;overflow:hidden}
.grammar-dots{display:flex;gap:5px;flex-wrap:wrap;margin-bottom:28px}
.grammar-dots button{border:1px solid #e4e5db;background:transparent;color:#a2a897;width:28px;height:28px;border-radius:50%;font:10px var(--mono);cursor:pointer}
.grammar-dots button.passed{background:#e8f0de;border-color:#d5e4c9;color:#728b5c}
.grammar-dots button.failed{background:#f5e7dc;border-color:#e7d3c2;color:#b5835d}
.grammar-dots button.current{border:2px solid #6a8456;color:#506d40}
.grammar-kind{display:inline-block;color:#6f845d;background:#eef2e7;padding:5px 9px;border-radius:4px;font-size:11px}
#grammarPrompt{font:400 clamp(20px,2vw,27px)/1.9 Georgia,var(--serif);margin:16px 0 9px;color:#354531;overflow-wrap:anywhere;outline:none}
.grammar-blank{display:inline-block;color:#85a270;background:#f0f4e8;border-bottom:2px solid #a0b58a;padding:0 10px;min-width:65px;line-height:1.5;border-radius:4px 4px 0 0}
.grammar-question-hint{font:12px/1.9 var(--sans);color:#969e8b;margin-bottom:23px}
.grammar-answer-field{display:block}
.grammar-answer-field>span{display:block;font:11px var(--sans);color:#8d987f;margin-bottom:9px}
.grammar-answer-field textarea{width:100%;min-height:51px;resize:vertical;border:1px solid #d8dfce;border-radius:7px;background:#fcfdf7;padding:14px 15px;font:16px/1.7 var(--sans);color:#40523a}
.grammar-answer-field textarea[readonly]{background:#f2f4ec;color:#7e8b71}
.grammar-choices{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.grammar-choice{display:flex;align-items:center;gap:12px;padding:13px 15px;min-height:51px;border:1px solid #e1e4d7;border-radius:7px;color:#627353;cursor:pointer;overflow-wrap:anywhere}
.grammar-choice:has(input:checked){border-color:#94ab7c;background:#f0f5e7}
.grammar-choice.right-answer{border-color:#94ab7c;background:#eef4e4}
.grammar-choice input{accent-color:#668552;width:15px;height:15px;flex-shrink:0}
.grammar-option-letter{font:10px var(--mono);color:#99a68d}
.grammar-choice>span:last-child{font-size:15px}
.grammar-question-actions{display:flex;gap:10px;flex-wrap:wrap;margin:22px 0 0}
.grammar-live{font:12px var(--sans);color:#b0855e;min-height:6px;margin:12px 0}
.grammar-feedback{padding:21px 23px;border:1px solid #dfe8d2;border-radius:8px;background:#f1f6e9;margin-top:20px}
.grammar-feedback.incorrect{background:#fbf2e9;border-color:#eedcc9}
.grammar-feedback.compare{background:#f6f4e9;border-color:#e5e0c7}
.grammar-feedback-heading{display:flex;justify-content:space-between;align-items:center;gap:15px;flex-wrap:wrap;margin-bottom:18px}
.grammar-feedback-heading strong{font:500 14px var(--sans);color:#638447}
.grammar-feedback.incorrect .grammar-feedback-heading strong{color:#b17c50}
.grammar-feedback.compare .grammar-feedback-heading strong{color:#9a8c53}
.grammar-feedback-heading button{font-size:11px;min-height:34px;padding:7px 9px}
.grammar-answer-caption{font:10px var(--sans);color:#98a085}
.grammar-reference{font:19px/1.8 Georgia,serif;color:#556b45;margin:8px 0 14px;overflow-wrap:anywhere}
.grammar-explanation{color:#83906f;font:13px/1.9 var(--sans)}
.grammar-feedback details{font:12px/1.8 var(--sans);color:#939b81}
.grammar-self-check{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.grammar-self-check button{font-size:12px;min-height:37px;padding:8px 12px}
/* Full explanations stay open and readable on tablets and phones. */
.grammar-feedback{scroll-margin-top:24px;min-width:0;color:#43513e}
.grammar-answer-comparison{display:flex;align-items:baseline;gap:8px 12px;flex-wrap:wrap;padding:12px 14px;margin-bottom:18px;background:#fffdf8;border:1px solid #e0e4d5;border-radius:7px}
.grammar-answer-comparison>span{font:12px var(--sans);color:#66715f}
.grammar-answer-comparison>p{font:16px/1.8 var(--sans);margin:0;overflow-wrap:anywhere;max-width:100%}
.grammar-answer-comparison>strong{font:600 16px/1.8 var(--sans);color:#3d603f;overflow-wrap:anywhere}
.grammar-reference-translation{font:14px/1.9 var(--sans);color:#53644c;margin:-6px 0 20px}
.grammar-alternatives{padding:12px 0}
.grammar-feedback details{color:#55644b;font-size:13px}
.grammar-detailed-explanation{margin-top:18px}
.grammar-analysis-section{border-top:1px solid #dfe4d4;padding-top:22px;margin-top:22px;min-width:0}
.grammar-analysis-section h4{display:flex;align-items:center;gap:10px;font:600 15px/1.7 var(--sans);color:#3e5538;margin:0 0 14px}
.grammar-analysis-section h4>span{font:11px var(--mono);color:#7e8e72;border:1px solid #ccd7c0;border-radius:5px;padding:4px 5px}
.grammar-analysis-section>p,.grammar-reasoning,.grammar-option-explanation p,.grammar-sentence-part p{font:14px/1.95 var(--sans);color:#4f5d46;overflow-wrap:anywhere}
.grammar-structure-formula{background:#fffdf8;border:1px solid #d8e1cb;border-left:3px solid #829b71;border-radius:6px;padding:13px 15px;font:500 15px/1.9 var(--sans);color:#36562e;overflow-wrap:anywhere}
.grammar-analysis-help{font-size:12px!important;color:#69755f!important;margin:0 0 13px}
.grammar-sentence-parts{display:grid;gap:9px}
.grammar-sentence-part{padding:13px 15px;border:1px solid #e0e4d7;background:#fffdf9;border-radius:7px;min-width:0}
.grammar-sentence-part>div{display:flex;align-items:baseline;gap:8px 12px;justify-content:space-between;flex-wrap:wrap}
.grammar-sentence-part strong{font:500 17px/1.6 Georgia,serif;color:#344e2c;overflow-wrap:anywhere;min-width:0}
.grammar-sentence-part span{font:11px/1.6 var(--sans);color:#637651;background:#edf2e5;border-radius:4px;padding:3px 7px}
.grammar-sentence-part p{margin:7px 0 0;font-size:13px}
.grammar-reasoning{padding-left:23px;margin:0}
.grammar-reasoning li{padding-left:4px;margin:0 0 12px}
.grammar-reasoning li::marker{font-weight:600;color:#6b8457}
.grammar-option-explanation{background:#fffdf9;border:1px solid #e2e2d6;border-radius:7px;padding:14px 15px;margin-bottom:10px}
.grammar-option-explanation>div{display:flex;align-items:baseline;flex-wrap:wrap;gap:8px 14px}
.grammar-option-explanation strong{font:500 16px/1.6 var(--sans);color:#48583b;overflow-wrap:anywhere}
.grammar-option-explanation span{font:11px/1.6 var(--sans);color:#7d826e}
.grammar-option-explanation p{margin:7px 0 0;font-size:13px}
.grammar-option-explanation.is-right{border-color:#b5caa7;background:#f6faf0}
.grammar-option-explanation.is-right span{color:#4a7139}
.grammar-option-explanation.is-selected-wrong{border-color:#d3aa8a;background:#fff6ec}
.grammar-option-explanation.is-selected-wrong span{color:#9d5d36}
.grammar-transfer-example{border-left:3px solid #9daf87;padding:2px 0 4px 15px}
.grammar-transfer-example p[lang=en]{font:18px/1.8 Georgia,serif;color:#3c5333;margin:0 0 7px;overflow-wrap:anywhere}
.grammar-transfer-example p:not([lang]){font:13px/1.9 var(--sans);color:#59694e;margin:0 0 12px}
.grammar-transfer-example button{font-size:12px;min-height:40px;padding:8px 12px}
.grammar-takeaway{display:flex;gap:10px 15px;align-items:baseline;flex-wrap:wrap;padding:16px;margin-top:24px;background:#e7eddd;border-radius:7px}
.grammar-takeaway strong{font:600 13px var(--sans);color:#4c6b3e}
.grammar-takeaway p{flex:1;min-width:180px;font:14px/1.9 var(--sans);color:#415736;margin:0}
.grammar-translation-check{border-top:1px solid #dedfce;margin-top:22px;padding-top:18px}
.grammar-translation-check>p{font:13px/1.9 var(--sans);color:#5e674e}
.grammar-explanation-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:22px;padding-top:20px;border-top:1px solid #dfe4d4}
.grammar-lesson-patterns{display:grid;gap:12px;margin:17px 0}
.grammar-lesson-patterns>div{background:#fcfdf7;border:1px solid #dfe6d5;border-radius:7px;padding:13px 15px}
.grammar-lesson-patterns strong{font:500 14px/1.8 var(--sans);color:#44633b;overflow-wrap:anywhere}
.grammar-lesson-patterns p,.grammar-lesson-pitfalls{font:13px/1.9 var(--sans);color:#596b4d;margin:6px 0 0}
.grammar-notes-heading{font:600 13px var(--sans);color:#526746;margin:20px 0 12px}
.grammar-lesson-pitfalls{padding-left:20px}.grammar-lesson-pitfalls li{margin-bottom:9px}
.grammar-session-end{text-align:center;padding:28px 10px}
.grammar-session-end>span{font-size:35px;color:#a1b18b}
.grammar-session-end h3{font:500 23px var(--serif);color:#5e754a;margin:20px 0 12px}
.grammar-session-end p{font:13px/2 var(--sans);color:#8e987e}
.grammar-session-end>div{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin-top:25px}
.grammar-save-note{font:11px/1.9 var(--sans);color:#979e8a;margin:16px 4px}
.grammar-source{font:10px/1.9 var(--sans);color:#9ba28e;border-top:1px solid #e5e7d9;padding:18px 0;margin-top:22px}
.grammar-source a{color:#859874}
.grammar-directory-toggle{display:none}
.grammar-jump-label{display:flex;gap:14px;align-items:center;margin:0 0 17px;padding-bottom:15px;border-bottom:1px solid #e0e7d6;color:#7b8b6c;font:11px var(--sans)}
.grammar-jump-label select{min-width:0;max-width:320px;flex:1;padding:8px;border-radius:6px;border:1px solid #d9e3ce;background:#fafcf5;color:#667a53;font:12px var(--sans)}
.grammar-hero p,.grammar-save-note{color:#7b8572}
.grammar-question-hint,.grammar-unit-copy small{color:#7c886e}
.grammar-stats span,.grammar-muted{color:#7b8771}
@media(max-width:1200px){.grammar-workspace{grid-template-columns:235px minmax(0,1fr);gap:17px}.grammar-lesson-card,.grammar-practice-card{padding:23px}.grammar-hero{align-items:flex-start}.grammar-hero>button{flex-shrink:0;margin-top:24px}}
@media(max-width:900px){.grammar-workspace{grid-template-columns:1fr}.grammar-directory{position:static}.grammar-units{max-height:245px;min-height:0}.grammar-directory-heading{margin-bottom:12px}.grammar-hero{flex-wrap:wrap;gap:14px}.grammar-hero>button{margin:0}.grammar-directory .grammar-unit{min-height:60px}.grammar-overall{margin-bottom:20px}.grammar-directory .grammar-unit-bar{max-width:250px}.grammar-stats>div{padding:15px}.grammar-stats strong{font-size:22px}}
@media(max-width:900px){.grammar-directory-toggle{display:block;width:100%;border:0;border-radius:6px;background:#e6ecdf;color:#6b8257;min-height:38px;padding:9px;font:12px var(--sans);cursor:pointer;margin-bottom:12px}.grammar-directory.is-collapsed>*:not(.grammar-directory-toggle){display:none!important}.grammar-directory.is-collapsed{padding:8px}.grammar-directory.is-collapsed .grammar-directory-toggle{margin-bottom:0}.grammar-jump-label{flex-wrap:wrap;gap:8px}.grammar-jump-label select{flex-basis:100%;max-width:none}}
@media(max-width:620px){.content-layout.grammar-mode{padding:23px 13px}.grammar-hero{margin-bottom:20px}.grammar-hero h2{font-size:23px}.grammar-hero p{font-size:12px}.grammar-stats{gap:8px;grid-template-columns:repeat(2,1fr)}.grammar-stats>div{padding:14px}.grammar-overall{display:block}.grammar-overall-track{max-width:none;margin-bottom:9px}.grammar-directory-heading>span{font-size:10px}.grammar-lesson-card,.grammar-practice-card{padding:18px 15px}.grammar-lesson-heading h2{font-size:19px}.grammar-unit-nav{gap:4px}.grammar-focus{font-size:11px}.grammar-examples{grid-template-columns:1fr;gap:13px}.grammar-mode-tabs{width:100%;gap:1px}.grammar-mode-tabs button{flex:1;font-size:11px;padding:10px 6px}.grammar-practice-toolbar{align-items:flex-start;gap:8px}.grammar-practice-toolbar>div{gap:6px;flex-direction:column;align-items:flex-start}.grammar-practice-toolbar label{font-size:10px}.grammar-practice-toolbar select{font-size:11px;padding:7px}.grammar-dots{gap:5px;margin-bottom:22px}.grammar-dots button{width:25px;height:25px}.grammar-choices{grid-template-columns:1fr}.grammar-primary,.grammar-secondary{font-size:12px;padding:10px 12px}.grammar-feedback{padding:17px 15px}.grammar-reference{font-size:17px}.grammar-question-actions{gap:8px}#grammarPrompt{font-size:23px}.grammar-source{font-size:10px}.grammar-save-note{font-size:10px}.nav-item#navGrammar .nav-icon{font-family:Georgia,serif;font-size:15px;width:19px}}
@media(max-width:620px){.grammar-feedback{padding:18px 13px;scroll-margin-top:15px}.grammar-analysis-section h4{font-size:15px}.grammar-structure-formula{padding:12px;font-size:14px}.grammar-sentence-part,.grammar-option-explanation{padding:12px}.grammar-sentence-part>div{display:block}.grammar-sentence-part span{display:table;margin-top:7px}.grammar-analysis-section>p,.grammar-reasoning{font-size:14px}.grammar-takeaway{padding:14px;gap:8px}.grammar-takeaway p{flex-basis:100%;min-width:0}.grammar-explanation-actions button{min-height:44px}.grammar-self-check button,.grammar-feedback-heading button{min-height:44px}.grammar-feedback-heading{gap:12px}.grammar-answer-comparison{padding:11px}.grammar-lesson-patterns>div{padding:12px}}
