/* =========================================================
   نجوم القواعد — لوحة مدرسية دافئة
   ========================================================= */
:root{
  --cream:#FFF8F0;
  --card:#FFFFFF;
  --line:#EADFCB;
  --teal:#0F766E;
  --teal-2:#0B5C56;
  --teal-soft:#E7F4F1;
  --coral:#F97362;
  --coral-soft:#FFEDE9;
  --gold:#F2B544;
  --gold-soft:#FFF4DE;
  --ink:#1F2937;
  --muted:#6B7280;
  --ok:#16A34A;
  --grid:#F3EAD9;
  --r:20px;
  --r-sm:14px;
  --sh:0 8px 24px rgba(31,41,55,.06);
  --sh-lg:0 18px 44px rgba(31,41,55,.12);
}

*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0}
html{scroll-behavior:smooth}
body{
  font-family:'Tajawal',system-ui,-apple-system,'Segoe UI',sans-serif;
  color:var(--ink);
  background-color:var(--cream);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size:32px 32px;
  min-height:100vh;
  line-height:1.65;
  -webkit-font-smoothing:antialiased;
}
button,input,select,textarea{font-family:inherit}
button{
  cursor:pointer;border:0;background:none;color:inherit;
  -webkit-user-select:none;user-select:none;touch-action:manipulation;
}
h1,h2,h3,h4,p,ul,ol{margin:0}
ul,ol{padding:0;list-style:none}
b,strong{font-weight:800}
.hidden{display:none !important}
.muted{color:var(--muted);font-size:14px}
[dir="ltr"]{font-family:'Nunito','Tajawal',system-ui,sans-serif}

/* ---------- عناصر أساسية ---------- */
.screen{max-width:1060px;margin:0 auto;padding:20px 16px 64px;display:block}
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--r);
  box-shadow:var(--sh);
}

