:root{--navy:#0B2242;--navy2:#16325C;--gold:#C9A24A;--goldl:#F6EED9;--red:#A33B32;--bg:#F4F6FA;--ink:#1F2A3C;--muted:#5B6577;--line:#DCE2EC;--light:#E8EDF5;
--blue:#1A6FA8;--orange:#E8720C;--green:#2E7D4F}
*{box-sizing:border-box;margin:0;padding:0}
html{-webkit-text-size-adjust:100%}
body{background:var(--bg);color:var(--ink);font-family:"Segoe UI",Tahoma,"Noto Sans Arabic","Noto Naskh Arabic",Arial,sans-serif;font-size:17px;line-height:1.65;min-height:100vh;display:flex;flex-direction:column}
a{color:inherit;text-decoration:none}
button{font:inherit;cursor:pointer}
.top{position:sticky;top:0;z-index:10;background:var(--navy);color:#fff;display:flex;align-items:center;gap:.5em;padding:.5em .8em;padding-top:max(.5em,env(safe-area-inset-top))}
.brand{display:flex;align-items:center;gap:.55em}
.brand img{border-radius:50%;background:#fff}
.brand span{display:flex;flex-direction:column;line-height:1.2}
.brand b{font-size:1.02em}.brand small{color:var(--gold);font-size:.78em}
.iconbtn{background:rgba(255,255,255,.1);border:0;color:#fff;width:38px;height:38px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex:none}
.iconbtn svg{width:22px;height:22px}
main{flex:1;width:100%;max-width:980px;margin:0 auto;padding:1em .9em 2em;outline:none}
.foot{text-align:center;font-size:.8em;color:var(--muted);padding:1em}
h1{font-size:1.5em;color:var(--navy);line-height:1.35}
h2{font-size:1.25em;color:var(--navy);line-height:1.35}
h3{font-size:1.08em;color:var(--navy);line-height:1.4}
.muted{color:var(--muted)}
.kick{color:var(--gold);font-weight:700;font-size:.85em}
/* home */
.hero{background:linear-gradient(135deg,var(--navy),var(--navy2));color:#fff;border-radius:16px;padding:1.3em 1.2em;margin-bottom:1.1em}
.hero h1{color:#fff;font-size:1.45em}.hero p{color:#C8D0DE;margin-top:.3em}
.hero .chips{display:flex;flex-wrap:wrap;gap:.4em;margin-top:.8em}
.chip{background:rgba(255,255,255,.12);border-radius:99px;padding:.15em .75em;font-size:.82em}
.cyc{margin:1.1em 0 .5em;color:var(--muted);font-weight:700;font-size:.9em}
.levels{display:grid;gap:.7em}
.lvl{background:#fff;border-radius:14px;padding:.9em 1em;display:flex;align-items:center;gap:.9em;box-shadow:0 1px 4px rgba(20,35,60,.08);border:1px solid var(--line)}
.lvl .badge{width:3.1em;height:3.1em;border-radius:12px;background:var(--navy);color:var(--gold);display:flex;align-items:center;justify-content:center;font-weight:800;font-size:1em;flex:none;text-align:center;line-height:1.1}
.lvl .t{flex:1}.lvl .t b{display:block;font-size:1.08em;color:var(--navy)}.lvl .t small{color:var(--muted)}
.count{background:var(--goldl);color:#6B4F12;border-radius:99px;padding:.1em .65em;font-size:.8em;font-weight:700;white-space:nowrap}
.count.zero{background:var(--light);color:var(--muted)}
.howto{margin-top:1.4em;display:grid;gap:.6em}
.howto div{background:#fff;border-radius:12px;padding:.7em .9em;border-inline-start:4px solid var(--gold);font-size:.95em}
/* level */
.tabs{display:flex;gap:.4em;overflow-x:auto;margin:.8em 0;padding-bottom:.2em;scrollbar-width:none}
.tabs button{flex:none;background:#fff;border:1px solid var(--line);border-radius:99px;padding:.35em 1em;color:var(--ink);font-weight:700}
.tabs button.on{background:var(--navy);color:#fff;border-color:var(--navy)}
.sem{margin:1em 0 .4em;font-weight:800;color:var(--muted);font-size:.9em}
.lessons{display:grid;gap:.5em}
.les{background:#fff;border-radius:12px;padding:.7em .9em;display:flex;align-items:center;gap:.7em;border:1px solid var(--line)}
.les .n{width:2em;height:2em;border-radius:50%;background:var(--light);color:var(--navy);display:flex;align-items:center;justify-content:center;font-weight:800;font-size:.9em;flex:none}
.les .t{flex:1;font-weight:600}
.les.ready{border-color:#CDB98A;box-shadow:0 2px 6px rgba(201,162,74,.18)}
.les.ready .n{background:var(--gold);color:var(--navy)}
.les.soon{opacity:.62}
.tag{font-size:.75em;border-radius:99px;padding:.1em .6em;white-space:nowrap}
.tag.ok{background:#E3F1E8;color:var(--green);font-weight:700}.tag.wait{background:var(--light);color:var(--muted)}
.c-blue{--c:var(--blue)}.c-orange{--c:var(--orange)}.c-green{--c:var(--green)}
.comp-h{display:flex;align-items:center;gap:.5em;margin-top:.6em}
.comp-h i{width:.8em;height:.8em;border-radius:3px;background:var(--c)}
/* lesson */
.lhead{background:var(--navy);color:#fff;border-radius:16px;padding:1.1em 1.1em 1em}
.lhead h1{color:#fff}.lhead .meta{color:var(--gold);font-weight:700;font-size:.88em}
.lhead .years{color:#C8D0DE;font-weight:700}
.ltabs{position:sticky;top:54px;z-index:5;background:var(--bg);display:grid;grid-template-columns:repeat(4,1fr);gap:.3em;padding:.6em 0}
.ltabs button{background:#fff;border:1px solid var(--line);border-radius:12px;padding:.45em .2em;font-weight:700;color:var(--ink);font-size:.86em;display:flex;flex-direction:column;align-items:center;gap:.1em;line-height:1.2}
.ltabs button svg{width:20px;height:20px}
.ltabs button.on{background:var(--navy);color:#fff;border-color:var(--navy)}
.card{background:#fff;border-radius:14px;padding:.95em 1em;box-shadow:0 1px 4px rgba(20,35,60,.08);border:1px solid var(--line)}
.stack{display:grid;gap:.8em}
.prob{background:var(--goldl);border:0}
.prob b{color:var(--red)}
.obj{list-style:none;display:grid;gap:.4em}
.obj li{display:flex;gap:.5em;align-items:flex-start}
.obj li::before{content:"✓";color:var(--green);font-weight:800}
/* stepper */
.stepper{display:flex;flex-direction:column;gap:.8em}
.prog{height:6px;background:var(--light);border-radius:99px;overflow:hidden}.prog i{display:block;height:100%;background:var(--gold);transition:width .3s}
.stepcount{font-size:.82em;color:var(--muted);text-align:center}
.slide{min-height:52vh;display:flex;flex-direction:column;gap:.8em}
.slide.axis{justify-content:center;align-items:center;text-align:center;background:var(--navy);color:#fff;border-radius:16px;padding:1.5em}
.slide.axis .big{width:3em;height:3em;border-radius:50%;background:var(--gold);color:var(--navy);font-size:2em;font-weight:900;display:flex;align-items:center;justify-content:center}
.slide.axis h2{color:#fff;font-size:1.4em}
.nav{display:flex;gap:.5em;position:sticky;bottom:0;background:linear-gradient(transparent,var(--bg) 30%);padding:.8em 0 max(.4em,env(safe-area-inset-bottom))}
.btn{background:var(--navy);color:#fff;border:0;border-radius:12px;padding:.65em 1em;font-weight:700;flex:1;display:inline-flex;align-items:center;justify-content:center;gap:.4em}
.btn.ghost{background:#fff;color:var(--navy);border:1px solid var(--line)}
.btn.gold{background:var(--gold);color:var(--navy)}
.btn:disabled{opacity:.4}
/* blocks */
.cards{display:grid;gap:.6em;grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}
.cards .card{border:0;background:#fff}
.cards .card h3{margin-bottom:.15em}
.t-orange{background:#F8E3C9!important}.t-orange h3{color:#8A4B12}
.t-green{background:#DCEBD5!important}.t-green h3{color:#2E5A26}
.t-red{background:#FBEDEB!important}.t-red h3{color:var(--red)}
.t-gold{background:var(--goldl)!important}.t-light{background:var(--light)!important}.t-goldl{background:var(--goldl)!important}
.tblw{overflow-x:auto;border-radius:12px;border:1px solid var(--line)}
table{width:100%;border-collapse:collapse;background:#fff;font-size:.93em}
th,td{border-bottom:1px solid var(--line);padding:.5em .6em;text-align:right;vertical-align:top}
thead th{background:var(--navy);color:#fff}
tbody th{color:var(--navy);white-space:nowrap}
tbody tr:nth-child(even){background:#F7F9FC}
td.rv{cursor:pointer;color:transparent;position:relative;min-width:4em}
td.rv::after{content:"اضغط";position:absolute;inset:.5em .6em auto auto;color:#9AA6B8;font-size:.8em}
td.rv.on{color:var(--ink)}td.rv.on::after{content:none}
.timeline{list-style:none;position:relative;padding-inline-start:1.4em;display:grid;gap:.5em}
.timeline::before{content:"";position:absolute;inset-inline-start:.45em;top:.4em;bottom:.4em;width:3px;background:var(--navy);border-radius:3px}
.timeline li{background:#fff;border-radius:10px;padding:.45em .75em;position:relative;border:1px solid var(--line)}
.timeline li::before{content:"";position:absolute;inset-inline-start:-1.28em;top:.75em;width:.8em;height:.8em;border-radius:50%;background:var(--gold);border:2px solid #fff}
.timeline li.hi{background:#FBEDEB;border-color:#F0CFCB}.timeline li.hi::before{background:var(--red)}
.timeline b{display:block;color:var(--navy);font-size:.92em}.timeline li.hi b{color:var(--red)}
.bars{display:grid;gap:.4em}
.bar{display:grid;grid-template-columns:7.2em 1fr 3em;align-items:center;gap:.5em;font-size:.93em}
.bar .tr{background:var(--light);border-radius:5px;height:1.25em;position:relative}
.bar .tr i{display:block;height:100%;border-radius:5px;background:var(--navy)}
.bar .tr .ref{position:absolute;top:-3px;bottom:-3px;width:2px;background:var(--gold)}
.bars.red .tr i{background:var(--red)}
.bar .v{font-weight:800}
.reflab{font-size:.78em;color:var(--muted)}
.stat{display:flex;align-items:center;gap:.8em;background:var(--navy);color:#fff;border-radius:14px;padding:.8em 1em}
.stat b{font-size:2.2em;color:var(--gold);line-height:1}
.quote{background:var(--navy);color:#fff;border-radius:14px;padding:1em;font-size:1.05em}
.blist{list-style:none;display:grid;gap:.45em}
.blist li{background:#fff;border-radius:10px;padding:.5em .75em;display:flex;gap:.6em;align-items:flex-start;border:1px solid var(--line)}
.blist .n{background:var(--gold);color:var(--navy);border-radius:50%;min-width:1.8em;height:1.8em;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:.85em;flex:none}
.think{background:#fff;border:2px dashed #CDB98A;border-radius:14px;padding:.8em 1em}
.think .qq{font-weight:700;color:var(--navy)}
.think .aa{display:none;margin-top:.5em;padding-top:.5em;border-top:1px dashed var(--line);color:var(--green);font-weight:700}
.think.on .aa{display:block}
.think button{margin-top:.5em;background:var(--goldl);border:0;border-radius:99px;padding:.25em .9em;color:#6B4F12;font-weight:700}
/* notebook */
.pill{align-self:flex-start;background:var(--gold);color:var(--navy);font-weight:800;border-radius:99px;padding:.3em 1em;display:inline-flex;align-items:center;gap:.4em}
.paper{background:#fff;border-radius:14px;padding:.9em 1.2em .9em 1em;border-inline-start:3px solid #E2A5A0;box-shadow:0 1px 4px rgba(20,35,60,.08);background-image:repeating-linear-gradient(transparent 0 1.9em,#E4ECF7 1.9em calc(1.9em + 1px));line-height:1.9em}
.paper h3{line-height:1.9em}
.paper p b{color:var(--red)}
.copy{align-self:flex-start;background:#fff;border:1px solid var(--line);border-radius:99px;padding:.25em .9em;font-size:.85em;color:var(--navy);font-weight:700}
/* terms & quiz */
.terms{display:grid;gap:.5em}
.terms div{background:#fff;border-radius:12px;overflow:hidden;border:1px solid var(--line)}
.terms dt{background:var(--navy);color:#fff;font-weight:700;padding:.35em .8em}
.terms div:nth-child(even) dt{background:var(--gold);color:var(--navy)}
.terms dd{padding:.45em .8em;font-size:.95em}
.qcard{background:#fff;border-radius:14px;padding:1em;border:1px solid var(--line);display:flex;flex-direction:column;gap:.7em}
.qcard .q{font-weight:700;color:var(--navy);font-size:1.05em}
.opts{display:grid;gap:.45em}
.opts button{background:var(--bg);border:1.5px solid var(--line);border-radius:12px;padding:.6em .8em;text-align:right;color:var(--ink)}
.opts button.right{background:#E3F1E8;border-color:var(--green);color:#1F5A37;font-weight:700}
.opts button.wrong{background:#FBEDEB;border-color:var(--red);color:var(--red)}
.ans{background:#E3F1E8;border-radius:10px;padding:.6em .8em;color:#1F5A37;font-weight:600}
.selfrow{display:flex;gap:.5em}
.score{text-align:center;padding:1.3em 1em}
.score b{display:block;font-size:2.6em;color:var(--gold);line-height:1.1}
/* files */
.files{display:grid;gap:.6em}
.file{background:#fff;border-radius:14px;padding:.8em 1em;display:flex;align-items:center;gap:.8em;border:1px solid var(--line)}
.file .ext{width:3em;height:3em;border-radius:10px;display:flex;align-items:center;justify-content:center;color:#fff;font-weight:800;font-size:.8em;flex:none}
.ext.pptx{background:#C4502A}.ext.docx{background:#2B5797}.ext.pdf{background:#B5302B}.ext.html{background:var(--navy)}
.file .t{flex:1;line-height:1.3}.file .t small{color:var(--muted)}
.file a{background:var(--navy);color:#fff;border-radius:10px;padding:.45em .9em;font-weight:700;font-size:.9em}
.note{background:var(--light);border-radius:12px;padding:.7em .9em;font-size:.9em;color:var(--muted)}
.dlg{position:fixed;inset:0;background:rgba(11,34,66,.55);display:flex;align-items:center;justify-content:center;z-index:50;padding:1em}
.dlg[hidden]{display:none}
.dlg .box{background:#fff;border-radius:16px;padding:1.2em;width:min(320px,100%);text-align:center}
.dlg .box p{font-weight:800;color:var(--navy);margin-bottom:.9em;font-size:1.1em}
.row{display:flex;gap:.5em}
.empty{text-align:center;padding:2em 1em;color:var(--muted)}
@media(min-width:760px){
  body{font-size:18px}
  .levels{grid-template-columns:1fr 1fr}
  .lessons{grid-template-columns:1fr 1fr}
  .terms{grid-template-columns:1fr 1fr}
}
@media print{.top,.ltabs,.nav,.foot,.copy{display:none}}
[hidden]{display:none!important}
.pill svg{width:1.1em;height:1.1em}
td.rv{color:inherit}td.rv span{display:none}td.rv.on span{display:inline}
td.rv::after{position:static;display:inline-block}
.lvl .badge{flex-direction:column;font-size:.8em}.lvl .badge b{font-size:1.6em;line-height:1}
