/* Approved shared direction: مساحة هادئة. Component behavior remains in study.css. */
@font-face{font-family:MarjaaPlex;src:url('fonts/ibm-plex-arabic-regular.ttf') format('truetype');font-weight:400;font-display:swap}
@font-face{font-family:MarjaaPlex;src:url('fonts/ibm-plex-arabic-medium.ttf') format('truetype');font-weight:500;font-display:swap}
@font-face{font-family:MarjaaPlex;src:url('fonts/ibm-plex-arabic-semibold.ttf') format('truetype');font-weight:600;font-display:swap}
@font-face{font-family:MarjaaPlex;src:url('fonts/ibm-plex-arabic-bold.ttf') format('truetype');font-weight:700;font-display:swap}
:root{--bg:#0e1724;--surface:#152131;--surface-alt:#1b2a3e;--text:#f0f3f8;--muted:#aab8ca;--border:#2a3a50;--accent:#e5bd75;--accent-soft:#e5bd7512;--accent-text:#152034;--navy:#111e30;--radius:14px;--space:28px;--shadow:none}
:root[data-theme=light]{--bg:#f5f5f2;--surface:#fff;--surface-alt:#eff1f3;--text:#1a293d;--muted:#59687b;--border:#dadddf;--accent:#875b17;--accent-soft:#aa7c2410;--accent-text:#fff;--navy:#111e30;--shadow:none}
body{font-family:MarjaaPlex,'Segoe UI',Tahoma,sans-serif;font-size:16px;line-height:1.9}
button{font-weight:500;border-radius:9px;padding:11px 18px;transition:background .16s,border-color .16s,transform .16s;line-height:1.65}
button:hover{filter:none}
button:not(.ghost):not(.icon-button):not(.avatar):not(.text-button):hover{background-color:color-mix(in srgb,var(--accent),white 7%)}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline-width:2px;outline-offset:4px}
h1{font-size:32px;font-weight:600;letter-spacing:-.5px;line-height:1.6}
h2{font-weight:600}
h3{font-weight:500}
.translation{font-family:MarjaaPlex,'Segoe UI',sans-serif;line-height:1.7;font-size:.78em}
.brand{font-size:29px;font-weight:600;gap:10px}
.brand img{width:45px;height:45px;border-radius:0}
.brand small{font-size:10px;letter-spacing:0}
.badge{font-size:11px;border-radius:5px;padding:3px 8px}
.card{border-radius:var(--radius)}
.icon{stroke-width:1.6}
.eyebrow{letter-spacing:0;font-weight:500}
.page-heading .eyebrow{letter-spacing:1.4px;font-size:9px}
input,select,textarea{border-radius:8px;background:var(--surface);font-size:13px}
input:focus,textarea:focus{border-color:var(--accent)}
.sidebar{width:232px;inset:16px 16px 16px auto;padding:24px 14px 18px;border:1px solid #293a51;border-radius:14px;scrollbar-width:thin;scrollbar-color:#34455a transparent}
.sidebar .brand{padding:0 12px;margin-bottom:28px}
.sidebar .course-switch{padding:0 8px 18px;margin-bottom:12px}
.course-switch label{font-size:10px;margin-bottom:9px}
.course-switch select{border-color:#3b4b60;background:#19283d;font-size:12px;padding:9px 10px;border-radius:7px}
.course-code{font-size:9px;color:#a3b4cb;letter-spacing:.8px}
.sidebar nav{gap:3px}
.sidebar button{font-size:12px;min-height:42px;padding:10px 11px;border-radius:7px;gap:11px}
.sidebar button .icon{width:18px;height:18px}
.sidebar .nav-link.active{background:#e5bd7516;border-color:transparent;color:#f1cf94}
.sidebar .nav-link.active::before{height:16px;width:2px;inset-inline-start:0}
.sidebar .back-subjects{font-size:11px;margin-bottom:2px}
.nav-group-label{font-size:9px;padding:12px 12px 7px;color:#99aac0}
.sidebar-foot{font-size:9px;padding:24px 10px 0;gap:7px}
.status-dot{width:5px;height:5px}
.main-wrap{margin-inline-start:256px;padding:0 40px}
.topbar{min-height:84px;border-color:var(--border)}
.topbar strong{font-size:13px;font-weight:500}
.topbar .small{font-size:10px;display:block;margin-bottom:2px}
.header-actions{gap:9px}
.icon-button{border-color:var(--border);width:38px;height:38px;min-height:38px;padding:9px}
.avatar{width:38px;height:38px;font-size:14px}
.main-wrap main{max-width:1140px;padding-block:34px 52px}
.page-heading{margin-bottom:26px}
.page-heading p{font-size:14px;margin-top:7px;line-height:1.9}
.page-heading .eyebrow{color:var(--muted);margin-bottom:6px}
.study-banner{padding:30px 32px;border:1px solid var(--border);border-inline-start:3px solid var(--accent);border-radius:14px;gap:32px;margin-bottom:0}
.study-banner .eyebrow{font-size:11px;margin-bottom:10px}
.study-banner h2{font-size:26px;font-weight:600;max-width:590px;line-height:1.7}
.study-banner p{font-size:12px;margin:8px 0 20px}
.study-banner .actions button{font-size:12px}
.completion{padding-inline-start:32px;max-width:175px;min-width:150px}
.completion>strong{font-size:42px;font-weight:500;line-height:1.5}
.completion>span{font-size:11px;margin-block:4px 16px}
.completion>strong>span{font-size:16px}
.progress{height:4px;background:var(--border)}
.stats{gap:0;margin:24px 0 34px;border-block:1px solid var(--border);padding-block:16px}
.stat{border:0;border-radius:0;background:none;padding:0 22px;border-inline-start:1px solid var(--border);min-height:68px}
.stat:first-child{border:0;padding-inline-start:0}
.stat>strong{font-size:28px;font-weight:500;line-height:1.7}
.stat>span{font-size:11px}
.stat>.icon{inset-inline-end:22px;top:5px;width:16px;height:16px;opacity:.8}
.section-head{margin:28px 0 15px}
.section-head h2{font-size:18px;font-weight:500}
.section-head .text-button{font-size:11px}
.chapter-list{gap:0;border:1px solid var(--border);border-radius:12px;overflow:hidden}
.chapter.card{border:0;border-radius:0;border-bottom:1px solid var(--border);padding:22px 26px;gap:22px}
.chapter:last-child{border-bottom:0}
.chapter-number{font-family:MarjaaPlex,sans-serif;font-size:20px;color:var(--muted);font-weight:400;width:35px}
.chapter-body h3{font-size:16px;line-height:1.8}
.chapter-body h3 .translation{font-size:11px}
.chapter-body>p{font-size:11px;margin:5px 0 12px}
.chapter-body>.progress{height:3px;max-width:350px}
.chapter-body .resource-chapter-links a{font-size:10px;border:0;background:var(--surface-alt);min-height:30px;border-radius:5px;padding:4px 9px}
.chapter-body>.resource-chapter-links{margin-top:12px}
.chapter-actions{min-width:118px;gap:4px}
.chapter-actions>button{font-size:11px;min-height:36px;padding:8px 12px}
.chapter-actions .text-button{font-size:11px}
.tool-grid{gap:14px}
.tool-card{background:var(--surface);padding:22px;border-radius:10px;gap:10px}
.tool-card>strong{font-size:15px;font-weight:500}
.tool-card>span{font-size:11px}
.tool-card>.icon:first-child{width:22px;height:22px;margin-bottom:3px}
.app-footer{font-size:9px;line-height:1.9;padding-block:20px 26px}
.sidebar .nav-link{font-size:13px}
.stat>span{font-size:12px}
.chapter-body>p{font-size:12px}
.study-banner .actions button{font-size:13px}
.study-banner p{font-size:13px}
.topbar .small{font-size:11px}
.tool-card>span{font-size:12px}
.toolbar{background:transparent;border:0;border-bottom:1px solid var(--border);border-radius:0;padding:0 0 22px;gap:16px;margin-bottom:26px}
.toolbar label{font-size:11px}
.toolbar input,.toolbar select{min-height:44px}
.toolbar .search-field{max-width:600px}
.toolbar button{font-size:12px}
.lesson-layout{grid-template-columns:220px minmax(0,1fr);gap:28px}
.lesson-menu{padding-inline-end:16px;gap:4px;scrollbar-width:thin;scrollbar-color:var(--border) transparent}
.lesson-menu button{font-size:12px;padding:11px 9px;line-height:1.8;gap:10px}
.lesson-menu button.active{border-color:transparent;box-shadow:inset -2px 0 var(--accent);background:var(--accent-soft);color:var(--text)}
.lesson-status{font-size:10px}
.lesson-menu .translation{font-size:9px}
.lesson-content{padding:32px 36px}
.lesson-content h2{font-size:26px;font-weight:600}
.lesson-content h2 .translation{font-size:13px;margin-top:4px}
.lesson-content h3{font-size:16px;font-weight:600}
.lesson-content>p,.lesson-reading p,.lesson-reading li{font-size:15px;line-height:2.2}
.definition{margin-block:26px;background:var(--surface-alt);border-inline-start-width:2px;padding:20px 22px;border-radius:6px}
.definition p{line-height:2.1}
.definition h3{font-weight:400;font-size:11px}
.definition .translation{font-size:13px;line-height:1.9}
.source-links{font-size:10px!important;opacity:.9}
.reading-table-wrap{border-radius:8px}
.reading-table-wrap th,.reading-table-wrap td{font-size:13px;padding:14px;line-height:2}
.reading-table-wrap th{font-weight:500}
.lesson-controls button{font-size:12px}
.note-editor label{font-size:12px}
.note-editor textarea{font-size:13px;background:var(--bg)}
pre{border-radius:8px;font-size:13px;padding:22px;background:#0b1420}
.callout{border-inline-start-width:2px;border-radius:6px;font-size:13px}
.question-progress{max-width:820px;margin:24px auto 12px;font-size:11px}
.question-progress+.progress{max-width:820px;margin:auto}
.question-card{max-width:820px;padding:32px 36px;border-radius:14px}
.question-meta{font-size:11px;gap:10px}
.question-title{font-size:22px;font-weight:500;line-height:1.9}
.question-title .translation{font-size:14px}
.choices>button{border-radius:8px;padding:14px 18px;min-height:58px;font-size:14px;gap:14px}
.choice-letter{border-radius:6px}
.question-footer{padding-top:24px}
.question-footer button{font-size:12px}
.question-footer .text-button{font-size:11px}
.flashcard{border-radius:14px;box-shadow:none}
.flashcard h2{font-size:28px}
.review-grid .card,.glossary-list{border-radius:10px}
.badr-welcome h2{font-weight:600}
.badr-message,.badr-consent{line-height:2}
.portal{max-width:1240px;padding-inline:40px}
.portal-header{height:96px}
.subjects-heading{padding:48px 0 12px}
.subjects-heading h1{font-size:40px;line-height:1.6;font-weight:500}
.subjects-heading h1 br{display:none}
.subjects-heading>p{font-size:14px;margin-top:12px}
.subject-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}
.subject-card{padding:26px;display:flex;flex-direction:column;border-radius:12px}
.subject-card>.section-head:first-child{margin:0 0 22px}
.subject-card h2{font-size:22px;font-weight:600;line-height:1.7}
.subject-card>.muted{font-size:13px;line-height:2;flex:1}
.subject-card .course-en{font-size:11px;min-height:19px;margin:7px 0 14px}
.subject-meta{font-size:11px;gap:10px;margin:20px 0 18px}
.subject-meta span+span{padding-inline-start:10px}
.subject-card>.section-head:last-child{margin:18px 0 0;align-items:center;gap:12px;flex-wrap:wrap}
.subject-card>.section-head:last-child>span{font-size:10px}
.subject-card button{font-size:11px;min-height:38px;padding:9px 13px}
.course-symbol{width:44px;height:44px;border:0;border-radius:8px;background:var(--accent-soft)}
.course-symbol .icon{width:23px;height:23px}
.local-notice{font-size:11px;margin-top:28px;justify-content:center}
.portal-footer{font-size:10px;margin-top:36px;padding-top:28px}
.welcome h1{font-size:44px}
.welcome section>p{font-size:16px}
@media(max-width:1099px) and (min-width:901px){.main-wrap{margin-inline-start:232px;padding-inline:26px}
.sidebar{width:208px;inset:12px 12px 12px auto;padding-inline:10px}
.sidebar button{font-size:11px}
.lesson-layout{grid-template-columns:180px minmax(0,1fr);gap:20px}
.lesson-content{padding:26px}
.subject-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.study-banner{padding:25px}
.study-banner h2{font-size:24px}
}
@media(max-width:900px){.sidebar{inset:0 0 0 auto;width:270px;border-radius:0;padding:24px 16px}
.sidebar button{font-size:13px;min-height:46px}
.sidebar .brand{margin-bottom:28px}
.main-wrap{margin-inline-start:0;padding:0 24px}
.main-wrap main{padding-top:28px}
.topbar{min-height:78px}
.menu-toggle{display:inline-flex}
.lesson-layout{grid-template-columns:1fr;gap:20px}
.lesson-menu{position:static;max-height:220px;border:1px solid var(--border);border-radius:10px;padding:8px}
.lesson-menu button{padding:10px}
.lesson-content{padding:28px}
.study-banner{padding:26px;gap:24px}
.study-banner h2{font-size:24px}
.completion{min-width:130px}
.subject-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.portal{padding-inline:24px}
.portal-header{height:84px}
.subjects-heading{padding-top:36px}
.subjects-heading h1{font-size:34px}
.mobile-tabs{background:var(--navy);border-top:1px solid #344155;box-shadow:none;padding-top:8px}
.mobile-tabs button{font-size:10px;border-radius:7px;min-height:48px;gap:5px;color:#b4c0d2}
.mobile-tabs button[aria-current]{background:#e5bd7515;color:#f1cf94}
.mobile-tabs .icon{width:20px;height:20px}
.app-footer{padding-bottom:30px}
}
@media(max-width:600px){:root{--space:20px}
.main-wrap{padding-inline:18px}
.topbar{min-height:76px;gap:10px}
.topbar>div:first-child{min-width:0;max-width:calc(100% - 138px)}
.topbar .small{font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar strong{font-size:12px}
.header-actions{gap:7px}
.header-actions .icon-button,.header-actions .avatar{width:36px;height:36px;min-height:36px;padding:8px}
.page-heading{margin-bottom:23px}
.page-heading h1{font-size:27px;letter-spacing:-.4px}
.page-heading p{font-size:12px;line-height:1.9;margin-top:8px}
.main-wrap main{padding-top:26px;padding-bottom:36px}
.page-heading .eyebrow{font-size:8px}
.study-banner{padding:23px 22px;display:block;border-radius:12px}
.study-banner h2{font-size:23px;line-height:1.7}
.study-banner .eyebrow{margin-bottom:8px;font-size:10px}
.study-banner p{margin:9px 0 18px;font-size:11px}
.study-banner .actions{gap:8px;flex-wrap:wrap}
.study-banner .actions button{font-size:11px;padding:10px 12px;min-height:40px}
.completion{display:grid;grid-template-columns:1fr auto;gap:0 18px;align-items:center;max-width:none;min-width:0;padding:18px 0 0;margin-top:20px;border:0;border-top:1px solid var(--border)}
.completion>strong{grid-column:2;grid-row:1/3;direction:ltr;font-size:30px}
.completion>strong>span{font-size:13px}
.completion>span{grid-column:1;grid-row:1;font-size:10px;margin:0 0 9px}
.completion>.progress{grid-column:1;grid-row:2}
.stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 0;margin-block:22px 27px;padding-block:18px}
.stat{padding:0 16px;min-height:58px}
.stat:nth-child(3){border:0;padding-inline-start:0}
.stat>strong{font-size:26px}
.stat>span{font-size:10px}
.stat>.icon{top:3px;inset-inline-end:14px;width:15px;height:15px}
.section-head{margin-top:24px;margin-bottom:13px;gap:10px}
.section-head h2{font-size:17px}
.section-head .text-button{font-size:10px}
.chapter.card{padding:19px 18px;gap:12px;flex-wrap:wrap}
.chapter-number{font-size:17px;width:23px;padding-top:3px;align-self:flex-start}
.chapter-body h3{font-size:15px}
.chapter-body h3 .translation{font-size:10px}
.chapter-body>p{font-size:10px}
.chapter-actions{flex-direction:row;margin-inline-start:35px;gap:14px;align-items:center}
.chapter-actions>button{font-size:10px;min-height:36px}
.chapter-body .resource-chapter-links a{font-size:9px;padding:4px 7px}
.chapter-body>.resource-chapter-links{margin-top:10px}
.tool-grid{grid-template-columns:1fr;gap:10px}
.tool-card{padding:18px;grid-template-columns:auto 1fr auto;column-gap:15px;row-gap:3px}
.tool-card>.icon:first-child{grid-column:1;grid-row:1/3;align-self:center;margin:0}
.tool-card>strong{grid-column:2;font-size:14px}
.tool-card>span{grid-column:2;font-size:10px}
.tool-card>.icon:last-child{grid-column:3;grid-row:1/3}
.toolbar{padding-bottom:18px;gap:12px;margin-bottom:20px}
.toolbar label{font-size:10px;min-width:120px}
.toolbar label.search-field{min-width:100%;max-width:none}
.toolbar select{font-size:11px}
.toolbar input{font-size:12px}
.toolbar button{font-size:11px}
.lesson-content{padding:22px 20px;border-radius:12px}
.lesson-content h2{font-size:23px;line-height:1.7}
.lesson-content h2 .translation{font-size:12px}
.lesson-content>p,.lesson-reading p,.lesson-reading li{font-size:14px;line-height:2.2}
.definition{padding:18px;margin-block:22px}
.definition p{font-size:14px}
.definition .translation{font-size:12px}
.lesson-content h3{font-size:15px}
.lesson-menu{max-height:180px}
.lesson-menu button{font-size:11px}
.lesson-controls button{font-size:11px;padding:9px 12px}
.reading-table-wrap th,.reading-table-wrap td{font-size:12px}
.lesson-reading ul{padding-inline-start:20px}
.quran-verse{line-height:2.3}
.question-card{padding:23px 20px;margin-block:20px}
.question-title{font-size:19px;line-height:1.9}
.question-title .translation{font-size:13px}
.question-progress{font-size:10px}
.question-card .choices>button{font-size:13px;padding:13px;min-height:55px}
.question-footer{gap:12px}
.question-footer button{font-size:11px;padding:9px 12px}
.question-footer .text-button{font-size:10px}
.flashcard h2{font-size:24px}
.portal{padding-inline:20px}
.portal-header{height:82px}
.brand{font-size:26px}
.brand img{width:42px;height:42px}
.subjects-heading{padding:34px 0 6px}
.subjects-heading h1{font-size:29px;line-height:1.8}
.subjects-heading h1 br{display:block}
.subjects-heading>p{font-size:12px;line-height:2}
.subject-grid{grid-template-columns:1fr;gap:15px}
.subject-card{padding:23px}
.subject-card h2{font-size:23px}
.subject-card>.muted{font-size:12px;margin-block:6px 12px}
.subject-card .course-en{min-height:0;margin-bottom:10px}
.subject-card>.section-head:first-child{margin-bottom:20px}
.subject-meta{font-size:10px;margin-block:16px}
.subject-card>.section-head:last-child{margin-top:18px;flex-wrap:nowrap}
.subject-card>.section-head:last-child>span{font-size:10px}
.subject-card button{font-size:11px}
.local-notice{align-items:flex-start;font-size:10px;gap:10px}
.portal-footer{font-size:9px}
.portal-header .ghost{font-size:11px;padding:8px 12px;min-height:36px}
.portal-header .avatar{display:none}
.welcome h1{font-size:32px}
.welcome section>p{font-size:14px}
.welcome-tools{font-size:12px;gap:18px}
.welcome-form{padding:24px}
.badr-welcome h2{font-size:23px}
.badr-message{font-size:14px}
.app-footer{display:block;font-size:9px;line-height:2.2}
.app-footer span{display:block}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;scroll-behavior:auto!important}
}
/* Readable editable fields without mobile browser focus zoom. */
@media(max-width:900px){#app input:not([type=checkbox]):not([type=radio]),#app select,#app textarea{font-size:16px}}
/* Keep the study tools' print contract after the screen design layer. */
@media print{
 :root[data-theme]{--bg:#fff;--surface:#fff;--surface-alt:#f5f5f5;--text:#111;--muted:#444;--border:#bbb;--accent:#704800;--quran-ink:#166534}
 body{background:#fff;color:#111;font-size:12px}
 .main-wrap{margin:0;padding:0}.portal{max-width:none;padding:0}
 pre{color:#111;background:#f5f5f5;white-space:pre-wrap}
}
