

: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;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: #0d2145;
    color: #63ddff;
    font-family:"IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
    direction: rtl;
    scroll-behavior: smooth;
}

/* ============ Topbar ============ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(120deg, #0d2145 0%, #0d2145 60%, #2f6df0 130%);
    color: #fff;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 2px 16px rgba(75,58,110,0.25);
}
.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.topbar-brand .logo-mark {
    width: 42px; height: 42px;
    border-radius: 10px;
    background: #0c1228;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 4px;
    overflow: hidden;
}
.topbar-brand .logo-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.topbar-brand .titles { line-height: 1.25; }
.topbar-brand .t-main { font-weight: 800; font-size: 14.5px; }
.topbar-brand .t-sub { font-size: 11px; opacity: .8; }

.topbar-search {
    flex: 1;
    max-width: 420px;
    position: relative;
}
.topbar-search input {
    width: 100%;
    padding: 9px 14px 9px 36px;
    border-radius: 999px;
    border: none;
    background: rgba(255,255,255,0.14);
    color: #fff;
    font-family:"IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 13.5px;
    outline: none;
    transition: background .2s;
}
.topbar-search input::placeholder { color: rgba(255,255,255,0.65); }
.topbar-search input:focus { background: rgba(255,255,255,0.22); }
.topbar-search .icon {
    position: absolute;
    left: 12px; top: 50%;
    transform: translateY(-50%);
    opacity: .7;
    font-size: 14px;
    pointer-events: none;
}

.menu-toggle {
    display: none;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    border-radius: 8px;
    width: 38px; height: 38px;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.home-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    border-radius: 999px;
    padding: 8px 16px;
    font-family:"IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s;
    white-space: nowrap;
}
.home-btn:hover { background: rgba(255,255,255,0.28); }
.home-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.home-btn .hb-text { display: inline; }

@media (max-width: 880px) {
    .home-btn { padding: 8px 10px; }
    .home-btn .hb-text { display: none; }
}

/* ============ Layout ============ */
.layout {
    display: flex;
    max-width: 1280px;
    margin: 0 auto;
    align-items: flex-start;
}

/* ============ Sidebar ============ */
.sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 66px;
    height: calc(100vh - 66px);
    overflow-y: auto;
    padding: 18px 14px 40px 14px;
    border-left: 1px solid rgba(99,221,255,.45);
    background: #0c1228;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #171446; border-radius: 4px; }

