/* ألوان المظهر المحدّدة سلفاً (تباين النص ≥ 4.5 في الفاتح والداكن). الافتراضي الأخضر هو الموجود في styles.css بلا تغيير. */
:root[data-accent="blue"]{--ink:#0b2e5c;--leaf:#1d5fa8;--leaf-soft:#e6eef8;}
:root[data-accent="purple"]{--ink:#2e1a5c;--leaf:#6b3fa0;--leaf-soft:#f0e9f8;}
:root[data-accent="amber"]{--ink:#4a2a08;--leaf:#9a5a12;--leaf-soft:#f8eddc;}
:root[data-accent="teal"]{--ink:#0b3b38;--leaf:#0f766e;--leaf-soft:#e3f3f1;}
:root[data-accent="rose"]{--ink:#5a1328;--leaf:#a3304f;--leaf-soft:#f9e8ed;}
:root[data-theme="dark"][data-accent="blue"]{--ink:#d6e6fa;--leaf:#7ab8f5;--leaf-soft:#13283f;}
:root[data-theme="dark"][data-accent="purple"]{--ink:#e6dcf7;--leaf:#bb9af0;--leaf-soft:#251a3a;}
:root[data-theme="dark"][data-accent="amber"]{--ink:#f6e3c8;--leaf:#f0b86a;--leaf-soft:#35260f;}
:root[data-theme="dark"][data-accent="teal"]{--ink:#d3f0ec;--leaf:#5fd3c7;--leaf-soft:#102f2c;}
:root[data-theme="dark"][data-accent="rose"]{--ink:#f8dbe3;--leaf:#f08fa8;--leaf-soft:#3a1620;}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]):not([data-theme="dark"])[data-accent="blue"]{--ink:#d6e6fa;--leaf:#7ab8f5;--leaf-soft:#13283f;}
  :root:not([data-theme="light"]):not([data-theme="dark"])[data-accent="purple"]{--ink:#e6dcf7;--leaf:#bb9af0;--leaf-soft:#251a3a;}
  :root:not([data-theme="light"]):not([data-theme="dark"])[data-accent="amber"]{--ink:#f6e3c8;--leaf:#f0b86a;--leaf-soft:#35260f;}
  :root:not([data-theme="light"]):not([data-theme="dark"])[data-accent="teal"]{--ink:#d3f0ec;--leaf:#5fd3c7;--leaf-soft:#102f2c;}
  :root:not([data-theme="light"]):not([data-theme="dark"])[data-accent="rose"]{--ink:#f8dbe3;--leaf:#f08fa8;--leaf-soft:#3a1620;}
}

/* زر المظهر ولوحته */
.thm-btn{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:12px;border:1px solid var(--line);background:var(--card);color:var(--ink);flex:none}
.thm-btn:hover{background:var(--leaf-soft);color:var(--leaf)}
.thm-btn svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.thm-pop{position:fixed;z-index:200;inset-inline:12px;top:calc(env(safe-area-inset-top,0px) + 68px);max-width:340px;margin-inline-start:auto;background:var(--card);color:var(--text);border:1px solid var(--line);border-radius:16px;box-shadow:0 12px 40px rgba(0,0,0,.25);padding:16px}
.thm-pop[hidden]{display:none}
.thm-pop h4{color:var(--ink);font-size:.95rem;margin:0 0 8px}
.thm-pop .grp+.grp{margin-top:14px}
.thm-modes{display:flex;gap:6px}
.thm-modes button{flex:1;padding:9px 6px;border-radius:10px;border:1px solid var(--line);background:transparent;color:var(--text);font-size:.9rem;font-weight:600}
.thm-modes button[aria-pressed="true"]{background:var(--leaf-soft);color:var(--leaf);border-color:var(--leaf)}
.thm-sw{display:flex;flex-wrap:wrap;gap:10px}
.thm-sw button{display:flex;flex-direction:column;align-items:center;gap:4px;width:74px;padding:8px 4px;border-radius:12px;border:2px solid transparent;font-size:.78rem;color:var(--text);background:transparent}
.thm-sw button[aria-pressed="true"]{border-color:var(--leaf)}
.thm-sw i{display:block;width:30px;height:30px;border-radius:50%;border:1px solid rgba(0,0,0,.18)}
.thm-reset{margin-top:14px;width:100%;padding:9px;border-radius:10px;border:1px solid var(--line);color:var(--muted);background:transparent;font-size:.88rem}
