/* قدراتك — خريطة فروع الدورة (course-branches.js) */
.cb-summary { background: linear-gradient(135deg, #0F6E56, #185FA5); color: #fff; border-radius: 12px; padding: 14px 16px; margin: 0 0 14px; }
.cb-summary-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 15px; }
.cb-pct { font-size: 26px; font-weight: 800; line-height: 1; }
.cb-bar { height: 8px; background: #E6EAF1; border-radius: 6px; overflow: hidden; flex: 1; min-width: 80px; }
.cb-bar i { display: block; height: 100%; width: 0; background: var(--teal, #0F6E56); border-radius: 6px; transition: width .4s ease; }
.cb-bar-lg { height: 12px; background: rgba(255,255,255,.25); margin: 10px 0 8px; }
.cb-bar-lg i { background: #FFD27A; }
.cb-sub { font-size: 12.5px; opacity: .92; }
.cb-item { cursor: pointer; align-items: center; padding: 11px 6px !important; border-radius: 10px; transition: background .15s; }
.cb-item:hover, .cb-item:focus-visible { background: #F3F7FA; outline: none; }
.cb-item.cb-current { background: #E7F4F0; }
.cb-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.cb-meta { display: flex; align-items: center; gap: 10px; }
.cb-status { font-size: 14px; color: #1D6B47; font-weight: 800; min-width: 18px; text-align: center; }
.cb-item.cb-done .branch-num { background: #2E9E6B; }
.cb-item.cb-done .cb-bar i { background: #2E9E6B; }
.cb-item.cb-done .cb-status { color: #1D6B47; font-weight: 700; }
.cb-item.cb-started .branch-num { background: #185FA5; }
.cb-chev { font-size: 22px; color: #9AA8BC; margin-inline-start: 6px; line-height: 1; }
.cb-hidden { display: none !important; }
.cb-nav, .cb-foot { display: none; }
.cb-nav.cb-on { display: flex; align-items: center; margin: 0 0 10px; }
.cb-nav-title, .cb-nav-pos { display: none !important; }
.cb-foot.cb-on { display: flex; justify-content: space-between; gap: 10px; margin-top: 4px; }
.cb-back, .cb-prev, .cb-next { font-family: inherit; font-weight: 700; font-size: 13.5px; padding: 8px 14px; border-radius: 9px; border: 1.5px solid var(--border, #DCE3EE); background: #fff; color: var(--ink, #16233F); cursor: pointer; }
.cb-next { background: var(--teal, #0F6E56); color: #fff; border-color: var(--teal, #0F6E56); }
.cb-prev:disabled, .cb-next:disabled { opacity: .45; cursor: default; }
.cb-nav-title { font-weight: 800; font-size: 15px; flex: 1; }
.cb-nav-pos { font-size: 12.5px; color: var(--ink-soft, #5C6B85); }
.cb-hint { color: var(--ink-soft, #5C6B85); font-size: 14px; margin: 4px 0 0; }
@media (max-width: 640px) { .cb-status { white-space: normal; } .cb-pct { font-size: 22px; } }
.cb-focus .cb-nav.cb-on .cb-nav-title::before { content: "الفرع المفتوح: "; font-weight: 500; color: var(--ink-soft, #5C6B85); }
.cb-focus header.path-header > p, .cb-focus header.path-header > div:not(.cb-nav):not(.cb-share) { display: none !important; }   /* زر «كل الفروع» يبقى ظاهرًا */   /* وصف الدورة وسطر الاشتراك */
.cb-train { margin-top: 14px; }
.cb-all { margin-top: 14px; padding: 12px 14px; border: 1.5px dashed var(--border, #DCE3EE); border-radius: 12px; background: #FBFCFE; }
.cb-all-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.cb-all-sub { font-size: 13px; color: var(--ink-soft, #5C6B85); margin-top: 3px; }
.cb-all-prog { font-size: 13px; color: #1D6B47; font-weight: 700; white-space: nowrap; }
.cb-all-btn { width: 100%; }

/* التحقق من فهم الدرس */
.cb-check { margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: #FFF8E8; border: 1.5px solid #F2D58A; }
.cb-check-head { font-weight: 800; font-size: 16px; margin-bottom: 4px; }
.cb-check-sub { font-size: 13.5px; color: var(--ink-soft, #5C6B85); margin: 0 0 10px; }
.cb-check-btn { width: 100%; }
.cb-check-ok { display: none; color: #1D6B47; font-weight: 700; font-size: 14px; }
.cb-check.cb-passed { background: #EAF6F0; border-color: #BFE3CF; }
.cb-check.cb-passed .cb-check-btn, .cb-check.cb-passed .cb-check-sub { display: none; }
.cb-check.cb-passed .cb-check-ok { display: block; }
.cb-check.cb-pulse { box-shadow: 0 0 0 4px rgba(242, 213, 138, .7); transition: box-shadow .3s; }
.cb-modal { position: fixed; inset: 0; background: rgba(22, 35, 63, .55); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.cb-modal.cb-on { display: flex; }
.cb-modal-open { overflow: hidden; }
.cb-modal-box { background: #fff; border-radius: 16px; max-width: 560px; width: 100%; max-height: 90vh; overflow: auto; padding: 18px 20px 20px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.cb-modal-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 15px; }
.cb-timer { font-weight: 800; font-size: 15px; color: #185FA5; background: #EAF1FA; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.cb-timer.cb-timer-low { color: #B3261E; background: #FBE9E7; }
.cb-q { font-size: 20px; font-weight: 800; text-align: center; padding: 14px 10px; background: #F6F8FB; border-radius: 12px; margin-bottom: 12px; }
.cb-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cb-opt { font-family: inherit; font-size: 15px; font-weight: 700; text-align: start; padding: 12px 12px; border-radius: 10px; border: 1.5px solid var(--border, #DCE3EE); background: #fff; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.cb-opt span { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; border-radius: 50%; background: #EEF2F7; font-size: 13px; flex: none; }
.cb-opt:hover:not(:disabled) { border-color: #185FA5; background: #F3F7FC; }
.cb-opt:disabled { cursor: default; opacity: .85; }
.cb-opt.cb-right { border-color: #2E9E6B; background: #EAF6F0; }
.cb-opt.cb-wrong { border-color: #B3261E; background: #FBE9E7; }
.cb-verdict { margin-top: 14px; padding: 12px 14px; border-radius: 12px; font-size: 14.5px; }
.cb-verdict p { margin: 6px 0; }
.cb-verdict.ok { background: #EAF6F0; border: 1.5px solid #BFE3CF; }
.cb-verdict.bad { background: #FFF4F2; border: 1.5px solid #F3C9C4; }
.cb-verdict .ls-go { margin-top: 8px; }
.cb-fail { font-weight: 700; color: #8A1C15; }
.cb-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
@media (max-width: 520px) { .cb-opts { grid-template-columns: 1fr; } .cb-q { font-size: 18px; } }
.cb-timer:empty { display: none; }
.cb-passage { margin-bottom: 12px; max-height: 38vh; overflow: auto; }
.cb-modal-box.cb-wide { max-width: 760px; }
.cb-q[dir="auto"], .cb-opt[dir="auto"] { unicode-bidi: plaintext; }
@media (max-width: 640px) { header.path-header h1 { font-size: 23px; margin-bottom: 6px; } }

/* فهرس الفروع كبطاقات (25 أكتوبر): صورة مصغّرة + الاسم + سطر تعريفي + شريط التقدّم */
.cb-card { display: flex !important; gap: 14px; align-items: center; padding: 10px 8px 10px 6px !important; border: 1px solid var(--border, #DCE3EE); border-radius: 14px; margin: 0 0 10px; background: var(--paper, #fff); }
.cb-card:hover { background: #F7FAFC; border-color: #C9D5E3; }
.cb-card .branch-num { position: static; margin: 0; flex: none; }
.cb-thumb { position: relative; flex: 0 0 168px; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: #122244 center/cover no-repeat; color: #fff; }
.cb-thumb-tpl { background: radial-gradient(120% 90% at 85% 10%, #27477A 0%, #152A50 45%, #0E1C3A 100%); }
.cb-thumb-tpl .cb-thumb-ttl { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 8px 10px; text-align: center; font-size: 13px; font-weight: 800; line-height: 1.4; text-shadow: 0 2px 8px rgba(0,0,0,.4); }
.cb-thumb-img .cb-thumb-ttl { display: none; }
.cb-thumb-img::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.35), rgba(0,0,0,0) 50%); }
.cb-play { position: absolute; left: 6px; bottom: 6px; width: 26px; height: 26px; border-radius: 50%; background: var(--gold, #F2A93C); color: #241B0A; display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 10px rgba(0,0,0,.35); }
.cb-dur { position: absolute; left: 38px; bottom: 9px; background: rgba(0,0,0,.72); color: #fff; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 5px; direction: ltr; }
.cb-card .cb-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cb-title { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15.5px; }
.cb-sum { font-size: 13px; color: var(--ink-soft, #5C6B85); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cb-card .cb-meta { margin-top: 2px; }
.cb-card .cb-chev { flex: none; }
@media (max-width: 640px) { .cb-card { gap: 10px; } .cb-thumb { flex-basis: 112px; } .cb-title { font-size: 14px; } .cb-sum { font-size: 12px; -webkit-line-clamp: 2; } .cb-thumb-tpl .cb-thumb-ttl { font-size: 11px; } .cb-dur { display: none; } }
/* أسئلة STEP في «تحقق من فهمك»: إنجليزية من اليسار إلى اليمين */
.cb-q.cb-en { direction: ltr; text-align: left; font-family: "Inter", "Segoe UI", Arial, sans-serif; }
.cb-opts.cb-en { direction: ltr; }
.cb-opts.cb-en .cb-opt { direction: ltr; text-align: left; font-family: "Inter", "Segoe UI", Arial, sans-serif; }

/* مشاركة الدورة / الدرس (2026-10-31) */
.cb-share { position: relative; display: flex; align-items: center; gap: 8px; margin: 6px 0 4px; }
.cb-share-btn { display: inline-flex; align-items: center; gap: 7px; font-family: inherit; font-weight: 700; font-size: 13px; padding: 7px 13px; border-radius: 999px; border: 1.5px solid var(--border, #DCE3EE); background: #fff; color: var(--ink, #16233F); cursor: pointer; }
.cb-share-btn:hover { border-color: var(--teal, #0F6E56); color: var(--teal, #0F6E56); }
.cb-share-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 50; background: #fff; border: 1px solid var(--border, #DCE3EE); border-radius: 14px; padding: 8px; box-shadow: 0 14px 36px rgba(22,35,63,.14); display: flex; flex-direction: column; gap: 4px; min-width: 210px; }
.cb-share-menu[hidden] { display: none !important; }
.cb-share-menu button { font-family: inherit; font-size: 14px; font-weight: 700; text-align: right; padding: 9px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--ink, #16233F); cursor: pointer; }
.cb-share-menu button:hover { background: #F3F7FA; }
.cb-share-note { font-size: 11.5px; color: var(--ink-soft, #5C6B85); padding: 4px 12px 2px; }
.cb-focus header.path-header > div.cb-share { display: flex !important; }
