
:root {
  --purple: #4B3A6E;
  --purple-dark: #382b54;
  --purple-light: #f3effa;
  --teal: #0a8f8f;
  --teal-light: #e6f5f5;
  --gold: #c9920a;
  --gold-light: #fdf6e8;
  --green-bg: #eef8f0;
  --green-text: #1e7a3d;
  --red-bg: #fdeeee;
  --red-text: #b03a2e;
  --ink: #232233;
  --muted: #6b6b7d;
  --border: #e3ddee;
  --bg: #faf9fc;
  --radius: 14px;
}

/* ===== LANG DIRECTION ===== */
[data-lang="ar"] { direction: rtl; }
[data-lang="en"] { direction: ltr; }
[data-lang="ar"] body { font-family:"IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif; }
[data-lang="en"] body { font-family:"IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif; }

* { box-sizing: border-box; }
html { overflow-x:clip; width:100%; }
html, body { margin:0; padding:0; background:#0d2145; color:#63ddff; scroll-behavior:smooth; max-width:100%; overflow-x:clip; }
body { position:relative; }

/* ===== TOPBAR ===== */
.topbar {
  position:sticky; top:0; z-index:50;
  background:linear-gradient(120deg,#0d2145 0%,#0d2145 60%,#2f6df0 130%);
  color:#fff; padding:12px 20px;
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  box-shadow:0 2px 16px rgba(75,58,110,0.25);
}
.topbar-brand { display:flex; align-items:center; gap:10px; flex-shrink:1; min-width:0; }
.topbar-brand .logo-mark {
  width:40px; height:40px; border-radius:50%; overflow:hidden; flex-shrink:0;
  background:#0c1228; display:flex; align-items:center; justify-content:center;
}
.topbar-brand .logo-mark img { width:36px; height:36px; object-fit:contain; }
.topbar-brand .titles { line-height:1.25; min-width:0; overflow:hidden; }
.topbar-brand .t-main {
  font-weight:800; font-size:14px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.topbar-brand .t-sub {
  font-size:11px; opacity:.8;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.topbar-search {
  flex:1; display:flex; align-items:center;
  background:rgba(255,255,255,.15); border-radius:8px;
  padding:8px 14px; gap:8px; max-width:380px;
}
.topbar-search .icon { opacity:.7; font-size:14px; }
.topbar-search input {
  background:none; border:none; outline:none; color:#fff;
  font-size:13.5px; width:100%; font-family:"IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
}
.topbar-search input::placeholder { color:rgba(255,255,255,.6); }
.topbar-right { display:flex; align-items:center; gap:8px; flex-shrink:0; margin-inline-start:auto; }
.home-btn {
  background:rgba(255,255,255,.15); border:none; color:#fff; padding:7px 12px;
  border-radius:8px; cursor:pointer; display:flex; align-items:center; gap:6px;
  font-size:13px; font-family:"IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif; transition:.2s;
}
.home-btn:hover { background:rgba(255,255,255,.25); }
.hb-text { font-weight:600; }

/* ===== LANG SWITCHER ===== */
.lang-btn {
  background:rgba(255,255,255,.2); border:1.5px solid #222c55;
  color:#fff; padding:6px 13px; border-radius:20px; cursor:pointer;
  font-size:12.5px; font-weight:700; font-family:"IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  display:flex; align-items:center; gap:6px; transition:.2s;
  white-space:nowrap;
}
.lang-btn:hover { background:rgba(255,255,255,.35); }
.lang-btn .lang-icon { font-size:15px; }
.lang-btn .lang-label { font-size:12px; letter-spacing:.3px; }
.menu-toggle {
  display:none; background:none; border:none; color:#fff; cursor:pointer; padding:6px;
}
@media(max-width:700px){
  .topbar { flex-wrap:wrap; }
  .menu-toggle { display:block; }
  .topbar-search { order:5; flex:1 1 100%; max-width:none; }
  .hb-text { display:none; }
  .lang-btn .lang-label { display:none; }
  .topbar-brand { gap:6px; }
  .topbar-brand .logo-mark { width:32px; height:32px; }
  .topbar-brand .logo-mark img { width:28px; height:28px; }
  .topbar-brand .t-main { font-size:12.5px; max-width:38vw; }
  .topbar-brand .t-sub { font-size:10px; max-width:38vw; }
  .home-btn, .lang-btn { padding:7px 9px; }
}

/* ===== LAYOUT ===== */
.layout { display:flex; min-height:calc(100vh - 60px); max-width:100vw; overflow-x:hidden; }

/* ===== SIDEBAR ===== */
.sidebar {
  width:min(270px, 78vw); flex-shrink:0; background:#0c1228;
  border-right:1px solid rgba(99,221,255,.45);
  position:sticky; top:60px; height:calc(100vh - 60px);
  overflow-y:auto; overflow-x:hidden; padding:16px 0;
}
[data-lang="ar"] .sidebar { border-right:none; border-left:1px solid rgba(99,221,255,.45); }
.sidebar-overlay { display:none; }
@media(max-width:900px){
  .sidebar {
    position:fixed; top:0; left:-82vw; height:100vh; z-index:40;
    transition:left .28s; padding-top:70px; width:min(270px, 78vw);
    box-shadow:none;
  }
  [data-lang="ar"] .sidebar { left:auto; right:-82vw; transition:right .28s; }
  .sidebar.open { left:0; box-shadow:4px 0 32px rgba(75,58,110,0.18); }
  [data-lang="ar"] .sidebar.open { right:0; left:auto; }
  .sidebar-overlay.open {
    display:block; position:fixed; inset:0; background:rgba(0,0,0,.35); z-index:39;
  }
}
.sb-stats {
  display:flex; gap:0; border-bottom:1px solid rgba(99,221,255,.45); margin-bottom:12px;
}
.sb-stat {
  flex:1; text-align:center; padding:10px 4px;
  border-right:1px solid rgba(99,221,255,.45);
}
[data-lang="ar"] .sb-stat { border-right:none; border-left:1px solid rgba(99,221,255,.45); }
.sb-stat:last-child { border:none; }
.sb-stat b { display:block; font-size:18px; font-weight:800; color:#63ddff; }
.sb-stat span { font-size:10.5px; color:#e9efff; }
.sb-section-btn {
  width:100%; background:none; border:none; cursor:pointer; text-align:right;
  padding:9px 16px; font-size:13px; font-weight:700; color:#63ddff;
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  border-left:3px solid transparent; transition:.15s; font-family:"IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-wrap:anywhere; min-width:0;
}
.sb-section-btn > span:first-child { min-width:0; overflow-wrap:anywhere; display:flex; align-items:center; }
[data-lang="en"] .sb-section-btn { text-align:left; border-left:none; border-right:3px solid transparent; }
.sb-section-btn:hover { background:#0d2145; }
.sb-section-btn.active { background:#0d2145; border-color:rgba(99,221,255,.45); color:#63ddff; }
[data-lang="en"] .sb-section-btn.active { border-left-color:transparent; border-right-color:rgba(99,221,255,.45); }
.sb-num {
  display:inline-flex; align-items:center; justify-content:center;
  width:22px; height:22px; background:#0d2145; color:#fff;
  border-radius:6px; font-size:11px; margin-left:8px; flex-shrink:0;
}
[data-lang="en"] .sb-num { margin-left:0; margin-right:8px; }
.sb-count {
  font-size:11px; background:#0d2145; color:#63ddff;
  padding:2px 7px; border-radius:10px; font-weight:600;
}
.sb-cmd-list { display:none; list-style:none; margin:0; padding:0 0 4px 0; }
.sb-cmd-list.open { display:block; }
.sb-cmd-list li a {
  display:block; padding:6px 16px 6px 32px; font-size:12px; color:#e9efff;
  text-decoration:none; border-bottom:1px solid #222c55; transition:.12s;
}
[data-lang="en"] .sb-cmd-list li a { padding:6px 32px 6px 16px; }
.sb-cmd-list li a:hover { background:#0d2145; color:#63ddff; }
.sb-section-btn.golden { color:#f2c14e; }
.sb-section-btn.golden.active { background:#0d2145; border-color:#222c55; }

/* ===== MAIN ===== */
.main { flex:1; padding:28px 32px; max-width:860px; min-width:0; overflow-wrap:anywhere; }
@media(max-width:700px){ .main { padding:18px 14px; } }

/* ===== INTRO ===== */
.intro-hero {
  background:linear-gradient(135deg,#0d2145 0%,#0d2145 70%,#2f6df0 140%);
  border-radius:var(--radius); padding:32px 28px; color:#fff; margin-bottom:20px;
  overflow-wrap:anywhere; min-width:0;
}
.intro-hero h1 { margin:0 0 10px; font-size:22px; font-weight:800; }
.intro-hero p { margin:0 0 18px; opacity:.9; font-size:14px; line-height:1.6; }
.intro-stats { display:flex; gap:0; background:rgba(255,255,255,.12); border-radius:10px; overflow:hidden; }
.is-item { flex:1; text-align:center; padding:12px 8px; border-right:1px solid rgba(255,255,255,.15); }
[data-lang="ar"] .is-item { border-right:none; border-left:1px solid rgba(255,255,255,.15); }
.is-item:last-child { border:none; }
.is-item b { display:block; font-size:22px; font-weight:800; }
.is-item span { font-size:11px; opacity:.8; }

/* ===== TABS ===== */
.intro-tabs { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:20px; }
.intro-tab {
  display:flex; align-items:center; gap:7px; padding:8px 14px;
  background:#0c1228; border:1.5px solid rgba(99,221,255,.45); border-radius:10px;
  cursor:pointer; font-size:12.5px; font-weight:600; color:#63ddff;
  transition:.15s; font-family:"IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
}
.intro-tab:hover { border-color:rgba(99,221,255,.45); background:#0d2145; color:#63ddff; }
.intro-tab .it-num {
  background:#0d2145; color:#fff; border-radius:6px;
  width:22px; height:22px; display:flex; align-items:center; justify-content:center;
  font-size:10.5px; font-weight:800; flex-shrink:0;
}
.intro-tab .it-count {
  background:#0d2145; color:#63ddff;
  border-radius:8px; padding:1px 6px; font-size:11px;
}
.intro-tab.golden .it-num { background:#c28a1a; }
.intro-tab.golden:hover { border-color:#222c55; background:#0d2145; color:#f2c14e; }

/* ===== HOW TO ===== */
.howto-steps { display:flex; flex-direction:column; gap:6px; margin-bottom:14px; }
.howto-step {
  display:flex; align-items:flex-start; gap:12px; padding:10px 14px;
  background:#0c1228; border-radius:10px; border:1px solid rgba(99,221,255,.45);
}
.hs-num {
  width:28px; height:28px; background:#2f6df0; color:#fff; border-radius:8px;
  display:flex; align-items:center; justify-content:center; font-size:12px;
  font-weight:800; flex-shrink:0;
}
.howto-step strong { display:block; font-size:13px; margin-bottom:2px; color:#63ddff; }
.howto-step span { font-size:12px; color:#e9efff; }
.howto-note {
  background:#0d2145; border-right:3px solid #222c55;
  border-radius:0 8px 8px 0; padding:12px 14px; font-size:12.5px;
  color:#63ddff; line-height:1.6; margin-bottom:10px;
}
[data-lang="en"] .howto-note { border-right:none; border-left:3px solid #222c55; border-radius:8px 0 0 8px; }
.integrity-note {
  background:#0d2145; border-right:3px solid rgba(99,221,255,.45);
  border-radius:0 8px 8px 0; padding:12px 14px; font-size:12.5px;
  color:#63ddff; line-height:1.6; margin-bottom:10px;
}
[data-lang="en"] .integrity-note { border-right:none; border-left:3px solid rgba(99,221,255,.45); border-radius:8px 0 0 8px; }

/* ===== SECTION HEAD ===== */
.section-head {
  background:linear-gradient(135deg,#0d2145 0%,#0d2145 80%);
  border-radius:var(--radius) var(--radius) 0 0; padding:22px 24px;
  margin-bottom:0; color:#fff;
}
.section-head.golden { background:linear-gradient(135deg,#c28a1a 0%,#c28a1a 80%); }
.section-head .eyebrow { font-size:11.5px; opacity:.75; margin-bottom:5px; font-weight:600; letter-spacing:.5px; text-transform:uppercase; }
.section-head h1 { margin:0 0 6px; font-size:20px; font-weight:800; }
.section-head p { margin:0; opacity:.88; font-size:13.5px; line-height:1.55; }

/* ===== CMD CARD ===== */
.cmd-card {
  background:#0c1228; border-radius:var(--radius); border:1px solid rgba(99,221,255,.45);
  margin-bottom:16px; overflow:hidden;
  box-shadow:0 2px 10px rgba(75,58,110,0.06);
}
.cmd-card.golden { border-color:rgba(242,193,78,.55); }
.cmd-head {
  background:#0d2145; padding:14px 18px;
  display:flex; align-items:center; justify-content:space-between;
}
.cmd-card.golden .cmd-head { background:linear-gradient(90deg,#c28a1a,#c28a1a); }
.cmd-head h3 { margin:0; color:#fff; font-size:14px; font-weight:700; flex:1; }
.cmd-head .badge {
  background:rgba(255,255,255,.2); color:#fff; border-radius:8px;
  padding:3px 10px; font-size:13px; font-weight:800; flex-shrink:0;
  margin-right:10px;
}
[data-lang="en"] .cmd-head .badge { margin-right:0; margin-left:10px; }
.cmd-body { padding:0; }

/* META ROW */
.meta-row { display:flex; border-bottom:1px solid rgba(99,221,255,.45); }
.meta-box { flex:1; padding:12px 16px; }
.meta-box:first-child { border-right:1px solid rgba(99,221,255,.45); }
[data-lang="ar"] .meta-box:first-child { border-right:none; border-left:1px solid rgba(99,221,255,.45); }
.meta-box.when { background:#0d2145; }
.meta-box.why { background:#0d2145; }
.m-label { display:block; font-size:10.5px; font-weight:700; color:#e9efff; margin-bottom:4px; text-transform:uppercase; letter-spacing:.4px; }
.meta-box p { margin:0; font-size:12.5px; line-height:1.55; }

/* PROMPT SECTION */
.prompt-section { padding:0; }
.prompt-label-row {
  display:flex; align-items:center; justify-content:space-between;
  padding:8px 16px; background:#0c1228; border-bottom:1px solid rgba(99,221,255,.45);
}
.pl-text { font-size:12px; color:#e9efff; font-weight:600; }
.copy-btn {
  display:flex; align-items:center; gap:6px; background:#0d2145;
  color:#fff; border:none; border-radius:7px; padding:6px 12px;
  cursor:pointer; font-size:12px; font-weight:600; transition:.2s; font-family:"IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
}
.copy-btn:hover { background:#0d2145; }
.copy-btn.copied { background:#2f6df0; }
.copy-btn svg { width:14px; height:14px; }
.prompt-box {
  padding:14px 18px; font-size:13px; line-height:1.7; white-space:pre-wrap;
  color:#63ddff; background:#0c1228;
  border-right:3px solid rgba(99,221,255,.45);
}
[data-lang="en"] .prompt-box { border-right:none; border-left:3px solid rgba(99,221,255,.45); }

/* VARIANTS ROW */
.variants-row { display:flex; border-top:1px solid rgba(99,221,255,.45); }
.variant-box { flex:1; padding:10px 16px; }
.variant-box.beginner { background:#0d2145; border-right:1px solid rgba(99,221,255,.45); }
[data-lang="ar"] .variant-box.beginner { border-right:none; border-left:1px solid rgba(99,221,255,.45); }
.variant-box.advanced { background:#0d2145; }
.v-label { display:block; font-size:10.5px; font-weight:700; margin-bottom:4px; text-transform:uppercase; letter-spacing:.4px; }
.variant-box.beginner .v-label { color:#5be39a; }
.variant-box.advanced .v-label { color:#ff8f8f; }
.variant-box p { margin:0; font-size:12.5px; line-height:1.5; }
.variant-box.beginner p { color:#5be39a; }
.variant-box.advanced p { color:#ff8f8f; }

/* EXPECT ROW */
.expect-row { display:flex; border-top:1px solid rgba(99,221,255,.45); }
.expect-box { flex:1; padding:10px 16px; }
.expect-box.good { background:#0c1228; border-right:1px solid rgba(99,221,255,.45); }
[data-lang="ar"] .expect-box.good { border-right:none; border-left:1px solid rgba(99,221,255,.45); }
.expect-box.bad { background:#0c1228; }
.e-label { display:block; font-size:10.5px; font-weight:700; margin-bottom:6px; text-transform:uppercase; letter-spacing:.4px; }
.expect-box.good .e-label { color:#5be39a; }
.expect-box.bad .e-label { color:#ff8f8f; }
.expect-box ul { margin:0; padding:0 0 0 16px; }
[data-lang="ar"] .expect-box ul { padding:0 16px 0 0; }
.expect-box.good ul { color:#5be39a; }
.expect-box.bad ul { color:#ff8f8f; }
.expect-box li { font-size:12.5px; line-height:1.55; margin-bottom:2px; }

/* SEARCH */
.empty-search { text-align:center; padding:60px 20px; color:#e9efff; }
.es-icon { font-size:40px; margin-bottom:12px; }

/* SCROLLBAR */
::-webkit-scrollbar { width:6px; height:6px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:#0d2145; border-radius:3px; }


/* قيم style المضمّنة سابقًا (منقولة لأن CSP تمنع style داخل الصفحة) */
[data-s="1"] { cursor:pointer; }
[data-s="2"] { padding:14px 18px; }
[data-s="3"] { font-size:11.5px;color:#e9efff;margin-bottom:4px; }
[data-s="4"] { font-weight:800;font-size:15px;color:#63ddff; }


/* مسار النسخ الاحتياطي: بدل style المضمّن */
.cp-fb { position: fixed; opacity: 0; }