.sb-stats {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}
.sb-stat {
    flex: 1;
    background: #0d2145;
    border-radius: 10px;
    text-align: center;
    padding: 8px 4px;
}
.sb-stat b { display: block; color: #63ddff; font-size: 17px; }
.sb-stat span { font-size: 9.5px; color: #e9efff; }

.sb-section-group { margin-bottom: 6px; }
.sb-section-btn {
    width: 100%;
    text-align: right;
    background: none;
    border: none;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family:"IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 13.5px;
    font-weight: 700;
    color: #63ddff;
    transition: background .15s;
}
.sb-section-btn:hover { background: #0d2145; }
.sb-section-btn.active { background: #0d2145; color: #fff; }
.sb-section-btn .sb-num {
    font-size: 10.5px;
    font-weight: 800;
    opacity: .65;
    margin-left: 6px;
}
.sb-section-btn .sb-count {
    font-size: 10px;
    font-weight: 600;
    background: rgba(0,0,0,0.06);
    border-radius: 999px;
    padding: 2px 8px;
}
.sb-section-btn.active .sb-count { background: rgba(255,255,255,0.22); }
.sb-section-btn.golden { color: #f2c14e; }
.sb-section-btn.golden.active { background: linear-gradient(90deg, #c28a1a, #c28a1a); color: #fff; }

.sb-cmd-list {
    list-style: none;
    margin: 2px 0 10px 0;
    padding: 0 6px;
    display: none;
}
.sb-cmd-list.open { display: block; }
.sb-cmd-list li a {
    display: block;
    padding: 6px 10px;
    font-size: 12px;
    color: #e9efff;
    text-decoration: none;
    border-radius: 8px;
    transition: background .15s, color .15s;
}
.sb-cmd-list li a:hover { background: #0d2145; color: #63ddff; }
.sb-cmd-list li a.active { background: #2f6df0; color: #fff; font-weight: 700; }

/* ============ Main content ============ */
.main {
    flex: 1;
    min-width: 0;
    padding: 26px 28px 80px 28px;
}

/* ============ Copyright footer ============ */
.copyright-footer {
    margin-top: 32px;
    padding: 18px 28px 28px 28px;
    border-top: 1px solid rgba(99,221,255,.45);
    text-align: center;
    font-size: 11.5px;
    color: #e9efff;
    line-height: 1.8;
}
.copyright-footer strong { color: #63ddff; font-weight: 700; }

.section-head {
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 2px solid rgba(99,221,255,.45);
}
.section-head .eyebrow {
    color: #63ddff;
    font-weight: 700;
    font-size: 12.5px;
    margin-bottom: 4px;
}
.section-head h1 {
    font-size: 26px;
    margin: 0 0 6px 0;
    color: #63ddff;
}
.section-head p {
    color: #e9efff;
    font-size: 14px;
    margin: 0;
    max-width: 720px;
    line-height: 1.7;
}
.section-head.golden h1 { color: #f2c14e; }
.section-head.golden .eyebrow { color: #f2c14e; }

/* ============ Command card ============ */
.cmd-card {
    background: #0c1228;
    border: 1px solid rgba(99,221,255,.45);
    border-radius: var(--radius);
    margin-bottom: 22px;
    overflow: hidden;
    scroll-margin-top: 80px;
    box-shadow: 0 1px 3px rgba(35,34,51,0.04);
}
.cmd-card.golden { border: 1.5px solid #222c55; }

.cmd-head {
    background: #0d2145;
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.cmd-card.golden .cmd-head { background: linear-gradient(90deg, #c28a1a, #c28a1a); }
.cmd-head h3 { margin: 0; font-size: 16.5px; font-weight: 800; }
.cmd-head .badge {
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    font-size: 13px;
    flex-shrink: 0;
}

.cmd-body { padding: 18px; }
.cmd-card.golden .cmd-body { background: #0d2145; }

.meta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}
.meta-box {
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 13px;
    line-height: 1.65;
}
.meta-box.when { background: #0d2145; }
.meta-box.why { background: #0d2145; }
.meta-box .m-label {
    display: block;
    font-weight: 800;
    font-size: 12.5px;
    margin-bottom: 4px;
}
.meta-box.when .m-label { color: #63ddff; }
.meta-box.why .m-label { color: #63ddff; }

.prompt-section { margin-bottom: 14px; }
.prompt-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.prompt-label-row .pl-text {
    font-weight: 800;
    color: #63ddff;
    font-size: 13.5px;
}
.copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #2f6df0;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    font-family:"IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
    transition: background .15s, transform .1s;
}
.copy-btn:hover { background: #2f6df0; }
.copy-btn:active { transform: scale(0.96); }
.copy-btn.copied { background: #2f6df0; }
.copy-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

.prompt-box {
    background: #0d2145;
    border: 1px solid #222c55;
    border-radius: 10px;
    padding: 16px 18px;
    font-size: 13px;
    line-height: 1.85;
    white-space: pre-wrap;
    color: #63ddff;
    font-family:"IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.variants-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}
.variant-box {
    border-radius: 10px;
    padding: 10px 13px;
    font-size: 12.5px;
    line-height: 1.6;
}
.variant-box.beginner { background: #0c1228; }
.variant-box.advanced { background: #0d2145; }
.variant-box .v-label {
    display: block;
    font-weight: 800;
    font-size: 12px;
    margin-bottom: 3px;
}
.variant-box.beginner .v-label { color: #63ddff; }
.variant-box.advanced .v-label { color: #63ddff; }

.expect-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.expect-box {
    border-radius: 10px;
    padding: 12px 14px;
}
.expect-box.good { background: #0d2145; }
.expect-box.bad { background: #0d2145; }
.expect-box .e-label {
    display: block;
    font-weight: 800;
    font-size: 12.5px;
    margin-bottom: 6px;
}
.expect-box.good .e-label { color: #5be39a; }
.expect-box.bad .e-label { color: #ff8f8f; }
.expect-box ul { margin: 0; padding-right: 18px; font-size: 12.5px; line-height: 1.7; }
.expect-box.good li { color: #5be39a; }
.expect-box.bad li { color: #ff8f8f; }

/* ============ Quick ref page ============ */
.qref-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
.qref-card {
    background: #0c1228;
    border: 1px solid rgba(99,221,255,.45);
    border-radius: var(--radius);
    overflow: hidden;
}
.qref-card .qc-head {
    background: #0d2145;
    color: #fff;
    padding: 10px 16px;
    font-weight: 800;
    font-size: 14px;
}
.qref-card .qc-body { padding: 14px 18px; }
.qref-card ul { margin: 0; padding-right: 18px; font-size: 13.5px; line-height: 2; }
.nimr-banner {
    background: #0d2145;
    border-right: 4px solid rgba(99,221,255,.45);
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 13.5px;
    margin-bottom: 20px;
    line-height: 1.7;
}
.qref-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.qref-table th {
    background: #0d2145;
    color: #fff;
    padding: 9px 14px;
    text-align: right;
}
.qref-table td { padding: 9px 14px; border-bottom: 1px solid #222c55; }
.qref-table tr:nth-child(even) { background: #0c1228; }

/* ============ Welcome / intro ============ */
.intro-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}
.intro-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #0c1228;
    border: 1.5px solid rgba(99,221,255,.45);
    border-radius: 999px;
    padding: 9px 16px;
    font-family:"IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #63ddff;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.intro-tab:hover { background: #0d2145; border-color: rgba(99,221,255,.45); }
.intro-tab .it-num {
    background: #0d2145;
    color: #63ddff;
    border-radius: 50%;
    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 {
    font-size: 10.5px;
    font-weight: 600;
    color: #e9efff;
}
.intro-tab.golden {
    border-color: #222c55;
    color: #f2c14e;
}
.intro-tab.golden .it-num {
    background: #0d2145;
    color: #f2c14e;
}
.intro-tab.golden:hover { background: #0d2145; }
.intro-hero {
    background: linear-gradient(135deg, #0d2145 0%, #0d2145 55%, #2f6df0 130%);
    color: #fff;
    border-radius: 18px;
    padding: 34px 32px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.intro-hero h1 { font-size: 26px; margin: 0 0 8px 0; }
.intro-hero p { opacity: .9; font-size: 14px; max-width: 600px; line-height: 1.8; margin: 0 0 18px 0; }
.intro-stats { display: flex; gap: 22px; }
.intro-stats .is-item b { display: block; font-size: 24px; color: #f0d98c; }
.intro-stats .is-item span { font-size: 11.5px; opacity: .85; }
.howto-steps {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 22px;
}
.howto-step {
    background: #0c1228;
    border: 1px solid rgba(99,221,255,.45);
    border-radius: 12px;
    padding: 14px 12px;
    text-align: center;
}
.howto-step .hs-num {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: #0d2145;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    font-size: 12.5px;
    margin: 0 auto 8px auto;
}
.howto-step strong { display: block; font-size: 12.5px; margin-bottom: 3px; }
.howto-step span { font-size: 11px; color: #e9efff; line-height: 1.5; }
.howto-note {
    background: #0d2145;
    border-right: 4px solid #222c55;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 13px;
    margin-bottom: 24px;
}

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

.hl { background: #2a2010; border-radius: 3px; padding: 0 2px; }

/* ============ Mobile ============ */
@media (max-width: 880px) {
    .menu-toggle { display: block; }
    .topbar { flex-wrap: wrap; }
    .topbar-search { order: 5; flex: 1 1 100%; max-width: none; }
    .layout { display: block; }
    .sidebar {
        position: fixed;
        top: 0; right: -100%;
        width: 82%;
        max-width: 320px;
        height: 100vh;
        z-index: 100;
        transition: right .25s ease;
        padding-top: 70px;
        box-shadow: 6px 0 24px rgba(0,0,0,0.2);
    }
    .sidebar.open { right: 0; }
    .sidebar-overlay {
        display: none;
        position: fixed; inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 90;
    }
    .sidebar-overlay.open { display: block; }
    .main { padding: 18px 14px 60px 14px; }
    .meta-row, .variants-row, .expect-row, .qref-grid, .howto-steps {
        grid-template-columns: 1fr;
    }
    .intro-stats { flex-wrap: wrap; gap: 14px; }
    .section-head h1 { font-size: 21px; }
    .cmd-head h3 { font-size: 14.5px; }
}



/* قيم style المضمّنة سابقًا (منقولة لأن CSP تمنع style داخل الصفحة) */
[data-s="1"] { font-size:12px; font-weight:500; opacity:.85; }
[data-s="2"] { background: #0d2145; border-right-color: rgba(99,221,255,.45); }
[data-s="3"] { margin-bottom: 24px; }
[data-s="4"] { margin-bottom:24px; }
[data-s="5"] { padding:0; }
[data-s="6"] { cursor:pointer; }
[data-s="7"] { padding:14px 18px; }
[data-s="8"] { font-size:11.5px; color:#e9efff; margin-bottom:4px; }
[data-s="9"] { font-weight:800; font-size:15px; color:#63ddff; }


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