:root{
    --navy:#0a2036;
    --navy-2:#153b60;
    --navy-3:#1f5480;
    --teal:#0f7a8c;
    --teal-2:#1ca0b5;
    --teal-light:#e9f5f6;
    --amber:#b8792a;
    --amber-light:#faf1e0;
    --bg:#f6f7f5;
    --card:#ffffff;
    --text:#16232f;
    --muted:#5c7185;
    --border:#e3e8ec;
    --danger:#c1453d;
    --danger-dark:#9c342e;
    --good:#12905f;
    --good-light:#e5f6ee;
    --radius-sm:10px;
    --radius:16px;
    --radius-lg:26px;
    --ink:#0a2036;
    --content-width:1180px;
    --shadow-xs:0 1px 3px rgba(10,32,54,.06);
    --shadow-sm:0 4px 14px rgba(10,32,54,.07);
    --shadow-md:0 14px 34px rgba(10,32,54,.12);
    --shadow-lg:0 28px 64px rgba(10,32,54,.18);
    --ease:cubic-bezier(.22,.9,.32,1);
  }
  body.dark{
    --bg:#0a121c;
    --card:#101d2c;
    --text:#dfe8ef;
    --muted:#8ea1b3;
    --border:#213244;
    --navy:#2f5b82;
    --navy-2:#3a6890;
    --navy-3:#4a7aa2;
    --ink:#eef5fb;
    --teal-light:#102e33;
    --amber-light:#2a2013;
    --shadow-xs:0 1px 3px rgba(0,0,0,.35);
    --shadow-sm:0 4px 14px rgba(0,0,0,.35);
    --shadow-md:0 14px 34px rgba(0,0,0,.45);
    --shadow-lg:0 28px 64px rgba(0,0,0,.55);
  }
  body.dark header{ background:rgba(11,20,31,0.92); }
  body.dark .stats-strip, body.dark .chip, body.dark .empty-state,
  body.dark .lecture-row, body.dark .course-side-card, body.dark .q-card, body.dark .q-opt, body.dark .card-panel, body.dark .modal-box,
  body.dark .uni-card, body.dark .mission-card, body.dark .contact-info-card, body.dark .wizard-dot,
  body.dark .wizard-card, body.dark .option-card, body.dark .count-chip, body.dark .bank-select,
  body.dark nav.links, body.dark .message-card{ background:var(--card); }
  body.dark .field input, body.dark .field select, body.dark .field textarea{ background:#0c1723; color:var(--text); border-color:var(--border); }
  body.dark .link-row input{ background:#0c1723; color:var(--text); border-color:var(--border); }
  body.dark .course-hero-banner .chip{ background:rgba(255,255,255,0.15); border-color:rgba(255,255,255,0.35); color:#fff; }
  body.dark .field input:focus, body.dark .field select:focus, body.dark .field textarea:focus{ background:#0c1723; }
  body.dark .hero .btn.solid{ background:#132030; color:#eef5fb; }
  body.dark .hero .btn:hover{ background:#132030; color:#eef5fb; }
  .icon-toggle{ display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; border-radius:50%; border:1.5px solid var(--border); background:transparent; font-size:15px; color:var(--navy-2); flex-shrink:0; transition:.2s; }
  .icon-toggle:hover{ background:var(--teal-light); border-color:var(--teal); }
  .notif-wrap{ position:relative; flex-shrink:0; }
  .notif-badge{ position:absolute; top:-2px; left:-2px; width:9px; height:9px; border-radius:50%; background:var(--danger); border:1.5px solid var(--card); }
  .notif-panel{ position:absolute; top:calc(100% + 10px); left:0; width:290px; max-width:86vw; background:var(--card); border:1px solid var(--border); border-radius:14px; box-shadow:0 14px 34px rgba(15,39,69,0.16); padding:8px; z-index:200; opacity:0; visibility:hidden; transform:translateY(-6px); transition:.18s; }
  .notif-panel.open{ opacity:1; visibility:visible; transform:translateY(0); }
  .notif-panel-title{ font-size:13px; font-weight:800; color:var(--muted); padding:8px 10px 6px; }
  .notif-item{ display:flex; align-items:flex-start; gap:10px; width:100%; text-align:right; background:transparent; border:none; border-radius:10px; padding:10px; cursor:pointer; font-family:inherit; transition:.15s; }
  .notif-item:hover{ background:var(--teal-light); }
  .notif-item-icon{ width:34px; height:34px; border-radius:50%; background:var(--teal-light); display:flex; align-items:center; justify-content:center; font-size:16px; flex-shrink:0; }
  .notif-item-text{ display:flex; flex-direction:column; gap:2px; }
  .notif-item-title{ font-size:14px; font-weight:700; color:var(--ink); }
  .notif-item-desc{ font-size:12px; color:var(--muted); }
  @media (max-width:640px){ .notif-panel{ left:0; right:auto; max-width:calc(100vw - 24px); } }
  .content-edit-btn{ display:inline-flex; align-items:center; justify-content:center; width:24px; height:24px; border-radius:50%; border:1px dashed var(--teal); background:var(--teal-light); color:var(--teal); font-size:12px; margin-inline-start:8px; vertical-align:middle; padding:0; }
  .content-edit-btn:hover{ background:var(--teal); color:#fff; }
  /* ===== هلامة مائية متحركة (اسم الطالب + رقم الهاتف): وحدة بالمنتصف واثنتان بالأطراف + حماية بنك الأسئلة من النسخ ===== */
  body.copy-protected .wizard-card,
  body.copy-protected .q-card{
    position:relative; overflow:hidden;
  }
  .wm-wrap{ position:absolute; inset:0; z-index:0; pointer-events:none; overflow:hidden; }
  .wm-item{
    position:absolute; white-space:nowrap; direction:ltr;
    font-weight:800; color:rgba(15,39,69,0.028);
  }
  body.dark .wm-item{ color:rgba(255,255,255,0.032); }
  .wm-item.wm-center{ top:50%; left:50%; font-size:26px; animation:wmDriftCenter 24s ease-in-out infinite; }
  .wm-item.wm-top{ top:8%; left:10%; font-size:16px; animation:wmDriftCorner 20s ease-in-out infinite; }
  .wm-item.wm-bottom{ bottom:8%; right:10%; font-size:16px; animation:wmDriftCorner 26s ease-in-out infinite reverse; }
  @keyframes wmDriftCenter{
    0%{ transform:translate(-50%,-50%) rotate(-24deg); }
    25%{ transform:translate(calc(-50% + 18px),calc(-50% + 10px)) rotate(-24deg); }
    50%{ transform:translate(calc(-50% - 8px),calc(-50% + 20px)) rotate(-24deg); }
    75%{ transform:translate(calc(-50% - 18px),calc(-50% - 10px)) rotate(-24deg); }
    100%{ transform:translate(-50%,-50%) rotate(-24deg); }
  }
  @keyframes wmDriftCorner{
    0%{ transform:rotate(-24deg) translate(0,0); }
    25%{ transform:rotate(-24deg) translate(10px,6px); }
    50%{ transform:rotate(-24deg) translate(-4px,12px); }
    75%{ transform:rotate(-24deg) translate(-10px,-6px); }
    100%{ transform:rotate(-24deg) translate(0,0); }
  }
  body.copy-protected #app{ user-select:none !important; -webkit-user-select:none !important; -moz-user-select:none !important; }
  body.copy-protected #app img{ pointer-events:none; -webkit-user-drag:none; }

  *{box-sizing:border-box; margin:0; padding:0;}
  html{scroll-behavior:smooth;}
  @media (prefers-reduced-motion:reduce){
    html{scroll-behavior:auto;}
    *, *::before, *::after{animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; scroll-behavior:auto !important;}
  }
  body{
    font-family:'Cairo', sans-serif;
    background:var(--bg);
    background-image:radial-gradient(circle at 100% 0%, rgba(15,122,140,.05), transparent 40%), radial-gradient(circle at 0% 100%, rgba(10,32,54,.04), transparent 40%);
    background-attachment:fixed;
    color:var(--text);
    line-height:1.7;
    min-height:100vh;
    display:flex;
    flex-direction:column;
    -webkit-font-smoothing:antialiased;
    text-rendering:optimizeLegibility;
  }
  a{color:inherit; text-decoration:none;}
  button{font-family:inherit; cursor:pointer;}
  ::selection{background:var(--teal-light); color:var(--ink);}
  ::-webkit-scrollbar{ width:11px; height:11px; }
  ::-webkit-scrollbar-track{ background:transparent; }
  ::-webkit-scrollbar-thumb{ background:var(--border); border-radius:999px; border:3px solid var(--bg); }
  ::-webkit-scrollbar-thumb:hover{ background:var(--teal-2); }
  body.dark ::-webkit-scrollbar-thumb{ border-color:var(--bg); }

  .steth-divider{ display:flex; align-items:center; justify-content:center; gap:10px; margin:0 auto; width:100%; max-width:340px; }
  .steth-divider svg{ width:100%; height:22px; }

  header{ position:sticky; top:0; z-index:100; background:rgba(255,255,255,0.82); backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%); border-bottom:1px solid var(--border); }
  body.dark header{ background:rgba(10,18,28,0.82); }
  .nav-wrap{
    max-width:var(--content-width); margin:0 auto;
    padding:10px clamp(12px,3vw,24px);
    display:flex; align-items:center; justify-content:space-between;
    flex-wrap:nowrap; gap:clamp(4px,1.2vw,14px);
  }
  .brand{ display:flex; align-items:center; gap:9px; flex-shrink:1; min-width:0; }
  .brand img{ height:38px; width:38px; object-fit:contain; flex-shrink:0; border-radius:9px; }
  .brand .wordmark{ font-family:'Playfair Display', serif; direction:ltr; font-weight:800; font-size:22px; letter-spacing:1px; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .brand .wordmark span{ color:var(--teal); }

  nav.links{ display:flex; align-items:center; gap:2px; flex-wrap:nowrap; overflow-x:auto; -ms-overflow-style:none; scrollbar-width:none; }
  nav.links::-webkit-scrollbar{ display:none; }
  nav.links a, nav.links button.navlink{ position:relative; background:none; border:none; padding:9px 14px; border-radius:999px; font-size:14px; font-weight:600; color:var(--navy-2); transition:background .2s var(--ease), color .2s var(--ease); white-space:nowrap; }
  nav.links a:hover, nav.links button.navlink:hover{ background:var(--teal-light); color:var(--teal); }
  nav.links a.active, nav.links button.navlink.active{ background:var(--navy); color:#fff; box-shadow:var(--shadow-xs); }

  /* Groups the app/theme icons + user area into one unit so they wrap
     as a block on narrow screens instead of scattering individually */
  .nav-actions{ display:flex; align-items:center; gap:clamp(3px,1vw,6px); flex-shrink:0; }
  .nav-cta{ display:flex; align-items:center; gap:6px; flex-shrink:1; min-width:0; }
  .btn{ display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:10px 19px; border-radius:999px; border:1.5px solid var(--navy); font-weight:700; font-size:14px; background:transparent; color:var(--ink); transition:background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease); white-space:nowrap; }
  .btn:hover{ background:var(--navy); color:#fff; transform:translateY(-1px); box-shadow:var(--shadow-sm); }
  .btn:active{ transform:translateY(0); }
  .btn.solid{ background:var(--navy); color:#fff; box-shadow:var(--shadow-xs); }
  .btn.solid:hover{ background:var(--navy-2); }
  .btn.teal{ border-color:var(--teal); color:var(--teal); }
  .btn.teal:hover{ background:var(--teal); color:#fff; }
  .btn.teal.solid{ background:var(--teal); color:#fff; box-shadow:var(--shadow-xs); }
  .btn.teal.solid:hover{ background:var(--teal-2); }
  .btn.danger{ border-color:var(--danger); color:var(--danger); padding:6px 12px; font-size:13px; }
  .btn.danger:hover{ background:var(--danger); color:#fff; }
  .btn.small{ padding:6px 12px; font-size:13px; }
  .btn[disabled]{ opacity:.45; cursor:not-allowed; pointer-events:none; transform:none; box-shadow:none; }
  .user-pill{ font-size:13px; font-weight:700; color:var(--ink); background:var(--teal-light); padding:8px 14px; border-radius:999px; display:flex; align-items:center; gap:8px; max-width:min(40vw,260px); overflow:hidden; }
  .user-pill > span:not(.admin-tag){ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .admin-tag{ background:var(--navy); color:#fff; padding:2px 8px; border-radius:999px; font-size:11px; flex-shrink:0; }

  .mobile-toggle{ display:none; background:none; border:none; font-size:24px; color:var(--ink); flex-shrink:0; padding:0 2px; }

  main{ flex:1; }
  .container{ max-width:var(--content-width); margin:0 auto; padding:0 24px; }
  .section{ padding:clamp(48px,7vw,72px) 24px; }
  .section-head{ text-align:center; max-width:640px; margin:0 auto 40px; }
  .eyebrow{ display:inline-block; font-size:12.5px; font-weight:800; letter-spacing:.5px; color:var(--teal); background:var(--teal-light); padding:6px 14px; border-radius:999px; margin-bottom:14px; }
  .section-head h2{ font-size:clamp(26px,3.4vw,34px); color:var(--ink); font-weight:800; margin-bottom:10px; letter-spacing:-.2px; }
  .section-head p{ color:var(--muted); font-size:16px; }

  .hero{
    background:
      radial-gradient(ellipse 620px 420px at 88% -8%, rgba(139,224,232,.20), transparent 60%),
      radial-gradient(ellipse 500px 500px at 6% 108%, rgba(23,160,181,.22), transparent 55%),
      linear-gradient(165deg, var(--navy) 0%, var(--navy-2) 55%, var(--teal) 135%);
    color:#fff; padding:clamp(56px,9vw,92px) 24px clamp(52px,7vw,74px); position:relative; overflow:hidden;
  }
  .hero::after{ content:""; position:absolute; inset:0; background-image: radial-gradient(circle at 85% 20%, rgba(255,255,255,0.10), transparent 45%); }
  .hero-inner{ max-width:var(--content-width); margin:0 auto; display:grid; grid-template-columns:1.1fr .9fr; gap:50px; align-items:center; position:relative; z-index:2; }
  .hero h1{ font-size:clamp(30px,4.2vw,44px); font-weight:800; line-height:1.32; margin-bottom:18px; letter-spacing:-.3px; animation:heroRise .7s var(--ease) both; }
  .hero h1 em{ font-style:normal; color:#8be0e8; background:linear-gradient(180deg, transparent 62%, rgba(139,224,232,.28) 62%); padding:0 2px; border-radius:4px; }
  .hero p.lead{ font-size:17px; color:#d7e6ee; max-width:520px; margin-bottom:30px; animation:heroRise .7s var(--ease) .08s both; }
  .hero-actions{ display:flex; gap:14px; flex-wrap:wrap; animation:heroRise .7s var(--ease) .16s both; }
  .hero .btn{ border-color:#fff; color:#fff; }
  .hero .btn:hover{ background:#fff; color:var(--ink); }
  .hero .btn.solid{ background:#fff; color:var(--ink); box-shadow:0 10px 26px rgba(0,0,0,.18); }
  .hero .btn.solid:hover{ background:var(--teal-light); }
  @keyframes heroRise{ from{ opacity:0; transform:translateY(14px); } to{ opacity:1; transform:translateY(0); } }

  .hero-card{ background:rgba(255,255,255,0.09); border:1px solid rgba(255,255,255,0.22); border-radius:var(--radius-lg); padding:28px; backdrop-filter:blur(10px); box-shadow:0 24px 60px rgba(0,0,0,.18); animation:heroRise .8s var(--ease) .1s both; }
  .hero-card h3{ font-size:13px; letter-spacing:.5px; color:#bfe4ea; margin-bottom:16px; font-weight:700; }
  .uni-row{ display:flex; align-items:center; gap:12px; padding:12px 0; border-bottom:1px solid rgba(255,255,255,0.15); transition:padding-inline-start .2s var(--ease); }
  .uni-row:hover{ padding-inline-start:4px; }
  .uni-row:last-child{ border-bottom:none; }
  .uni-dot{ width:10px; height:10px; border-radius:50%; background:#8be0e8; flex-shrink:0; box-shadow:0 0 0 4px rgba(139,224,232,.18); }
  .uni-row div span{ display:block; }
  .uni-row .uni-name{ font-weight:700; font-size:14.5px; }
  .uni-row .uni-loc{ font-size:12.5px; color:#b9d3dc; }

  .stats-strip{ display:flex; justify-content:center; flex-wrap:wrap; padding:34px 24px; background:var(--card); border-bottom:1px solid var(--border); }
  .stat{ --stat-gap:clamp(20px,6vw,60px); text-align:center; position:relative; padding-inline-end:var(--stat-gap); }
  .stat:last-child{ padding-inline-end:0; }
  .stat:not(:last-child)::after{ content:""; position:absolute; inset-inline-end:calc(var(--stat-gap) / 2); top:8%; bottom:8%; width:1px; background:var(--border); }
  .stat b{ font-size:30px; color:var(--ink); display:block; font-variant-numeric:tabular-nums; }
  .stat span{ font-size:13.5px; color:var(--muted); }
  @media (max-width:480px){
    .stat{ --stat-gap:14px; }
    .stat b{ font-size:22px; }
    .stat span{ font-size:12px; }
  }

  .grid-3{ display:grid; grid-template-columns:repeat(3,1fr); gap:22px; }
  .feature-card{
    position:relative; overflow:hidden; border-radius:22px; border:1px solid var(--border); padding:0;
    background:var(--card); display:flex; align-items:stretch; transition:transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease); box-shadow:var(--shadow-xs);
  }
  .feature-card::before{ content:none; }
  .feature-card:hover{ transform:translateY(-6px); box-shadow:var(--shadow-md); border-color:transparent; }
  /* one card in the row carries the brand color to break up the identical-tile pattern */
  .grid-3 .feature-card:first-child{ background:linear-gradient(150deg, var(--navy) 0%, var(--navy-2) 60%, var(--teal) 130%); border-color:transparent; }
  .grid-3 .feature-card:first-child .feature-icon{ background:rgba(255,255,255,.14); }
  .grid-3 .feature-card:first-child .feature-icon svg{ stroke:#8be0e8; }
  .grid-3 .feature-card:first-child h3, .grid-3 .feature-card:first-child p{ color:#fff; }
  .grid-3 .feature-card:first-child p{ opacity:.85; }
  .grid-3 .feature-card:first-child .feature-start{ background:rgba(255,255,255,.16); color:#fff; }
  .grid-3 .feature-card:first-child .feature-start:hover{ background:#fff; color:var(--navy); }
  .feature-card-inner{ position:relative; z-index:1; width:100%; padding:32px 28px 28px; display:flex; flex-direction:column; }
  .feature-icon{
    width:50px; height:50px; border-radius:14px; display:flex; align-items:center; justify-content:center;
    margin-bottom:20px; align-self:flex-start; background:var(--teal-light); flex-shrink:0; transition:transform .3s var(--ease);
  }
  .feature-card:hover .feature-icon{ transform:scale(1.08) rotate(-4deg); }
  .feature-icon svg{ width:25px; height:25px; stroke:var(--teal-2); }
  .feature-card h3{ font-size:20px; color:var(--ink); margin-bottom:10px; font-weight:800; text-align:right; }
  .feature-card p{ font-size:14px; color:var(--muted); line-height:1.85; margin-bottom:18px; text-align:right; }
  .feature-start{
    display:inline-flex; align-items:center; gap:8px; background:var(--teal-light); color:var(--teal-2);
    padding:9px 18px; border-radius:999px; font-size:13.5px; font-weight:700; transition:.2s; align-self:flex-start;
    border:1.5px solid transparent;
  }
  .feature-start:hover{ background:var(--teal-2); color:#fff; }
  .feature-start svg{ width:15px; height:15px; }
  body.dark .feature-card{ box-shadow:0 8px 20px rgba(0,0,0,0.35); }

  .toolbar{ display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:22px; flex-wrap:wrap; }
  .toolbar h2{ font-size:28px; color:var(--ink); font-weight:800; }
  .toolbar-actions{ display:flex; gap:10px; flex-wrap:wrap; }
  .filter-row{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:26px; }
  .filter-group{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:10px; }
  .filter-group .filter-row{ margin-bottom:0; }
  .filter-label{ font-weight:800; color:var(--ink); font-size:14.5px; white-space:nowrap; }
  .chip{ padding:7px 16px; border-radius:999px; border:1.5px solid var(--border); font-size:13.5px; font-weight:700; color:var(--muted); background:#fff; }
  .chip.active{ background:var(--navy); border-color:var(--ink); color:#fff; }

  .course-canvas{
    background:linear-gradient(155deg, #142c47 0%, #1c4a63 55%, #1f6478 100%);
    border-radius:28px; padding:30px; margin-bottom:4px; position:relative; overflow:hidden;
  }
  .course-canvas::after{ content:""; position:absolute; inset:0; background-image:radial-gradient(circle at 15% 85%, rgba(255,255,255,0.06), transparent 45%); pointer-events:none; }
  body.dark .course-canvas{ background:linear-gradient(155deg, #060c14 0%, #0b1c26 55%, #0d2830 100%); }
  .course-emblem{ width:52px; height:52px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:24px; margin-bottom:12px; flex-shrink:0;
    background:linear-gradient(135deg, var(--navy), var(--teal)); box-shadow:0 4px 14px rgba(15,39,69,0.25); }
  .course-stats-row{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
  .course-stat-chip{ display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:800; color:var(--ink); background:rgba(255,255,255,0.75); border:1px solid rgba(255,255,255,0.7); padding:5px 10px; border-radius:999px; }
  body.dark .course-stat-chip{ background:rgba(255,255,255,0.1); border-color:rgba(255,255,255,0.18); color:var(--text); }
  .course-grid{ display:grid; grid-template-columns:repeat(3, 1fr); gap:24px; perspective:1400px; }
  .course-pagination{ display:flex; align-items:center; justify-content:center; gap:16px; flex-wrap:wrap; margin-top:26px; }
  .course-pagination-info{ font-size:14px; font-weight:700; color:var(--muted); }
  .course-pagination .btn[disabled]{ opacity:.45; cursor:not-allowed; pointer-events:none; }
  .courses-hero{ background:linear-gradient(150deg, var(--navy) 0%, var(--navy-2) 55%, var(--teal) 130%); color:#fff; border-radius:var(--radius-lg); padding:clamp(36px,5vw,48px) 24px 38px; text-align:center; margin-bottom:26px; position:relative; overflow:hidden; }
  .courses-hero::after{ content:""; position:absolute; inset:0; background-image: radial-gradient(circle at 85% 20%, rgba(255,255,255,0.10), transparent 45%); }
  .courses-hero-inner{ position:relative; z-index:2; }
  .courses-hero h2{ font-size:clamp(24px,3.4vw,31px); font-weight:800; color:#fff; margin-bottom:8px; letter-spacing:-.2px; }
  .courses-hero p{ color:#d7e6ee; font-size:15px; margin-bottom:22px; }
  .courses-coverage-line{ color:#eef5fb; font-size:14px; opacity:0.9; margin:-14px 0 18px; text-align:center; }
  .courses-search{ max-width:440px; margin:0 auto; position:relative; }
  .courses-search input{ width:100%; padding:13px 46px 13px 18px; border-radius:999px; border:none; font-size:14.5px; font-family:inherit; color:var(--ink); background:#fff; }
  .courses-search input:focus{ outline:2px solid #8be0e8; }
  .courses-search .search-icon{ position:absolute; inset-inline-start:18px; top:50%; transform:translateY(-50%); font-size:15px; pointer-events:none; }
  .filter-dropdown-bar{ display:flex; gap:14px; flex-wrap:wrap; margin-bottom:24px; }
  .filter-dropdown{ display:flex; flex-direction:column; gap:6px; min-width:170px; }
  .filter-dropdown label{ font-size:13px; font-weight:800; color:var(--ink); }
  .filter-dropdown select{ padding:10px 14px; border-radius:10px; border:1.5px solid var(--border); background:var(--card); color:var(--text); font-family:inherit; font-size:14px; font-weight:700; }
  .filter-dropdown select:focus{ outline:none; border-color:var(--teal); }
  .course-card{
    position:relative; aspect-ratio:1/1; border-radius:24px; padding:0; overflow:hidden;
    display:flex; flex-direction:column; cursor:pointer;
    background:linear-gradient(160deg, rgba(255,255,255,0.92), rgba(255,255,255,0.72));
    border:1px solid rgba(255,255,255,0.6);
    -webkit-backdrop-filter:blur(18px) saturate(180%); backdrop-filter:blur(18px) saturate(180%);
    box-shadow:0 8px 28px rgba(10,32,54,0.16), inset 0 1px 0 rgba(255,255,255,0.7);
    transform-style:preserve-3d; will-change:transform;
    transition:transform .45s var(--ease), box-shadow .4s ease, background .4s ease, border-color .4s ease;
  }
  .course-card::before{
    content:""; position:absolute; inset:0; z-index:1; pointer-events:none; opacity:0;
    background:radial-gradient(280px circle at var(--mx,50%) var(--my,50%), rgba(255,255,255,0.65), transparent 62%);
    transition:opacity .35s ease;
  }
  .course-card:hover::before{ opacity:1; }
  .course-card:hover{
    box-shadow:0 24px 50px rgba(15,39,69,0.26), 0 0 0 1px rgba(34,152,171,0.4), inset 0 1px 0 rgba(255,255,255,0.8);
    border-color:rgba(34,152,171,0.55);
  }
  body.dark .course-card{
    background:linear-gradient(160deg, rgba(24,40,56,0.92), rgba(16,28,40,0.85));
    border-color:rgba(255,255,255,0.16);
    box-shadow:0 8px 28px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.07);
  }
  body.dark .course-card::before{ background:radial-gradient(280px circle at var(--mx,50%) var(--my,50%), rgba(255,255,255,0.14), transparent 62%); }
  body.dark .course-card:hover{ box-shadow:0 24px 50px rgba(0,0,0,0.5), 0 0 0 1px rgba(34,152,171,0.45); }
  .course-top{ background:linear-gradient(135deg, var(--navy), var(--teal)); height:6px; flex-shrink:0; position:relative; z-index:2; }
  .course-body{ padding:20px; flex:1; display:flex; flex-direction:column; position:relative; z-index:2; min-height:0; overflow:hidden; }
  .course-uni{ font-size:12px; font-weight:800; color:var(--teal); letter-spacing:.5px; margin-bottom:8px; }
  .course-body h3{ font-size:18px; color:var(--ink); font-weight:800; margin-bottom:10px; line-height:1.35; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
  .course-body p{ font-size:13.5px; color:var(--text); font-weight:500; opacity:.85; flex:1; margin-bottom:12px; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
  .course-foot{ display:flex; justify-content:space-between; align-items:center; font-size:12.5px; color:var(--muted); border-top:1px solid var(--border); padding-top:10px; margin-bottom:12px; flex-wrap:wrap; gap:6px; }
  .course-actions{ display:flex; gap:8px; flex-wrap:wrap; margin-top:auto; }
  @media (max-width:680px){
    .course-card{ aspect-ratio:auto; min-height:260px; }
  }

  /* صفحة "دوراتي": قائمة عمودية مرتّبة بدل الشبكة، مع شريط تقدم لكل دورة */
  .my-course-list{ display:flex; flex-direction:column; gap:14px; }
  .my-course-row{ display:flex; align-items:center; gap:20px; background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:18px 22px; transition:.25s; cursor:pointer; }
  .my-course-row:hover{ box-shadow:0 10px 26px rgba(15,39,69,0.1); border-color:var(--teal); }
  .my-course-row .course-emblem{ margin-bottom:0; }
  .my-course-info{ flex:1.4; min-width:0; }
  .my-course-row-top{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:3px; }
  .my-course-row-top h3{ font-size:16.5px; color:var(--ink); font-weight:800; }
  .my-course-progress{ width:220px; flex-shrink:0; }
  .my-course-progress-head{ display:flex; justify-content:space-between; align-items:center; font-size:12.5px; font-weight:800; color:var(--ink); margin-bottom:6px; }
  .my-course-progress-head b{ color:var(--teal); font-size:14px; }
  .my-course-progress-track{ height:8px; background:var(--border); border-radius:999px; overflow:hidden; }
  .my-course-progress-fill{ height:100%; background:linear-gradient(90deg, var(--teal), var(--navy)); border-radius:999px; transition:width .3s; }
  .my-course-progress-sub{ display:block; font-size:11.5px; color:var(--muted); margin-top:5px; }
  .my-course-actions{ flex-shrink:0; }
  @media(max-width:760px){
    .my-course-row{ flex-wrap:wrap; }
    .my-course-progress{ width:100%; order:3; }
    .my-course-actions{ width:100%; order:4; }
    .my-course-actions .btn{ width:100%; justify-content:center; }
  }

  .summary-grid{ display:grid; grid-template-columns:repeat(3, 1fr); gap:20px; }
  /* ===== قالب موحّد لعرض كل الملخصات (يدوية أو AI) بنفس الهوية البصرية ===== */
  .summary-card{ position:relative; background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:22px 20px 20px; display:flex; flex-direction:column; gap:10px; box-shadow:0 3px 14px rgba(15,39,69,.07); overflow:hidden; }
  .summary-card::before{ content:''; position:absolute; inset:0 0 auto 0; height:4px; background:linear-gradient(90deg, var(--teal), var(--navy)); }
  .summary-card-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
  .summary-card-head h4{ display:flex; align-items:center; gap:8px; font-size:16px; color:var(--ink); font-weight:800; line-height:1.4; }
  .summary-brand-mark{ width:24px; height:24px; border-radius:7px; object-fit:contain; background:#fff; border:1px solid var(--border); padding:2px; flex-shrink:0; }
  .summary-card-actions{ display:flex; gap:6px; flex-shrink:0; }
  .summary-card-foot{ display:flex; align-items:center; justify-content:flex-end; gap:6px; margin-top:2px; padding-top:8px; border-top:1px dashed var(--border); font-size:11px; font-weight:700; color:var(--muted); }
  .summary-card-foot img{ width:16px; height:16px; border-radius:4px; object-fit:contain; opacity:.85; }
  .summary-card-body{ font-size:14px; color:var(--text); line-height:1.75; overflow-x:auto; }
  .summary-card-body p{ margin:0 0 10px; }
  .summary-card-body img{ max-width:100%; border-radius:8px; margin:6px 0; display:block; }
  .summary-card-body table{ width:100%; border-collapse:collapse; margin:10px 0; font-size:13px; border-radius:8px; overflow:hidden; }
  .summary-card-body table th{ background:var(--navy); color:#fff; font-weight:700; }
  .summary-card-body table td, .summary-card-body table th{ border:1px solid var(--border); padding:7px 10px; text-align:right; }
  .summary-card-body table tr:nth-child(even) td{ background:var(--teal-light); }
  .summary-card-body ul, .summary-card-body ol{ padding-inline-start:22px; margin:8px 0; }
  .summary-card-body li{ margin-bottom:4px; }
  .summary-card-body ul > li::marker{ color:var(--teal); font-weight:800; }
  @media(max-width:900px){ .summary-grid{ grid-template-columns:1fr 1fr; } }
  @media(max-width:600px){ .summary-grid{ grid-template-columns:1fr; } }
  body.dark .summary-card{ background:var(--card); }
  .summary-card-body h3{ font-size:15.5px; color:var(--navy); font-weight:800; margin:16px 0 8px; padding-inline-start:10px; border-inline-start:3px solid var(--teal); }
  .summary-card-body h3:first-child{ margin-top:0; padding:10px 14px; border-radius:10px; background:linear-gradient(135deg, var(--teal-light), transparent); border:1px solid var(--teal); border-inline-start:3px solid var(--teal); }
  .summary-card-body h4{ font-size:14px; color:var(--teal); font-weight:800; margin:8px 0 4px; }
  .summary-card-body b, .summary-card-body strong{ color:var(--navy); }
  body.dark .summary-card-body h3{ color:#8be0e8; border-inline-start-color:#8be0e8; }
  body.dark .summary-card-body h3:first-child{ border-color:#8be0e8; }
  body.dark .summary-card-body table th{ background:var(--navy-2); }

  /* ===== تلخيص محاضرة بالذكاء الاصطناعي (High-Yield) ===== */
  .ai-summary-badge{ display:inline-flex; align-items:center; gap:6px; font-size:12.5px; font-weight:800; color:#fff; background:linear-gradient(135deg, var(--teal), var(--navy)); padding:4px 12px; border-radius:999px; }
  .ai-upload-box{ border:2px dashed var(--border); border-radius:14px; padding:22px; text-align:center; background:var(--teal-light); cursor:pointer; transition:.2s; }
  .ai-upload-box:hover{ border-color:var(--teal); }
  .ai-upload-box .ai-upload-icon{ font-size:30px; margin-bottom:8px; }
  .ai-upload-box .ai-upload-filename{ margin-top:8px; font-size:13.5px; font-weight:700; color:var(--teal); word-break:break-all; }
  .ai-bank-hint{ display:flex; align-items:center; gap:8px; background:var(--teal-light); border:1px solid var(--border); border-radius:10px; padding:10px 14px; font-size:13.5px; font-weight:700; color:var(--navy-2); margin-top:6px; }
  body.dark .ai-bank-hint{ color:var(--text); }
  .ai-loading-box{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; padding:40px 20px; text-align:center; color:var(--muted); }
  .ai-spinner{ width:38px; height:38px; border-radius:50%; border:3.5px solid var(--border); border-top-color:var(--teal); animation:aiSpin .8s linear infinite; }
  @keyframes aiSpin{ to{ transform:rotate(360deg); } }
  .ai-result-box{ margin-top:22px; padding-top:22px; border-top:1px dashed var(--border); }
  /* محرر الملخص المنسّق: شريط أدوات + منطقة قابلة للتحرير تدعم صور وجداول */
  .rte-toolbar{ display:flex; align-items:center; gap:4px; flex-wrap:wrap; padding:6px; border:1.5px solid var(--border); border-bottom:none; border-radius:10px 10px 0 0; background:var(--bg); }
  .rte-btn{ display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; border-radius:8px; border:1px solid var(--border); background:var(--card); color:var(--ink); font-size:14px; }
  .rte-btn:hover{ background:var(--teal-light); border-color:var(--teal); color:var(--teal); }
  .rte-select{ height:32px; border-radius:8px; border:1px solid var(--border); background:var(--card); color:var(--ink); font-size:12.5px; padding:0 4px; cursor:pointer; }
  .rte-color-input{ width:32px; height:32px; padding:2px; border:1px solid var(--border); border-radius:8px; cursor:pointer; background:var(--card); }
  .rte-editor{ min-height:160px; max-height:360px; overflow-y:auto; border:1.5px solid var(--border); border-top:none; border-radius:0 0 10px 10px; padding:12px 14px; font-family:inherit; font-size:14.5px; color:var(--text); background:var(--card); line-height:1.7; }
  .rte-editor:focus{ outline:2px solid var(--teal); outline-offset:-2px; }
  .rte-editor:empty:before{ content:attr(data-placeholder); color:var(--muted); }
  .rte-editor img{ max-width:100%; border-radius:8px; margin:6px 0; }
  .rte-editor table{ width:100%; border-collapse:collapse; margin:8px 0; }
  .rte-editor table td, .rte-editor table th{ border:1px solid var(--border); padding:6px 10px; min-width:40px; }
  .rte-editor table th{ background:var(--navy); color:#fff; }
  .rte-editor h3{ font-size:15.5px; color:var(--navy); font-weight:800; margin:12px 0 6px; padding-inline-start:10px; border-inline-start:3px solid var(--teal); }
  .rte-editor h4{ font-size:14px; color:var(--teal); font-weight:800; margin:8px 0 4px; }
  body.dark .rte-editor h3{ color:#8be0e8; border-inline-start-color:#8be0e8; }
  /* عرض المحتوى المنسّق (صور/جداول/تنسيق خط) داخل نص السؤال والتفسير في كل أماكن عرض الأسئلة */
  .q-text img, .q-explain img, .quiz-q-text img{ max-width:100%; border-radius:8px; margin:6px 0; display:block; }
  .q-text table, .q-explain table, .quiz-q-text table{ width:100%; border-collapse:collapse; margin:8px 0; }
  .q-text table td, .q-text table th, .q-explain table td, .q-explain table th, .quiz-q-text table td, .quiz-q-text table th{ border:1px solid var(--border); padding:6px 10px; min-width:40px; }
  .empty-state{ text-align:center; padding:60px 20px; color:var(--muted); background:var(--card); border:1.5px dashed var(--border); border-radius:var(--radius-lg); }
  .empty-state h3{ color:var(--ink); margin-bottom:8px; font-size:18px; }

  /* Breadcrumb */
  .breadcrumb{ font-size:13.5px; color:var(--muted); margin-bottom:18px; }
  .breadcrumb a{ color:var(--teal); font-weight:700; }

  .course-hero-banner{ background:linear-gradient(150deg, var(--navy) 0%, var(--navy-2) 55%, var(--teal) 130%); color:#fff; border-radius:var(--radius); padding:36px 30px; margin-bottom:28px; position:relative; overflow:hidden; }
  .course-hero-banner::after{ content:""; position:absolute; inset:0; background-image: radial-gradient(circle at 85% 20%, rgba(255,255,255,0.10), transparent 45%); }
  .course-hero-banner-inner{ position:relative; z-index:2; }
  .course-hero-banner .course-uni{ color:#bfe4ea; margin-bottom:10px; }
  .course-hero-banner h1{ font-size:26px; color:#fff; font-weight:800; margin-bottom:10px; }
  .course-hero-banner p{ color:#d7e6ee; font-size:14.5px; max-width:720px; margin-bottom:14px; }
  .course-hero-banner .course-coverage-line{ color:#bfe4ea; font-size:13.5px; opacity:0.9; margin-top:-6px; max-width:720px; }
  .course-hero-banner .course-detail-meta{ color:#d7e6ee; }
  .course-hero-banner .course-detail-meta b{ color:#fff; }
  .course-hero-banner .chip{ background:rgba(255,255,255,0.15); border-color:rgba(255,255,255,0.35); color:#fff; }
  .hero-settings-btn{ position:absolute; top:18px; left:18px; z-index:5; display:inline-flex; align-items:center; gap:8px; padding:9px 16px; border-radius:999px; background:rgba(255,255,255,0.16); border:1.5px solid rgba(255,255,255,0.45); color:#fff; font-weight:700; font-size:13.5px; backdrop-filter:blur(6px); transition:.2s; text-decoration:none; cursor:pointer; touch-action:manipulation; -webkit-tap-highlight-color:rgba(255,255,255,0.3); }
  .hero-settings-btn:hover, .hero-settings-btn:active{ background:#fff; color:var(--navy); border-color:#fff; }
  @media (max-width:520px){
    .course-hero-banner{ padding-top:66px; }
    .hero-settings-btn{ top:14px; left:14px; padding:8px 13px; font-size:12.5px; }
  }

  .course-detail-layout{ display:grid; grid-template-columns:1fr 300px; gap:28px; align-items:start; }
  .course-detail-main{ min-width:0; }
  .course-detail-side{ position:sticky; top:90px; display:flex; flex-direction:column; gap:18px; }
  .course-side-card{ background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:22px; }
  .course-side-card h4{ font-size:14.5px; color:var(--ink); font-weight:800; margin-bottom:14px; }
  .course-side-card .btn{ width:100%; }
  .course-spec-row{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding:9px 0; border-bottom:1px solid var(--border); font-size:13.5px; color:var(--muted); }
  .course-spec-row:last-child{ border-bottom:none; }
  .course-spec-row b{ color:var(--ink); }

  .lecture-list{ display:flex; flex-direction:column; gap:12px; }
  .lecture-row{ background:var(--card); border:1px solid var(--border); border-radius:12px; overflow:hidden; }
  .lecture-row.locked{ background:#fbfbfc; }
  .lecture-row-summary{ display:flex; align-items:center; gap:14px; padding:16px 20px; cursor:pointer; list-style:none; }
  .lecture-row-summary::-webkit-details-marker{ display:none; }
  .lecture-row-summary::marker{ content:''; }
  .lecture-row-summary:hover{ background:var(--teal-light); }
  .lecture-row-main{ flex:1; min-width:0; }
  .lecture-row-main h4{ font-size:15.5px; color:var(--ink); font-weight:800; margin-bottom:0; }
  .lecture-row-main p{ font-size:13px; color:var(--muted); margin:4px 0 0; }
  .lecture-toggle-icon{ margin-inline-start:auto; width:36px; height:36px; border-radius:50%; background:var(--teal-light); color:var(--teal); display:flex; align-items:center; justify-content:center; flex-shrink:0; transition:.25s; }
  .lecture-toggle-icon svg{ width:16px; height:16px; transition:transform .25s; }
  .lecture-row-summary:hover .lecture-toggle-icon{ background:var(--teal); color:#fff; }
  .lecture-row[open] > summary .lecture-toggle-icon{ background:var(--navy); color:#fff; }
  .lecture-row[open] > summary .lecture-toggle-icon svg{ transform:rotate(180deg); }
  .lecture-row-content{ padding:0 20px 18px; border-top:1px solid var(--border); padding-top:14px; }
  .lecture-row .lecture-actions{ flex-direction:column; gap:10px; }
  .lecture-action-btn{ display:flex; align-items:center; gap:12px; padding:12px 18px; border-radius:12px; font-weight:800; font-size:14.5px; border:1.5px solid var(--border); background:var(--bg); color:var(--ink); transition:.2s; width:100%; }
  .lecture-action-btn .action-icon{ width:34px; height:34px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:14px; flex-shrink:0; }
  .lecture-action-btn.watch{ background:var(--teal); color:#fff; border-color:var(--teal); }
  .lecture-action-btn.watch .action-icon{ background:rgba(255,255,255,0.22); }
  .lecture-action-btn.watch:hover{ background:var(--teal-2); border-color:var(--teal-2); }
  .lecture-action-btn.download{ background:#fff; color:var(--navy); border-color:var(--navy); }
  .lecture-action-btn.download .action-icon{ background:var(--teal-light); color:var(--teal); }
  .lecture-action-btn.download:hover{ background:var(--navy); color:#fff; }
  .lecture-action-btn.download:hover .action-icon{ background:rgba(255,255,255,0.22); color:#fff; }
  .lecture-action-btn[disabled]{ opacity:.55; cursor:not-allowed; pointer-events:none; background:var(--bg); color:var(--muted); border-color:var(--border); }
  .lecture-action-btn[disabled] .action-icon{ background:var(--border); color:var(--muted); }
  .lecture-action-btn span.label-main{ display:block; }
  .lecture-action-btn span.label-sub{ display:block; font-size:11.5px; font-weight:600; opacity:.8; margin-top:1px; }
  .lecture-row-admin{ width:100%; display:flex; justify-content:flex-end; border-top:1px dashed var(--border); padding-top:10px; margin-top:10px; }
  .video-player-slot{ width:100%; display:flex; justify-content:center; }
  /* الفيديو بياخد أقصى عرض ممكن، بس بدون ما يتعدى ارتفاع الشاشة المرئية (منحسب أقصى ارتفاع مسموح بالـ vh، وعلى أساسه أقصى عرض يحافظ على نسبة 16:9، وناخد الأصغر بينه وبين عرض الحاوية) */
  .video-player-wrap{
    position:relative;
    aspect-ratio:16/9;
    width:min(100%, calc(72vh * 16 / 9));
    width:min(100%, calc(72dvh * 16 / 9));
    max-height:72vh;
    max-height:72dvh;
    border-radius:12px; overflow:hidden; background:#000; margin-top:10px;
  }
  .video-player-wrap iframe{ position:absolute; inset:0; width:100%; height:100%; border:none; }
  .video-player-loading{ padding:14px; text-align:center; font-size:13.5px; font-weight:700; color:var(--muted); background:var(--bg); border:1px dashed var(--border); border-radius:10px; margin-top:10px; }

  @media (max-width:900px){
    .course-detail-layout{ grid-template-columns:1fr; }
    .course-detail-side{ position:static; }
  }

  /* Course detail meta (used inside the hero banner) */
  .course-detail-meta{ display:flex; gap:20px; font-size:13.5px; color:var(--muted); flex-wrap:wrap; }
  .course-detail-meta b{ color:var(--ink); }

  /* Lecture rows */
  .lecture-num{ width:34px; height:34px; border-radius:10px; background:var(--navy); color:#fff; font-weight:800; font-size:14px; display:flex; align-items:center; justify-content:center; flex-shrink:0; transition:.2s; }
  .lecture-row.watched .lecture-num{ background:var(--good); }
  .watch-toggle{ display:inline-flex; align-items:center; gap:8px; font-size:13px; font-weight:700; color:var(--ink); background:var(--good-light); padding:8px 12px; border-radius:10px; margin-bottom:12px; cursor:pointer; user-select:none; width:fit-content; }
  .watch-toggle input{ width:16px; height:16px; accent-color:var(--good); cursor:pointer; }
  .lecture-actions{ display:flex; gap:8px; flex-wrap:wrap; }
  .lecture-tier-tag{ display:inline-block; font-size:11.5px; font-weight:800; padding:3px 10px; border-radius:999px; background:var(--teal-light); color:var(--teal); width:fit-content; }
  .lecture-tier-tag.locked{ background:#f3e8d8; color:#8a5a1c; }
  .lecture-lock-msg{ display:flex; align-items:center; gap:8px; background:var(--bg); border:1px dashed var(--border); border-radius:10px; padding:10px 14px; font-size:13.5px; font-weight:700; color:var(--muted); }

  /* Section groups: فيرست / ميد / فاينال — كل قسم بمحاضراته وحالة اشتراكه الخاصة */
  .section-group-list{ display:flex; flex-direction:column; gap:14px; }
  .section-group{ background:var(--card); border:1.5px solid var(--border); border-radius:16px; overflow:hidden; }
  .section-group[open]{ border-color:var(--teal); }
  .section-group-summary{ display:flex; align-items:center; gap:14px; padding:16px 20px; cursor:pointer; list-style:none; }
  .section-group-summary::-webkit-details-marker{ display:none; }
  .section-group-summary::marker{ content:''; }
  .section-group-summary:hover{ background:var(--teal-light); }
  .section-num-badge{ width:42px; height:42px; border-radius:12px; background:var(--navy); color:#fff; font-family:'Cairo'; font-weight:800; font-size:16px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
  .section-group-title{ display:flex; align-items:center; gap:14px; flex:1; min-width:0; }
  .section-group-title h3{ font-size:17px; color:var(--ink); font-weight:800; margin:0; }
  .section-group-title p{ font-size:12.5px; color:var(--muted); margin:3px 0 0; }
  .section-group-status{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
  .section-group[open] > summary .lecture-toggle-icon{ background:var(--navy); color:#fff; }
  .section-group[open] > summary .lecture-toggle-icon svg{ transform:rotate(180deg); }
  .section-group-content{ padding:4px 20px 20px; border-top:1px solid var(--border); }
  .section-group-content .lecture-list{ margin-top:14px; }
  .section-group-empty{ padding:14px 20px 20px; color:var(--muted); font-size:13.5px; }

  .section-picker-row{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 14px; border:1.5px solid var(--border); border-radius:10px; margin-bottom:8px; }
  .section-picker-check{ display:flex; align-items:center; gap:8px; font-weight:800; font-size:14px; flex:1; cursor:pointer; }
  .section-picker-check input{ width:17px; height:17px; accent-color:var(--teal); }
  .section-picker-row select{ padding:6px 10px; border-radius:8px; border:1.5px solid var(--border); font-family:inherit; font-size:13px; background:var(--card); color:var(--text); }
  .section-picker-row select:disabled{ opacity:.4; }

  .enroll-box{ margin-top:18px; padding-top:16px; border-top:1px solid var(--border); }
  .enroll-box h4{ font-size:14.5px; color:var(--ink); font-weight:800; margin-bottom:10px; }
  .enroll-list{ display:flex; gap:8px; flex-wrap:wrap; }
  .enroll-chip{ display:flex; align-items:center; gap:8px; background:var(--good-light); color:var(--good); border-radius:999px; padding:6px 8px 6px 14px; font-size:13px; font-weight:700; }
  .enroll-chip button{ background:none; border:none; color:var(--good); font-size:15px; line-height:1; opacity:.7; }
  .enroll-chip button:hover{ opacity:1; }

  /* Question bank management view (admin) */
  .qbank-group{ margin-bottom:34px; }
  .qbank-group-title{ display:flex; align-items:center; gap:10px; margin-bottom:16px; font-size:17px; font-weight:800; color:var(--ink); }
  .qbank-group-title .count{ background:var(--teal-light); color:var(--teal); font-size:12px; padding:3px 10px; border-radius:999px; font-weight:800; }
  .q-card{ background:#fff; border:1px solid var(--border); border-radius:12px; padding:20px 22px; margin-bottom:14px; }
  .q-card .q-text{ font-weight:700; color:var(--text); margin-bottom:14px; font-size:15.5px; }
  .q-tag{ display:inline-block; font-size:11.5px; font-weight:800; padding:3px 10px; border-radius:999px; margin-bottom:10px; }
  .q-tag.past{ background:#fdf0e4; color:#a05a1c; }
  .q-tag.ref{ background:var(--teal-light); color:var(--teal); }
  .q-options{ display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:12px; }
  .q-opt{ border:1.5px solid var(--border); border-radius:10px; padding:10px 14px; font-size:14px; color:var(--muted); display:flex; align-items:center; gap:8px; text-align:start; background:#fff; width:100%; }
  .q-opt.correct{ border-color:var(--good); background:var(--good-light); color:var(--ink); font-weight:700; }
  .q-opt.wrong{ border-color:var(--danger); background:#fdeceb; color:var(--danger-dark); font-weight:700; }
  .q-opt b{ color:var(--ink); }
  .q-opt.clickable{ cursor:pointer; transition:.15s; }
  .q-opt.clickable:hover{ border-color:var(--teal); }
  .q-opt[disabled]{ cursor:default; }
  .q-card-foot{ display:flex; justify-content:flex-end; gap:8px; }

  /* Auth / cards */
  .auth-wrap{ max-width:440px; margin:50px auto; }
  .card-panel{ background:var(--card); border:1px solid var(--border); border-radius:var(--radius-lg); padding:36px; box-shadow:var(--shadow-md); }
  .card-panel h2{ font-size:24px; color:var(--ink); font-weight:800; margin-bottom:6px; text-align:center; }
  .card-panel p.sub{ text-align:center; color:var(--muted); font-size:14px; margin-bottom:26px; }
  .field{ margin-bottom:16px; }
  .field label{ display:block; font-size:13.5px; font-weight:700; color:var(--navy-2); margin-bottom:6px; }
  .field input, .field select, .field textarea{ width:100%; padding:11px 14px; border:1.5px solid var(--border); border-radius:10px; font-family:inherit; font-size:14.5px; color:var(--text); background:#fbfdfe; }
  .field input:focus, .field select:focus, .field textarea:focus{ outline:none; border-color:var(--teal); background:#fff; }
  .field textarea{ resize:vertical; min-height:80px; }
  .settings-section-title{ font-size:14.5px; font-weight:800; color:var(--ink); margin-bottom:14px; }
  .settings-divider{ border:none; border-top:1px solid var(--border); margin:24px 0 20px; }
  .link-rows{ display:flex; flex-direction:column; gap:8px; margin-bottom:10px; }
  .link-row{ display:flex; gap:8px; align-items:center; }
  .link-row input{ padding:9px 12px; border:1.5px solid var(--border); border-radius:8px; font-family:inherit; font-size:13.5px; color:var(--text); background:#fbfdfe; }
  .link-row input:focus{ outline:none; border-color:var(--teal); background:#fff; }
  .link-row .link-label{ flex:0 0 36%; }
  .link-row .link-url{ flex:1; min-width:0; direction:ltr; }
  .link-row .link-remove{ flex-shrink:0; width:32px; height:32px; border-radius:8px; border:1.5px solid var(--danger); color:var(--danger); background:transparent; font-size:14px; }
  .link-row .link-remove:hover{ background:var(--danger); color:#fff; }
  /* ===== صفوف رفع الفيديو مباشرة إلى Bunny Stream ===== */
  .video-row{ display:flex; flex-direction:column; gap:6px; padding:10px 12px; border:1.5px solid var(--border); border-radius:10px; background:#fbfdfe; margin-bottom:8px; position:relative; }
  body.dark .video-row{ background:#0c1723; }
  .video-row-main{ display:flex; gap:8px; align-items:center; }
  .video-row-main .link-label{ flex:0 0 36%; padding:9px 12px; border:1.5px solid var(--border); border-radius:8px; font-family:inherit; font-size:13.5px; color:var(--text); background:transparent; }
  .video-row .link-url{ flex:1; min-width:0; direction:ltr; padding:9px 12px; border:1.5px solid var(--border); border-radius:8px; font-family:inherit; font-size:13.5px; color:var(--text); background:transparent; }
  .video-file-input{ flex:1; min-width:0; font-size:12.5px; color:var(--muted); }
  .video-row-remove{ position:absolute; left:8px; top:8px; width:26px; height:26px; border-radius:8px; border:1.5px solid var(--danger); color:var(--danger); background:transparent; font-size:12px; }
  .video-row-remove:hover{ background:var(--danger); color:#fff; }
  .video-row-badge{ font-size:12.5px; font-weight:700; color:var(--good); background:var(--good-light); padding:4px 10px; border-radius:20px; white-space:nowrap; }
  .upload-progress{ width:100%; height:7px; border-radius:5px; background:var(--border); overflow:hidden; }
  .upload-progress-fill{ height:100%; width:0%; background:var(--teal); transition:width .2s ease; }
  .upload-status{ font-size:12px; color:var(--muted); }
  .video-row-uploading .upload-status{ color:var(--teal-2); font-weight:700; }
  details.manual-link-details{ margin-top:10px; }
  details.manual-link-details summary{ cursor:pointer; font-size:13px; font-weight:700; color:var(--muted); padding:6px 0; }
  details.manual-link-details .link-rows{ margin-top:8px; }
  .form-msg{ font-size:13.5px; padding:10px 14px; border-radius:10px; margin-bottom:14px; }
  .form-msg.error{ background:#fdeceb; color:var(--danger-dark); }
  .form-msg.success{ background:var(--good-light); color:var(--good); }
  .form-msg.ok{ background:var(--good-light); color:var(--good); }
  .form-msg.info{ background:var(--teal-light); color:var(--teal); }
  .switch-row{ text-align:center; margin-top:18px; font-size:13.5px; color:var(--muted); }
  .switch-row button{ background:none; border:none; color:var(--teal); font-weight:800; }

  .modal-overlay{ position:fixed; inset:0; background:rgba(10,32,54,0.55); backdrop-filter:blur(3px); z-index:200; display:flex; align-items:center; justify-content:center; padding:20px; animation:fadeIn .18s var(--ease) both; }
  @keyframes fadeIn{ from{ opacity:0; } to{ opacity:1; } }
  .modal-box{ background:var(--card); border-radius:var(--radius-lg); padding:30px; width:100%; max-width:520px; max-height:88vh; overflow-y:auto; box-shadow:var(--shadow-lg); animation:heroRise .22s var(--ease) both; }
  .modal-box.wide{ max-width:760px; }
  .import-q-card .field{ margin-bottom:10px; }
  .import-q-card textarea{ min-height:60px; }
  .modal-box h3{ color:var(--ink); font-size:20px; font-weight:800; margin-bottom:18px; }
  .modal-actions{ display:flex; gap:10px; justify-content:flex-end; margin-top:20px; }

  .about-hero{ text-align:center; max-width:720px; margin:0 auto 50px; }
  .uni-cards{ display:grid; grid-template-columns:repeat(4,1fr); gap:22px; margin-top:30px; }
  .uni-card{ background:#fff; border:1px solid var(--border); border-radius:var(--radius); padding:26px; text-align:center; }
  .uni-card .badge{ width:72px; height:72px; border-radius:50%; background:#fff; color:#fff; font-weight:800; display:flex; align-items:center; justify-content:center; margin:0 auto 14px; font-size:20px; border:1px solid var(--border); overflow:hidden; padding:6px; }
  .uni-card .badge img{ width:100%; height:100%; object-fit:contain; }
  .uni-card .badge .badge-fallback{ width:100%; height:100%; border-radius:50%; background:var(--navy); color:#fff; display:flex; align-items:center; justify-content:center; font-size:20px; font-weight:800; }
  .uni-card h4{ color:var(--ink); font-size:16px; font-weight:800; margin-bottom:6px; }
  .uni-card p{ font-size:13.5px; color:var(--muted); }

  .mission-grid{ display:grid; grid-template-columns:1fr 1fr; gap:24px; margin-top:20px;}
  .mission-card{ background:#fff; border:1px solid var(--border); border-radius:var(--radius); padding:26px; }
  .mission-card h4{ color:var(--ink); font-weight:800; margin-bottom:10px; font-size:16.5px; display:flex; align-items:center; gap:8px;}
  .mission-card p{ color:var(--muted); font-size:14.5px; }

  .admin-banner{ background:linear-gradient(90deg, var(--navy), var(--navy-2)); color:#fff; padding:16px 24px; display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px; border-bottom:2px solid var(--teal-2); }
  .admin-banner span{ font-weight:700; font-size:14.5px; }

  /* Contact page */
  .contact-grid{ display:grid; grid-template-columns:.9fr 1.1fr; gap:30px; align-items:start; }
  .contact-info-card{ background:#fff; border:1px solid var(--border); border-radius:var(--radius); padding:28px; }
  .contact-info-card h3{ color:var(--ink); font-size:18px; font-weight:800; margin-bottom:18px; }
  .contact-row{ display:flex; align-items:flex-start; gap:12px; margin-bottom:16px; }
  .contact-row .ic{ width:38px; height:38px; border-radius:10px; background:var(--teal-light); color:var(--teal); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
  .contact-row div b{ display:block; color:var(--ink); font-size:14px; margin-bottom:2px; }
  .contact-row div span{ font-size:13.5px; color:var(--muted); direction:ltr; display:inline-block; }
  .messages-list{ margin-top:30px; }
  .message-card{ background:#fbfdfe; border:1px solid var(--border); border-radius:12px; padding:16px 18px; margin-bottom:12px; }
  .message-card .m-head{ display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }
  .message-card b{ color:var(--ink); font-size:14px; }
  .message-card span.m-email{ font-size:12.5px; color:var(--muted); direction:ltr; display:inline-block; }
  .message-card p{ font-size:13.5px; color:var(--text); }

  /* Quiz wizard */
  .wizard-wrap{ max-width:680px; margin:0 auto; }
  .wizard-progress{ display:flex; align-items:center; justify-content:center; gap:8px; margin-bottom:36px; }
  .wizard-dot{ width:34px; height:34px; border-radius:50%; background:#fff; border:2px solid var(--border); color:var(--muted); font-weight:800; font-size:13.5px; display:flex; align-items:center; justify-content:center; }
  .wizard-dot.active{ background:var(--navy); border-color:var(--ink); color:#fff; }
  .wizard-dot.done{ background:var(--teal); border-color:var(--teal); color:#fff; }
  .wizard-line{ width:34px; height:2px; background:var(--border); }
  .wizard-card{ background:var(--card); border:1px solid var(--border); border-radius:var(--radius-lg); padding:32px; box-shadow:var(--shadow-sm); }
  .wizard-card h3{ color:var(--ink); font-size:21px; font-weight:800; margin-bottom:6px; text-align:center; }
  .wizard-card p.hint{ text-align:center; color:var(--muted); font-size:14px; margin-bottom:26px; }
  .option-cards{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
  .option-cards.single{ grid-template-columns:1fr; }
  .option-card{ border:2px solid var(--border); border-radius:12px; padding:18px; background:#fff; text-align:center; transition:.2s; }
  .option-card:hover{ border-color:var(--teal); }
  .option-card.selected{ border-color:var(--ink); background:var(--teal-light); }
  .option-card b{ display:block; color:var(--ink); font-size:15px; margin-bottom:4px; }
  .option-card span{ font-size:12.5px; color:var(--muted); }
  .wizard-nav{ display:flex; justify-content:space-between; margin-top:28px; }
  .count-input-row{ display:flex; gap:10px; justify-content:center; flex-wrap:wrap; margin-bottom:18px; }
  .count-chip{ padding:10px 18px; border-radius:10px; border:2px solid var(--border); font-weight:800; color:var(--ink); background:#fff; }
  .count-chip.active{ border-color:var(--ink); background:var(--navy); color:#fff; }

  .bank-block{ margin-bottom:28px; padding-bottom:26px; border-bottom:1px solid var(--border); }
  .bank-block:last-of-type{ border-bottom:none; margin-bottom:0; padding-bottom:0; }
  .bank-block-label{ font-weight:800; color:var(--ink); font-size:15px; margin-bottom:14px; display:flex; align-items:center; justify-content:space-between; gap:10px; }
  .bank-select{ width:100%; padding:14px 16px; border-radius:12px; border:2px solid var(--border); font-family:inherit; font-size:15px; font-weight:700; color:var(--ink); background:#fff; }
  .bank-select:focus{ border-color:var(--teal); outline:none; }
  .option-cards.small .option-card{ padding:14px; }

  .user-pill-avatar{ width:24px; height:24px; border-radius:50%; object-fit:cover; flex-shrink:0; }
  .avatar-upload-wrap{ display:flex; align-items:center; gap:20px; flex-wrap:wrap; margin-bottom:22px; }
  .avatar-preview{ width:96px; height:96px; border-radius:50%; object-fit:cover; border:2px solid var(--border); background:var(--teal-light); display:flex; align-items:center; justify-content:center; font-size:36px; flex-shrink:0; }
  .avatar-actions{ display:flex; flex-direction:column; gap:8px; }
  .avatar-actions .hint{ font-size:12px; color:var(--muted); margin:0; }
  .lecture-select-list{ display:flex; flex-direction:column; gap:10px; }
  .lecture-select-row{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding:12px 16px; border:1.5px solid var(--border); border-radius:10px; font-size:14px; font-weight:600; color:var(--text); cursor:pointer; transition:.15s; }
  .lecture-select-row:hover{ border-color:var(--teal); }
  .lecture-select-row.muted{ opacity:.5; cursor:not-allowed; }
  .lecture-select-row span:first-child{ display:flex; align-items:center; gap:10px; }
  .lecture-select-row input[type="checkbox"]{ width:17px; height:17px; accent-color:var(--teal); }
  .count-badge{ background:var(--teal-light); color:var(--teal); font-size:12px; padding:4px 10px; border-radius:999px; font-weight:800; flex-shrink:0; }
  .bank-section-group{ margin-bottom:18px; }
  .bank-section-group:last-of-type{ margin-bottom:0; }
  .bank-section-group-head{ display:flex; align-items:center; gap:10px; margin-bottom:10px; }
  .bank-section-group-head .section-num-badge{ width:28px; height:28px; font-size:12.5px; border-radius:8px; }
  .bank-section-group-head b{ font-size:14.5px; color:var(--ink); }
  .bank-section-group-head .hint{ margin:0; }
  .link-btn{ background:none; border:none; color:var(--teal); font-size:12.5px; font-weight:700; padding:0; text-decoration:underline; }
  .q-explain{ margin-top:12px; background:var(--teal-light); border-right:3px solid var(--teal); border-radius:8px; padding:12px 14px; font-size:13.5px; color:var(--navy-2); }
  .q-explain b{ color:var(--teal); }
  .review-item .ans-tag.review{ background:#eef2f7; color:var(--navy-2); }

  /* ---- نمط السؤال: خيارات (radio) في نموذج الإضافة/التعديل ---- */
  .opt-row{ display:flex; align-items:center; gap:10px; margin-bottom:8px; }
  .opt-row input[type="radio"]{ width:18px; height:18px; accent-color:var(--good); flex-shrink:0; }
  .opt-row .opt-letter{ font-weight:800; color:var(--navy-2); flex-shrink:0; width:16px; }
  .opt-row input[type="text"]{ flex:1; min-width:0; padding:9px 12px; border:1.5px solid var(--border); border-radius:8px; font-family:inherit; font-size:13.5px; color:var(--text); background:#fbfdfe; direction:ltr; text-align:left; }
  .opt-row input[type="text"]:focus{ outline:none; border-color:var(--teal); background:#fff; }

  /* ---- نمط السؤال: توصيل (matching) ---- */
  .match-pair-row .match-left{ flex:0 0 40%; }
  .match-pair-row .match-right{ flex:1; min-width:0; }
  .match-pair-arrow{ flex-shrink:0; color:var(--muted); font-weight:700; }
  .match-answer-list{ display:flex; flex-direction:column; gap:10px; margin-bottom:22px; }
  .match-answer-row{ display:flex; align-items:center; gap:10px; padding:12px 14px; border:1.5px solid var(--border); border-radius:10px; }
  .match-answer-row select{ flex:1; min-width:0; padding:9px 10px; border:1.5px solid var(--border); border-radius:8px; font-family:inherit; direction:ltr; background:#fff; color:var(--text); }
  .match-answer-row.correct{ border-color:var(--good); background:var(--good-light); }
  .match-answer-row.wrong{ border-color:var(--danger); background:#fdeceb; }

  /* ---- نمط السؤال: كتابي (written) ---- */
  .written-answer-box{ margin-bottom:14px; }
  .written-answer-box textarea{ width:100%; min-height:120px; padding:12px 14px; border:1.5px solid var(--border); border-radius:10px; font-family:inherit; font-size:14px; color:var(--text); direction:ltr; text-align:left; background:#fbfdfe; resize:vertical; }
  .written-answer-box textarea:focus{ outline:none; border-color:var(--teal); background:#fff; }

  .q-type-tag{ display:inline-block; font-size:11.5px; font-weight:800; padding:3px 10px; border-radius:999px; margin-bottom:10px; margin-inline-end:6px; background:#eef2f7; color:var(--navy-2); }
  .btn.edit{ border-color:var(--teal-2); color:var(--teal-2); }
  .btn.edit:hover{ background:var(--teal-2); color:#fff; }

  .quiz-progress-bar{ height:8px; background:var(--border); border-radius:999px; overflow:hidden; margin-bottom:22px; }
  .quiz-progress-bar div{ height:100%; background:linear-gradient(90deg, var(--teal), var(--navy)); border-radius:999px; transition:.3s; }

  /* ---------------- Admin analytics dashboard ---------------- */
  .analytics-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:18px; margin-bottom:30px; }
  .analytics-kpi{ background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:20px; text-align:center; }
  .analytics-kpi b{ display:block; font-size:26px; color:var(--ink); font-weight:800; }
  .analytics-kpi span{ font-size:12.5px; color:var(--muted); font-weight:700; }
  .analytics-cols{ display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-bottom:20px; }
  .analytics-card{ background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:22px; }
  .analytics-card h3{ font-size:15.5px; color:var(--ink); font-weight:800; margin-bottom:16px; }
  .analytics-row{ margin-bottom:12px; }
  .analytics-row-head{ display:flex; justify-content:space-between; font-size:13px; font-weight:700; color:var(--muted); margin-bottom:6px; }
  .analytics-row-head b{ color:var(--ink); }
  .analytics-bar{ height:9px; background:var(--border); border-radius:999px; overflow:hidden; }
  .analytics-bar div{ height:100%; background:linear-gradient(90deg, var(--teal), var(--navy)); border-radius:999px; }
  @media (max-width: 860px){ .analytics-grid{ grid-template-columns:repeat(2,1fr); } .analytics-cols{ grid-template-columns:1fr; } }
  .quiz-topline{ display:flex; justify-content:space-between; align-items:center; font-size:13.5px; color:var(--muted); margin-bottom:8px; font-weight:700; }
  .quiz-mode-badge{ background:var(--teal-light); color:var(--teal); padding:3px 10px; border-radius:999px; font-size:12px; font-weight:800; }
  .quiz-q-text{ font-size:18px; font-weight:800; color:var(--ink); margin-bottom:22px; line-height:1.6; }
  .quiz-options{ display:flex; flex-direction:column; gap:12px; margin-bottom:26px; }

  .score-circle{ width:140px; height:140px; border-radius:50%; border:10px solid var(--teal-light); display:flex; align-items:center; justify-content:center; flex-direction:column; margin:0 auto 26px; }
  .score-circle b{ font-size:34px; color:var(--ink); }
  .score-circle span{ font-size:12.5px; color:var(--muted); }
  .review-item{ background:#fbfdfe; border:1px solid var(--border); border-radius:12px; padding:16px 18px; margin-bottom:12px; }
  .review-item .ans-tag{ font-size:12px; font-weight:800; padding:2px 10px; border-radius:999px; }
  .review-item .ans-tag.right{ background:var(--good-light); color:var(--good); }
  .review-item .ans-tag.wrong{ background:#fdeceb; color:var(--danger-dark); }

  footer{ background:linear-gradient(180deg, var(--navy) 0%, #081a2c 100%); color:#cbdbe4; padding:48px 24px 26px; margin-top:40px; position:relative; }
  footer::before{ content:""; position:absolute; inset-block-start:0; inset-inline:0; height:2px; background:linear-gradient(90deg, transparent, var(--teal-2), transparent); }
  .footer-inner{ max-width:var(--content-width); margin:0 auto; display:flex; justify-content:space-between; gap:30px; flex-wrap:wrap; }
  .footer-brand{ display:flex; align-items:center; gap:10px; }
  .footer-brand img{ height:36px; }
  .footer-brand .wordmark{ font-family:'Playfair Display', serif; direction:ltr; font-weight:800; font-size:20px; letter-spacing:2px; color:#fff; }
  .footer-brand .wordmark span{ color:var(--teal); }
  .footer-cols{ display:flex; gap:60px; flex-wrap:wrap; }
  .footer-col h5{ font-size:13px; letter-spacing:1px; color:#8be0e8; margin-bottom:12px; font-weight:800; }
  .footer-col a, .footer-col p{ display:block; font-size:13.5px; color:#cbdbe4; margin-bottom:8px; }
  .footer-social{ display:flex; gap:10px; margin-top:16px; }
  .social-ic{ width:38px; height:38px; border-radius:50%; background:rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.18); display:flex; align-items:center; justify-content:center; color:#cbdbe4; transition:.2s; }
  .social-ic svg{ width:18px; height:18px; }
  .social-ic:hover{ background:var(--teal); border-color:var(--teal); color:#fff; transform:translateY(-2px); }
  .footer-bottom{ text-align:center; margin-top:34px; padding-top:20px; border-top:1px solid rgba(255,255,255,0.12); font-size:12.5px; color:#7f9aab; }

  .hidden{ display:none !important; }
  .loading-dot{ display:inline-block; width:8px; height:8px; border-radius:50%; background:var(--teal); animation:pulse 1s infinite ease-in-out; }
  @keyframes pulse{ 0%,100%{opacity:.3;} 50%{opacity:1;} }

  @media (max-width: 1000px){
    .contact-grid{ grid-template-columns:1fr; }
    .uni-cards{ grid-template-columns:repeat(2,1fr); }
  }
  @media (max-width: 900px){
    .hero-inner{ grid-template-columns:1fr; }
    .grid-3{ grid-template-columns:1fr; }
    .course-grid{ grid-template-columns:1fr 1fr; }
    .uni-cards{ grid-template-columns:1fr; }
    .mission-grid{ grid-template-columns:1fr; }
    .option-cards{ grid-template-columns:1fr; }
  }
  /* روابط عديدة ممكن تزيد مع الوقت (بنك أسئلة، مكتبة التمريض، لوحات الإدارة...)
     فبنبكّر تحويل الشريط لقائمة همبرغر عند 1300px بدل 1180px، وبنضيّق المسافات
     شوي بالنطاق يلي قبلها مباشرة (1300-1500px) عشان الروابط تضل مرتاحة بسطر
     وحد بدون ما تحتاج سكرول أفقي على أغلب شاشات اللابتوب. */
  @media (max-width: 1500px) and (min-width: 1301px){
    nav.links a, nav.links button.navlink{ padding:9px 10px; font-size:13.5px; }
  }
  @media (max-width: 1300px){
    nav.links{ display:none; position:absolute; top:100%; right:0; left:0; background:#fff; flex-direction:column;
      align-items:stretch; padding:14px; border-bottom:1px solid var(--border); box-shadow:0 12px 20px rgba(0,0,0,0.06); max-height:70vh; overflow-y:auto; }
    nav.links.open{ display:flex; }
    nav.links a, nav.links button.navlink{ text-align:start; width:100%; }
    .mobile-toggle{ display:block; }
  }
  body.dark nav.links{ background:var(--card); }
  /* Medium screens: everything still fits on one row, just tighter */
  @media (max-width: 560px){
    .brand .wordmark{ font-size:20px; }
    .icon-toggle{ width:34px; height:34px; font-size:14px; }
    .nav-cta .btn{ padding:8px 12px; font-size:13px; }
    .user-pill{ padding:7px 10px; font-size:12.5px; max-width:34vw; }
  }
  /* Very small screens: drop the wordmark text to guarantee the icons
     and login/user pill always stay on a single, uncluttered row */
  @media (max-width: 400px){
    .brand .wordmark{ display:none; }
    .nav-wrap{ gap:6px; }
    .icon-toggle{ width:32px; height:32px; font-size:13px; }
    .user-pill{ max-width:30vw; padding:6px 10px; }
  }
  @media (max-width: 680px){
    .course-grid{ grid-template-columns:1fr; }
    .q-options{ grid-template-columns:1fr; }
    .hero h1{ font-size:30px; }
    .footer-inner{ flex-direction:column; }
    .wizard-card{ padding:22px; }
  }
  :focus-visible{ outline:2.5px solid var(--teal); outline-offset:2px; }

  /* ---------------- قسم تحميل التطبيق (أندرويد فقط) في الصفحة الرئيسية ---------------- */
  .app-download-section{ background:linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 55%, var(--teal) 130%); padding:52px 24px; position:relative; overflow:hidden; }
  .app-download-section::after{ content:""; position:absolute; inset:0; background-image: radial-gradient(circle at 12% 85%, rgba(255,255,255,0.10), transparent 45%); }
  .app-download-box{ max-width:var(--content-width); margin:0 auto; display:flex; align-items:center; justify-content:space-between; gap:28px; flex-wrap:wrap; position:relative; z-index:2; }
  .app-download-info{ display:flex; align-items:center; gap:20px; flex:1; min-width:260px; }
  .app-download-icon{ font-size:38px; flex-shrink:0; background:rgba(255,255,255,0.12); width:76px; height:76px; border-radius:20px; display:flex; align-items:center; justify-content:center; border:1px solid rgba(255,255,255,0.25); }
  .app-download-text{ color:#fff; }
  .app-download-text .eyebrow{ background:rgba(255,255,255,0.15); color:#fff; margin-bottom:8px; }
  .app-download-text h2{ font-size:24px; font-weight:800; margin-bottom:6px; }
  .app-download-text p{ color:#d7e6ee; font-size:14.5px; max-width:460px; }
  .app-download-btn-wrap{ display:flex; flex-direction:column; align-items:center; gap:8px; flex-shrink:0; }
  .app-download-btn{ display:inline-flex; align-items:center; gap:10px; background:#fff; color:var(--ink); border-color:#fff; padding:14px 26px; font-size:15px; flex-shrink:0; }
  .app-download-btn:hover{ background:var(--teal-light); }
  .app-download-btn svg{ width:22px; height:22px; flex-shrink:0; fill:currentColor; }
  .app-download-note{ font-size:12px; color:#bfe4ea; }
  @media (max-width:640px){
    .app-download-box{ flex-direction:column; text-align:center; }
    .app-download-info{ flex-direction:column; text-align:center; }
    .app-download-text p{ max-width:none; }
  }

  /* ---------------- بطاقة الترويج لمكتبة التمريض (الصفحة الرئيسية، تحت قسم "لماذا MEDORA") ---------------- */
  .library-promo-box{
    background:var(--card); border:1.5px solid var(--border); border-radius:var(--radius-lg);
    padding:36px 34px; margin-top:36px; display:flex; align-items:center; justify-content:space-between;
    gap:28px; flex-wrap:wrap; box-shadow:var(--shadow-sm); position:relative; overflow:hidden;
  }
  .library-promo-box::before{ content:""; position:absolute; inset-inline-start:0; inset-block:0; width:5px; background:linear-gradient(180deg, var(--teal), var(--navy)); }
  .library-promo-info{ display:flex; align-items:center; gap:20px; flex:1; min-width:260px; }
  .library-promo-icon{ font-size:32px; flex-shrink:0; background:var(--teal-light); width:68px; height:68px; border-radius:18px; display:flex; align-items:center; justify-content:center; }
  .library-promo-text h2{ font-size:22px; font-weight:800; color:var(--ink); margin-bottom:6px; }
  .library-promo-text p{ font-size:14.5px; color:var(--muted); max-width:460px; }
  .library-promo-btn-wrap{ flex-shrink:0; }
  body.dark .library-promo-box{ background:var(--card); }
  @media (max-width:640px){
    .library-promo-box{ flex-direction:column; text-align:center; padding:28px 22px; }
    .library-promo-box::before{ inset-inline:0; inset-block-start:0; inset-block-end:auto; width:100%; height:5px; }
    .library-promo-info{ flex-direction:column; text-align:center; }
    .library-promo-text p{ max-width:none; }
  }
