@font-face{font-family:TimeFont;src:url('/assets/TWFzbWFrLm90ZjE2NTY0ODc2MTEyMzc=.otf') format('opentype');font-display:swap}
:root{font-family:TimeFont,system-ui,sans-serif;color:#17201f;background:#f5f8f6;line-height:1.5;font-synthesis:none}*{box-sizing:border-box}body{margin:0;min-width:320px;background:linear-gradient(180deg,#f7faf8 0%,#eef5f1 100%)}button{font:inherit;cursor:pointer}.topbar{height:74px;background:#fff;border-bottom:1px solid #dce8e2;display:flex;align-items:center;justify-content:space-between;padding:0 max(22px,calc((100vw - 1180px)/2));direction:ltr}.brand{display:flex;align-items:center;gap:10px;color:#19352d;text-decoration:none;font-size:20px;font-weight:800}.brand-mark{display:grid;place-items:center;width:38px;height:38px;border-radius:12px;background:#143f32;color:#c8f27b;font-size:23px}.topbar-actions{display:flex;align-items:center;gap:14px;direction:rtl}.streak{color:#567169;font-size:14px}.sound-button,.listen-button{border:1px solid #c9ddd3;background:#f4faf6;color:#1c5847;border-radius:10px;min-height:40px;padding:0 12px}.sound-button{font-size:18px;width:42px;padding:0}.app-shell{max-width:1080px;margin:0 auto;padding:42px 22px 64px}.welcome-row{display:flex;align-items:end;justify-content:space-between;gap:24px;margin-bottom:30px}.eyebrow{margin:0 0 5px;color:#4c886f;font-size:13px;font-weight:700;letter-spacing:.02em}.welcome-row h1{margin:0;color:#17372d;font-size:clamp(29px,4vw,44px);line-height:1.15}.intro{margin:10px 0 0;color:#6a7e76;font-size:16px}.daily-score{min-width:130px;padding:15px 17px;background:#e4f2db;border:1px solid #c7e1b8;border-radius:14px;text-align:center}.daily-score span{display:block;color:#4d7250;font-size:13px}.daily-score strong{display:block;color:#2a6b3e;font-size:25px}.module-tabs{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:18px}.module-tab{display:flex;align-items:center;justify-content:center;gap:9px;border:1px solid #d5e3dc;background:#fff;color:#557067;border-radius:12px;padding:13px 9px;transition:.2s}.module-tab span{display:grid;place-items:center;min-width:27px;height:27px;border-radius:8px;background:#edf4ef;color:#287154;font-size:13px;font-weight:800;direction:ltr}.module-tab.active{background:#1c5745;color:#fff;border-color:#1c5745;box-shadow:0 5px 14px #1c57451c}.module-tab.active span{background:#c8f27b;color:#1c5745}.progress-panel{background:#fff;border:1px solid #dce8e2;border-radius:14px;padding:14px 17px;margin-bottom:18px}.progress-copy{display:flex;justify-content:space-between;color:#5a7068;font-size:14px;margin-bottom:9px}.progress-track{height:7px;background:#e7efeb;border-radius:8px;overflow:hidden}.progress-track span{display:block;width:20%;height:100%;background:#79b95d;border-radius:inherit;transition:width .3s}.lesson-grid{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(270px,.8fr);gap:18px;align-items:start}.question-card,.lesson-aside,.result-card{background:#fff;border:1px solid #dce8e2;border-radius:17px;box-shadow:0 9px 30px #1f4d3d0c}.question-card{padding:24px;min-height:410px}.question-meta{display:flex;align-items:center;justify-content:space-between;gap:12px}.pill{border-radius:20px;background:#edf7e8;color:#4b8245;padding:5px 11px;font-size:12px}.listen-button{font-size:14px;min-height:36px}.question-prompt{margin:27px 0 13px;color:#6b7d76;font-size:15px}.question-content{min-height:100px}.word-display{color:#153d31;font-size:40px;font-weight:800;direction:ltr;text-align:center;margin:8px 0 27px}.sentence-display{font-size:26px;font-weight:700;line-height:1.55;text-align:center;direction:ltr;color:#183f33;margin:7px auto 25px;max-width:600px}.sentence-display .blank{display:inline-block;color:#76a75c;border-bottom:3px solid #a3c98e;min-width:70px}.options{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.option{border:1px solid #d5e3dc;background:#fbfdfc;color:#31594c;text-align:center;border-radius:11px;padding:12px 10px;min-height:50px;transition:.18s}.option:hover:not(:disabled){border-color:#7bb965;background:#f1f9ed}.option:disabled{cursor:default}.option.correct{border-color:#76b660;background:#e9f6e4;color:#2b7731}.option.wrong{border-color:#e7a5a5;background:#fff1f1;color:#af4444}.feedback{margin-top:16px;border-radius:11px;padding:11px 13px;font-size:14px}.feedback.good{background:#edf8e9;color:#317342}.feedback.bad{background:#fff3f1;color:#ae5145}.feedback strong{display:block;margin-bottom:2px}.next-button{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;border:0;border-radius:11px;background:#1c5745;color:#fff;padding:13px;margin-top:21px;transition:.2s}.next-button:disabled{opacity:.35;cursor:not-allowed}.next-button:not(:disabled):hover{background:#123e31}.next-button span{font-size:22px;line-height:0}.lesson-aside{padding:21px}.aside-heading{display:flex;align-items:center;gap:9px;margin-bottom:15px}.aside-heading h2{margin:0;font-size:18px;color:#1d4639}.mini-icon{display:grid;place-items:center;background:#e9f5df;color:#4c8a43;border-radius:9px;width:29px;height:29px}.plan-item{display:flex;align-items:center;gap:11px;padding:12px 0;border-bottom:1px solid #edf2ef}.plan-item>span{display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:#edf3ef;color:#647b70;font-size:13px}.plan-item.active>span{background:#c8f27b;color:#25563c}.plan-item div{flex:1}.plan-item strong,.plan-item small{display:block}.plan-item strong{color:#32564b;font-size:14px}.plan-item small{color:#879890;font-size:12px;margin-top:2px}.plan-item b{color:#4a9564;font-size:11px}.tip-box{margin-top:18px;background:#f3f8ee;border:1px solid #deebd2;border-radius:12px;padding:12px 13px}.tip-box strong{color:#5c8a48;font-size:13px}.tip-box p{margin:4px 0 0;color:#63746b;font-size:13px}.result-card{display:flex;align-items:center;gap:15px;padding:20px 23px;margin-top:18px}.result-icon{display:grid;place-items:center;flex:none;width:45px;height:45px;border-radius:50%;background:#dff2d7;color:#338043;font-size:24px}.result-card h2{margin:0;color:#194334;font-size:20px}.result-card p:not(.eyebrow){margin:4px 0 0;color:#6c7d75;font-size:14px}.restart-button{margin-right:auto;background:#edf6e9;border:1px solid #c9e0bd;border-radius:10px;color:#367341;padding:10px 14px;white-space:nowrap}.footer{border-top:1px solid #dce8e2;background:#fff;color:#80918a;display:flex;justify-content:center;gap:24px;padding:20px 22px;font-size:13px}.footer a{color:#397158;text-decoration:none}@media(max-width:720px){.app-shell{padding-top:28px}.welcome-row{align-items:stretch;flex-direction:column}.daily-score{align-self:flex-start}.module-tabs{grid-template-columns:repeat(2,1fr)}.lesson-grid{grid-template-columns:1fr}.question-card{min-height:390px}.lesson-aside{order:2}.footer{flex-wrap:wrap;gap:10px 18px}.sentence-display{font-size:21px}}
/* Match the main Time4en brand while keeping the preview route independent. */
:root{--ink:#18212f;--muted:#667085;--paper:#fffdfa;--line:#ded6eb;--brand:#4c148f;--brand-dark:#35106a;--brand-soft:#f1e8ff;--green:#16845b;--red:#c2413c}
body{background:linear-gradient(138deg,rgba(76,20,143,.16),transparent 38%),linear-gradient(318deg,rgba(22,132,91,.11),transparent 42%),#f8f4fc;color:var(--ink);font-family:"Time4en",system-ui,sans-serif}
@font-face{font-family:"Time4en";src:url("/assets/fonts/time4en.otf") format("opentype");font-display:swap}
.topbar{background:#fff;border-bottom:1px solid var(--line);padding:0 max(22px,calc((100vw - 1080px)/2));height:74px}
.brand{gap:12px;color:var(--brand-dark);font-size:20px}.brand-home{display:block}.brand-home img{width:70px;height:48px;object-fit:contain;display:block}.brand-slogan{color:var(--brand-dark);font-size:15px;font-weight:800}
.sound-button,.listen-button{border-color:#d8cbea;background:var(--brand-soft);color:var(--brand);border-radius:8px}.sound-button{width:42px}
.app-shell{max-width:1080px;padding-top:34px}.eyebrow{color:var(--brand)}.welcome-row h1{color:var(--ink)}.module-tab.active{background:var(--brand);border-color:var(--brand);box-shadow:0 8px 20px rgba(76,20,143,.16)}.module-tab span{color:var(--brand);background:var(--brand-soft)}.module-tab.active span{background:#fff;color:var(--brand)}
.level-tabs{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 18px;padding:11px 14px;border:1px solid var(--line);border-radius:8px;background:rgba(255,255,255,.72)}.level-title{color:var(--muted);font-size:14px;font-weight:800;margin-left:4px}.level-tab{border:1px solid #dfd5eb;border-radius:8px;background:#fff;color:#62556f;padding:7px 13px;font-size:13px}.level-tab.active{border-color:var(--brand);background:var(--brand-soft);color:var(--brand);font-weight:800}.bank-count{margin-right:auto;color:#8b7d95;font-size:12px}
.progress-panel,.question-card,.lesson-aside,.result-card{border-color:var(--line);border-radius:8px;box-shadow:var(--shadow)}.progress-track span{background:var(--green)}.pill{background:var(--brand-soft);color:var(--brand)}.word-display,.sentence-display{color:var(--brand-dark)}.option{border-radius:8px}.option:hover:not(:disabled){border-color:var(--brand);background:var(--brand-soft)}.option.correct{border-color:#85c99f;background:#edf9f0;color:#16845b}.option.wrong{border-color:#e8aaaa;background:#fff3f2;color:#b33f3d}.feedback{border-radius:8px}.feedback.good{background:#edf9f0;color:#267443}.feedback.bad{background:#fff3f2;color:#a94340}.reason-label{display:block;margin-top:7px;font-weight:800}.example-line{margin-top:10px;padding-top:9px;border-top:1px solid currentColor;opacity:.9}.next-button{background:var(--brand);border-radius:8px}.next-button:not(:disabled):hover{background:var(--brand-dark)}.result-icon{background:var(--brand-soft);color:var(--brand)}.restart-button{border-radius:8px;color:var(--brand);background:var(--brand-soft);border-color:#d8cbea}.footer{border-color:var(--line);background:#fff;color:var(--muted);padding-bottom:24px}.footer a{color:var(--brand)}.version-label{color:#8b7d95;font-size:12px}
@media(max-width:720px){.brand-home img{width:58px}.brand-slogan{font-size:13px}.level-tabs{gap:6px}.level-title{width:100%;margin-bottom:1px}.bank-count{width:100%;margin:2px 0 0}.footer{font-size:12px}}
.category-label,.type-label{display:block;margin-top:8px;font-weight:800}.feedback.good .category-label,.feedback.good .type-label{color:#267443}.feedback.bad .category-label,.feedback.bad .type-label{color:#a94340}.feedback-explanation{display:block;line-height:1.85}.feedback-explanation .reason-label{margin-top:9px}.grammar-feedback span{line-height:1.85}
.module-tabs{grid-template-columns:repeat(7,1fr)}.grammar-panel{margin-top:4px}.grammar-topline{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin-bottom:18px}.grammar-topline h2{margin:0;color:var(--brand-dark);font-size:28px}.grammar-goal{margin:8px 0 0;color:var(--muted);font-size:15px}.grammar-number{display:flex;flex-direction:column;align-items:center;gap:4px;min-width:120px;padding:12px 16px;border:1px solid var(--line);border-radius:8px;background:#fff}.grammar-number span{color:var(--brand);font-size:13px;font-weight:800}.grammar-number strong{color:var(--ink);font-size:16px;white-space:nowrap}.grammar-layout{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(270px,.8fr);gap:18px;align-items:start}.grammar-lesson,.grammar-progress{background:#fff;border:1px solid var(--line);border-radius:8px;box-shadow:var(--shadow)}.grammar-lesson{padding:24px}.grammar-explanation strong,.grammar-examples>strong,.grammar-check-heading strong,.grammar-tip strong{color:var(--brand);font-size:16px}.grammar-explanation p{margin:8px 0 20px;color:var(--ink);line-height:1.9}.grammar-examples{display:grid;gap:9px}.grammar-example{display:flex;justify-content:space-between;gap:14px;padding:11px 13px;border:1px solid #ebe5f1;border-radius:8px;background:#fcfbfe;direction:ltr;text-align:left}.grammar-example b{color:var(--brand-dark)}.grammar-example span{color:var(--muted);direction:rtl;text-align:right}.grammar-tip{margin-top:18px;padding:12px 14px;border:1px solid #d8eadf;border-radius:8px;background:#f3faf5}.grammar-tip strong{color:var(--green)}.grammar-tip p{margin:4px 0 0;color:#3f6855;font-size:14px}.grammar-check{margin-top:22px;padding-top:20px;border-top:1px solid var(--line)}.grammar-check-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.grammar-check-heading span{color:var(--muted);font-size:13px}.grammar-question{direction:ltr;text-align:center;color:var(--brand-dark);font-size:25px;font-weight:800;margin:13px 0 18px}.grammar-question .blank{display:inline-block;color:var(--green);border-bottom:3px solid #99c9a6;min-width:72px}.grammar-options{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.grammar-feedback{display:grid;gap:4px;margin-top:15px;padding:12px 14px;border-radius:8px;font-size:14px}.grammar-feedback.good{background:#edf9f0;color:#267443}.grammar-feedback.bad{background:#fff3f2;color:#a94340}.grammar-feedback strong{font-size:15px}.grammar-next{margin-top:14px}.grammar-progress{padding:20px}.grammar-progress .aside-heading{margin-bottom:10px}.grammar-progress-copy{margin:0 0 8px;color:var(--muted);font-size:13px}.grammar-track{height:7px;background:#eee8f4;border-radius:8px;overflow:hidden;margin-bottom:14px}.grammar-track span{display:block;height:100%;background:var(--green);border-radius:inherit;transition:width .3s}.lesson-list{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;max-height:430px;overflow:auto;padding-left:2px}.lesson-link{display:flex;align-items:center;gap:6px;min-width:0;border:1px solid #e5deed;background:#fff;border-radius:7px;padding:7px 6px;color:var(--muted);text-align:right}.lesson-link span{display:grid;place-items:center;flex:none;width:22px;height:22px;border-radius:50%;background:#f0ebf5;color:#776786;font-size:11px}.lesson-link b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:700}.lesson-link.active{border-color:var(--brand);background:var(--brand-soft);color:var(--brand)}.lesson-link.active span,.lesson-link.visited span{background:var(--brand);color:#fff}.lesson-link.visited{color:var(--brand-dark)}
@media(max-width:900px){.module-tabs{grid-template-columns:repeat(3,1fr)}.grammar-layout{grid-template-columns:1fr}.grammar-progress{order:2}.lesson-list{max-height:none}}
@media(max-width:560px){.module-tabs{grid-template-columns:repeat(2,1fr)}.grammar-topline{align-items:stretch;flex-direction:column}.grammar-number{align-self:flex-start}.grammar-lesson{padding:18px}.grammar-topline h2{font-size:23px}.grammar-example{align-items:flex-start;flex-direction:column;gap:3px}.grammar-question{font-size:21px}.grammar-options{grid-template-columns:1fr}}
.news-card{margin-bottom:18px;padding:20px 22px;background:#fff;border:1px solid #d8cbea;border-radius:8px;box-shadow:var(--shadow)}.news-card-topline{display:flex;align-items:flex-start;justify-content:space-between;gap:18px}.news-card h2{margin:2px 0 0;color:var(--brand-dark);font-size:24px;line-height:1.45;direction:ltr;text-align:left}.news-arabic-title{margin:5px 0 0;color:var(--muted);font-size:14px}.news-date{color:var(--muted);font-size:12px;white-space:nowrap;padding-top:6px}.news-summary{margin:17px 0 0;color:var(--ink);line-height:1.9;font-size:14px}.news-card-footer{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-top:16px;padding-top:12px;border-top:1px solid #eee8f4;color:var(--muted);font-size:12px}.news-card-footer a{color:var(--brand);font-weight:800;text-decoration:none}.news-card-footer a:hover{text-decoration:underline}
@media(max-width:720px){.news-card{padding:17px}.news-card-topline{flex-direction:column;gap:2px}.news-card h2{font-size:20px}.news-date{padding-top:0}.news-card-footer{align-items:flex-start;flex-direction:column;gap:8px}}
.news-library{margin-top:18px;padding-top:15px;border-top:1px solid #eee8f4}.news-library-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}.news-library-heading strong{color:var(--brand-dark);font-size:14px}.news-library-heading span{color:var(--muted);font-size:12px}.news-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.news-list-item{display:grid;grid-template-columns:28px 1fr;gap:2px 8px;align-items:center;border:1px solid #e5deed;background:#fff;border-radius:8px;padding:9px 10px;color:var(--muted);text-align:right}.news-list-item>span{grid-row:span 2;display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:#f0ebf5;color:#776786;font-size:11px}.news-list-item b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink);font-size:12px;direction:ltr;text-align:left}.news-list-item small{color:var(--muted);font-size:10px}.news-list-item.active{border-color:var(--brand);background:var(--brand-soft)}.news-list-item.active>span{background:var(--brand);color:#fff}.news-list-item.active b{color:var(--brand-dark)}
@media(max-width:560px){.news-list{grid-template-columns:1fr}.news-library-heading{align-items:flex-start;flex-direction:column;gap:3px}}
.grammar-info-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:0 0 20px}.grammar-info-item{padding:13px;border:1px solid #ebe5f1;border-radius:8px;background:#fcfbfe}.grammar-info-item strong{display:block;color:var(--brand);font-size:13px;margin-bottom:5px}.grammar-info-item p{margin:0;color:var(--ink);font-size:13px;line-height:1.7;direction:rtl}.grammar-examples>strong{display:block;margin-bottom:9px}@media(max-width:720px){.grammar-info-grid{grid-template-columns:1fr}}
.all-words-button{display:inline-flex;align-items:center;gap:7px;border:1px solid #b9d8b0;border-radius:8px;background:#f2faee;color:#397a3d;padding:7px 11px;line-height:1.2;direction:rtl}.all-words-button span{display:grid;place-items:center;width:22px;height:22px;border-radius:50%;background:#dcefd4;color:#4d9149;font-size:17px}.all-words-button b{font-size:12px;white-space:nowrap}.all-words-button small{color:#70906e;font-size:11px;white-space:nowrap}.all-words-button:hover,.all-words-button.active{border-color:#76b660;background:#e8f6e2}.all-words-button.active span{background:#76b660;color:#fff}.grammar-quiz-result{display:grid;gap:8px;padding:17px;border:1px solid #d8eadf;border-radius:8px;background:#f3faf5;color:#35664e}.grammar-quiz-result strong{color:var(--brand-dark);font-size:20px}.grammar-quiz-result span{color:var(--muted);font-size:14px}.grammar-quiz-result .next-button{margin-top:6px}@media(max-width:720px){.all-words-button{width:100%;justify-content:center;order:5}.all-words-button b{font-size:13px}.bank-count{order:6}}
.auth-button{border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--brand);padding:8px 12px;font-size:13px;font-weight:800;white-space:nowrap}.auth-button:hover{background:var(--brand-soft)}.new-auth-panel{max-width:1080px;margin:14px auto 0;padding:0 22px}.new-auth-form{background:#fff;border:1px solid var(--line);border-radius:8px;box-shadow:var(--shadow);padding:16px 18px}.auth-panel-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:12px}.auth-panel-heading strong,.auth-panel-heading span{display:block}.auth-panel-heading strong{color:var(--brand-dark);font-size:17px}.auth-panel-heading span{color:var(--muted);font-size:13px;margin-top:2px}.auth-close{border:0;background:transparent;color:var(--muted);font-size:25px;line-height:1;padding:0 4px}.new-auth-form label{display:block;color:var(--ink);font-size:13px;font-weight:800;margin-bottom:6px}.auth-form-row{display:flex;gap:9px}.auth-form-row input{flex:1;min-width:0;border:1px solid #d8cbea;border-radius:8px;padding:10px 12px;color:var(--ink);font:inherit;direction:ltr;text-align:left}.auth-submit,.auth-logout{border:1px solid var(--brand);border-radius:8px;background:var(--brand);color:#fff;padding:9px 16px;font:inherit;font-size:13px;font-weight:800}.auth-submit:hover{background:var(--brand-dark)}.auth-logout{margin-top:10px;background:#fff;color:var(--red);border-color:#edc0bd}.new-auth-message{min-height:20px;margin:8px 0 0;color:var(--muted);font-size:13px}.new-auth-message.error{color:var(--red)}.new-auth-message.success{color:var(--green)}@media(max-width:720px){.topbar-actions{gap:7px}.streak{display:none}.auth-button{padding:7px 9px}.new-auth-panel{padding:0 14px}.auth-form-row{align-items:stretch;flex-direction:column}.auth-submit{width:100%}}
.grammar-number small{color:var(--muted);font-size:11px;white-space:nowrap}.grammar-quiz-result.passed{border-color:#b9dfbf;background:#f0fbf2}.grammar-quiz-result.needs-review{border-color:#efc2bc;background:#fff6f4}.grammar-quiz-result.needs-review strong{color:var(--red)}.grammar-quiz-result.needs-review span{color:#9a514b}.grammar-next-lesson{background:var(--green)}.grammar-next-lesson:hover{background:#0f6b49}.lesson-link>div{min-width:0;flex:1}.lesson-link .lesson-status{display:block;margin-top:2px;font-size:10px;font-style:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.lesson-status.completed{color:var(--green)}.lesson-status.needs-review{color:var(--red)}.lesson-status.not-started{color:var(--muted)}.lesson-link.completed{border-color:#b9dfbf}.lesson-link.needs-review{border-color:#efc2bc}.lesson-link.completed>span{background:#e7f7ea;color:var(--green)}.lesson-link.needs-review>span{background:#fff0ed;color:var(--red)}

.news-learning-copy{margin-top:20px;border-top:1px solid var(--line)}.news-learning-section{padding:15px 0;border-bottom:1px solid var(--line)}.news-learning-en,.news-learning-ar{margin:0}.news-learning-en{direction:ltr;text-align:left;color:var(--ink);font-size:15px;line-height:1.85}.news-learning-ar{margin-top:7px;color:var(--muted);font-size:14px;line-height:1.9}
@media(max-width:560px){.news-learning-section{padding:13px 0}.news-learning-en{font-size:14px}.news-learning-ar{font-size:13px}}

/* Quiet workspace layout inspired by chat-first learning tools. */
:root{--ink:#2f2f2f;--muted:#6f7077;--paper:#fff;--line:#e5e5e7;--brand:#10a37f;--brand-dark:#08785e;--brand-soft:#e9f7f3;--green:#16845b;--red:#c2413c;--shadow:0 1px 2px rgba(0,0,0,.04)}
body{background:#f7f7f8;color:var(--ink)}
.topbar{height:60px;background:#fff;border-bottom:1px solid var(--line);padding:0 22px;box-shadow:none}
.brand{gap:9px;color:var(--ink);font-size:17px}.brand-home img{width:54px;height:39px}.brand-slogan{color:var(--muted);font-size:13px;font-weight:600}
.topbar-actions{gap:10px}.streak{color:var(--muted);font-size:12px}.sound-button{height:36px;min-height:36px;border-color:var(--line);background:#fff;color:var(--ink);border-radius:8px}.sound-button:hover{background:#f1f1f2}
.auth-button{border-color:var(--line);background:#fff;color:var(--ink);font-size:12px;font-weight:600}.auth-button:hover{background:#f1f1f2}
.membership-link{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:0 10px;border:1px solid var(--line);border-radius:8px;background:var(--brand-soft);color:var(--brand);font-size:12px;font-weight:800;text-decoration:none;white-space:nowrap}.membership-link:hover{background:#eadcff;color:var(--brand-dark)}
.app-shell{max-width:none;margin:0;padding:0}
.app-layout{display:grid;grid-template-columns:250px minmax(0,1fr);direction:rtl;min-height:calc(100vh - 60px)}
.app-sidebar{direction:rtl;background:#f9f9fa;border-left:1px solid var(--line);padding:16px 12px 18px;display:flex;flex-direction:column;gap:16px}
.sidebar-new-session{display:flex;align-items:center;justify-content:center;gap:7px;min-height:40px;padding:8px 12px;border:1px solid #d9d9de;border-radius:8px;background:#fff;color:var(--ink);font-size:13px;font-weight:700;text-decoration:none}.sidebar-new-session:hover{background:#f0f0f1}.sidebar-new-session span{font-size:20px;line-height:1;font-weight:400}
.sidebar-label{margin:2px 9px -8px;color:#96979c;font-size:11px;font-weight:700}
.module-tabs{display:grid;grid-template-columns:1fr;gap:2px;margin:0}
.module-tab{justify-content:flex-start;gap:10px;width:100%;border:0;border-radius:7px;background:transparent;color:#5d5e65;padding:10px 10px;font-size:13px;text-align:right;box-shadow:none}.module-tab:hover{background:#ececee;color:var(--ink)}.module-tab span{min-width:24px;height:24px;border-radius:6px;background:transparent;color:#777980;font-size:11px}.module-tab.active{background:#e9e9eb;border:0;color:var(--ink);box-shadow:none;font-weight:700}.module-tab.active span{background:transparent;color:var(--brand-dark)}
.sidebar-note{display:flex;align-items:center;gap:9px;margin-top:auto;padding:11px 10px;border-top:1px solid var(--line);color:var(--muted)}.sidebar-note-icon{display:grid;place-items:center;width:24px;height:24px;border-radius:6px;background:var(--brand-soft);color:var(--brand-dark);font-size:12px}.sidebar-note strong,.sidebar-note small{display:block}.sidebar-note strong{color:var(--ink);font-size:12px}.sidebar-note small{font-size:11px;margin-top:2px}
.main-column{direction:rtl;width:min(100%,980px);margin:0 auto;padding:38px 48px 64px}
.welcome-row{align-items:flex-start;margin-bottom:28px}.welcome-row h1{color:var(--ink);font-size:32px;font-weight:700}.intro{margin-top:7px;color:var(--muted);font-size:14px}.eyebrow{color:var(--brand-dark);font-size:12px}
.daily-score{min-width:100px;padding:8px 12px;background:transparent;border:1px solid var(--line);border-radius:8px}.daily-score span{color:var(--muted);font-size:11px}.daily-score strong{color:var(--ink);font-size:20px}
.level-tabs{margin-bottom:16px;padding:0 0 12px;border:0;border-bottom:1px solid var(--line);background:transparent;border-radius:0}.level-title{color:var(--muted);font-size:12px}.level-tab{border-color:transparent;background:transparent;color:var(--muted);border-radius:6px;padding:6px 10px;font-size:12px}.level-tab:hover{background:#ececee;color:var(--ink)}.level-tab.active{border-color:transparent;background:#e7e7e9;color:var(--ink);font-weight:700}.bank-count{color:#92939a}
.all-words-button{border-color:#b8ded3;background:var(--brand-soft);color:var(--brand-dark);border-radius:7px}.all-words-button:hover,.all-words-button.active{border-color:#87c9b8;background:#dcf3ec}
.progress-panel{margin-bottom:18px;padding:0 0 7px;background:transparent;border:0;border-radius:0}.progress-copy{color:var(--muted);font-size:12px;margin-bottom:7px}.progress-track{height:4px;background:#e6e6e8;border-radius:3px}.progress-track span{background:var(--brand)}
.lesson-grid{grid-template-columns:minmax(0,1.6fr) minmax(220px,.72fr);gap:16px}.question-card,.lesson-aside,.result-card{border-color:var(--line);border-radius:10px;box-shadow:none}.question-card{padding:26px;min-height:390px}.question-prompt{margin:24px 0 14px;color:var(--muted);font-size:13px}.word-display{color:var(--ink);font-size:38px;margin:10px 0 28px}.sentence-display{color:var(--ink);font-size:24px}.option{border-color:#dedee1;background:#fff;color:#44454b;border-radius:8px;min-height:48px;padding:11px 10px}.option:hover:not(:disabled){border-color:#b7b7bc;background:#f5f5f6}.option.correct{border-color:#8ed0bc;background:#edf9f5;color:#08785e}.option.wrong{border-color:#e9abab;background:#fff3f2;color:#b33f3d}.listen-button{border-color:var(--line);background:#fff;color:var(--muted);border-radius:7px;font-size:12px}.listen-button:hover{background:#f1f1f2;color:var(--ink)}.next-button{background:var(--ink);border-radius:7px;margin-top:20px}.next-button:not(:disabled):hover{background:#111}.pill{background:#f0f0f1;color:#64656b;border-radius:6px;padding:5px 9px}
.lesson-aside{padding:18px;background:#fff}.aside-heading h2,.aside-heading h3{color:var(--ink);font-size:15px}.mini-icon{width:25px;height:25px;background:#f0f0f1;color:#6e6f75;border-radius:6px}.plan-item{padding:10px 0}.plan-item>span{width:24px;height:24px;background:#f0f0f1;color:#777980;font-size:11px}.plan-item.active>span{background:var(--brand-soft);color:var(--brand-dark)}.plan-item strong{color:#46474c;font-size:12px}.plan-item small{color:#909198;font-size:11px}.plan-item b{color:var(--brand-dark);font-size:10px}.tip-box{margin-top:14px;padding:10px 11px;border-color:#e2ebe8;background:#f7fbfa;border-radius:7px}.tip-box strong{color:var(--brand-dark);font-size:12px}.tip-box p{color:var(--muted);font-size:12px}
.news-card,.grammar-lesson,.grammar-progress{border-color:var(--line);box-shadow:none}.news-card{background:#fff}.news-card h2,.grammar-topline h2{color:var(--ink)}.news-card-footer,.news-library{border-color:var(--line)}.news-card-footer a{color:var(--brand-dark)}.news-list-item{border-color:var(--line);background:#fff;border-radius:7px}.news-list-item.active{border-color:#9ed5c6;background:var(--brand-soft)}.news-list-item.active>span{background:var(--brand);color:#fff}.news-list-item.active b{color:var(--brand-dark)}
.grammar-topline{align-items:flex-start}.grammar-number{border-color:var(--line);background:#fff;box-shadow:none}.grammar-number span{color:var(--brand-dark)}.grammar-layout{gap:16px}.grammar-lesson,.grammar-progress{background:#fff}.grammar-explanation strong,.grammar-examples>strong,.grammar-check-heading strong{color:var(--brand-dark)}.grammar-info-item,.grammar-example{border-color:var(--line);background:#fcfcfc}.grammar-tip{border-color:#d7e9e3;background:#f5fbf9}.grammar-tip strong{color:var(--brand-dark)}.grammar-track{background:#e7e7e9}.grammar-track span{background:var(--brand)}.lesson-link{border-color:var(--line);background:#fff;border-radius:6px}.lesson-link.active{border-color:#9ed5c6;background:var(--brand-soft);color:var(--brand-dark)}.lesson-link.active span,.lesson-link.visited span{background:var(--brand);color:#fff}.lesson-link.completed{border-color:#9ed5ac;background:#edf9f0;color:#267443}.lesson-link.completed>span{background:#39a85c;color:#fff}.lesson-link.completed b{color:#267443}.grammar-auto-advance{display:block;color:var(--green);font-size:12px;font-weight:700}
.result-card{background:#fff}.result-icon{background:var(--brand-soft);color:var(--brand-dark)}.result-card h2{color:var(--ink)}.restart-button{border-color:#b8ded3;background:var(--brand-soft);color:var(--brand-dark)}
.new-auth-panel{max-width:none;margin:0;padding:12px 22px;background:#f7f7f8;border-bottom:1px solid var(--line)}.new-auth-form{max-width:980px;margin:0 auto;border-color:var(--line);border-radius:8px;box-shadow:none}.auth-panel-heading strong{color:var(--ink)}.auth-submit{border-color:var(--ink);background:var(--ink)}.auth-submit:hover{background:#111}.footer{border-color:var(--line);background:#fff;color:#8b8c92;padding:18px 22px}.footer a{color:var(--brand-dark)}
@media(max-width:900px){.app-layout{display:block}.app-sidebar{border-right:0;border-left:0;border-bottom:1px solid var(--line);padding:10px 12px;gap:9px}.sidebar-label,.sidebar-note{display:none}.sidebar-new-session{display:none}.module-tabs{display:flex;overflow-x:auto;gap:3px;padding-bottom:2px;scrollbar-width:none}.module-tabs::-webkit-scrollbar{display:none}.module-tab{flex:0 0 auto;width:auto;justify-content:center;padding:8px 10px;white-space:nowrap;font-size:12px}.module-tab span{display:none}.main-column{width:100%;padding:28px 20px 48px}.lesson-grid{grid-template-columns:1fr}.lesson-aside{display:none}}
@media(max-width:560px){.topbar{padding:0 14px}.brand-slogan{display:none}.streak{display:none}.main-column{padding:24px 14px 40px}.welcome-row{gap:16px;margin-bottom:22px}.welcome-row h1{font-size:27px}.intro{font-size:13px}.level-tabs{gap:4px}.level-title{width:auto;margin:0}.level-tab{padding:6px 8px}.bank-count{width:100%;margin:2px 0 0}.question-card{padding:20px 16px;min-height:360px}.word-display{font-size:34px}.sentence-display{font-size:20px}.options{grid-template-columns:1fr}.grammar-lesson{padding:18px}.grammar-topline{gap:14px}.grammar-topline h2{font-size:22px}.grammar-number{align-self:flex-start}.grammar-options{grid-template-columns:1fr}.result-card{align-items:flex-start;flex-wrap:wrap}.restart-button{margin-right:0}.membership-link{min-height:34px;padding:0 8px;font-size:11px}}
.grammar-explanation p{white-space:pre-line}.lesson-stage-heading{grid-column:1/-1;padding:8px 4px 2px;border-top:1px solid var(--line);color:var(--brand-dark);font-size:11px;font-weight:800}.lesson-stage-heading:first-child{border-top:0;padding-top:0}.lesson-link b{white-space:normal;line-height:1.45}.lesson-status{display:block;margin-top:3px;color:var(--muted);font-size:9px;font-style:normal}.lesson-link.completed .lesson-status{color:#267443}.lesson-link.needs-review .lesson-status{color:#b27622}
.lesson-grid{grid-template-columns:minmax(0,1fr)}

.learning-dashboard{margin:0 0 20px;padding:18px;background:#fff;border:1px solid var(--line);border-radius:10px}.dashboard-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:16px}.dashboard-heading h2{margin:0;color:var(--ink);font-size:20px}.dashboard-heading p:not(.eyebrow){margin:4px 0 0;color:var(--muted);font-size:13px}.dashboard-action,.text-action{border:0;background:transparent;color:var(--brand-dark);font-weight:800;font-size:12px;padding:7px 2px}.dashboard-action{border:1px solid #b8ded3;border-radius:7px;padding:8px 11px;background:var(--brand-soft)}.dashboard-action:hover,.text-action:hover{color:var(--brand)}.dashboard-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}.dashboard-card{padding:13px;border:1px solid var(--line);border-radius:8px;background:#fcfcfc;min-width:0}.dashboard-card-top{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--muted);font-size:11px;margin-bottom:11px}.dashboard-icon{display:grid;place-items:center;width:24px;height:24px;border-radius:6px;background:var(--brand-soft);color:var(--brand-dark);font-weight:800}.dashboard-card strong{display:block;color:var(--ink);font-size:13px}.dashboard-card p{min-height:39px;margin:5px 0;color:var(--muted);font-size:11px;line-height:1.6}.dashboard-track{height:4px;background:#e7e7e9;border-radius:4px;overflow:hidden;margin:8px 0}.dashboard-track span{display:block;width:0;height:100%;background:var(--brand);border-radius:inherit;transition:width .25s}.text-action{display:flex;align-items:center;gap:6px;padding:0}.text-action span{font-size:17px;line-height:0}.cefr-path{margin-top:16px;padding-top:15px;border-top:1px solid var(--line)}.cefr-heading{display:flex;justify-content:space-between;gap:12px;margin-bottom:11px}.cefr-heading strong{color:var(--ink);font-size:13px}.cefr-heading span{color:var(--muted);font-size:11px}.cefr-steps{display:grid;grid-template-columns:1fr 1fr 1fr 1fr 1fr 1fr 1fr;align-items:center;gap:7px}.cefr-steps span{display:flex;align-items:center;justify-content:center;gap:4px;min-height:34px;border:1px solid var(--line);border-radius:7px;color:var(--muted);font-size:13px;font-weight:800}.cefr-steps span small{font-size:10px;font-weight:500}.cefr-steps i{height:1px;background:var(--line)}.cefr-steps span.passed{border-color:#9ed5c6;background:var(--brand-soft);color:var(--brand-dark)}.cefr-steps span.active{box-shadow:0 0 0 2px #b8ded3}.mistake-preview{margin-top:15px;padding-top:13px;border-top:1px solid var(--line)}.mistake-preview>div:first-child{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.mistake-preview strong{color:var(--ink);font-size:13px}.mistake-preview span{color:var(--muted);font-size:11px}.mistake-item{display:flex;justify-content:space-between;gap:10px;width:100%;padding:8px 0;border:0;border-top:1px solid #f0f0f1;background:transparent;text-align:right}.mistake-item b{color:var(--ink);font-size:12px;direction:ltr}.mistake-item span{color:var(--red);font-size:12px}.question-actions{display:flex;align-items:center;gap:6px}.record-button{border:1px solid #b8ded3;background:var(--brand-soft);color:var(--brand-dark);border-radius:7px;min-height:36px;padding:0 11px;font-size:12px}.record-button:disabled{opacity:.6;cursor:wait}.writing-display,.speaking-display{display:grid;gap:10px;max-width:620px;margin:22px auto 8px;padding:18px;border:1px solid var(--line);border-radius:8px;background:#fcfcfc}.writing-display span,.speaking-display span{color:var(--muted);font-size:12px}.writing-display strong,.speaking-display strong{direction:ltr;text-align:left;color:var(--ink);font-size:22px;line-height:1.6}.writing-display textarea{width:100%;resize:vertical;border:1px solid #d7d7da;border-radius:7px;padding:10px;direction:ltr;text-align:left;color:var(--ink);font:inherit;line-height:1.5}.writing-display textarea:focus{outline:2px solid #b8ded3;border-color:var(--brand)}.writing-submit{border:1px solid var(--brand);border-radius:7px;background:var(--brand);color:#fff;padding:10px;font-size:13px}.writing-submit:disabled{opacity:.55}.speaking-display small{color:var(--muted);font-size:12px;line-height:1.7}.empty-state{padding:24px;border:1px dashed #d7d7da;border-radius:8px;color:var(--muted);text-align:center}
@media(max-width:900px){.dashboard-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.learning-dashboard{padding:15px}.dashboard-heading{align-items:stretch;flex-direction:column}.dashboard-action{align-self:flex-start}.dashboard-grid{grid-template-columns:1fr}.cefr-steps{grid-template-columns:repeat(4,1fr);gap:5px}.cefr-steps i{display:none}.cefr-steps span{flex-direction:column;min-height:46px}.dashboard-card p{min-height:auto}.writing-display,.speaking-display{padding:14px}.writing-display strong,.speaking-display strong{font-size:19px}}

.idiom-card{margin:0 0 18px;padding:20px;background:#fff;border:1px solid var(--line);border-radius:10px}.idiom-card-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:16px}.idiom-card-heading h2{margin:0;color:var(--ink);font-size:23px}.idiom-card-heading p:not(.eyebrow){margin:5px 0 0;color:var(--muted);font-size:13px}.idiom-count{padding:6px 9px;border:1px solid #b8ded3;border-radius:7px;background:var(--brand-soft);color:var(--brand-dark);font-size:11px;white-space:nowrap}.idiom-search{display:flex;align-items:center;gap:8px;margin-bottom:14px;padding:0 11px;border:1px solid #d7d7da;border-radius:8px;background:#fcfcfc}.idiom-search span{color:var(--muted);font-size:20px}.idiom-search input{width:100%;border:0;outline:0;background:transparent;color:var(--ink);font:inherit;font-size:13px;padding:10px 0;direction:rtl}.idiom-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;max-height:610px;overflow:auto;padding:2px}.idiom-list-item{padding:12px;border:1px solid var(--line);border-radius:8px;background:#fcfcfc}.idiom-list-top{display:flex;align-items:center;gap:8px;direction:ltr}.idiom-list-top>span{display:grid;place-items:center;flex:none;width:23px;height:23px;border-radius:6px;background:var(--brand-soft);color:var(--brand-dark);font-size:10px}.idiom-list-top strong{flex:1;color:var(--ink);font-size:15px}.idiom-speak{border:0;background:transparent;color:var(--muted);font-size:15px;padding:2px}.idiom-speak:hover{color:var(--brand-dark)}.idiom-arabic{margin:8px 0 5px;color:var(--brand-dark);font-size:13px;font-weight:800}.idiom-example{margin:0;color:var(--ink);direction:ltr;text-align:left;font-size:12px;line-height:1.65}.idiom-list-item small{display:block;margin-top:4px;color:var(--muted);font-size:11px;line-height:1.6}.module-tab[data-mode="idioms"] span{font-size:12px}
@media(max-width:720px){.idiom-card{padding:16px}.idiom-card-heading{flex-direction:column;gap:8px}.idiom-list{grid-template-columns:1fr;max-height:540px}}

.daily-plan,.daily-calendar{margin-top:16px;padding-top:15px;border-top:1px solid var(--line)}.daily-plan-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}.daily-plan-heading strong,.daily-plan-heading span{display:block}.daily-plan-heading strong{color:var(--ink);font-size:13px}.daily-plan-heading span{margin-top:3px;color:var(--muted);font-size:11px}.daily-plan-heading>b{color:var(--muted);font-size:11px}.daily-plan-items{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}.daily-plan-item{display:flex;align-items:center;gap:8px;min-width:0;padding:10px 9px;border:1px solid var(--line);border-radius:8px;background:#fcfcfc;color:var(--ink);text-align:right}.daily-plan-item:hover{border-color:#b8ded3;background:#f7fbfa}.daily-plan-item.is-complete{border-color:#9ed5ac;background:#edf9f0}.daily-plan-check{display:grid;place-items:center;flex:none;width:25px;height:25px;border-radius:6px;background:#f0f0f1;color:#777980;font-size:11px;font-weight:800}.daily-plan-item.is-complete .daily-plan-check{background:#39a85c;color:#fff}.daily-plan-item>span:nth-child(2){min-width:0;flex:1}.daily-plan-item b,.daily-plan-item small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.daily-plan-item b{font-size:11px}.daily-plan-item small{margin-top:2px;color:var(--muted);font-size:10px}.daily-plan-item em{flex:none;color:var(--muted);font-size:10px;font-style:normal}.daily-plan-item.is-complete em{color:var(--green);font-weight:800}.daily-calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px}.daily-calendar-day{display:grid;justify-items:center;gap:3px;padding:8px 3px;border:1px solid var(--line);border-radius:8px;background:#fcfcfc;color:var(--muted)}.daily-calendar-day.today{border-color:#b8ded3;box-shadow:0 0 0 2px #e9f7f3}.daily-calendar-day.complete{border-color:#9ed5ac;background:#edf9f0;color:#267443}.daily-calendar-day.partial{background:#fffaf0}.daily-calendar-day span{font-size:10px}.daily-calendar-day b{color:var(--ink);font-size:15px}.daily-calendar-day small{font-size:9px;white-space:nowrap}.daily-calendar-day.complete b{color:#267443}.idiom-meaning{display:grid;gap:3px;margin-top:8px;padding:7px 8px;border:1px solid #e5e5e7;border-radius:7px;background:#fff}.idiom-meaning p{margin:0;color:var(--muted);font-size:11px;line-height:1.6}.idiom-meaning .idiom-arabic{margin:0;color:var(--brand-dark);font-size:12px}.idiom-answer-meaning{display:grid;gap:5px;margin:8px 0;padding:9px 10px;border:1px solid #d7e9e3;border-radius:7px;background:#f7fbfa;color:var(--ink);font-size:12px;line-height:1.7}.idiom-answer-meaning span{display:block}.idiom-answer-meaning span+span{padding-top:5px;border-top:1px solid #dfeee9}.idiom-answer-meaning b{color:var(--brand-dark)}
@media(max-width:900px){.daily-plan-items{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.daily-plan-heading{align-items:flex-start}.daily-plan-items{grid-template-columns:1fr}.daily-calendar-grid{gap:4px}.daily-calendar-day{padding:7px 2px}.daily-calendar-day span{font-size:9px}.daily-calendar-day small{font-size:8px}}

/* Main Time4en visual system: keep /new functional, but make its visual language match /. */
:root {
  color-scheme: light;
  --ink: #18212f;
  --muted: #667085;
  --paper: #fffdfa;
  --line: #ded6eb;
  --brand: #4c148f;
  --brand-dark: #35106a;
  --brand-soft: #f1e8ff;
  --blue: var(--brand);
  --green: #16845b;
  --green-soft: #edf9f0;
  --red: #c2413c;
  --red-soft: #fff3f2;
  --gold: #e5a11a;
  --shadow: 0 24px 70px rgba(63, 20, 120, 0.18);
}

body {
  min-width: 320px;
  display: block;
  background:
    linear-gradient(138deg, rgba(76, 20, 143, 0.16), transparent 38%),
    linear-gradient(318deg, rgba(22, 132, 91, 0.11), transparent 42%),
    #f8f4fc;
  color: var(--ink);
  font-family: "Time4en", system-ui, sans-serif;
}

button,
input,
textarea {
  font-family: inherit;
}

.topbar {
  height: 74px;
  padding: 0 max(22px, calc((100vw - 1080px) / 2));
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}

.brand {
  gap: 12px;
  color: var(--brand-dark);
}

.brand-home {
  border-radius: 8px;
}

.brand-home img {
  display: block;
  width: 70px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 12px 20px rgba(76, 20, 143, 0.18));
}

.brand-slogan {
  color: var(--brand-dark);
  font-size: 15px;
  font-weight: 900;
}

.topbar-actions {
  gap: 8px;
}

.streak {
  color: var(--muted);
  font-size: 13px;
}

.auth-button,
.membership-link,
.sound-button,
.listen-button {
  border-color: var(--line);
  border-radius: 8px;
}

.auth-button {
  color: var(--brand);
  background: rgba(255, 255, 255, 0.72);
}

.auth-button:hover {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.membership-link,
.sound-button,
.listen-button {
  color: var(--brand);
  background: var(--brand-soft);
}

.membership-link:hover,
.sound-button:hover,
.listen-button:hover {
  color: var(--brand-dark);
  background: #eadcff;
}

.app-shell {
  max-width: none;
  padding: 0;
}

.app-layout {
  min-height: calc(100vh - 74px);
}

.app-sidebar {
  background: rgba(255, 255, 255, 0.82);
  border-color: var(--line);
  box-shadow: 8px 0 30px rgba(63, 20, 120, 0.04);
}

.sidebar-label {
  color: var(--brand-dark);
}

.module-tab {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
}

.module-tab:hover {
  border-color: #c9b5e4;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.module-tab span {
  background: var(--brand-soft);
  color: var(--brand);
}

.module-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 8px 20px rgba(76, 20, 143, 0.16);
}

.module-tab.active span {
  background: #fff;
  color: var(--brand);
}

.main-column {
  background: transparent;
}

.welcome-row h1,
.dashboard-heading h2,
.idiom-card-heading h2,
.news-card h2,
.grammar-topline h2 {
  color: var(--ink);
}

.eyebrow,
.grammar-explanation strong,
.grammar-examples > strong,
.grammar-check-heading strong {
  color: var(--brand);
}

.intro,
.grammar-goal,
.news-date,
.bank-count {
  color: var(--muted);
}

.daily-score {
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--line);
}

.daily-score span,
.daily-score strong {
  color: var(--brand-dark);
}

.learning-dashboard,
.progress-panel,
.question-card,
.lesson-aside,
.result-card,
.idiom-card,
.news-card,
.grammar-lesson,
.grammar-progress {
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.learning-dashboard,
.question-card,
.lesson-aside,
.result-card,
.idiom-card,
.news-card,
.grammar-lesson,
.grammar-progress {
  background: #fff;
}

.level-tabs {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.level-tab {
  border-color: #dfd5eb;
  background: #fff;
  color: #62556f;
}

.level-tab:hover,
.level-tab.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.all-words-button,
.dashboard-action,
.record-button,
.idiom-count,
.restart-button {
  border-color: #d8cbea;
  background: var(--brand-soft);
  color: var(--brand);
}

.all-words-button:hover,
.all-words-button.active,
.dashboard-action:hover,
.record-button:hover,
.restart-button:hover {
  border-color: #b99cdd;
  background: #eadcff;
  color: var(--brand-dark);
}

.progress-track,
.dashboard-track,
.grammar-track {
  background: #eee8f4;
}

.progress-track span,
.dashboard-track span,
.grammar-track span {
  background: var(--brand);
}

.pill,
.dashboard-icon,
.mini-icon,
.result-icon,
.idiom-list-top > span {
  background: var(--brand-soft);
  color: var(--brand);
}

.word-display,
.sentence-display,
.grammar-question,
.grammar-example b,
.idiom-arabic,
.idiom-list-top strong {
  color: var(--brand-dark);
}

.option,
.grammar-options button,
.grammar-example,
.dashboard-card,
.idiom-list-item,
.writing-display,
.speaking-display,
.news-list-item {
  border-color: #ebe5f1;
  background: #fcfbfe;
}

.option:hover:not(:disabled),
.grammar-options button:hover:not(:disabled),
.news-list-item:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.next-button,
.writing-submit,
.auth-submit {
  border-color: var(--brand);
  background: var(--brand);
}

.next-button:not(:disabled):hover,
.writing-submit:hover,
.auth-submit:hover {
  background: var(--brand-dark);
}

.grammar-tip {
  border-color: #d8eadf;
  background: #f3faf5;
}

.grammar-tip strong,
.grammar-tip p {
  color: var(--green);
}

.option.correct,
.grammar-options button.correct,
.feedback.good,
.grammar-feedback.good,
.daily-plan-item.is-complete,
.daily-calendar-day.complete,
.lesson-link.completed {
  border-color: #9ed5ac;
  background: #edf9f0;
  color: #267443;
}

.option.wrong,
.grammar-options button.wrong,
.feedback.bad,
.grammar-feedback.bad {
  border-color: #e8aaaa;
  background: #fff3f2;
  color: #a94340;
}

.new-auth-panel {
  background: rgba(255, 255, 255, 0.64);
  border-color: var(--line);
}

.new-auth-form {
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.auth-panel-heading strong {
  color: var(--brand-dark);
}

.auth-form-row input,
.idiom-search,
.writing-display textarea {
  border-color: #d8cbea;
  background: #fff;
}

.auth-form-row input:focus,
.idiom-search:focus-within,
.writing-display textarea:focus {
  border-color: var(--brand);
  outline-color: rgba(76, 20, 143, 0.16);
}

.footer {
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
}

.footer a,
.text-action,
.dashboard-action {
  color: var(--brand);
}

@media (max-width: 900px) {
  .app-sidebar {
    box-shadow: 0 8px 22px rgba(63, 20, 120, 0.05);
  }
}

@media (max-width: 560px) {
  .brand-home img {
    width: 58px;
  }

  .brand-slogan {
    color: var(--brand-dark);
  }
}

.grammar-deep-dive {
  display: grid;
  gap: 12px;
  margin: 0 0 20px;
}

.grammar-section-block {
  padding: 16px 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfcfc;
  direction: rtl;
}

.grammar-section-block h3 {
  margin: 0 0 10px;
  color: var(--brand-dark);
  font-size: 16px;
  line-height: 1.6;
}

.grammar-section-block p {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 14px;
  line-height: 2;
}

.grammar-section-block p:last-child {
  margin-bottom: 0;
}

.grammar-section-points {
  display: grid;
  gap: 7px;
  margin: 12px 0 0;
  padding: 0 20px 0 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.9;
}

.grammar-section-points li::marker {
  color: var(--brand);
}

.grammar-section-examples,
.grammar-mistakes,
.grammar-rule-table {
  display: grid;
  gap: 8px;
  margin-top: 13px;
}

.grammar-deep-example {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #ebe5f1;
  border-radius: 7px;
  background: #fff;
  direction: ltr;
  text-align: left;
}

.grammar-deep-example b {
  color: var(--brand-dark);
  font-size: 14px;
}

.grammar-deep-example span {
  color: var(--muted);
  font-size: 13px;
  direction: rtl;
  text-align: right;
}

.grammar-deep-example small {
  grid-column: 1 / -1;
  padding-top: 7px;
  border-top: 1px dashed #e8e2ee;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  direction: rtl;
  text-align: right;
}

.grammar-rule-table {
  overflow: hidden;
  border: 1px solid #e5e0e9;
  border-radius: 7px;
  background: #fff;
}

.grammar-rule-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.15fr) minmax(130px, .8fr) minmax(190px, 1fr);
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border-bottom: 1px solid #eeeaf1;
  direction: ltr;
  text-align: left;
}

.grammar-rule-row:last-child {
  border-bottom: 0;
}

.grammar-rule-row strong {
  color: var(--brand-dark);
  font-size: 13px;
}

.grammar-rule-row span {
  color: var(--muted);
  font-size: 12px;
  direction: rtl;
  text-align: right;
}

.grammar-rule-row b {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.grammar-mistake {
  padding: 11px 12px;
  border: 1px solid #efd1cd;
  border-radius: 7px;
  background: #fff8f7;
}

.grammar-mistake p {
  margin: 0 0 4px;
  font-size: 13px;
  line-height: 1.6;
}

.grammar-mistake p strong:first-child {
  color: var(--red);
}

.grammar-mistake p:nth-child(2) strong:first-child {
  color: var(--green);
}

.grammar-mistake code {
  direction: ltr;
  color: var(--ink);
  font-family: inherit;
  font-weight: 700;
}

.grammar-mistake span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

@media (max-width: 720px) {
  .grammar-section-block {
    padding: 14px;
  }

  .grammar-rule-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .grammar-rule-row span {
    text-align: right;
  }
}

@media (max-width: 560px) {
  .grammar-deep-example {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .grammar-deep-example span {
    text-align: left;
  }
}

.arabic-word-display {
  direction: rtl;
  text-align: center;
  unicode-bidi: plaintext;
}

.arabic-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.arabic-options .option {
  min-width: 0;
  overflow-wrap: anywhere;
  direction: ltr;
}

.vocabulary-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.vocabulary-options .option {
  min-width: 0;
  overflow-wrap: anywhere;
}

.test-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.test-link:hover {
  border-color: #c9afe9;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.module-tab-link {
  text-decoration: none;
}

.membership-panel { display: grid; gap: 16px; margin-bottom: 18px; }
.membership-panel[hidden] { display: none; }
.membership-heading { padding: 4px 0 2px; }
.membership-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.membership-heading h2 { margin: 0; color: var(--ink); font-size: 28px; line-height: 1.2; }
.membership-heading p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.membership-heading-row > div { min-width: 0; }
.membership-logout { flex: none; min-height: 34px; padding: 0 10px; border: 1px solid #efc7c4; border-radius: 7px; background: #fff; color: var(--red); font-size: 12px; font-weight: 800; }
.membership-logout:hover { background: #fff3f2; }
.membership-auth, .membership-card, .account-card, .membership-stats article { border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.membership-auth, .membership-card { padding: 18px; }
.membership-auth h2, .membership-card h2, .account-details h2 { margin: 0; color: var(--ink); font-size: 19px; }
.membership-auth p:not(.eyebrow), .membership-card p:not(.eyebrow) { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.membership-auth label { display: block; margin-top: 16px; color: var(--ink); font-size: 13px; font-weight: 800; }
.membership-auth-row { display: flex; gap: 8px; margin-top: 7px; }
.membership-auth-row input { width: 100%; min-width: 0; height: 42px; border: 1px solid var(--line); border-radius: 8px; padding: 0 11px; background: #fff; color: var(--ink); direction: ltr; text-align: left; }
.membership-auth-row button { flex: 0 0 auto; border: 0; border-radius: 8px; padding: 0 15px; background: var(--brand); color: #fff; font-weight: 800; }
.membership-message { min-height: 20px; margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.membership-message.error { color: var(--red); }
.membership-message.success { color: var(--green); }
.account-card { display: flex; align-items: center; gap: 13px; padding: 17px; box-shadow: none; }
.account-avatar { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 21px; font-weight: 900; }
.account-details { min-width: 0; }
.account-details > p:not(.eyebrow) { margin: 4px 0 0; color: var(--muted); font-size: 13px; direction: ltr; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.account-meta span { padding: 4px 7px; border-radius: 6px; background: var(--brand-soft); color: var(--muted); font-size: 10px; }
.account-meta .account-status { background: var(--green-soft); color: var(--green); }
.membership-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.membership-stats article { padding: 12px 9px; text-align: center; box-shadow: none; }
.membership-stats span, .membership-stats strong { display: block; }
.membership-stats span { color: var(--muted); font-size: 11px; }
.membership-stats strong { margin-top: 4px; color: var(--brand-dark); font-size: 17px; }
.current-level, .mistake-count { flex: none; padding: 5px 8px; border: 1px solid #d8cbea; border-radius: 7px; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 800; }
.member-cefr-steps { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr; align-items: center; gap: 5px; margin-top: 17px; }
.member-cefr-steps span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 48px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: 13px; font-weight: 900; }
.member-cefr-steps span small { font-size: 9px; font-weight: 600; }
.member-cefr-steps i { height: 1px; background: var(--line); }
.member-cefr-steps span.active, .member-cefr-steps span.passed { border-color: #9ed5c6; background: var(--brand-soft); color: var(--brand-dark); }
.member-cefr-steps span.active { box-shadow: 0 0 0 2px #b8ded3; }
.primary-link { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 42px; margin-top: 16px; border: 0; border-radius: 8px; background: var(--brand); color: #fff; font-weight: 800; }
.primary-link:hover { background: var(--brand-dark); }
.primary-link span { margin-right: 7px; font-size: 19px; line-height: 0; }
.membership-mistakes { display: grid; gap: 0; margin-top: 14px; }
.mistake-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.mistake-row:first-child { border-top: 0; }
.mistake-row strong { direction: ltr; text-align: left; color: var(--ink); font-size: 13px; line-height: 1.5; }
.mistake-row span { flex: 0 0 auto; color: var(--red); font-size: 12px; text-align: left; }
.mistake-empty { padding: 18px 10px; border: 1px dashed #d9d1e4; border-radius: 8px; color: var(--muted); font-size: 13px; text-align: center; }
.secondary-link { display: inline-flex; align-items: center; margin-top: 13px; border: 0; background: transparent; color: var(--brand); font-size: 12px; font-weight: 800; text-decoration: none; }
.membership-training-link { padding: 0; cursor: pointer; }

@media (max-width: 560px) {
  .membership-heading h2 { font-size: 24px; }
  .membership-auth-row { align-items: stretch; flex-direction: column; }
  .membership-auth-row button { min-height: 42px; }
  .membership-stats { gap: 5px; }
  .member-cefr-steps { gap: 3px; }
  .member-cefr-steps span { font-size: 11px; }
  .member-cefr-steps span small { font-size: 8px; }
  .account-card { align-items: flex-start; }
}

@media (max-width: 560px) {
  .test-link {
    min-height: 34px;
    padding: 0 8px;
    font-size: 11px;
  }
}

.vocabulary-mode-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
}

.vocabulary-mode-label {
  margin-left: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.vocabulary-mode-button {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 800;
}

.vocabulary-mode-button:hover {
  background: #ececee;
  color: var(--ink);
}

.vocabulary-mode-button.is-active {
  background: #e7e7e9;
  color: var(--ink);
}

@media (max-width: 560px) {
  .vocabulary-mode-switch {
    gap: 4px;
  }

  .vocabulary-mode-label {
    width: 100%;
    margin: 0;
  }

  .vocabulary-mode-button {
    padding: 6px 9px;
  }
}

/* Keep every learning surface on the same visual grid. */
.learning-dashboard,
.progress-panel,
.question-card,
.lesson-aside,
.result-card,
.idiom-card,
.news-card,
.grammar-lesson,
.grammar-progress,
.membership-auth,
.membership-card,
.account-card,
.membership-stats article,
.test-question-card,
.result-view {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.option,
.grammar-options button,
.grammar-example,
.grammar-info-item,
.dashboard-card,
.idiom-list-item,
.news-list-item,
.daily-plan-item,
.daily-calendar-day,
.lesson-link,
.test-option,
.hero-meta span,
.test-mode-button,
.section-note,
.live-score,
.quiz-progress,
.back-button,
.secondary-button {
  border-radius: 8px;
}

.feedback,
.grammar-feedback,
.test-feedback {
  border: 1px solid transparent;
  border-radius: 8px;
}

.feedback.good,
.grammar-feedback.good,
.test-feedback.good {
  border-color: #9ed5ac;
}

.feedback.bad,
.grammar-feedback.bad,
.test-feedback.bad {
  border-color: #e8aaaa;
}

.tip-box,
.grammar-tip,
.grammar-quiz-result,
.mistake-empty,
.idiom-meaning,
.idiom-answer-meaning {
  border-radius: 8px;
}

/* Final component pass: all pages use the same framed controls and rows. */
.topbar,
.app-sidebar,
.main-column,
.footer {
  border-color: var(--line);
}

.topbar {
  min-height: 64px;
  height: 64px;
  padding-inline: max(16px, calc((100vw - 1080px) / 2));
}

.brand-home img {
  width: 58px;
  height: 40px;
}

.test-link,
.auth-button,
.listen-button,
.record-button,
.membership-link,
.membership-logout,
.auth-submit,
.auth-logout,
.membership-auth-row button,
.restart-button,
.writing-submit,
.primary-link,
.next-button,
.back-button,
.secondary-button,
.all-words-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
}

.test-link,
.auth-button,
.listen-button,
.record-button,
.membership-link,
.restart-button,
.back-button,
.secondary-button,
.all-words-button {
  background: #fff;
  color: var(--brand-dark);
}

.test-link:hover,
.auth-button:hover,
.listen-button:hover,
.record-button:hover,
.membership-link:hover,
.restart-button:hover,
.back-button:hover,
.secondary-button:hover,
.all-words-button:hover,
.all-words-button.active {
  border-color: #bda5da;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.auth-submit,
.membership-auth-row button,
.primary-link,
.next-button,
.writing-submit {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.auth-submit:hover,
.membership-auth-row button:hover,
.primary-link:hover,
.next-button:not(:disabled):hover,
.writing-submit:hover {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
}

.app-sidebar {
  background: #fafafa;
  box-shadow: none;
}

.app-layout {
  min-height: calc(100vh - 64px);
}

.module-tabs {
  gap: 6px;
}

.module-tab {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  text-decoration: none;
}

.module-tab:hover {
  border-color: #bda5da;
  background: var(--brand-soft);
}

.module-tab.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.module-tab.active span {
  background: #fff;
  color: var(--brand);
}

.vocabulary-mode-switch,
.level-tabs {
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.vocabulary-mode-switch {
  display: grid;
  grid-template-columns: auto repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
}

.vocabulary-mode-label,
.level-title {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin: 0;
  padding: 0 9px;
  border: 1px solid #ebe5f1;
  border-radius: 8px;
  background: #fcfbfe;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.vocabulary-mode-button,
.level-tab {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 700;
}

.vocabulary-mode-button:hover,
.level-tab:hover {
  border-color: #bda5da;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.vocabulary-mode-button.is-active,
.level-tab.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.level-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.bank-count {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-right: auto;
  padding: 0 10px;
  border: 1px solid #ebe5f1;
  border-radius: 8px;
  background: #fcfbfe;
  color: var(--muted);
  font-size: 11px;
}

.all-words-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  font-weight: 800;
}

.progress-panel {
  margin-bottom: 16px;
  padding: 13px 15px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

.progress-copy {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.progress-copy span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid #ebe5f1;
  border-radius: 8px;
  background: #fcfbfe;
}

.progress-copy span:first-child {
  color: var(--brand-dark);
  font-weight: 800;
}

.progress-copy span:last-child {
  color: var(--brand);
  font-weight: 800;
  direction: rtl;
}

.progress-track {
  height: 6px;
  border-radius: 8px;
  background: #eee8f4;
}

.question-card {
  min-height: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

.question-meta {
  min-height: 38px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #d8cbea;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
}

.question-prompt {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: 20px 0 12px;
  padding: 0 10px;
  border: 1px solid #ebe5f1;
  border-radius: 8px;
  background: #fcfbfe;
  color: var(--muted);
  font-size: 12px;
}

.word-display,
.sentence-display {
  margin: 8px auto 22px;
  padding: 18px 14px;
  border: 1px solid #ebe5f1;
  border-radius: 8px;
  background: #fcfbfe;
}

.word-display {
  max-width: 620px;
}

.sentence-display {
  max-width: 620px;
}

.options,
.grammar-options {
  gap: 10px;
}

.option,
.grammar-options button {
  min-height: 50px;
  border: 1px solid #ebe5f1;
  border-radius: 8px;
  background: #fcfbfe;
  color: var(--ink);
  font-weight: 700;
}

.option:hover:not(:disabled),
.grammar-options button:hover:not(:disabled) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.feedback,
.grammar-feedback,
.grammar-quiz-result {
  padding: 13px 14px;
  border-radius: 8px;
}

.daily-plan,
.daily-calendar {
  margin-top: 16px;
  padding-top: 0;
  border-top: 0;
}

#membershipContent {
  display: grid;
  gap: 16px;
}

#membershipContent[hidden],
.membership-panel[hidden] {
  display: none;
}

.membership-heading {
  padding: 0;
}

/* Keep mode-specific controls hidden even when their component has a display rule. */
[hidden] {
  display: none !important;
}

.level-tabs[hidden],
.vocabulary-mode-switch[hidden] {
  display: none !important;
}

.membership-heading-row {
  padding: 2px 0 0;
}

.account-card,
.membership-card,
.membership-stats article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

.account-card {
  padding: 20px;
}

.membership-stats {
  gap: 10px;
}

.membership-stats article {
  min-height: 88px;
  padding: 16px 12px;
}

.path-card,
.mistakes-card {
  padding: 20px;
}

.path-card .section-heading,
.mistakes-card .section-heading {
  margin-bottom: 16px;
}

.daily-plan-items {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.daily-plan-item,
.daily-calendar-day {
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfbfe;
}

.daily-plan-item:hover {
  border-color: #bda5da;
  background: var(--brand-soft);
}

.daily-plan-item.is-complete {
  border-color: #9ed5ac;
  background: var(--green-soft);
}

.daily-calendar-day.partial {
  background: #fffaf0;
}

@media (max-width: 900px) {
  .main-column {
    padding: 28px 20px 48px;
  }

  .module-tabs {
    gap: 6px;
  }

  .module-tab {
    border: 1px solid var(--line);
  }

  .daily-plan-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .topbar {
    min-height: 60px;
    height: 60px;
    padding-inline: 12px;
  }

  .brand-home img {
    width: 52px;
    height: 36px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .test-link,
  .auth-button {
    min-height: 34px;
    padding-inline: 8px;
    font-size: 11px;
  }

  .app-layout {
    min-height: calc(100vh - 60px);
  }

  .main-column {
    padding: 20px 14px 40px;
  }

  .module-tabs {
    gap: 6px;
  }

  .module-tab {
    min-height: 36px;
    padding: 7px 9px;
    font-size: 11px;
  }

  .vocabulary-mode-switch {
    grid-template-columns: 1fr 1fr;
  }

  .vocabulary-mode-label {
    grid-column: 1 / -1;
  }

  .vocabulary-mode-button,
  .level-tab {
    min-height: 36px;
    padding-inline: 8px;
  }

  .level-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .level-title,
  .bank-count,
  .all-words-button {
    width: 100%;
    justify-content: center;
    margin: 0;
  }

  .level-title,
  .bank-count {
    grid-column: 1 / -1;
  }

  .progress-copy {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .progress-copy span {
    justify-content: center;
  }

  .question-card {
    padding: 16px;
  }

  .question-meta {
    align-items: stretch;
  }

  .question-prompt {
    width: 100%;
    justify-content: center;
  }

  .word-display,
  .sentence-display {
    padding: 15px 10px;
  }

  .daily-plan-items {
    grid-template-columns: 1fr;
  }

  .daily-plan-item {
    min-height: 58px;
  }

  .account-card,
  .path-card,
  .mistakes-card {
    padding: 16px;
  }

  .membership-stats {
    grid-template-columns: 1fr;
  }
}

/* Put the grammar path directly below the daily calendar, like the other page summaries. */
.grammar-progress-top {
  margin: 0 0 16px;
}

.grammar-progress-top .grammar-progress {
  width: 100%;
}

.grammar-progress-top .lesson-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-height: none;
}

.grammar-layout {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 900px) {
  .grammar-progress-top .lesson-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .grammar-progress-top .lesson-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.motivation-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 16px;
  padding: 17px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.motivation-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 20px;
}

.motivation-copy {
  min-width: 0;
}

.motivation-copy .eyebrow {
  margin-bottom: 2px;
}

.motivation-copy h2 {
  margin: 0;
  color: var(--brand-dark);
  direction: ltr;
  font-size: 20px;
  text-align: left;
}

.motivation-copy p:last-child {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 560px) {
  .motivation-card {
    align-items: flex-start;
    padding: 15px 16px;
  }

  .motivation-copy h2 {
    font-size: 18px;
  }
}

/* Keep the daily plan scannable: two choices per row on every viewport. */
.daily-plan-items {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.vocabulary-test-switch {
  display: grid;
  grid-template-columns: auto repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.vocabulary-test-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 700;
}

.vocabulary-test-button:hover {
  border-color: #bda5da;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.vocabulary-test-button.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.vocabulary-meaning-display {
  display: grid;
  gap: 9px;
  min-height: 132px;
  align-content: center;
  margin: 10px 0 21px;
  padding: 20px 18px;
  border: 1px solid #e5deed;
  border-radius: 8px;
  background: #fcfbfe;
  text-align: center;
}

.vocabulary-meaning-display span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.vocabulary-meaning-display strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.65;
}

.vocabulary-meaning-options .option {
  min-height: 56px;
  font-weight: 700;
}

@media (max-width: 560px) {
  .vocabulary-test-switch {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .vocabulary-test-switch .vocabulary-mode-label {
    grid-column: 1 / -1;
  }

  .vocabulary-test-button {
    min-height: 38px;
    padding-inline: 8px;
  }

  .vocabulary-meaning-display {
    min-height: 148px;
    padding: 18px 14px;
  }

  .vocabulary-meaning-display strong {
    font-size: 19px;
  }
}

/* Daily review: make the source, goal, and explanation visible without adding visual noise. */
.daily-question-context {
  display: grid;
  gap: 7px;
  margin: 18px 0 3px;
  padding: 12px 14px;
  border: 1px solid #e3d7f1;
  border-radius: 8px;
  background: linear-gradient(135deg, #fbf8ff, #f7fcfa);
}

.daily-question-context-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.daily-question-context-top span:last-child {
  color: var(--muted);
  font-weight: 700;
}

.daily-question-context strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.75;
}

.daily-question-context[hidden] {
  display: none;
}

.daily-feedback-source,
.selected-answer,
.correct-answer-line {
  display: block;
  margin-top: 8px;
  line-height: 1.8;
}

.daily-feedback-source {
  padding-top: 8px;
  border-top: 1px solid currentColor;
  opacity: .9;
}

.selected-answer {
  font-size: 13px;
}

.correct-answer-line {
  padding: 8px 10px;
  border: 1px solid currentColor;
  border-radius: 7px;
  background: rgba(255,255,255,.46);
  font-size: 13px;
}

.feedback-explanation {
  margin-top: 7px;
}

.feedback-explanation .reason-label {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
}

.example-line {
  line-height: 1.85;
}

.example-line span {
  color: inherit;
  opacity: .9;
}

@media (max-width: 560px) {
  .daily-question-context {
    margin-top: 15px;
    padding: 11px 12px;
  }

  .daily-question-context-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .feedback {
    font-size: 13px;
  }
}
