#arkanThemeBtn{position:fixed;bottom:16px;right:16px;left:auto;z-index:2147483000;font:600 14px 'Reem Kufi',Tajawal,sans-serif;padding:8px 14px;border-radius:999px;border:1px solid #c9a24a;background:#fffaf0;color:#0f5c5c;box-shadow:0 4px 14px rgba(0,0,0,.18);cursor:pointer;pointer-events:auto}
html[data-theme="dark"]{color-scheme:dark;--bg:#0e1518;--paper:#162127;--card:#1a272e;--ink:#e8eef0;--muted:#a9b8bd;--teal:#3fb6b0;--gold:#e0b85a;--line:#2b3b43}
html[data-theme="dark"] body{background:#0e1518!important;color:#e8eef0!important}
html[data-theme="dark"] .bar,html[data-theme="dark"] header,html[data-theme="dark"] nav{background-color:#132026!important;color:#e8eef0!important;border-color:#2b3b43!important}
html[data-theme="dark"] #main,html[data-theme="dark"] main,html[data-theme="dark"] .card,html[data-theme="dark"] .paper,html[data-theme="dark"] .page,html[data-theme="dark"] .book,html[data-theme="dark"] .panel,html[data-theme="dark"] .box,html[data-theme="dark"] section,html[data-theme="dark"] article{background-color:#162127!important;color:#e8eef0!important;border-color:#2b3b43!important}
html[data-theme="dark"] p,html[data-theme="dark"] li,html[data-theme="dark"] td,html[data-theme="dark"] th,html[data-theme="dark"] span,html[data-theme="dark"] label{color:inherit}
html[data-theme="dark"] h1,html[data-theme="dark"] h2,html[data-theme="dark"] h3,html[data-theme="dark"] h4{color:#e0b85a!important}
html[data-theme="dark"] a{color:#5fd0c9}
html[data-theme="dark"] input,html[data-theme="dark"] textarea,html[data-theme="dark"] select{background:#0f1a1f!important;color:#e8eef0!important;border-color:#2b3b43!important}
html[data-theme="dark"] table,html[data-theme="dark"] tr{background-color:transparent!important}
html[data-theme="dark"] #arkanThemeBtn{background:#1b2a33;color:#f3d27a;border-color:#e0b85a}
@media(max-width:600px){#arkanThemeBtn{bottom:auto;top:70px;right:10px;padding:6px 10px;font-size:12px}}

/* حفظ / قصائد — بطاقات بيضاء تبقى واضحة في الداكن */
html[data-theme="dark"] .poem,
html[data-theme="dark"] .note,
html[data-theme="dark"] #res,
html[data-theme="dark"] .b{
  background-color:#1a272e!important;
  color:#e8eef0!important;
  border-color:#e0b85a!important;
}
html[data-theme="dark"] .poem .bt,
html[data-theme="dark"] .poem .bt span,
html[data-theme="dark"] .poem p,
html[data-theme="dark"] .poem small,
html[data-theme="dark"] .ph small{
  color:#e8eef0!important;
}
html[data-theme="dark"] .bt span:nth-child(3n+1){color:#e0b85a!important}
html[data-theme="dark"] .ph h2,
html[data-theme="dark"] .big{color:#e0b85a!important}
html[data-theme="dark"] .tabs button{
  background:#1a272e!important;
  color:#e8eef0!important;
  border-color:#e0b85a!important;
}
html[data-theme="dark"] .tabs button.on,
html[data-theme="dark"] .btn{
  background:#d4a94a!important;
  color:#083c40!important;
}
html[data-theme="dark"] .arkan-level,
html[data-theme="dark"] .arkan-topbar{
  background:#132026!important;
  color:#e8eef0!important;
  border-color:#2b3b43!important;
}


/* عرض كامل الشاشة — منع التصغير الأفقي على الجوال */
html,body{width:100%;max-width:100%;overflow-x:hidden;-webkit-text-size-adjust:100%;text-size-adjust:100%}
img,video,iframe,canvas,svg{max-width:100%;height:auto}
.sunnah-radio,.arkan-pn,.arkan-level,.arkan-topbar{max-width:100%;box-sizing:border-box}
@media(max-width:640px){
  .tri{grid-template-columns:1fr!important;gap:1rem!important}
  .tri figure:nth-child(2){transform:none!important}
  .branches{grid-template-columns:1fr!important}
  #abwab .br{margin:10px 6px!important}
}

/* ===== v171 — إصلاح شامل للوضع الداكن ===== */
html[data-theme="dark"] :is(.by,.sheet,.read,.rule,.tip,.tool,.tp,.tb,.demo,.genre,.ghost,.er,.bweak,.bx,.paper,details.mdl,section.sec,.wrep,.rub,.facts,.wtbl,.toc,.login-box,#arkanTutor,#arkReg,.leg,.seg button,.sunnah-radio button,.bbar,.pbtn.ask,.door-img,.ark-masc){background-color:#1a272e!important;background-image:none!important;color:#e8eef0!important;border-color:#2b3b43!important}
html[data-theme="dark"] .by.ok{background-color:#13281c!important;border-color:#2b3b43!important;border-right-color:#2e9e4f!important}
html[data-theme="dark"] .by.half{background-color:#2a2410!important;border-color:#2b3b43!important;border-right-color:#e0a100!important}
html[data-theme="dark"] .by.bad{background-color:#2c1618!important;border-color:#2b3b43!important;border-right-color:#ff5a5a!important}
html[data-theme="dark"] :is(.by,.hm,.bh,.hm b,.lg){color:#e8eef0!important}
html[data-theme="dark"] .why,html[data-theme="dark"] .er .ty{color:#ff8a8a!important}
html[data-theme="dark"] .wk{color:#7fdc9a!important}
html[data-theme="dark"] span.ws{background:#5a1d22!important;color:#ffb3b3!important}
html[data-theme="dark"] span.wm{background:#4a3a10!important;color:#ffd77a!important;border-bottom-color:#e0a100!important}
html[data-theme="dark"] .we{color:#8a9aa0!important}
html[data-theme="dark"] .bx.g{background:#13281c!important}
html[data-theme="dark"] .bx.y{background:#2a2410!important}
html[data-theme="dark"] :is(.rub th,.facts td:first-child,.wtbl td.wt,.toc .nn,.rub .tot,.genre.on,.leg .m){background-color:#22333b!important;color:#f3d27a!important}
html[data-theme="dark"] :is(td,th){border-color:#2b3b43!important;color:#e8eef0}
html[data-theme="dark"] :is(.bt,.bt span){color:#e8eef0!important;border-color:#3a4c55!important}
html[data-theme="dark"] .bt span:nth-child(3n+1){color:#e0b85a!important}
html[data-theme="dark"] :is(small,.muted,figcaption){color:#a9b8bd!important}
html[data-theme="dark"] :is(b,strong){color:inherit}
html[data-theme="dark"] [style*="background:#fff"],html[data-theme="dark"] [style*="background: #fff"],html[data-theme="dark"] [style*="background:white"],html[data-theme="dark"] [style*="background-color:#fff"],html[data-theme="dark"] [style*="background:#f"],html[data-theme="dark"] [style*="background:#F"]{background:#1a272e!important;color:#e8eef0!important}
html[data-theme="dark"] [style*="color:#111"],html[data-theme="dark"] [style*="color:#000"],html[data-theme="dark"] [style*="color:#333"],html[data-theme="dark"] [style*="color:#12343B"],html[data-theme="dark"] [style*="color:#0B4F53"]{color:#e8eef0!important}
html[data-theme="dark"] :is(.btn,.tabs button.on){color:#083c40!important}
html[data-theme="dark"] button:not(#arkanThemeBtn):not(.btn):not(.on){color:inherit}
html[data-theme="dark"] ::placeholder{color:#7d8f95}
html[data-theme="dark"] hr{border-color:#2b3b43}
html[data-theme="dark"] div.wm,html[data-theme="dark"] .wm[aria-hidden]{background:transparent!important;border:0!important}
html[data-theme="dark"] #arkReg form{background:#1a272e!important;color:#e8eef0!important}
