/* ==========================================================================
   وضع الليل (الرئيسية + المتجر + المدونة) — يُفعَّل بالأيقونة في الهيدر ويُحفظ في المتصفح.
   كل التنسيقات داخل html[data-theme="dark"] فلا تؤثر على الوضع النهاري.
   ========================================================================== */
.theme-tg{display:inline-grid;place-items:center;width:40px;height:40px;border-radius:999px;border:1px solid var(--line0,var(--line));background:transparent;color:var(--ink);transition:background .2s,border-color .2s,color .2s;flex:none}
.theme-tg:hover{background:var(--surface2);border-color:var(--accent)}
.theme-tg .i-sun{display:none}
html[data-theme=dark] .theme-tg .i-moon{display:none}html[data-theme=dark] .theme-tg .i-sun{display:inline-grid}
.theme-tg span{display:inline-grid;place-items:center;line-height:0}

html[data-theme=dark]{color-scheme:dark;
  --bg:#0e1015;--surface:#161922;--surface2:#1e222d;--ink:#eceef5;--muted:#a1a9bd;--line:rgba(255,255,255,.13);
  --bg0:#0e1015;--surface0:#161922;--surface20:#1e222d;--ink0:#eceef5;--muted0:#a1a9bd;--line0:rgba(255,255,255,.13);
  --accent:var(--accent-dk,#7f95ff);--accent2:var(--accent2-dk,#a98bff);--accent-ink:var(--accent-ink-dk,#0b0f1f)}
/* الرئيسية التعريفية تعرّف ألوانها على body */
html[data-theme=dark] body.lp{--paper:#0e1015;--bg:#0e1015;--surface:#161922;--surface2:#1e222d;--ink:#eceef5;--muted:#a1a9bd;--line:rgba(255,255,255,.13);--night:#161922;
  --accent:#7f95ff;--accent2:#a98bff;--accent-ink:#0b0f1f}
html[data-theme=dark] body{background-color:var(--bg);color:var(--ink)}

/* أسطح كانت بيضاء ثابتة */
html[data-theme=dark] .cat-go,html[data-theme=dark] .duo-card .btn,html[data-theme=dark] .lp .hdr-act .lang-sw,html[data-theme=dark] .lp .hdr-act>a.hdr-login,
html[data-theme=dark] .nx-badge,html[data-theme=dark] .nx-points li,html[data-theme=dark] .nx-ring .sat>i,html[data-theme=dark] .nx-ring .sat em,html[data-theme=dark] .nx-card,
html[data-theme=dark] .nx-row-i,html[data-theme=dark] .nx-node,html[data-theme=dark] .nx-testi figure,html[data-theme=dark] body.lo .pc-wish:hover,
html[data-theme=dark] .nx-core{background:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-theme=dark] body.lo.lp .nx-core,html[data-theme=dark] body.lo.lp .nx-ring .sat:nth-child(odd)>i{background:var(--accent);color:var(--accent-ink)}
html[data-theme=dark] body.lo.lp .nx-testi figure.main{background:var(--surface2)}
html[data-theme=dark] .nx-ring .sat:nth-child(odd) em{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
html[data-theme=dark] body.lo .lp-form input,html[data-theme=dark] body.lo .lp-form textarea,html[data-theme=dark] body.lo.lp .lp-form input,html[data-theme=dark] body.lo.lp .lp-form textarea{background:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-theme=dark] body.lo .scrim,html[data-theme=dark] body.lo .nl-pop{background:rgba(6,8,13,.72)}
html[data-theme=dark] body.lo .toast.err{background:#3a1b20;color:#ffb4bd}
html[data-theme=dark] body.lo .lp-form-msg.ok{color:#6fe3a0}html[data-theme=dark] body.lo .lp-form-msg.err{color:#ff8a9b}
html[data-theme=dark] body.lo .nx-btn>i,html[data-theme=dark] body.lo .nx-about .nx-btn>i,html[data-theme=dark] body.lo .lp-contact .nx-btn>i{background:var(--volt);color:#14161f}
html[data-theme=dark] .nx-grid{opacity:.35;filter:invert(1)}
/* حقول النماذج في المتجر والمدونة */
html[data-theme=dark] input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),html[data-theme=dark] select,html[data-theme=dark] textarea{background-color:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-theme=dark] input::placeholder,html[data-theme=dark] textarea::placeholder{color:var(--muted);opacity:.8}
/* الصور: خفض سطوع بسيط كي لا تبهر العين */
html[data-theme=dark] img{filter:brightness(.92)}
html[data-theme=dark] .logo img{filter:none}