.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-height:48px;padding:0 20px;border-radius:16px;
  font-weight:800;font-size:16px;line-height:1;
  transition:transform .18s ease-out, background .18s ease-out, box-shadow .18s ease-out, border-color .18s ease-out;
  white-space:nowrap;
}
.btn:active{transform:scale(.97)}
.btn:focus-visible{outline:3px solid #7DD3C8;outline-offset:2px}
.btn-primary{background:var(--teal);color:#fff;box-shadow:0 6px 16px rgba(15,118,110,.22)}
.btn-primary:hover{background:var(--teal-2)}
.btn-coral{background:var(--coral);color:#fff;box-shadow:0 6px 18px rgba(249,115,98,.28)}
.btn-coral:hover{background:#E45C4B}
.btn-ghost{background:#fff;color:var(--ink);border:1px solid var(--line);box-shadow:0 2px 8px rgba(31,41,55,.04)}
.btn-ghost:hover{border-color:#DCCBAE;background:#FFFDF9}
.btn-sm{min-height:42px;padding:0 14px;font-size:14px;border-radius:13px}
.btn-lg{min-height:56px;font-size:18px;border-radius:18px}
.btn-block{width:100%}
.btn:disabled{opacity:.45;cursor:not-allowed;box-shadow:none}

.icon-btn{
  width:44px;height:44px;border-radius:14px;flex:0 0 auto;
  display:grid;place-items:center;color:var(--teal);
  background:#fff;border:1px solid var(--line);
  transition:background .18s ease-out,transform .18s ease-out;
}
.icon-btn:hover{background:var(--teal-soft)}
.icon-btn:active{transform:scale(.94)}
.icon-btn:focus-visible{outline:3px solid #7DD3C8;outline-offset:2px}

.icon-chip{
  display:inline-grid;place-items:center;flex:0 0 auto;
  width:44px;height:44px;border-radius:14px;
}
.icon-chip svg{width:22px;height:22px}
.icon-chip--sm{width:34px;height:34px;border-radius:11px}
.icon-chip--sm svg{width:18px;height:18px}

.pill{
  display:inline-flex;align-items:center;gap:6px;
  padding:6px 12px;border-radius:999px;font-size:14px;font-weight:800;
  border:1px solid var(--line);background:#fff;
}
.pill--gold{background:var(--gold-soft);border-color:#F3D79A;color:#8A5A05}

.badge{
  display:inline-flex;align-items:center;
  padding:3px 10px;border-radius:999px;font-size:12px;font-weight:800;
}
.badge--ok{background:#E9F9EF;color:#15803D}
.badge--warn{background:#FFF1E0;color:#B45309}
.badge--muted{background:#F3F1EC;color:#7A7468}

.head-actions{display:flex;gap:10px;flex-wrap:wrap;margin:0 0 20px}

/* ---------- البومة لولو ---------- */
.owl{display:block;line-height:0}
.owl svg{width:100%;height:100%;display:block;overflow:visible}
.owl .pupil{transform-box:fill-box;transform-origin:center}
.owl .happy-eyes{opacity:0;transition:opacity .2s ease-out}
.owl .owl-stars{opacity:0;transition:opacity .3s ease-out}
.owl--calm .pupil{animation:blink 6.5s ease-in-out infinite}
@keyframes blink{
  0%,92%,100%{transform:scaleY(1)}
  95%{transform:scaleY(.12)}
}
.owl--celebrate{animation:hop .65s cubic-bezier(.34,1.56,.64,1)}
.owl--celebrate .owl-stars{opacity:1}
@keyframes hop{
  0%{transform:translateY(0) scale(1)}
  35%{transform:translateY(-12px) scale(1.05)}
  65%{transform:translateY(-3px) scale(.98)}
  100%{transform:translateY(0) scale(1)}
}
.owl--think .owl-body{animation:tilt 3.4s ease-in-out infinite;transform-box:fill-box;transform-origin:center bottom}
@keyframes tilt{
  0%,100%{transform:rotate(0deg)}
  50%{transform:rotate(-7deg)}
}
.owl--bless .happy-eyes{opacity:1}
.owl--bless .pupil{opacity:0}
.owl--bless .owl-stars{opacity:1}

/* =========================================================
   شاشة البداية
   ========================================================= */
.welcome{max-width:720px;margin:0 auto;padding-top:12px}
.brand{display:flex;align-items:center;gap:14px;margin-bottom:20px}
.brand-owl{width:96px;height:96px;flex:0 0 auto}
.brand-kicker{
  display:inline-block;font-size:12px;font-weight:700;color:var(--teal);
  background:var(--teal-soft);border-radius:999px;padding:4px 12px;margin-bottom:8px;
}
.brand-title{font-size:34px;font-weight:800;letter-spacing:-.2px;color:var(--teal);line-height:1.2}
.brand-sub{color:var(--muted);font-size:15px;margin-top:6px}

.start-card{padding:24px 20px}
.start-head{display:flex;gap:12px;align-items:flex-start;margin-bottom:20px}
.start-head h2{font-size:20px;font-weight:800}
.start-head .muted{margin-top:2px}

.field{margin-bottom:16px}
.field-label{display:block;font-size:14px;font-weight:800;margin-bottom:8px;color:#374151}
.input{
  width:100%;min-height:52px;padding:0 16px;border-radius:14px;
  border:1.5px solid var(--line);background:#FFFDF9;color:var(--ink);
  font-size:16px;transition:border-color .18s ease-out, box-shadow .18s ease-out;
}
.input::placeholder{color:#B3A99A}
.input:focus{outline:none;border-color:var(--teal);box-shadow:0 0 0 3px rgba(15,118,110,.13);background:#fff}
.input.is-error{border-color:var(--coral);box-shadow:0 0 0 3px rgba(249,115,98,.13)}
.field-error{color:#C2410C;font-size:13px;font-weight:700;margin-top:6px}

.class-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.class-btn{
  min-height:52px;border-radius:14px;border:1.5px solid var(--line);
  background:#FFFDF9;font-weight:800;font-size:16px;color:#4B5563;
  font-family:'Nunito',system-ui,sans-serif;
  transition:all .18s ease-out;
}
.class-btn:hover{border-color:#D9C7A8;background:#fff}
.class-btn:active{transform:scale(.97)}
.class-btn.is-active{
  background:var(--teal);border-color:var(--teal);color:#fff;
  box-shadow:0 6px 16px rgba(15,118,110,.24);
}
.class-btn:focus-visible{outline:3px solid #7DD3C8;outline-offset:2px}

.start-teacher{
  text-align:center;font-size:13px;color:var(--muted);margin-top:14px;
}
.start-teacher b{color:var(--teal)}

.students-card{margin-top:18px;padding:20px}
.students-title{font-size:16px;font-weight:800;margin-bottom:4px}
.students-hint{margin-bottom:12px}
.students-list{display:flex;flex-wrap:wrap;gap:8px}
.student-chip{
  display:inline-flex;align-items:center;gap:8px;
  padding:8px 14px;border-radius:999px;border:1px solid var(--line);
  background:#fff;font-weight:700;font-size:14px;color:var(--ink);
  transition:all .18s ease-out;
}
.student-chip:hover{border-color:var(--teal);background:var(--teal-soft)}
.student-chip small{color:var(--muted);font-weight:700;font-family:'Nunito',system-ui,sans-serif}

.foot-note{text-align:center;color:#A79C8A;font-size:12px;margin-top:22px}

/* =========================================================
   الترويسة والرئيسية
   ========================================================= */
.topbar{
  position:sticky;top:0;z-index:30;
  background:rgba(255,248,240,.92);
  backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line);
  margin:-20px -16px 20px;
}
.topbar-in{
  max-width:1060px;margin:0 auto;display:flex;align-items:center;gap:10px;
  padding:10px 16px;
}
.topbar-spacer{flex:1}
.owl-mini{width:44px;height:44px;flex:0 0 auto}
.user-chip{display:flex;align-items:center;gap:10px;min-width:0}
.avatar{
  width:40px;height:40px;border-radius:50%;flex:0 0 auto;
  display:grid;place-items:center;font-weight:800;font-size:16px;
  background:var(--coral-soft);color:#C2410C;border:1px solid #FBD5CC;
}
.user-meta{display:flex;flex-direction:column;line-height:1.25;min-width:0}
.user-meta b{font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:38vw}
.user-meta span{font-size:11.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:38vw}

.page{display:block}

.hero{
  display:flex;gap:16px;align-items:center;
  padding:20px;margin-bottom:18px;
  background:linear-gradient(135deg,#FFFFFF 0%,#FFF9EE 100%);
  position:relative;overflow:hidden;
}
.hero-owl{width:112px;height:112px;flex:0 0 auto}
.hero-text{flex:1;min-width:0}
.hero-kicker{font-size:12.5px;font-weight:800;color:var(--coral);margin-bottom:2px}
.hero-title{font-size:26px;font-weight:800;line-height:1.25;margin-bottom:2px}
.hero-hint{font-size:13.5px;color:#5B6675;margin-top:10px}
.xp{height:10px;border-radius:999px;background:#F1E8D8;margin-top:10px;overflow:hidden}
.xp span{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,#0F766E,#2AA79C);transition:width .5s ease-out}
.hero-stats{display:flex;flex-direction:column;gap:8px;flex:0 0 auto}
.stat{
  background:#fff;border:1px solid var(--line);border-radius:14px;
  padding:8px 14px;text-align:center;min-width:104px;
}
.stat b{display:block;font-size:18px;color:var(--teal);font-family:'Nunito',system-ui,sans-serif}
.stat span{font-size:11.5px;color:var(--muted);font-weight:700}

.actions{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-bottom:26px}
.actions .action-main{grid-column:1 / -1}
.actions .badge{margin-inline-start:6px}

.sec-title{font-size:18px;font-weight:800;margin:0 0 12px;display:flex;align-items:center;gap:8px}
.skills-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:12px}

.skill-card{
  display:flex;flex-direction:column;gap:10px;
  padding:16px;text-align:right;
  transition:transform .18s ease-out, box-shadow .18s ease-out, border-color .18s ease-out;
}
.skill-card:hover{transform:translateY(-2px);box-shadow:0 14px 32px rgba(31,41,55,.09);border-color:#DCCBAE}
.skill-card:active{transform:translateY(0) scale(.99)}
.skill-card:focus-visible{outline:3px solid #7DD3C8;outline-offset:2px}
.skill-top{display:flex;align-items:center;gap:12px;width:100%}
.skill-titles{display:flex;flex-direction:column;line-height:1.3;flex:1;min-width:0}
.skill-titles b{font-size:15.5px}
.skill-titles em{font-size:12px;color:var(--muted);font-style:normal}
.skill-flag{
  font-size:11.5px;font-weight:800;padding:3px 9px;border-radius:999px;
  background:#E9F9EF;color:#15803D;flex:0 0 auto;
}
.skill-flag--warn{background:#FFF1E0;color:#B45309}
.skill-bar{display:block;width:100%;height:8px;border-radius:999px;background:#F3EEE3;overflow:hidden}
.skill-bar i{display:block;height:100%;border-radius:999px;transition:width .4s ease-out}
.skill-foot{display:flex;justify-content:space-between;width:100%;font-size:12px;color:var(--muted);font-weight:700}

/* =========================================================
   الاختبار
   ========================================================= */
.quiz-top{display:flex;align-items:center;gap:12px;margin-bottom:18px}
.quiz-prog{flex:1;height:10px;border-radius:999px;background:#F1E8D8;overflow:hidden}
.quiz-prog span{display:block;height:100%;width:0;border-radius:999px;background:linear-gradient(90deg,#0F766E,#2AA79C);transition:width .35s ease-out}
.quiz-streak{
  display:flex;align-items:center;gap:6px;padding:8px 14px;border-radius:999px;
  background:var(--coral-soft);border:1px solid #FBD5CC;color:#C2410C;font-weight:800;
}
.quiz-streak b{font-family:'Nunito',system-ui,sans-serif;font-size:15px}

.quiz-stage{display:block}
.q-card{padding:20px}
.q-meta{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:16px;flex-wrap:wrap}
.q-skill{display:inline-flex;align-items:center;gap:8px;font-size:13.5px;font-weight:800;color:#374151}
.q-count{font-size:13px;font-weight:800;color:var(--muted);font-family:'Nunito',system-ui,sans-serif}

.q-text{
  font-family:'Nunito','Tajawal',system-ui,sans-serif;
  font-size:24px;font-weight:700;line-height:1.5;color:#111827;
  background:#FFFDF6;border:1px dashed #E4D6BB;border-radius:16px;
  padding:18px 16px;margin-bottom:16px;text-align:left;
  word-break:break-word;
}
.q-text .blank{
  display:inline-block;min-width:64px;border-bottom:2.5px solid var(--coral);
  transform:translateY(-2px);
}
.q-speak{
  display:inline-flex;align-items:center;gap:6px;font-size:12.5px;font-weight:800;
  color:var(--teal);background:var(--teal-soft);border-radius:999px;padding:6px 12px;margin-bottom:14px;
}
.q-speak:hover{background:#D6EDE9}

.choices{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:16px}
.choice{
  min-height:58px;border-radius:16px;border:1.5px solid var(--line);
  background:#FFFDF9;font-family:'Nunito','Tajawal',system-ui,sans-serif;
  font-size:18px;font-weight:700;color:#1F2937;
  display:flex;align-items:center;justify-content:center;text-align:center;
  padding:8px 10px;transition:all .16s ease-out;
}
.choice:hover:not(:disabled){border-color:var(--teal);background:var(--teal-soft)}
.choice:active:not(:disabled){transform:scale(.98)}
.choice:focus-visible{outline:3px solid #7DD3C8;outline-offset:2px}
.choice:disabled{cursor:default}
.choice--right{background:#E9F9EF !important;border-color:var(--ok) !important;color:#14532D !important;font-weight:800}
.choice--wrong{background:#FFF0EC !important;border-color:#DC5B48 !important;color:#9A3412 !important}
.choice--dim{opacity:.5}

.feedback{
  border-radius:16px;padding:16px;margin-bottom:16px;
  border:1px solid var(--line);border-inline-start-width:6px;
  animation:popIn .22s ease-out;
}
@keyframes popIn{
  from{opacity:0;transform:translateY(6px)}
  to{opacity:1;transform:translateY(0)}
}
.fb--ok{background:#F2FCF5;border-color:#BBE9C9;border-inline-start-color:var(--ok)}
.fb--bad{background:#FFFAF0;border-color:#F3DCA8;border-inline-start-color:var(--gold)}
.fb-head{display:flex;align-items:center;gap:12px}
.fb-badge{
  width:40px;height:40px;border-radius:50%;display:grid;place-items:center;
  flex:0 0 auto;color:#fff;
}
.fb--ok .fb-badge{background:var(--ok)}
.fb--bad .fb-badge{background:var(--gold);color:#4A2E00}
.fb-head > div{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.4}
.fb-head b{font-size:16px}
.fb--ok .fb-head b{color:#14532D}
.fb--bad .fb-head b{color:#8A5A05}
.fb-head span{font-size:13px;color:#5B6675}
.fb-head em{font-style:normal;font-weight:800;color:var(--teal)}
.fb-owl{width:64px;height:64px;flex:0 0 auto}
.fb-why{font-size:14px;margin-top:10px;color:#374151}
.fb-rule{
  margin-top:10px;font-size:13.5px;color:#4B5563;
  background:#fff;border:1px solid #F0E2C6;border-radius:12px;padding:10px 12px;
}
.fb-ar{font-size:13.5px;color:#4B5563;margin-top:8px}
.fb-lib{font-size:12.5px;color:#B45309;font-weight:800;margin-top:8px}

/* ملخص الاختبار */
.summary{text-align:center;padding:28px 20px}
.summary .owl{width:120px;height:120px;margin:0 auto 10px}
.summary h2{font-size:24px;font-weight:800;margin-bottom:4px}
.summary .sum-sub{color:var(--muted);font-size:14px}
.sum-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:20px 0}
.sum-tile{background:#FFFDF9;border:1px solid var(--line);border-radius:14px;padding:12px 8px}
.sum-tile b{display:block;font-size:22px;color:var(--teal);font-family:'Nunito',system-ui,sans-serif}
.sum-tile span{font-size:11.5px;color:var(--muted);font-weight:700}
.sum-actions{display:flex;flex-direction:column;gap:10px}
.sum-note{
  background:var(--gold-soft);border:1px solid #F3D79A;border-radius:14px;
  padding:12px;font-size:13.5px;color:#8A5A05;font-weight:700;margin-bottom:16px;
}

/* =========================================================
   المكتبة
   ========================================================= */
.page-head{display:flex;align-items:flex-start;gap:12px;margin-bottom:18px}
.page-head-text{flex:1;min-width:0}
.page-head h1{font-size:22px;font-weight:800;line-height:1.3}
.page-head .muted{font-size:13px;margin-top:2px}

.library-list{display:grid;gap:14px}
.lib-card{padding:18px}
.lib-head{display:flex;align-items:center;gap:12px;margin-bottom:12px}
.lib-titles{display:flex;flex-direction:column;line-height:1.3;flex:1;min-width:0}
.lib-titles b{font-size:16px}
.lib-titles span{font-size:12px;color:var(--muted)}
.lib-rule{
  font-size:14px;color:#374151;background:#FFFDF6;border:1px solid #F1E6D2;
  border-radius:14px;padding:12px 14px;margin-bottom:12px;
}
.lib-ex{display:grid;gap:8px;margin-bottom:14px}
.lib-ex li{
  display:flex;flex-direction:column;gap:1px;
  padding-inline-start:12px;border-inline-start:3px solid var(--teal-soft);
}
.lib-ex li span{font-size:15px;font-weight:700;color:#111827}
.lib-ex li em{font-size:12.5px;color:var(--muted);font-style:normal}
.lib-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.lib-foot .muted{font-size:12.5px;font-weight:700}

.empty-state{text-align:center;padding:34px 20px}
.empty-state .owl{width:110px;height:110px;margin:0 auto 12px}
.empty-state h3{font-size:18px;font-weight:800;margin-bottom:6px}
.empty-state p{color:var(--muted);font-size:14px;max-width:420px;margin:0 auto 18px}

/* =========================================================
   الشهادة
   ========================================================= */
.sheet-wrap{width:100%;display:flex;justify-content:center;overflow:hidden}
.cert-sheet{
  width:1000px;height:707px;flex:0 0 auto;
  background:#FFFCF5;position:relative;overflow:hidden;
  border-radius:10px;box-shadow:var(--sh-lg);
  transform-origin:top center;
  direction:rtl;
}
.cert-frame{position:absolute;inset:16px;border:3px solid var(--gold);border-radius:6px}
.cert-frame::after{content:"";position:absolute;inset:7px;border:1px solid rgba(242,181,68,.5);border-radius:4px}
.cert-inner{
  position:absolute;inset:34px;padding:26px 70px;
  display:flex;flex-direction:column;align-items:center;text-align:center;
}
.cert-corner{
  position:absolute;color:var(--gold);font-size:30px;line-height:1;
  opacity:.85;user-select:none;
}
.cert-corner.tl{top:14px;right:18px}
.cert-corner.tr{top:14px;left:18px}
.cert-corner.bl{bottom:14px;right:18px}
.cert-corner.br{bottom:14px;left:18px}

.cert-school{font-size:13px;letter-spacing:.4px;color:#8A7A5C;font-weight:700;margin-bottom:10px}
.cert-title{
  font-size:44px;font-weight:800;color:var(--teal);line-height:1.15;
  margin-bottom:6px;
}
.cert-divider{display:flex;align-items:center;gap:12px;width:60%;margin:10px 0 18px;color:var(--gold)}
.cert-divider i{flex:1;height:1px;background:linear-gradient(90deg,transparent,#EDD9AE,transparent);display:block}
.cert-lead{font-size:17px;color:#6B7280;margin-bottom:10px}
.cert-name{
  font-size:48px;font-weight:800;color:#1F2937;line-height:1.25;
  padding:0 34px 8px;border-bottom:2px dashed rgba(249,115,98,.55);
  margin-bottom:16px;max-width:80%;
}
.cert-line{font-size:16px;color:#4B5563;margin-bottom:6px;max-width:82%}
.cert-line b{color:var(--teal)}
.cert-foot{
  margin-top:auto;width:100%;display:flex;align-items:flex-end;justify-content:space-between;
  padding-top:12px;
}
.cert-sign{text-align:center}
.cert-sign .sign{
  display:block;font-family:'Aref Ruqaa','Tajawal',serif;
  font-size:30px;color:var(--teal);line-height:1.4;
  border-bottom:1.5px solid #E3D3B4;padding:0 18px 2px;
}
.cert-sign small,.cert-date small{display:block;font-size:12px;color:#8A7A5C;font-weight:700;margin-top:4px}
.cert-date{text-align:center}
.cert-date b{font-size:15px;color:#4B5563;padding-bottom:4px;border-bottom:1.5px solid #E3D3B4;display:inline-block}
.cert-seal{
  position:absolute;bottom:26px;left:50%;transform:translateX(-50%);
  width:74px;height:74px;border-radius:50%;
  border:2.5px dashed var(--gold);display:grid;place-items:center;
  color:var(--gold);background:rgba(242,181,68,.07);
}

/* =========================================================
   التقرير
   ========================================================= */
.tabs{display:flex;gap:8px;margin-bottom:14px;background:#F7F0E3;padding:5px;border-radius:16px;width:fit-content;max-width:100%}
.tab{
  padding:10px 18px;border-radius:12px;font-size:14px;font-weight:800;color:#7A7468;
  transition:all .18s ease-out;
}
.tab.is-active{background:#fff;color:var(--teal);box-shadow:0 2px 8px rgba(31,41,55,.07)}

.report-sheet{
  background:#fff;border:1px solid var(--line);border-radius:16px;
  padding:30px 26px;box-shadow:var(--sh);max-width:900px;
}
.rep-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;border-bottom:2px solid var(--gold);padding-bottom:14px;margin-bottom:18px;flex-wrap:wrap}
.rep-kicker{font-size:12px;font-weight:800;color:var(--coral);margin-bottom:2px}
.rep-head h2{font-size:26px;font-weight:800;line-height:1.25}
.rep-sub{font-size:13px;color:var(--muted);margin-top:2px}
.rep-date{text-align:left;font-size:13px;color:#4B5563;font-weight:700;line-height:1.5}
.rep-date small{display:block;color:var(--muted);font-weight:700;font-size:11.5px}

.rep-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:22px}
.rep-tile{background:#FFFDF7;border:1px solid var(--line);border-radius:14px;padding:12px 10px;text-align:center}
.rep-tile b{display:block;font-size:20px;color:var(--teal);font-family:'Nunito',system-ui,sans-serif}
.rep-tile span{font-size:11.5px;color:var(--muted);font-weight:700}

.rep-h{font-size:15px;font-weight:800;margin:22px 0 10px;display:flex;align-items:center;gap:8px;color:#374151}
.rep-h::before{content:"";width:5px;height:16px;border-radius:3px;background:var(--coral);display:block}

.rep-tablewrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
.rep-table{width:100%;border-collapse:collapse;font-size:13.5px;min-width:520px}
.rep-table th,.rep-table td{padding:9px 8px;text-align:right;border-bottom:1px solid #F1E9DA}
.rep-table th{background:#FBF6EC;font-weight:800;font-size:12.5px;color:#5B6675}
.rep-table td.num{font-family:'Nunito',system-ui,sans-serif;font-weight:700}
.rep-table tr.total td{background:#FFF8EC;font-weight:800;border-bottom:none}

.chart{display:grid;gap:8px}
.chart-row{display:grid;grid-template-columns:120px 1fr 46px;align-items:center;gap:10px}
.chart-label{font-size:12.5px;font-weight:700;color:#4B5563;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chart-track{height:14px;border-radius:999px;background:#F3EEE3;overflow:hidden}
.chart-fill{height:100%;border-radius:999px;transition:width .5s ease-out}
.chart-val{font-family:'Nunito',system-ui,sans-serif;font-size:12.5px;font-weight:800;color:#4B5563;text-align:left}

.rep-analysis{font-size:14px;color:#374151;line-height:1.85}
.rep-analysis p{margin-bottom:8px;padding-inline-start:14px;position:relative}
.rep-analysis p::before{content:"◆";position:absolute;inset-inline-start:0;top:0;color:var(--gold);font-size:10px;line-height:1.9}
.rep-foot{
  margin-top:24px;padding-top:14px;border-top:1px dashed #E3D3B4;
  display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;
  font-size:12.5px;color:var(--muted);font-weight:700;
}
.rep-sign{font-family:'Aref Ruqaa',serif;font-size:20px;color:var(--teal)}

/* =========================================================
   التنبيه العائم
   ========================================================= */
.toast{
  position:fixed;bottom:26px;left:50%;transform:translateX(-50%);
  z-index:200;max-width:calc(100vw - 40px);
  background:#1F2937;color:#fff;font-size:14px;font-weight:700;
  padding:12px 20px;border-radius:999px;box-shadow:0 12px 30px rgba(31,41,55,.28);
  pointer-events:none;text-align:center;
  animation:toastIn .28s cubic-bezier(.34,1.4,.64,1);
}
.toast--gold{background:#8A5A05}
.toast--ok{background:var(--teal)}
@keyframes toastIn{
  from{opacity:0;transform:translate(-50%,14px) scale(.94)}
  to{opacity:1;transform:translate(-50%,0) scale(1)}
}

/* =========================================================
   الاستجابة
   ========================================================= */
@media (max-width:720px){
  .brand{flex-direction:column;text-align:center;gap:8px}
  .brand-title{font-size:30px}
  .brand-owl{width:104px;height:104px}
  .hero{flex-wrap:wrap;padding:18px}
  .hero-owl{width:88px;height:88px}
  .hero-title{font-size:23px}
  .hero-stats{flex-direction:row;width:100%;gap:8px}
  .stat{flex:1;min-width:0;padding:8px 6px}
  .stat b{font-size:16px}
  .rep-stats{grid-template-columns:repeat(2,1fr)}
  .q-text{font-size:20px;padding:14px 12px}
  .choice{font-size:16px;min-height:54px}
  .sum-grid{grid-template-columns:repeat(2,1fr)}
  .report-sheet{padding:20px 14px}
  .chart-row{grid-template-columns:92px 1fr 42px}
}
@media (max-width:430px){
  .screen{padding:16px 12px 60px}
  .topbar{margin:-16px -12px 16px}
  .topbar-in{padding:8px 12px;gap:8px}
  .user-meta b,.user-meta span{max-width:30vw}
  .actions{grid-template-columns:1fr}
  .choices{grid-template-columns:1fr}
  .cert-inner{padding:20px 40px}
  .cert-title{font-size:34px}
  .cert-name{font-size:34px}
}
@media (max-width:360px){
  .class-grid{grid-template-columns:repeat(2,1fr)}
  .brand-title{font-size:26px}
}

@media (prefers-reduced-motion:reduce){
  *{animation-duration:.001ms !important;animation-iteration-count:1 !important;transition-duration:.001ms !important;scroll-behavior:auto !important}
}

/* =========================================================
   الطباعة
   ========================================================= */
@media print{
  html,body{
    background:#fff !important;background-image:none !important;
    color:#1F2937;
  }
  .no-print,.topbar,.toast,.tabs{display:none !important}
  .screen{padding:0 !important;margin:0 !important;max-width:none !important}
  .page-head{display:none !important}
  .sheet-wrap{height:auto !important;display:block !important;overflow:visible !important}
  .cert-sheet{transform:none !important;box-shadow:none !important;border-radius:0 !important;margin:0 auto}
  .report-sheet{box-shadow:none !important;border:none !important;padding:0 !important;max-width:none !important;background:#fff}
  .rep-table th{background:#F7F1E6 !important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .chart-fill,.cert-frame,.cert-seal,.badge{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .rep-h{page-break-after:avoid}
  .report-sheet{page-break-inside:auto}
  tr,li,.chart-row{page-break-inside:avoid}
}

/* =========================================================
   الكتاب · الدروس · الألعاب · التنقل
   ========================================================= */
.screen{padding-bottom:112px}
.toast{bottom:96px}

/* ---------- شريط التنقل ---------- */
.app-nav{
  position:fixed;left:0;right:0;bottom:0;z-index:120;
  display:flex;justify-content:space-around;align-items:stretch;
  background:rgba(255,252,246,.97);
  backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
  border-top:1px solid var(--line);
  padding:6px;
  box-shadow:0 -6px 22px rgba(31,41,55,.07);
}
.nav-btn{
  flex:1;min-height:56px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  border-radius:14px;color:#8B8578;font-size:11px;font-weight:800;
  transition:color .16s ease-out,background .16s ease-out,transform .16s ease-out;
}
.nav-btn.is-active{color:var(--teal);background:var(--teal-soft)}
.nav-btn:active{transform:scale(.95)}
.nav-btn:focus-visible{outline:3px solid #7DD3C8;outline-offset:2px}

/* ---------- الرئيسية الجديدة ---------- */
.continue-card{
  display:flex;align-items:center;gap:14px;width:100%;padding:16px;margin-bottom:16px;
  text-align:right;background:linear-gradient(135deg,#0F766E,#0B5C56);
  border:none;color:#fff;box-shadow:0 12px 28px rgba(15,118,110,.28);
  border-radius:var(--r);transition:transform .18s ease-out;
}
.continue-card:active{transform:scale(.985)}
.continue-ic{
  width:46px;height:46px;border-radius:14px;display:grid;place-items:center;
  background:rgba(255,255,255,.18);flex:0 0 auto;color:#fff;
}
.continue-text{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.45}
.continue-text small{font-size:11.5px;opacity:.85;font-weight:700}
.continue-text b{font-size:16px;font-weight:800}
.continue-text em{font-style:normal;font-size:11.5px;opacity:.85;font-weight:700}

.book-pick{padding:16px;margin-bottom:22px}
.book-pick-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.book-pick-head h3{font-size:15px;font-weight:800}
.book-pick-row{display:flex;align-items:center;gap:12px;margin-bottom:14px}
.book-mini{
  width:52px;height:62px;border-radius:9px;flex:0 0 auto;
  background:linear-gradient(160deg,#0F766E,#134E4A);color:#fff;
  display:grid;place-items:center;font-family:'Nunito',sans-serif;font-weight:800;
  font-size:11px;text-align:center;padding:4px;line-height:1.2;
  box-shadow:0 8px 18px rgba(15,118,110,.25);
}
.book-pick-row b{display:block;font-size:14px}
.book-pick-row .muted{font-size:11.5px}

.quick-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:26px}
.quick{
  display:flex;align-items:center;gap:10px;padding:13px 14px;background:#fff;
  border:1px solid var(--line);border-radius:16px;box-shadow:var(--sh);
  font-weight:800;font-size:13.5px;text-align:right;color:var(--ink);
  transition:transform .16s ease-out,border-color .16s ease-out;
}
.quick:hover{border-color:#DCCBAE;transform:translateY(-1px)}
.quick:active{transform:scale(.98)}
.quick:focus-visible{outline:3px solid #7DD3C8;outline-offset:2px}
.quick svg{color:var(--teal);flex:0 0 auto}
.quick span{min-width:0;display:flex;flex-direction:column;line-height:1.35}
.quick b{display:block;font-size:13.5px}
.quick small{font-size:10.5px;color:var(--muted);font-weight:700}

/* ---------- صفحة الكتاب ---------- */
.book-banner{display:flex;gap:14px;align-items:center;padding:16px;margin-bottom:20px}
.book-cover{
  width:92px;height:118px;border-radius:12px;flex:0 0 auto;
  background:linear-gradient(160deg,#0F766E,#0B5C56 60%,#134E4A);
  color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;
  box-shadow:0 10px 24px rgba(15,118,110,.28);
  font-family:'Nunito',sans-serif;font-weight:800;font-size:15px;text-align:center;
  padding:8px;border:1px solid rgba(255,255,255,.18);
}
.book-cover small{font-size:9.5px;font-weight:700;opacity:.85}
.book-info{flex:1;min-width:0}
.book-info h2{font-size:16.5px;font-weight:800;line-height:1.35}
.progress{height:10px;border-radius:999px;background:#F1E8D8;overflow:hidden;margin-top:12px}
.progress span{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,#F2B544,#F97362);transition:width .5s ease-out}
.book-progress{font-size:12.5px;font-weight:800;color:var(--muted);margin-top:6px}

.unit{margin-bottom:20px}
.unit-head{display:flex;align-items:center;gap:10px;margin-bottom:10px;padding-inline-start:2px}
.unit-dot{width:9px;height:34px;border-radius:6px;flex:0 0 auto}
.unit-head h3{font-size:16px;font-weight:800;line-height:1.3}
.unit-head p{font-size:11.5px;color:var(--muted)}
.unit-count{margin-inline-start:auto;font-size:12px;font-weight:800;color:var(--muted);font-family:'Nunito',sans-serif}
.lesson-list{display:grid;gap:10px}
.lesson-row{
  display:flex;align-items:center;gap:12px;width:100%;text-align:right;
  background:#fff;border:1px solid var(--line);border-radius:16px;padding:12px 14px;
  box-shadow:var(--sh);transition:transform .16s ease-out,border-color .16s ease-out;
}
.lesson-row:hover{border-color:#DCCBAE;transform:translateY(-1px)}
.lesson-row:active{transform:scale(.99)}
.lesson-row:focus-visible{outline:3px solid #7DD3C8;outline-offset:2px}
.lesson-row.is-done{border-color:#BBE9C9;background:#F7FDF9}
.lesson-titles{display:flex;flex-direction:column;flex:1;min-width:0;line-height:1.3}
.lesson-titles b{font-size:15px}
.lesson-titles em{font-size:11.5px;color:var(--muted);font-style:normal}
.lesson-state{font-size:12px;font-weight:800;color:var(--teal);flex:0 0 auto}
.lesson-row.is-done .lesson-state{color:#15803D}

/* ---------- صفحة الدرس ---------- */
.lesson-bar{height:8px;border-radius:999px;background:#F1E8D8;overflow:hidden;margin-bottom:16px}
.lesson-bar span{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,#0F766E,#2AA79C);transition:width .35s ease-out}
.lesson-step{font-size:12.5px;font-weight:800;color:var(--muted);font-family:'Nunito',sans-serif;flex:0 0 auto}
.lesson-stage{display:block;margin-bottom:16px}
.ls-card{padding:20px;animation:popIn .22s ease-out}
.ls-badge{
  display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:800;
  color:var(--teal);background:var(--teal-soft);border-radius:999px;padding:5px 12px;margin-bottom:12px;
}
.ls-title{font-size:20px;font-weight:800;margin-bottom:10px;line-height:1.35}
.ls-lead{font-size:15.5px;line-height:1.85;color:#374151}
.ls-note{font-size:13px;color:var(--muted);margin-bottom:14px}
.ls-tags{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.ls-tags span{
  font-family:'Nunito',sans-serif;font-weight:800;font-size:14px;color:#0F766E;
  background:#E7F4F1;border-radius:10px;padding:5px 12px;
}
.warm-box{background:#FFFDF6;border:1px dashed #E4D6BB;border-radius:16px;padding:16px;margin-bottom:14px}
.warm-q{font-size:15.5px;line-height:1.85;color:#374151}
.warm-reveal{
  margin-top:12px;background:#F2FCF5;border:1px solid #BBE9C9;border-radius:14px;
  padding:12px 14px;font-size:14px;color:#14532D;line-height:1.8;
}
.rule-grid{display:grid;gap:10px}
.rule-card{background:#FFFDF7;border:1px solid #F0E2C6;border-radius:16px;padding:14px}
.rule-card h4{font-size:14.5px;font-weight:800;color:#8A5A05;margin-bottom:4px}
.rule-card p{font-size:14.5px;color:#374151;line-height:1.85}
.hl{color:#0F766E;font-family:'Nunito',sans-serif;font-weight:800}
.struct-list{display:grid;gap:12px}
.struct{background:#FFFDF7;border:1px solid #F0E2C6;border-radius:16px;padding:14px}
.struct-label{
  display:inline-block;font-size:11.5px;font-weight:800;color:#fff;
  background:var(--teal);border-radius:999px;padding:2px 10px;margin-bottom:10px;
}
.struct-chips{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-bottom:8px}
.chip-word{
  font-family:'Nunito',sans-serif;font-weight:800;font-size:15px;background:#fff;
  border:1px solid var(--line);border-radius:10px;padding:5px 10px;color:#374151;
}
.chip-word--hi{background:var(--teal);color:#fff;border-color:var(--teal)}
.struct-chips i{font-style:normal;color:#B3A99A;font-weight:800}
.struct-ar{font-size:13px;color:var(--muted);font-weight:700}
.ex-list{display:grid;gap:10px}
.ex-list li{background:#FFFDF7;border:1px solid #F0E2C6;border-radius:14px;padding:12px 14px}
.ex-row{display:flex;align-items:center;gap:10px}
.ex-en{flex:1;min-width:0;font-family:'Nunito',sans-serif;font-size:17px;font-weight:700;color:#111827;text-align:left;line-height:1.45}
.ex-ar{display:block;font-size:13px;color:var(--muted);margin-top:3px}
.spk{
  width:40px;height:40px;flex:0 0 auto;border-radius:12px;display:grid;place-items:center;
  background:var(--teal-soft);color:var(--teal);border:1px solid #CFE8E3;
  transition:transform .16s ease-out,background .16s ease-out;
}
.spk:hover{background:#D6EDE9}
.spk:active{transform:scale(.93)}
.mist-list{display:grid;gap:12px}
.mist-list li{background:#FFFCF5;border:1px solid var(--line);border-radius:16px;padding:14px}
.mist-wrong,.mist-right{
  display:flex;align-items:center;gap:8px;font-family:'Nunito',sans-serif;
  font-weight:800;font-size:15.5px;text-align:left;line-height:1.45;
}
.mist-wrong{color:#B91C1C}
.mist-right{color:#15803D;margin-top:6px}
.mist-x,.mist-v{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;font-size:12px;flex:0 0 auto;color:#fff}
.mist-x{background:#DC5B48}
.mist-v{background:#16A34A}
.mist-why{font-size:13.5px;color:#4B5563;margin-top:8px;line-height:1.85}
.practice{display:grid;gap:14px}
.pq{background:#FFFDF9;border:1px solid var(--line);border-radius:16px;padding:14px;transition:border-color .2s ease-out,background .2s ease-out}
.pq--ok{background:#F5FDF8;border-color:#BBE9C9}
.pq--bad{background:#FFFAF2;border-color:#F3DCA8}
.pq-q{
  font-family:'Nunito',sans-serif;font-size:18px;font-weight:700;color:#111827;
  line-height:1.5;margin-bottom:12px;text-align:left;word-break:break-word;
}
.pq-hintbtn{
  display:inline-flex;align-items:center;gap:5px;font-size:12.5px;font-weight:800;
  color:#8A5A05;background:var(--gold-soft);border:1px solid #F3D79A;
  border-radius:999px;padding:5px 12px;margin-bottom:10px;
}
.pq-hint{font-size:13px;color:#8A5A05;background:#FFF8EA;border-radius:12px;padding:10px 12px;margin-bottom:10px;line-height:1.85}
.pq-why{font-size:13.5px;margin-top:10px;line-height:1.8}
.pq-why.is-ok{color:#14532D}
.pq-why.is-bad{color:#8A5A05}
.choices--4{grid-template-columns:1fr 1fr}
.lesson-nav{display:flex;gap:10px;justify-content:space-between;margin-top:6px}
.lesson-nav .btn{flex:1}
.ls-final{text-align:center}
.ls-final .owl{width:104px;height:104px;margin:0 auto 8px}
.sum-box{background:#FFFDF6;border:1px solid #F0E2C6;border-radius:16px;padding:14px;text-align:right;margin:12px 0}
.sum-box b{display:block;color:var(--teal);font-size:15px;margin-bottom:4px}
.sum-box p{font-size:14px;color:#374151;line-height:1.85}
.final-actions{display:grid;gap:10px;margin-top:14px}

/* ---------- الألعاب ---------- */
.game-cards{display:grid;gap:12px}
.game-card{padding:18px;display:flex;flex-direction:column;gap:10px}
.game-card h3{font-size:17px;font-weight:800}
.game-card p{font-size:13.5px;color:var(--muted);line-height:1.8}
.game-best{
  font-size:12px;font-weight:800;color:#8A5A05;background:var(--gold-soft);
  border:1px solid #F3D79A;border-radius:999px;padding:4px 12px;align-self:flex-start;
}
.speed-card{padding:16px}
.speed-hud{display:flex;gap:8px;justify-content:space-between;margin-bottom:10px;flex-wrap:wrap}
.hud-pill{
  font-size:12.5px;font-weight:800;background:#fff;border:1px solid var(--line);
  border-radius:999px;padding:5px 12px;font-family:'Nunito',sans-serif;color:var(--ink);
}
.hud-pill--time{color:#B91C1C;border-color:#FBD5CC;background:#FFF3F0}
.hud-pill--lvl{color:var(--teal);border-color:#BBE9C9;background:#F2FCF5}
.speed-bar{height:10px;border-radius:999px;background:#F1E8D8;overflow:hidden;margin-bottom:14px}
.speed-bar span{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,#F97362,#F2B544);transition:width .1s linear}
.speed-skill{font-size:12px;font-weight:800;color:var(--muted);margin-bottom:6px}
.speed-q{
  font-family:'Nunito',sans-serif;font-size:22px;font-weight:700;line-height:1.45;
  color:#111827;text-align:left;margin-bottom:14px;word-break:break-word;
}
.speed-streak{text-align:center;font-weight:800;color:#C2410C;font-size:14px;margin-top:12px}
.tf-statement{
  font-family:'Nunito',sans-serif;font-size:22px;font-weight:700;text-align:center;
  line-height:1.5;color:#111827;background:#FFFDF6;border:1px dashed #E4D6BB;
  border-radius:16px;padding:20px 14px;margin-bottom:14px;direction:ltr;word-break:break-word;
}
.tf-btns{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.tf-btn{
  min-height:64px;border-radius:18px;font-size:18px;font-weight:800;
  display:flex;align-items:center;justify-content:center;gap:8px;color:#fff;
  transition:transform .16s ease-out;
}
.tf-btn:active{transform:scale(.97)}
.tf-yes{background:#16A34A;box-shadow:0 6px 16px rgba(22,163,74,.28)}
.tf-no{background:#DC5B48;box-shadow:0 6px 16px rgba(220,91,72,.28)}
.game-over{text-align:center;padding:24px 18px}
.game-over .owl{width:104px;height:104px;margin:0 auto 8px}
.game-over h2{font-size:22px;font-weight:800;margin-bottom:6px}
.game-score{font-size:46px;font-weight:800;color:var(--teal);font-family:'Nunito',sans-serif;line-height:1.1}

/* ---------- الاختبارات ---------- */
.test-hero{text-align:center;padding:22px 18px;margin-bottom:20px}
.test-hero h2{font-size:20px;font-weight:800;margin-bottom:6px}
.test-hero .muted{margin-bottom:14px}
.tests-grid{display:grid;gap:10px;margin-bottom:20px}
.test-card{display:flex;align-items:center;gap:12px;padding:12px 14px}
.test-info{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.35}
.test-info b{font-size:14.5px}
.test-info span{font-size:12px;color:var(--muted)}

/* ---------- الإنجازات ---------- */
.badge-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.badge-item{
  display:flex;gap:10px;align-items:center;background:#fff;border:1px solid var(--line);
  border-radius:16px;padding:12px;opacity:.55;
}
.badge-item.is-got{opacity:1;border-color:#F3D79A;background:#FFFDF6}
.bi-ic{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;background:#F3F1EC;color:#9A9484;flex:0 0 auto}
.badge-item.is-got .bi-ic{background:var(--gold-soft);color:#8A5A05}
.badge-item b{display:block;font-size:13px;line-height:1.3}
.badge-item span{font-size:11px;color:var(--muted)}

/* ---------- الإعدادات ---------- */
.set-card{padding:18px;margin-bottom:14px}
.set-card h3{font-size:16px;font-weight:800;margin-bottom:10px}
.set-student{font-size:14.5px;color:#374151;font-weight:700}
.switch-row{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:8px 0 12px;font-weight:700;font-size:14.5px;color:#374151;cursor:pointer;
}
.switch-row input{
  appearance:none;-webkit-appearance:none;width:52px;height:30px;border-radius:999px;
  background:#E5E0D5;position:relative;transition:background .2s ease-out;flex:0 0 auto;
  border:0;cursor:pointer;margin:0;
}
.switch-row input::after{
  content:"";position:absolute;top:3px;inset-inline-start:3px;width:24px;height:24px;
  border-radius:50%;background:#fff;transition:transform .2s ease-out;
  box-shadow:0 1px 4px rgba(0,0,0,.2);
}
.switch-row input:checked{background:var(--teal)}
.switch-row input:checked::after{transform:translateX(-22px)}
.switch-row input:focus-visible{outline:3px solid #7DD3C8;outline-offset:2px}
.help details{border:1px solid var(--line);border-radius:14px;padding:12px 14px;margin-bottom:8px;background:#FFFDF9}
.help summary{font-weight:800;font-size:14px;cursor:pointer;list-style:none;color:#374151}
.help summary::-webkit-details-marker{display:none}
.help summary::before{content:"▸ ";color:var(--teal)}
.help details[open] summary::before{content:"▾ "}
.help p{font-size:13.5px;color:#4B5563;margin-top:8px;line-height:1.9}
.teacher-tiles{grid-template-columns:repeat(3,1fr)}

@media (max-width:430px){
  .quick-grid{grid-template-columns:1fr}
  .badge-grid{grid-template-columns:1fr}
  .ex-en,.mist-wrong,.mist-right{font-size:16px}
  .speed-q,.tf-statement{font-size:19px}
  .book-cover{width:78px;height:100px;font-size:13px}
}

@media print{
  .app-nav,.lesson-nav,.lesson-bar{display:none !important}
  .screen{padding-bottom:0 !important}
}

/* =========================================================
   ألعاب القواعد القصيرة
   ========================================================= */
.word-chip{
  font-family:'Nunito','Tajawal',system-ui,sans-serif;
  font-size:16px;font-weight:800;color:#1F2937;line-height:1.2;
  background:#fff;border:1.5px solid var(--line);border-radius:12px;
  padding:9px 14px;min-height:44px;
  transition:transform .14s ease-out,border-color .14s ease-out,background .14s ease-out;
}
.word-chip:hover:not(:disabled){border-color:var(--teal);background:var(--teal-soft)}
.word-chip:active:not(:disabled){transform:scale(.95)}
.word-chip:focus-visible{outline:3px solid #7DD3C8;outline-offset:2px}
.word-chip.is-picked{background:var(--teal-soft);border-color:#BBE0DA;color:var(--teal)}
.word-chip.is-right{background:#E9F9EF !important;border-color:var(--ok) !important;color:#14532D !important}
.word-chip.is-wrong{background:#FFF0EC !important;border-color:#DC5B48 !important;color:#991B1B !important}
.word-chip:disabled{cursor:default}

.order-answer{
  display:flex;flex-wrap:wrap;gap:8px;align-items:center;min-height:66px;
  background:#FFFDF6;border:1.5px dashed #E4D6BB;border-radius:14px;
  padding:12px;margin-bottom:12px;
  transition:border-color .2s ease-out,background .2s ease-out;
}
.order-answer.is-ok{border-color:var(--ok);background:#F5FDF8}
.order-answer.is-bad{border-color:#E9A78F;background:#FFF9F5}
.order-hint{font-family:'Tajawal',sans-serif;font-size:12.5px;font-weight:700;color:#B3A99A}
.order-pool{display:flex;flex-wrap:wrap;gap:8px;min-height:44px;margin-bottom:12px}
.order-actions{display:flex;gap:8px;margin-top:2px}
.order-fb{
  font-size:13.5px;font-weight:700;line-height:1.9;border-radius:12px;
  padding:10px 12px;margin-bottom:12px;
}
.order-fb.is-ok{background:#F2FCF5;border:1px solid #BBE9C9;color:#14532D}
.order-fb.is-bad{background:#FFFAF0;border:1px solid #F3DCA8;color:#8A5A05}
.order-fb b{font-family:'Nunito',sans-serif}

.err-sentence{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-bottom:14px}

.match-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin-bottom:6px}
.match-card{
  min-height:78px;display:flex;align-items:center;justify-content:center;text-align:center;
  padding:8px;border-radius:14px;border:1.5px solid var(--line);background:#fff;
  font-family:'Tajawal',sans-serif;font-size:13.5px;font-weight:800;color:#1F2937;line-height:1.35;
  transition:transform .16s ease-out,background .16s ease-out,border-color .16s ease-out;
}
.match-card[dir="ltr"]{font-family:'Nunito',sans-serif;font-size:15px}
.match-card:hover:not(:disabled){border-color:var(--teal);background:var(--teal-soft)}
.match-card:active:not(:disabled){transform:scale(.96)}
.match-card:focus-visible{outline:3px solid #7DD3C8;outline-offset:2px}
.match-card.is-open{background:var(--teal-soft);border-color:#9FD5CD;color:var(--teal);box-shadow:0 0 0 3px rgba(15,118,110,.12)}
.match-card.is-matched{background:#EAF9F0;border-color:#9DDCB2;color:#15803D;opacity:.72;border-style:dashed}
.match-card:disabled{cursor:default}

.ladder-track{display:flex;gap:6px;margin-bottom:14px}
.ladder-node{
  flex:1;text-align:center;padding:7px 2px;border-radius:11px;
  border:1px solid var(--line);background:#fff;color:#9A9484;
  font-family:'Nunito',sans-serif;font-size:12.5px;font-weight:800;
}
.ladder-node.is-done{background:#E9F9EF;border-color:#BBE9C9;color:#15803D}
.ladder-node.is-now{background:var(--teal);border-color:var(--teal);color:#fff;box-shadow:0 4px 12px rgba(15,118,110,.22)}

.mini-new{
  display:inline-block;margin-top:8px;font-size:13px;font-weight:800;color:#8A5A05;
  background:var(--gold-soft);border:1px solid #F3D79A;border-radius:999px;padding:4px 14px;
}
#minute-cancel{margin-top:6px}

@media (max-width:430px){
  .word-chip{font-size:15px;padding:8px 12px}
  .match-card{min-height:72px;font-size:12.5px}
  .match-card[dir="ltr"]{font-size:14px}
}