/* ==========================================================================
   Academic Institutions Management — design system (LTR + RTL via logical properties)
   ========================================================================== */
:root {
    --brand: #4f46e5;
    --brand-600: #4338ca;
    --brand-50: #eef2ff;
    --accent: #14b8a6;
    --accent-50: #e6fffa;
    --warm: #f59e0b;
    --rose: #f43f5e;
    --ink: #0f172a;
    --ink-2: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #f6f7fb;
    --card: #ffffff;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
    --shadow: 0 10px 30px -12px rgba(15, 23, 42, .18);
    --shadow-lg: 0 30px 60px -20px rgba(30, 27, 75, .35);
    --sidebar-w: 268px;
    --font-en: "Plus Jakarta Sans", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    /* Arabic: IBM Plex Sans Arabic for reading (clear letters, good with numbers and Latin terms); Cairo for headings. */
    --font-ar: "IBM Plex Sans Arabic", "Cairo", "Segoe UI", Tahoma, sans-serif;
    --font-ar-head: "Cairo", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
    --bs-primary: var(--brand);
    --bs-primary-rgb: 79, 70, 229;
    --bs-link-color: var(--brand);
    --bs-link-hover-color: var(--brand-600);
}

html { font-size: 15px; scroll-behavior: smooth; }
body { font-family: var(--font-en); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
html[lang="ar"] body { font-family: var(--font-ar); }
html[lang="ar"] :is(.lesson, .legal, .fb-msg) { line-height: 1.85; }
html[lang="ar"] :is(h1, h2, h3, .h1, .h2, .h3, .page-head h1, .section-title, .brand, .stat-value) { font-family: var(--font-ar-head); }
/* Diagrams and charts drawn in lessons use the page's Arabic font instead of the browser's default. */
html[lang="ar"] svg text, html[lang="ar"] svg tspan { font-family: var(--font-ar); }
a { text-decoration: none; }
::selection { background: var(--brand); color: #fff; }

/* ---------- Buttons ---------- */
.btn { border-radius: 12px; font-weight: 600; padding: .6rem 1.1rem; transition: transform .15s ease, box-shadow .15s ease, background .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--brand), #7c3aed); border: 0; box-shadow: 0 8px 20px -8px rgba(79, 70, 229, .7); }
.btn-primary:hover, .btn-primary:focus { background: linear-gradient(135deg, var(--brand-600), #6d28d9); box-shadow: 0 12px 26px -10px rgba(79, 70, 229, .8); transform: translateY(-1px); }
.btn-accent { background: var(--accent); color: #fff; border: 0; }
.btn-accent:hover { background: #0d9488; color: #fff; }
.btn-soft { background: var(--brand-50); color: var(--brand); border: 0; }
.btn-soft:hover { background: #e0e7ff; color: var(--brand-600); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: #fff; border-color: #cbd5e1; }
.btn-lg { padding: .85rem 1.5rem; font-size: 1.05rem; border-radius: 14px; }
.btn-icon { width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0; border-radius: 10px; }

/* ---------- Forms ---------- */
.form-control, .form-select { border-radius: 12px; border-color: var(--line); padding: .65rem .9rem; background-color: #fff; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(79, 70, 229, .12); }
.form-label { font-weight: 600; font-size: .9rem; color: var(--ink-2); margin-bottom: .35rem; }
.form-text { color: var(--muted); }
.input-icon { position: relative; }
.input-icon > i { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon > .form-control { padding-inline-start: 2.6rem; }
.field-validation-error, .text-danger { font-size: .85rem; }
.validation-summary-errors ul { margin: 0; padding-inline-start: 1.1rem; }

/* ---------- Cards ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); background: var(--card); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); padding: 1rem 1.25rem; font-weight: 700; }
.card-body { padding: 1.25rem; }
.stat-card { position: relative; overflow: hidden; padding: 1.25rem; }
.stat-card .stat-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.3rem; }
.stat-card .stat-value { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat-card .stat-label { color: var(--muted); font-size: .9rem; }
.stat-card::after { content: ""; position: absolute; inset-inline-end: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: currentColor; opacity: .05; }
.tone-brand { color: var(--brand); } .tone-brand .stat-icon { background: var(--brand-50); }
.tone-accent { color: #0d9488; } .tone-accent .stat-icon { background: var(--accent-50); }
.tone-warm { color: #d97706; } .tone-warm .stat-icon { background: #fff7e6; }
.tone-rose { color: #e11d48; } .tone-rose .stat-icon { background: #fff1f2; }
.stat-card .stat-value, .stat-card .stat-label { color: var(--ink); }
.stat-card .stat-label { color: var(--muted); }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; margin: 0; }
.table > thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); background: #f8fafc; padding: .8rem 1rem; }
html[lang="ar"] .table > thead th { text-transform: none; letter-spacing: 0; font-size: .85rem; }
.table > tbody td { padding: .85rem 1rem; vertical-align: middle; border-color: var(--line); }
.table-hover > tbody > tr:hover > * { background: #f8faff; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: .85rem; color: #fff; background: linear-gradient(135deg, var(--brand), var(--accent)); flex: none; }
.badge-soft { background: var(--brand-50); color: var(--brand); font-weight: 600; border-radius: 999px; padding: .35em .75em; }
.badge-soft.success { background: #ecfdf5; color: #059669; }
.badge-soft.warn { background: #fffbeb; color: #b45309; }
.badge-soft.danger { background: #fff1f2; color: #e11d48; }
.badge-soft.muted { background: #f1f5f9; color: var(--muted); }
.lang-chip { font-size: .72rem; font-weight: 700; border-radius: 6px; padding: .15rem .4rem; background: #f1f5f9; color: var(--ink-2); }
.color-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; vertical-align: middle; }

/* ==========================================================================
   App shell
   ========================================================================== */
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-w); flex: none; position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 1040;
    background: radial-gradient(1200px 500px at 0% 0%, #312e81 0%, #1e1b4b 45%, #0f0d2e 100%);
    color: #c7d2fe; display: flex; flex-direction: column; transition: transform .25s ease;
}
.sidebar .brand { display: flex; align-items: center; gap: .7rem; padding: 1.25rem 1.25rem 1rem; color: #fff; font-weight: 800; font-size: 1.05rem; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, #818cf8, #2dd4bf); color: #fff; font-size: 1.2rem; box-shadow: 0 8px 20px -6px rgba(45, 212, 191, .6); flex: none; }
.sidebar .school-chip { margin: 0 1rem 1rem; padding: .7rem .85rem; border-radius: 12px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); font-size: .85rem; }
.sidebar .school-chip small { display: block; color: #a5b4fc; font-size: .75rem; }
.sidebar nav { overflow-y: auto; padding: 0 .75rem 1rem; flex: 1; }
.nav-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #818cf8; padding: 1rem .75rem .4rem; font-weight: 700; }
html[lang="ar"] .nav-section { text-transform: none; letter-spacing: 0; font-size: .78rem; }
.side-link { display: flex; align-items: center; gap: .75rem; color: #c7d2fe; padding: .6rem .8rem; border-radius: 10px; font-weight: 500; margin-bottom: 2px; transition: background .15s, color .15s; }
.side-link i { font-size: 1.1rem; width: 22px; text-align: center; opacity: .9; }
.side-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-link.active { background: linear-gradient(90deg, rgba(129, 140, 248, .28), rgba(129, 140, 248, .06)); color: #fff; box-shadow: inset 3px 0 0 #818cf8; }
html[dir="rtl"] .side-link.active { background: linear-gradient(270deg, rgba(129, 140, 248, .28), rgba(129, 140, 248, .06)); box-shadow: inset -3px 0 0 #818cf8; }
.side-link .soon { margin-inline-start: auto; font-size: .65rem; padding: .1rem .45rem; border-radius: 999px; background: rgba(255, 255, 255, .1); color: #a5b4fc; }
.sidebar-footer { padding: 1rem; border-top: 1px solid rgba(255, 255, 255, .08); font-size: .8rem; color: #a5b4fc; }

.main { flex: 1; margin-inline-start: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1030; height: 68px; display: flex; align-items: center; gap: 1rem; padding: 0 1.75rem; background: rgba(246, 247, 251, .85); backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--line); }
.topbar .search { flex: 1; max-width: 420px; }
.topbar .search .form-control { background: #fff; border-radius: 999px; }
/* "backwards" (not "both"): a kept transform would trap pop-up windows under their dark overlay. */
.content { padding: 1.75rem; flex: 1; animation: fadeUp .45s ease backwards; }
.page-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between; margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.page-head p { color: var(--muted); margin: .25rem 0 0; }
.crumbs { font-size: .82rem; color: var(--muted); margin-bottom: .35rem; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--brand); }
.user-pill { display: flex; align-items: center; gap: .6rem; padding: .3rem .4rem .3rem .3rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink); }
.user-pill:hover { border-color: #cbd5e1; color: var(--ink); }
.sidebar-toggle { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    html[dir="rtl"] .sidebar { transform: translateX(100%); }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 1035; }
    .main { margin-inline-start: 0; }
    .sidebar-toggle { display: inline-grid; }
    .content { padding: 1.1rem; }
    .topbar { padding: 0 1rem; }
}

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; inset-block-end: 1.25rem; inset-inline-end: 1.25rem; z-index: 2000; display: grid; gap: .6rem; }
.app-toast { display: flex; gap: .7rem; align-items: center; min-width: 280px; max-width: 420px; padding: .85rem 1rem; border-radius: 14px; background: #0f172a; color: #fff; box-shadow: var(--shadow-lg); animation: toastIn .35s cubic-bezier(.2, .9, .3, 1.2) both; }
.app-toast.success i { color: #34d399; } .app-toast.error i { color: #fb7185; }

/* ---------- Empty states, wizard ---------- */
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty .empty-icon { width: 72px; height: 72px; margin: 0 auto 1rem; border-radius: 22px; display: grid; place-items: center; font-size: 2rem; background: var(--brand-50); color: var(--brand); }
.checklist .step { display: flex; gap: .9rem; align-items: center; padding: .85rem 0; border-bottom: 1px dashed var(--line); }
.checklist .step:last-child { border-bottom: 0; }
.checklist .dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: #f1f5f9; color: var(--muted); font-weight: 700; }
.checklist .done .dot { background: #10b981; color: #fff; }
.stage-card { border-radius: var(--radius); border: 1px solid var(--line); background: #fff; overflow: hidden; }
.stage-card .stage-head { padding: .9rem 1.1rem; display: flex; align-items: center; justify-content: space-between; background: linear-gradient(90deg, var(--brand-50), #fff); border-bottom: 1px solid var(--line); }
.grade-pill { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .75rem; border-radius: 10px; background: #f8fafc; border: 1px solid var(--line); margin: .25rem; font-weight: 500; }
.template-option { cursor: pointer; border: 2px solid var(--line); border-radius: 14px; padding: 1rem; transition: border-color .15s, box-shadow .15s, transform .15s; height: 100%; background: #fff; }
.template-option:hover { border-color: #c7d2fe; transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-check:checked + .template-option { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(79, 70, 229, .12); }
.template-bar { display: flex; gap: 3px; margin-top: .6rem; }
.template-bar span { height: 8px; border-radius: 4px; }

/* ==========================================================================
   Public site (marketing + auth)
   ========================================================================== */
.public body, body.public { background: #fff; }
.site-nav { position: fixed; inset-inline: 0; top: 0; z-index: 1050; transition: background .25s, box-shadow .25s, padding .25s; padding: 1.1rem 0; }
.site-nav.scrolled { background: rgba(255, 255, 255, .9); backdrop-filter: blur(14px) saturate(160%); box-shadow: 0 1px 0 var(--line); padding: .65rem 0; }
.site-nav .nav-link { color: var(--ink-2); font-weight: 600; padding: .5rem .9rem !important; border-radius: 10px; }
.site-nav .nav-link:hover { color: var(--brand); background: var(--brand-50); }
.site-brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; color: var(--ink); font-size: 1.1rem; }
.site-brand:hover { color: var(--ink); }

.hero { position: relative; overflow: hidden; padding: 9rem 0 6rem; background:
        radial-gradient(900px 500px at 85% 10%, rgba(124, 58, 237, .14), transparent 60%),
        radial-gradient(700px 400px at 5% 30%, rgba(20, 184, 166, .14), transparent 60%),
        linear-gradient(180deg, #f8f9ff 0%, #fff 100%); }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.9rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.07; }
html[lang="ar"] .hero h1 { letter-spacing: 0; line-height: 1.3; }
.hero .lead { font-size: 1.2rem; color: var(--ink-2); max-width: 560px; }
.gradient-text { background: linear-gradient(120deg, var(--brand), #7c3aed 40%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .9rem .4rem .45rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: .85rem; font-weight: 600; color: var(--ink-2); box-shadow: var(--shadow-sm); }
.eyebrow .tag { background: var(--brand); color: #fff; padding: .15rem .55rem; border-radius: 999px; font-size: .72rem; }
.hero-visual { position: relative; }
.hero-photo { border-radius: 28px; overflow: hidden; box-shadow: var(--shadow-lg); aspect-ratio: 4 / 4.2; background: linear-gradient(135deg, #c7d2fe, #99f6e4); }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); animation: slowZoom 18s ease-in-out infinite alternate; }
.float-card { position: absolute; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); padding: .9rem 1rem; display: flex; gap: .75rem; align-items: center; font-size: .88rem; animation: float 6s ease-in-out infinite; }
.float-card .fc-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.15rem; flex: none; }
.float-card b { display: block; font-size: 1.05rem; }
.float-card.one { inset-inline-start: -40px; top: 12%; }
.float-card.two { inset-inline-end: -30px; top: 48%; animation-delay: -2s; }
.float-card.three { inset-inline-start: 8%; bottom: -28px; animation-delay: -4s; }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: drift 14s ease-in-out infinite alternate; pointer-events: none; }

.logos { display: flex; flex-wrap: wrap; gap: 2.5rem; align-items: center; justify-content: center; opacity: .65; font-weight: 800; color: var(--muted); font-size: 1.1rem; }
.section { padding: 6rem 0; }
.section-title { font-size: clamp(1.8rem, 3.4vw, 2.7rem); font-weight: 800; letter-spacing: -.03em; }
html[lang="ar"] .section-title { letter-spacing: 0; }
.section-sub { color: var(--muted); font-size: 1.1rem; max-width: 640px; margin-inline: auto; }
.feature { padding: 1.6rem; border-radius: 20px; background: #fff; border: 1px solid var(--line); height: 100%; transition: transform .25s ease, box-shadow .25s ease, border-color .25s; }
.feature:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: #c7d2fe; }
.feature .f-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 1.5rem; margin-bottom: 1rem; color: #fff; }
.feature h3 { font-size: 1.15rem; font-weight: 700; }
.feature p { color: var(--muted); margin: 0; }
.g1 { background: linear-gradient(135deg, #6366f1, #8b5cf6); } .g2 { background: linear-gradient(135deg, #14b8a6, #06b6d4); }
.g3 { background: linear-gradient(135deg, #f59e0b, #f97316); } .g4 { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.g5 { background: linear-gradient(135deg, #10b981, #84cc16); } .g6 { background: linear-gradient(135deg, #3b82f6, #6366f1); }
.split-photo { border-radius: 28px; overflow: hidden; box-shadow: var(--shadow-lg); aspect-ratio: 5 / 4; background: #e0e7ff; }
.split-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s ease; }
.split-photo:hover img { transform: scale(1.05); }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { display: flex; gap: .7rem; padding: .45rem 0; color: var(--ink-2); }
.check-list li i { color: var(--accent); font-size: 1.15rem; }
.stats-band { background: linear-gradient(135deg, #1e1b4b, #312e81 50%, #134e4a); color: #fff; border-radius: 32px; padding: 3rem; position: relative; overflow: hidden; }
.stats-band .num { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; }
.stats-band .lbl { color: #c7d2fe; }
.ai-panel { border-radius: 24px; background: #0f172a; color: #e2e8f0; padding: 1.4rem; box-shadow: var(--shadow-lg); font-size: .92rem; }
.ai-panel .ai-step { display: flex; gap: .8rem; align-items: center; padding: .7rem .8rem; border-radius: 12px; background: rgba(255, 255, 255, .04); margin-bottom: .5rem; opacity: 0; animation: stepIn .5s ease forwards; }
.ai-panel .ai-step:nth-child(2) { animation-delay: .35s; } .ai-panel .ai-step:nth-child(3) { animation-delay: .7s; }
.ai-panel .ai-step:nth-child(4) { animation-delay: 1.05s; } .ai-panel .ai-step:nth-child(5) { animation-delay: 1.4s; }
.ai-panel .ai-step i { color: #5eead4; font-size: 1.1rem; }
.pricing { border-radius: 24px; padding: 2rem; border: 1px solid var(--line); background: #fff; height: 100%; position: relative; transition: transform .25s, box-shadow .25s; }
.pricing:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.pricing.featured { border: 2px solid var(--brand); box-shadow: 0 30px 60px -30px rgba(79, 70, 229, .5); }
.pricing .price { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; }
.pricing .ribbon { position: absolute; top: -13px; inset-inline-start: 50%; transform: translateX(-50%); background: var(--brand); color: #fff; font-size: .78rem; font-weight: 700; padding: .3rem .9rem; border-radius: 999px; }
html[dir="rtl"] .pricing .ribbon { transform: translateX(50%); }
.quote { border-radius: 20px; padding: 1.6rem; background: #fff; border: 1px solid var(--line); height: 100%; }
.quote .stars { color: #f59e0b; }
.faq .accordion-item { border: 1px solid var(--line); border-radius: 14px !important; margin-bottom: .75rem; overflow: hidden; }
.faq .accordion-button { font-weight: 700; }
.faq .accordion-button:not(.collapsed) { background: var(--brand-50); color: var(--brand); box-shadow: none; }
.cta { border-radius: 32px; padding: 4rem 2rem; text-align: center; color: #fff; background: linear-gradient(120deg, #4f46e5, #7c3aed 50%, #0d9488); position: relative; overflow: hidden; }
.cta::before { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 300px at 20% 0%, rgba(255, 255, 255, .25), transparent 60%); }
.site-footer { background: #0b1023; color: #94a3b8; padding: 4rem 0 2rem; }
.site-footer a { color: #cbd5e1; } .site-footer a:hover { color: #fff; }
.site-footer h6 { color: #fff; font-weight: 700; margin-bottom: 1rem; }

/* ---------- Legal pages ---------- */
.legal { padding: 8rem 0 4rem; }
.legal article { max-width: 820px; margin: 0 auto; }
.legal h1 { font-weight: 800; letter-spacing: -.02em; }
.legal h2 { font-size: 1.25rem; font-weight: 700; margin-top: 2rem; }
.legal p, .legal li { color: var(--ink-2); line-height: 1.8; }
.legal .toc { position: sticky; top: 100px; }

/* ---------- Auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.auth-aside { position: relative; overflow: hidden; color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between;
    background: linear-gradient(160deg, rgba(30, 27, 75, .92), rgba(49, 46, 129, .82) 50%, rgba(19, 78, 74, .88)), var(--auth-photo) center / cover no-repeat; }
.auth-aside h2 { font-size: 2.2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.auth-aside .quote-card { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(10px); border-radius: 20px; padding: 1.25rem; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; position: relative; }
.auth-card { width: 100%; max-width: 440px; animation: fadeUp .5s ease both; }
.auth-card.wide { max-width: 640px; }
.auth-card h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; }
.auth-top { position: absolute; top: 1.5rem; inset-inline: 1.5rem; display: flex; justify-content: space-between; align-items: center; }
.divider { display: flex; align-items: center; gap: 1rem; color: var(--muted); font-size: .85rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.pw-meter { height: 6px; border-radius: 3px; background: #f1f5f9; overflow: hidden; margin-top: .45rem; }
.pw-meter span { display: block; height: 100%; width: 0; transition: width .25s, background .25s; }
.subdomain-input { display: flex; align-items: stretch; }
.subdomain-input .form-control { border-start-end-radius: 0; border-end-end-radius: 0; direction: ltr; text-align: left; }
.subdomain-input .suffix { display: flex; align-items: center; padding: 0 .9rem; background: #f8fafc; border: 1px solid var(--line); border-inline-start: 0; border-start-end-radius: 12px; border-end-end-radius: 12px; color: var(--muted); font-size: .9rem; direction: ltr; }
.steps-indicator { display: flex; gap: .5rem; margin-bottom: 1.5rem; }
.steps-indicator span { flex: 1; height: 5px; border-radius: 3px; background: #e2e8f0; transition: background .3s; }
.steps-indicator span.on { background: linear-gradient(90deg, var(--brand), #7c3aed); }
.wizard-step { display: none; animation: fadeUp .35s ease both; }
.wizard-step.active { display: block; }
.cf-turnstile { min-height: 65px; }
@media (max-width: 991.98px) {
    .auth { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .float-card.one { inset-inline-start: -8px; } .float-card.two { inset-inline-end: -8px; }
}

/* ---------- Reveal-on-scroll + keyframes ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .1s; } .reveal.d2 { transition-delay: .2s; } .reveal.d3 { transition-delay: .3s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(40px, -30px) scale(1.15); } }
@keyframes slowZoom { from { transform: scale(1.04); } to { transform: scale(1.14); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes stepIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .reveal { opacity: 1; transform: none; }
}
.flex-none { flex: none; }

/* ---------- Lessons ---------- */
.lesson { font-size: 1.05rem; line-height: 1.75; }
.lesson .md p:last-child { margin-bottom: 0; }
.lesson .md img { max-width: 100%; border-radius: 12px; }
.lesson .md table { width: 100%; margin-bottom: 1rem; border-collapse: collapse; }
.lesson .md th, .lesson .md td { border: 1px solid var(--line); padding: .4rem .6rem; }
.lesson-hook { display: flex; gap: .5rem; padding: 1rem 1.25rem; border-radius: 16px; background: linear-gradient(120deg, #fef3c7, #fde68a55); border: 1px solid #fde68a; font-weight: 500; }
.lesson-step { animation: fadeUp .35s ease both; }
.step-hidden { display: none; }
.step-num { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--brand); color: #fff; font-size: .85rem; font-weight: 700; flex: none; }
.quiz-opt { white-space: normal; }
.lesson-row { display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
.lesson-row:last-child { border-bottom: 0; }
.lesson-row .date-chip { width: 54px; text-align: center; border-radius: 10px; background: #f1f5f9; font-size: .75rem; line-height: 1.2; padding: .3rem 0; flex: none; }
.lesson-row .date-chip b { display: block; font-size: 1rem; }
.lesson-row.today .date-chip { background: var(--brand); color: #fff; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.status-dot.s0 { background: #cbd5e1; } .status-dot.s1 { background: #f59e0b; } .status-dot.s2 { background: #10b981; }

/* ==========================================================================
   Online admissions
   ========================================================================== */
.badge-soft.info { background: #e0f2fe; color: #0369a1; }
.is-invalid.form-control, .is-invalid.form-select { border-color: var(--rose) !important; box-shadow: 0 0 0 4px rgba(244, 63, 94, .1) !important; }

/* Searchable select */
.combo { position: relative; }
.combo-native { position: absolute; inset: 0; opacity: 0; pointer-events: none; height: 100%; }
.combo-input { padding-inline-end: 2.2rem; }
.combo.has-flag .combo-input { padding-inline-start: 2.6rem; }
.combo-flag { position: absolute; inset-inline-start: .85rem; top: 50%; transform: translateY(-50%); font-size: 1.15rem; line-height: 1; z-index: 2; pointer-events: none; }
.combo-caret { position: absolute; inset-inline-end: .9rem; top: 50%; transform: translateY(-50%); color: var(--muted); cursor: pointer; transition: transform .2s; }
.combo.open .combo-caret { transform: translateY(-50%) rotate(180deg); }
.combo-list { display: none; position: absolute; z-index: 30; inset-inline: 0; top: calc(100% + 6px); max-height: 280px; overflow-y: auto;
    background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: .35rem; }
.combo.open .combo-list { display: block; animation: fadeUp .15s ease both; }
.combo-item { padding: .55rem .7rem; border-radius: 10px; cursor: pointer; display: flex; align-items: center; gap: .25rem; }
.combo-item small { color: var(--muted); margin-inline-start: auto; font-size: .8rem; }
.combo-item.active, .combo-item:hover { background: var(--brand-50); }
.combo-item.selected { font-weight: 700; color: var(--brand); }
.combo-empty { padding: .75rem; color: var(--muted); text-align: center; }

/* Application page */
.apply-page { min-height: 100vh; background: radial-gradient(1200px 500px at 100% -10%, rgba(124, 58, 237, .10), transparent 60%),
    radial-gradient(900px 400px at -10% 10%, rgba(20, 184, 166, .10), transparent 60%), var(--bg); padding-bottom: 4rem; }
.apply-top { display: flex; align-items: center; gap: .9rem; padding: 1.1rem 0; }
.apply-top .school-logo { width: 46px; height: 46px; border-radius: 14px; object-fit: contain; background: #fff; box-shadow: var(--shadow-sm); padding: 4px; }
.apply-top .school-name { font-weight: 800; font-size: 1.05rem; line-height: 1.2; }
.apply-hero { background: linear-gradient(135deg, var(--brand), #7c3aed 60%, var(--accent)); color: #fff; border-radius: 24px; padding: 2rem; position: relative; overflow: hidden; box-shadow: var(--shadow-lg); }
.apply-hero::after { content: ""; position: absolute; width: 320px; height: 320px; inset-inline-end: -80px; top: -120px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.apply-hero h1 { font-weight: 800; font-size: clamp(1.5rem, 3.5vw, 2.2rem); letter-spacing: -.02em; margin-bottom: .35rem; }
.apply-hero p { color: #e0e7ff; margin: 0; max-width: 620px; }
.lang-switch { display: inline-flex; background: rgba(255, 255, 255, .16); border-radius: 999px; padding: 4px; gap: 4px; position: relative; z-index: 1; }
.lang-switch a { color: #fff; padding: .35rem .9rem; border-radius: 999px; font-weight: 600; font-size: .9rem; }
.lang-switch a.on { background: #fff; color: var(--brand); }
.apply-card { background: #fff; border-radius: 24px; box-shadow: var(--shadow); padding: clamp(1.25rem, 3vw, 2.25rem); }
.apply-card .wizard-step h5 { font-weight: 800; }
.section-title { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1rem; margin: 1.75rem 0 .9rem; color: var(--ink); }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.section-title i { color: var(--brand); }
.req { color: var(--rose); font-weight: 700; margin-inline-start: 2px; }
.hint-box { background: var(--brand-50); border-radius: 16px; padding: 1rem 1.1rem; color: var(--ink-2); font-size: .92rem; }
.hint-box.teal { background: var(--accent-50); }
.hint-box.warm { background: #fffbeb; }

/* Stepper */
.stepper { display: flex; gap: .4rem; list-style: none; padding: 0; margin: 0 0 1.5rem; overflow-x: auto; scrollbar-width: none; }
.stepper::-webkit-scrollbar { display: none; }
.stepper li { flex: 1; min-width: 96px; display: flex; flex-direction: column; align-items: center; gap: .4rem; text-align: center; font-size: .78rem; font-weight: 600; color: var(--muted); position: relative; cursor: default; }
.stepper li::before { content: ""; position: absolute; top: 19px; inset-inline-start: calc(-50% + 22px); width: calc(100% - 44px); height: 3px; border-radius: 2px; background: var(--line); }
.stepper li:first-child::before { display: none; }
.stepper .dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--line); font-size: 1.05rem; transition: all .25s; position: relative; z-index: 1; }
.stepper li.reachable { cursor: pointer; }
.stepper li.done .dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.stepper li.done::before, .stepper li.current::before { background: linear-gradient(90deg, var(--accent), var(--brand)); }
.stepper li.current { color: var(--ink); }
.stepper li.current .dot { background: linear-gradient(135deg, var(--brand), #7c3aed); border-color: transparent; color: #fff; box-shadow: 0 8px 18px -6px rgba(79, 70, 229, .7); transform: scale(1.08); }
@media (max-width: 575px) { .stepper li span.lbl { display: none; } .stepper li.current span.lbl { display: block; } .stepper li { min-width: 46px; } }

/* Choice cards (radio) */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice label { display: flex; align-items: center; gap: .75rem; border: 2px solid var(--line); border-radius: 16px; padding: .85rem 1rem; cursor: pointer; font-weight: 600; transition: all .15s; background: #fff; height: 100%; }
.choice label i { font-size: 1.4rem; color: var(--muted); }
.choice label small { display: block; font-weight: 500; color: var(--muted); font-size: .8rem; }
.choice input:checked + label { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 4px rgba(79, 70, 229, .1); }
.choice input:checked + label i { color: var(--brand); }
.choice input:focus-visible + label { outline: 3px solid rgba(79, 70, 229, .35); }
[data-radio-group].is-invalid .choice label { border-color: var(--rose); }

/* Document tiles */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.doc-tile { border: 2px dashed #cbd5e1; border-radius: 18px; padding: 1rem; display: flex; gap: .9rem; background: #fcfcfe; transition: all .2s; position: relative; }
.doc-tile.drag { border-color: var(--brand); background: var(--brand-50); }
.doc-tile.has-file { border-style: solid; border-color: #a7f3d0; background: #f0fdf9; }
.doc-tile.is-invalid { border-color: var(--rose); background: #fff1f2; }
.doc-tile.requested { border-color: var(--warm); background: #fffbeb; }
.doc-tile.busy::after { content: ""; position: absolute; inset: 0; border-radius: 16px; background: rgba(255, 255, 255, .6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 50 50'%3E%3Ccircle cx='25' cy='25' r='20' fill='none' stroke='%234f46e5' stroke-width='5' stroke-dasharray='90 40'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 25 25' to='360 25 25' dur='0.8s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") center no-repeat; }
.doc-icon { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem; background: var(--brand-50); color: var(--brand); }
.doc-tile.has-file .doc-icon { background: #d1fae5; color: #059669; }
.doc-body { flex: 1; min-width: 0; }
.doc-title { font-weight: 700; }
.doc-hint { font-size: .8rem; color: var(--muted); margin-bottom: .6rem; }
.doc-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.doc-actions .btn { padding: .4rem .7rem; font-size: .85rem; }
.doc-preview { display: grid; gap: .4rem; margin-bottom: .5rem; }
.doc-file { display: flex; align-items: center; gap: .6rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .35rem; }
.doc-file img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.doc-file > i { width: 44px; height: 44px; display: grid; place-items: center; font-size: 1.4rem; color: #e11d48; }
.doc-meta { flex: 1; min-width: 0; line-height: 1.2; }
.doc-meta strong { display: block; font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta small { color: var(--muted); font-size: .75rem; }
.on-file { font-size: .8rem; color: #059669; font-weight: 600; margin-bottom: .4rem; }
.photo-tile .doc-file img { width: 64px; height: 64px; border-radius: 50%; }

/* Review */
.review-block { border: 1px solid var(--line); border-radius: 16px; padding: .9rem 1.1rem; margin-bottom: .8rem; }
.review-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; margin-bottom: .4rem; }
.review-row { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; border-top: 1px dashed #eef0f5; font-size: .9rem; }
.review-row:first-of-type { border-top: 0; }
.review-row span { color: var(--muted); }
.review-row strong { text-align: end; font-weight: 600; word-break: break-word; }

.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 20px; height: 20px; inset: 0; margin: auto; border: 3px solid rgba(255, 255, 255, .5); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Status page */
.ref-chip { display: inline-flex; align-items: center; gap: .5rem; background: rgba(255, 255, 255, .18); border-radius: 14px; padding: .5rem .9rem; font-weight: 800; letter-spacing: .06em; font-size: 1.15rem; }
.timeline-steps { display: flex; gap: 0; margin: 1.5rem 0 .5rem; }
.timeline-steps > div { flex: 1; text-align: center; position: relative; font-size: .8rem; font-weight: 600; color: var(--muted); }
.timeline-steps > div::before { content: ""; position: absolute; top: 15px; inset-inline-start: -50%; width: 100%; height: 3px; background: var(--line); z-index: 0; }
.timeline-steps > div:first-child::before { display: none; }
.timeline-steps .tdot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto .4rem; background: #fff; border: 2px solid var(--line); position: relative; z-index: 1; }
.timeline-steps > div.on { color: var(--ink); }
.timeline-steps > div.on .tdot { background: var(--accent); border-color: var(--accent); color: #fff; }
.timeline-steps > div.on::before { background: var(--accent); }
.timeline-steps > div.warn .tdot { background: var(--warm); border-color: var(--warm); color: #fff; }
.timeline-steps > div.bad .tdot { background: var(--rose); border-color: var(--rose); color: #fff; }
.thread { display: grid; gap: .75rem; }
.bubble { max-width: 85%; padding: .75rem 1rem; border-radius: 18px; background: #f1f5f9; white-space: pre-line; }
.bubble.school { background: var(--brand-50); justify-self: start; border-end-start-radius: 6px; }
.bubble.family { background: #ecfdf5; justify-self: end; border-end-end-radius: 6px; }
.bubble .who { font-size: .75rem; color: var(--muted); font-weight: 600; margin-bottom: .2rem; display: flex; gap: .5rem; justify-content: space-between; }
.thread-event { text-align: center; font-size: .78rem; color: var(--muted); }
.thread-event span { background: #f8fafc; border: 1px solid var(--line); border-radius: 999px; padding: .2rem .7rem; }
.celebrate { background: linear-gradient(135deg, #ecfdf5, #e0f2fe); border-radius: 24px; padding: 2rem; text-align: center; }
.celebrate .big-id { font-size: clamp(1.4rem, 5vw, 2.2rem); font-weight: 800; letter-spacing: .08em; color: var(--ink); }

/* Admin review */
.app-row { display: flex; align-items: center; gap: 1rem; padding: .9rem 1.1rem; border-bottom: 1px solid #f1f5f9; color: inherit; transition: background .15s; }
.app-row:hover { background: #fafbff; color: inherit; }
.app-row .who { flex: 1; min-width: 0; }
.status-tabs { display: flex; flex-wrap: wrap; gap: .4rem; }
.status-tabs a { padding: .45rem .9rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; font-size: .88rem; }
.status-tabs a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.status-tabs a .n { background: rgba(100, 116, 139, .15); border-radius: 999px; padding: 0 .45rem; margin-inline-start: .3rem; font-size: .78rem; }
.status-tabs a.on .n { background: rgba(255, 255, 255, .2); }
.doc-thumb { display: block; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; color: inherit; transition: box-shadow .15s, transform .15s; }
.doc-thumb:hover { box-shadow: var(--shadow); transform: translateY(-2px); color: inherit; }
.doc-thumb .ph { height: 130px; display: grid; place-items: center; background: #f8fafc; font-size: 2.4rem; color: #e11d48; }
.doc-thumb img { width: 100%; height: 130px; object-fit: cover; display: block; }
.doc-thumb .cap { padding: .5rem .7rem; font-size: .8rem; }
.kv { display: grid; grid-template-columns: 42% 58%; row-gap: .45rem; font-size: .9rem; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }
.share-link { display: flex; gap: .5rem; align-items: center; background: #f8fafc; border: 1px solid var(--line); border-radius: 14px; padding: .4rem .4rem .4rem .9rem; }
.share-link code { flex: 1; color: var(--ink); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#qr svg { width: 160px; height: 160px; }
.apply-card .empty-icon { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; font-size: 2rem; background: var(--brand-50); color: var(--brand); }

/* ==========================================================================
   Timetable, attendance, gradebook, quizzes, report cards
   ========================================================================== */
.tt-grid { width: 100%; border-collapse: separate; border-spacing: 4px; min-width: 640px; }
.tt-grid th { font-size: .8rem; color: var(--muted); font-weight: 700; text-align: center; padding: .3rem; }
.tt-grid thead th.today { color: var(--brand); }
.tt-grid tbody th { text-align: start; width: 90px; color: var(--ink-2); }
.tt-grid tbody th small { color: var(--muted); font-weight: 500; }
.tt-grid td { background: #f8fafc; border-radius: 12px; height: 62px; padding: 4px; vertical-align: top; border-inline-start: 4px solid var(--c, transparent); }
.tt-grid td.live { outline: 2px solid var(--brand); }
.tt-grid tr.brk td { height: auto; text-align: center; font-size: .8rem; color: var(--muted); background: repeating-linear-gradient(45deg, #f8fafc, #f8fafc 8px, #f1f5f9 8px, #f1f5f9 16px); border: 0; padding: .35rem; }
.tt-cell { padding: .2rem .35rem; line-height: 1.2; }
.tt-cell strong { display: block; font-size: .85rem; }
.tt-cell small { color: var(--muted); font-size: .72rem; }
.tt-select { border: 0; background-color: transparent; font-weight: 600; font-size: .82rem; padding: .2rem 1.6rem .2rem .3rem; }
@media print { .sidebar, .topbar, .page-head .btn, form .btn, .no-print { display: none !important; } .main { margin: 0 !important; } }

.att-row { display: flex; align-items: center; gap: .75rem; padding: .6rem .9rem; border-bottom: 1px solid #f1f5f9; }
.att-row .who { flex: 1; min-width: 0; }
.att-btns { display: flex; gap: .3rem; }
.att-btns input { position: absolute; opacity: 0; pointer-events: none; }
.att-btns label { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; cursor: pointer; border: 2px solid var(--line); color: var(--muted); background: #fff; transition: all .12s; user-select: none; }
.att-btns input:checked + label.p { background: #10b981; border-color: #10b981; color: #fff; }
.att-btns input:checked + label.a { background: var(--rose); border-color: var(--rose); color: #fff; }
.att-btns input:checked + label.l { background: var(--warm); border-color: var(--warm); color: #fff; }
.att-btns input:checked + label.e { background: #0ea5e9; border-color: #0ea5e9; color: #fff; }
.att-note { max-width: 180px; }
@media (max-width: 575px) { .att-note { display: none; } .att-btns label { width: 38px; height: 38px; } }
.att-cal td, .att-cal th { text-align: center; padding: .25rem; font-size: .75rem; min-width: 26px; }
.att-dot { width: 20px; height: 20px; border-radius: 6px; display: inline-grid; place-items: center; font-weight: 800; font-size: .65rem; color: #fff; }
.att-dot.Present { background: #10b981; } .att-dot.Absent { background: var(--rose); } .att-dot.Late { background: var(--warm); } .att-dot.Excused { background: #0ea5e9; }

.gb { border-collapse: separate; border-spacing: 0; font-size: .85rem; }
.gb th, .gb td { border-bottom: 1px solid #f1f5f9; padding: .4rem .5rem; white-space: nowrap; }
.gb thead th { position: sticky; top: 0; background: #fff; z-index: 2; vertical-align: bottom; }
.gb .stu { position: sticky; inset-inline-start: 0; background: #fff; z-index: 1; min-width: 180px; }
.gb thead .stu { z-index: 3; }
.gb .a-head { max-width: 120px; white-space: normal; font-size: .75rem; font-weight: 700; }
.gb .a-head small { display: block; color: var(--muted); font-weight: 500; }
.gb input.sc { width: 64px; text-align: center; padding: .25rem; border-radius: 8px; border: 1px solid var(--line); }
.gb input.sc:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }
.gb input.sc.changed { background: #fffbeb; border-color: var(--warm); }
.gb .tot { font-weight: 800; background: #fafbff; }
.pct { font-weight: 800; }
.pct.lo { color: var(--rose); } .pct.mid { color: #b45309; } .pct.hi { color: #059669; }

.q-card { border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.1rem; margin-bottom: .9rem; background: #fff; }
.q-card .q-num { width: 30px; height: 30px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--brand-50); color: var(--brand); font-weight: 800; flex: 0 0 30px; }
.q-opt { display: flex; align-items: center; gap: .6rem; border: 2px solid var(--line); border-radius: 12px; padding: .6rem .8rem; margin-top: .5rem; cursor: pointer; transition: all .12s; }
.q-opt:hover { border-color: #c7d2fe; }
.q-opt input { accent-color: var(--brand); width: 18px; height: 18px; }
.q-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.q-opt.right { border-color: #10b981; background: #ecfdf5; }
.q-opt.wrong { border-color: var(--rose); background: #fff1f2; }
.quiz-bar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: .6rem 0; margin-bottom: 1rem; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.1rem; }
.timer.low { color: var(--rose); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .5; } }

.work-item { display: flex; gap: .9rem; align-items: center; padding: .85rem 1rem; border-bottom: 1px solid #f1f5f9; color: inherit; }
.work-item:hover { background: #fafbff; color: inherit; }
.work-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; background: var(--brand-50); color: var(--brand); flex: 0 0 42px; }
.due-chip { font-size: .75rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; background: #f1f5f9; color: var(--ink-2); white-space: nowrap; }
.due-chip.soon { background: #fffbeb; color: #b45309; } .due-chip.late { background: #fff1f2; color: #e11d48; } .due-chip.done { background: #ecfdf5; color: #059669; }

.rc { background: #fff; max-width: 860px; margin: 0 auto; padding: 2rem; border-radius: 18px; box-shadow: var(--shadow); }
.rc-head { display: flex; align-items: center; gap: 1rem; border-bottom: 3px solid var(--brand); padding-bottom: 1rem; margin-bottom: 1rem; }
.rc-head img { max-height: 70px; max-width: 120px; }
.rc table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.rc th, .rc td { border: 1px solid #e2e8f0; padding: .45rem .6rem; }
.rc thead th { background: #f8fafc; }
.rc .sig { display: flex; justify-content: space-between; gap: 2rem; margin-top: 2.5rem; }
.rc .sig div { flex: 1; border-top: 1px solid #94a3b8; padding-top: .4rem; text-align: center; font-size: .8rem; color: var(--muted); }
.rc-break { page-break-after: always; break-after: page; }
@media print {
  body { background: #fff !important; }
  .rc { box-shadow: none; border-radius: 0; padding: 0; max-width: none; }
  .rc thead th { background: #f1f5f9 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.script-hint { font-size: .78rem; color: var(--rose); height: 0; overflow: hidden; opacity: 0; transition: opacity .2s; }
.script-hint.show { height: auto; opacity: 1; margin-top: .25rem; }

/* ---------- Jobs board ---------- */
.job-card { display: block; background: #fff; border-radius: 20px; padding: 1.2rem 1.4rem; box-shadow: var(--shadow); color: inherit; text-decoration: none; border: 1px solid transparent; transition: transform .2s, box-shadow .2s, border-color .2s; }
.job-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--brand-50); color: inherit; }
.job-chip { display: inline-flex; align-items: center; gap: .35rem; background: #f1f5f9; color: #334155; border-radius: 999px; padding: .25rem .7rem; }
.job-text { white-space: pre-line; color: #334155; }
.step-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-size: .85rem; margin-inline-end: .5rem; }
.job-steps { display: grid; grid-template-columns: repeat(6, 1fr); gap: .3rem; font-size: .78rem; text-align: center; color: var(--muted); }
.job-step span { display: block; height: 6px; border-radius: 4px; background: #e2e8f0; margin-bottom: .35rem; }
.job-step.done span { background: var(--brand); } .job-step.now span { background: var(--accent); } .job-step.now { color: var(--ink); font-weight: 700; }
.empty-hide:empty, .validation-summary-valid.empty-hide { display: none; }
@media (max-width: 575px) { .job-steps { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Curriculum roadmaps ---------- */
.roadmap-hero { background: linear-gradient(135deg, #312e81, #4f46e5 55%, #0891b2); color: #fff; border-radius: 1.25rem; padding: 1.75rem; box-shadow: 0 12px 30px -12px rgba(49,46,129,.5); }
.roadmap-hero h1 { color: #fff; font-size: 1.6rem; font-weight: 800; }
.roadmap-eyebrow { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; opacity: .8; }
.roadmap-road { display: flex; position: relative; gap: .5rem; }
.roadmap-road::before { content: ""; position: absolute; top: 22px; inset-inline: 8%; height: 4px; border-radius: 4px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.55) 0 14px, transparent 14px 24px); }
.roadmap-stop { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; color: #fff; text-decoration: none; position: relative; z-index: 1; padding: 0 .25rem; }
.roadmap-stop:hover { color: #fff; }
.roadmap-dot { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.15rem; background: rgba(255,255,255,.18); border: 3px solid rgba(255,255,255,.6); backdrop-filter: blur(4px); transition: transform .2s; }
.roadmap-stop.done .roadmap-dot { background: rgba(255,255,255,.35); }
.roadmap-stop.active .roadmap-dot { background: #fff; color: #4338ca; border-color: #fff; transform: scale(1.12); box-shadow: 0 0 0 6px rgba(255,255,255,.25); }
.roadmap-stop-name { font-weight: 700; margin-top: .5rem; font-size: .95rem; }
.roadmap-stop-sub { font-size: .78rem; opacity: .75; }
.roadmap-card { border-top: 4px solid var(--subject); transition: transform .15s, box-shadow .15s; }
.roadmap-card:hover { transform: translateY(-3px); box-shadow: 0 12px 24px -12px rgba(15,23,42,.25); }
.roadmap-icon { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; color: var(--subject, #4f46e5); background: color-mix(in srgb, var(--subject, #4f46e5) 12%, transparent); }
.roadmap-icon.lg { width: 60px; height: 60px; flex-basis: 60px; font-size: 1.7rem; color: #fff; background: rgba(255,255,255,.18); }
.roadmap-mini { padding-inline-start: 1.1rem; font-size: .85rem; color: var(--bs-secondary-color, #64748b); }
.roadmap-mini li { margin-bottom: .15rem; }
.roadmap-mini li::marker { color: var(--subject); font-weight: 700; }
.roadmap-mini li.more { list-style: none; font-weight: 600; }
.roadmap-pick-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; color: #fff; background: linear-gradient(135deg, #4f46e5, #0891b2); }
.roadmap-subject-head { background: linear-gradient(135deg, var(--subject), color-mix(in srgb, var(--subject) 55%, #0f172a)); color: #fff; border-radius: 1.25rem; padding: 1.5rem 1.75rem; }
.roadmap-subject-head h1 { color: #fff; font-size: 1.5rem; font-weight: 800; }
.roadmap-overview { border-inline-start: 4px solid #4f46e5; font-size: .98rem; }
.roadmap-steps { position: relative; }
.roadmap-steps::before { content: ""; position: absolute; top: 8px; bottom: 8px; inset-inline-start: 19px; width: 3px; border-radius: 3px; background: linear-gradient(#4f46e5, #0891b2); opacity: .35; }
.roadmap-step { display: flex; gap: 1rem; margin-bottom: 1.25rem; position: relative; }
.roadmap-step-num { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, #4f46e5, #0891b2); box-shadow: 0 0 0 5px var(--bs-body-bg, #fff); z-index: 1; }
.roadmap-step-card { flex: 1; min-width: 0; }
.roadmap-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--bs-secondary-color, #64748b); margin: .75rem 0 .35rem; display: flex; gap: .35rem; align-items: center; }
.roadmap-list { margin: 0; padding-inline-start: 1.1rem; }
.roadmap-list li { margin-bottom: .2rem; }
.roadmap-content { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .35rem .75rem; }
.roadmap-content li { display: flex; gap: .4rem; align-items: baseline; }
.roadmap-content li i { color: #16a34a; }
.roadmap-chip { font-size: .8rem; padding: .2rem .6rem; border-radius: 999px; background: #eef2ff; color: #3730a3; }
.roadmap-chip.skill { background: #ecfeff; color: #155e75; }
.roadmap-chip.value { background: #fdf2f8; color: #9d174d; }
.roadmap-chip.assess { background: #f0fdf4; color: #166534; }
.roadmap-pdf { width: 100%; height: 78vh; border: 0; display: block; }
.roadmap-pdf.small { height: 60vh; }
[data-bs-theme="dark"] .roadmap-chip { filter: brightness(.85); }
@media (max-width: 576px) { .roadmap-stop-name { font-size: .8rem; } .roadmap-dot { width: 40px; height: 40px; } .roadmap-road::before { top: 18px; } }
.roadmap-pending-icon { width: 72px; height: 72px; margin-inline: auto; border-radius: 20px; display: grid; place-items: center; font-size: 2rem; color: #fff; background: linear-gradient(135deg, var(--subject, #4f46e5), #0891b2); }
.roadmap-toc-num { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 700; color: #fff; background: linear-gradient(135deg, #4f46e5, #0891b2); }
.roadmap-step { scroll-margin-top: 1rem; }
.roadmap-hero h1, .roadmap-subject-head h1 { line-height: 1.3; overflow-wrap: anywhere; }
/* ---------- Library home ---------- */
.library-group { border: 2px solid transparent; transition: border-color .15s, transform .15s; }
.library-group:hover { transform: translateY(-2px); }
.library-group.active { border-color: #4f46e5; background: linear-gradient(180deg, rgba(79,70,229,.07), transparent); }
.library-group-icon { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; color: #4f46e5; background: rgba(79,70,229,.1); }
.library-group.active .library-group-icon { color: #fff; background: linear-gradient(135deg, #4f46e5, #0891b2); }
.library-section-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; font-weight: 800; font-size: 1.05rem; margin: .5rem 0 1rem; }
.library-section-title > i { color: #4f46e5; }
.library-section-title > span { flex-basis: 100%; font-weight: 400; font-size: .85rem; color: var(--bs-secondary-color, #64748b); }
.library-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.library-program-list { list-style: none; margin: 0; padding: 0; font-size: .88rem; }
.library-program-list li { display: flex; gap: .5rem; align-items: center; padding: .3rem 0; border-top: 1px dashed rgba(100,116,139,.2); }
.library-program-list li i { color: #4f46e5; }
.library-program-list li span { flex: 1; min-width: 0; }
.library-program-list li small { color: var(--bs-secondary-color, #64748b); white-space: nowrap; }
.library-modules { margin: 0; padding-inline-start: 1.2rem; font-size: .9rem; }
.library-modules li { padding: .25rem 0; border-bottom: 1px solid rgba(100,116,139,.12); }
.library-modules li::marker { color: #4f46e5; font-weight: 700; }
.library-modules li { display: list-item; }
.library-modules li > span { display: inline; }
.library-modules li > small { float: inline-end; color: var(--bs-secondary-color, #64748b); }

/* ---------- The Holy Quran ---------- */
.quran-hero, .quran-surah-head { position: relative; overflow: hidden; color: #fff; border-radius: 1.25rem; padding: 2rem 1.75rem; background: linear-gradient(135deg, #064e3b, #0f766e 55%, #155e75); box-shadow: 0 14px 34px -14px rgba(6,78,59,.6); }
.quran-surah-head.madani { background: linear-gradient(135deg, #1e3a8a, #0f766e 60%, #064e3b); }
.quran-hero-pattern { position: absolute; inset: 0; opacity: .12; pointer-events: none;
  background-image: radial-gradient(circle at 25% 25%, #fff 2px, transparent 2.5px), radial-gradient(circle at 75% 75%, #fff 2px, transparent 2.5px),
    repeating-conic-gradient(from 22.5deg, rgba(255,255,255,.5) 0 12.5%, transparent 0 25%);
  background-size: 48px 48px, 48px 48px, 96px 96px; mask-image: linear-gradient(90deg, transparent, #000 40%, #000 60%, transparent); }
.quran-hero-title { font-family: "Amiri Quran", "Amiri", serif; font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1.6; }
.quran-hero-sub { opacity: .85; max-width: 46rem; }
.quran-surah-title { font-family: "Amiri", serif; font-weight: 700; font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.5; }
.quran-surah-number { width: 54px; height: 54px; margin: 0 auto .25rem; display: grid; place-items: center; font-weight: 800; color: #064e3b; background: #fef3c7; clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); }
.quran-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .75rem; border-radius: 999px; background: rgba(255,255,255,.15); font-size: .85rem; backdrop-filter: blur(4px); }
.quran-nav-btn { color: #fff; text-decoration: none; padding: .25rem .65rem; border-radius: 999px; background: rgba(255,255,255,.14); font-family: "Amiri", serif; }
.quran-nav-btn:hover { color: #fff; background: rgba(255,255,255,.25); }
.quran-tracks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; }
.quran-track { display: block; padding: 1rem; border-radius: 1rem; color: #fff; background: linear-gradient(135deg, var(--track), color-mix(in srgb, var(--track) 60%, #0f172a)); box-shadow: 0 10px 22px -14px var(--track); transition: transform .15s; }
.quran-track:hover { color: #fff; transform: translateY(-3px); }
.quran-track-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; background: rgba(255,255,255,.2); margin-bottom: .5rem; }
.quran-track-icon.lg { width: 60px; height: 60px; font-size: 1.7rem; margin: 0; }
.quran-track-bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,.25); margin-top: .6rem; overflow: hidden; }
.quran-track-bar span { display: block; height: 100%; background: #fff; border-radius: 6px; }
.quran-search { position: relative; min-width: 220px; }
.quran-search i { position: absolute; inset-inline-start: .85rem; top: 50%; transform: translateY(-50%); color: #64748b; }
.quran-search input { padding-inline-start: 2.4rem; border-radius: 999px; }
.quran-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: .75rem; }
.quran-surah { position: relative; display: flex; align-items: center; gap: .85rem; padding: .85rem 1rem; border-radius: 1rem; background: var(--bs-body-bg, #fff); border: 1px solid rgba(100,116,139,.18); color: inherit; text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
a.quran-surah:hover, .quran-surah:hover { border-color: #0f766e; transform: translateY(-2px); box-shadow: 0 10px 22px -16px rgba(15,118,110,.6); color: inherit; }
.quran-surah.is-done { border-color: #16a34a; background: linear-gradient(90deg, rgba(22,163,74,.07), transparent); }
.quran-surah.is-learning { border-color: #f59e0b; }
.quran-num { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: #0f766e; background: rgba(15,118,110,.1); clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); }
.quran-name-ar { display: block; font-family: "Amiri", serif; font-size: 1.35rem; font-weight: 700; color: #064e3b; line-height: 1.4; }
[data-bs-theme="dark"] .quran-name-ar { color: #6ee7b7; }
.quran-flag { position: absolute; top: .4rem; inset-inline-end: .5rem; font-size: .8rem; }
.quran-flag.curriculum { color: #4f46e5; } .quran-flag.memorized { color: #16a34a; inset-inline-end: 1.6rem; } .quran-flag.learning { color: #f59e0b; inset-inline-end: 1.6rem; }
.quran-state-btn { border: 0; background: none; font-size: 1.3rem; padding: .25rem; line-height: 1; }
.quran-tabs .nav-link { border-radius: 999px; }
.quran-tabs .nav-link.active { background: #0f766e; }
.quran-toolbar { position: sticky; top: .5rem; z-index: 5; }
.quran-reader { --quran-size: 2rem; }
.quran-basmala { text-align: center; font-family: "Amiri Quran", "Amiri", serif; font-size: calc(var(--quran-size) * 1.05); color: #064e3b; padding: .5rem 0 1rem; }
.quran-ayah { display: flex; gap: 1rem; padding: 1.1rem 1.1rem; border-radius: 1rem; margin-bottom: .6rem; background: var(--bs-body-bg, #fff); border: 1px solid rgba(100,116,139,.14); transition: background .2s, border-color .2s; scroll-margin-top: 6rem; }
.quran-ayah.playing { border-color: #0f766e; background: linear-gradient(90deg, rgba(15,118,110,.08), rgba(15,118,110,.02)); }
.quran-ayah.linked { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.25); }
.quran-ayah-side { display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.quran-ayah-num { width: 34px; height: 34px; display: grid; place-items: center; font-size: .8rem; font-weight: 700; color: #0f766e; border: 2px solid rgba(15,118,110,.35); border-radius: 50%; }
.quran-icon-btn { border: 0; background: none; color: #64748b; font-size: 1.15rem; padding: .15rem; line-height: 1; border-radius: 8px; }
.quran-icon-btn:hover { color: #0f766e; background: rgba(15,118,110,.08); }
.quran-ayah-body { flex: 1; min-width: 0; }
.quran-arabic { font-family: "Amiri Quran", "Amiri", serif; font-size: var(--quran-size, 2rem); line-height: 2.25; text-align: right; color: var(--bs-body-color); }
.quran-end { font-size: .8em; color: #0f766e; }
.quran-reader[data-mode="plain"] .quran-arabic.tajweed, .quran-reader[data-mode="tajweed"] .quran-arabic.plain { display: none; }
.quran-reader.no-translation .quran-translation { display: none; }
.quran-translation { margin-top: .5rem; padding-top: .6rem; border-top: 1px dashed rgba(100,116,139,.25); font-size: 1rem; line-height: 1.7; color: var(--bs-secondary-color, #475569); }
.quran-arabic .ayah-end { font-size: .8em; color: #0f766e; }
.tj.ham_wasl, .tj.laam_shamsiyah, .tj.slnt { color: #9ca3af; }
.tj.madda_normal { color: #537fff; } .tj.madda_permissible { color: #4050ff; } .tj.madda_obligatory { color: #2144c1; } .tj.madda_necessary { color: #000ebc; }
.tj.ghunnah { color: #ff7e1e; } .tj.qalaqah { color: #dd0008; } .tj.ikhafa { color: #9400a8; } .tj.ikhafa_shafawi { color: #d500b7; } .tj.iqlab { color: #26bffd; }
.tj.idgham_ghunnah { color: #169777; } .tj.idgham_wo_ghunnah { color: #169200; } .tj.idgham_shafawi { color: #58b800; } .tj.idgham_mutajanisayn, .tj.idgham_mutaqaribayn { color: #a1a1a1; }
[data-bs-theme="dark"] .tj.madda_necessary { color: #6b7cff; }
.quran-legend-item { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .55rem; border-radius: 999px; background: rgba(100,116,139,.08); }
.quran-legend-item span { width: 12px; height: 12px; border-radius: 50%; }
.quran-offcanvas { width: min(560px, 100vw) !important; }
.quran-offcanvas #tafsir-ayah { font-size: 1.6rem; line-height: 2; padding: .75rem 1rem; border-radius: .75rem; background: rgba(15,118,110,.06); }
.quran-tafsir-text { line-height: 1.9; font-size: 1.02rem; }
.quran-tafsir-text h5 { font-size: 1rem; font-weight: 700; margin-top: 1rem; color: #0f766e; }
.quran-info { line-height: 1.9; }
.quran-info h5 { font-weight: 800; font-size: 1.05rem; color: #0f766e; margin-top: 1.25rem; }
.quran-fact { display: flex; gap: .85rem; align-items: center; padding: .7rem 0; border-bottom: 1px solid rgba(100,116,139,.12); }
.quran-fact:last-child { border-bottom: 0; }
.quran-fact > i { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: rgba(15,118,110,.1); color: #0f766e; font-size: 1.1rem; }
.quran-chip-link { display: inline-flex; gap: .35rem; align-items: center; padding: .3rem .75rem; border-radius: 999px; color: #fff; background: var(--track); text-decoration: none; font-size: .85rem; }
.quran-chip-link:hover { color: #fff; filter: brightness(1.1); }
.quran-rule { border-top: 4px solid var(--rule); }
.quran-rule-swatch { width: 18px; height: 18px; border-radius: 50%; background: var(--rule); box-shadow: 0 0 0 4px color-mix(in srgb, var(--rule) 20%, transparent); }
.quran-track-head { color: #fff; border-radius: 1.25rem; padding: 1.5rem 1.75rem; background: linear-gradient(135deg, var(--track), color-mix(in srgb, var(--track) 55%, #0f172a)); }
.quran-track-head h1 { color: #fff; font-weight: 800; font-size: 1.6rem; }
.quran-ring { --pct: 0; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(#fff calc(var(--pct) * 1%), rgba(255,255,255,.25) 0); }
.quran-ring span { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: color-mix(in srgb, var(--track) 70%, #0f172a); }
a.quran-link { display: inline-flex; align-items: baseline; gap: .25rem; padding: 0 .4rem; border-radius: .4rem; color: #0f766e; background: rgba(15,118,110,.08); text-decoration: none; font-weight: 600; }
a.quran-link:hover { background: rgba(15,118,110,.16); color: #064e3b; }
a.quran-link i { font-size: .8em; }
.lesson-body a[href^="/quran/"], .markdown a[href^="/quran/"] { color: #0f766e; font-weight: 600; background: rgba(15,118,110,.08); padding: 0 .35rem; border-radius: .35rem; text-decoration: none; }
@media (max-width: 576px) { .quran-ayah { flex-direction: column; } .quran-ayah-side { flex-direction: row; } }
/* ---------- Book upload (parts + supporting materials) ---------- */
.book-upload { display: grid; gap: 1rem; }
.book-step { display: flex; gap: .85rem; padding: 1rem; border: 1px dashed rgba(100,116,139,.35); border-radius: 1rem; }
.book-step-num { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, #4f46e5, #0891b2); }
.book-count.active { background: #4f46e5; color: #fff; }
.book-part { display: grid; grid-template-columns: minmax(110px, auto) 1fr minmax(120px, 160px); gap: .5rem; align-items: center; }
.book-part-label { display: flex; gap: .35rem; align-items: center; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.book-part .book-kind { min-width: 150px; }
.book-part:has(.book-kind) { grid-template-columns: minmax(150px, 210px) 1fr auto; }
@media (max-width: 576px) { .book-part, .book-part:has(.book-kind) { grid-template-columns: 1fr; } }
/* ---------- Developed syllabus (المفردات) ---------- */
.roadmap-syllabus-note { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; padding: 1rem 1.25rem; border-radius: 1rem; background: linear-gradient(135deg, rgba(22,163,74,.08), rgba(8,145,178,.06)); border: 1px solid rgba(22,163,74,.25); }
.roadmap-syllabus-badge { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; color: #fff; background: linear-gradient(135deg, #16a34a, #0891b2); }
.roadmap-syllabus-tag { display: inline-flex; align-items: center; font-size: .75rem; font-weight: 700; color: #15803d; background: rgba(22,163,74,.1); padding: .15rem .55rem; border-radius: 999px; }
.roadmap-unit { border-inline-start: 4px solid var(--subject); }
.roadmap-unit-num { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: #fff; background: var(--subject); }
.roadmap-topics { padding-inline-start: 1.25rem; font-size: .92rem; columns: 2 220px; column-gap: 1.5rem; }
.roadmap-topics li { break-inside: avoid; margin-bottom: .25rem; }
.roadmap-topics li::marker { color: var(--subject); font-weight: 700; }

/* ---------- Quran: language, study guide, videos, programme ---------- */
.quran-info.is-en { text-align: left; font-family: system-ui, "Segoe UI", sans-serif; }
.quran-info.is-en .lead { font-size: 1.05rem; color: var(--ink-2); }
.quran-lang-note { font-size: .85rem; padding: .6rem .85rem; border-radius: .75rem; background: #fef3c7; color: #92400e; margin-bottom: 1rem; text-align: right; }
.quran-tabs .quran-tab-guide { color: #047857; font-weight: 700; }
.quran-tabs .quran-tab-guide.active { background: linear-gradient(135deg, #047857, #0f766e) !important; color: #fff; }
.quran-guide-teaser { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; border-radius: 1rem; background: linear-gradient(135deg, rgba(4,120,87,.1), rgba(14,116,144,.08)); border: 1px solid rgba(4,120,87,.25); }
.quran-guide-teaser > i { font-size: 1.5rem; color: #047857; }
.quran-guide-hero { padding: 1.4rem 1.5rem; border-radius: 1.25rem; color: #fff; background: radial-gradient(circle at 15% 20%, rgba(255,255,255,.15), transparent 40%), linear-gradient(135deg, #065f46, #0f766e 55%, #1e3a8a); line-height: 2; box-shadow: 0 14px 30px -16px rgba(6,95,70,.7); }
.quran-theme { display: flex; align-items: center; gap: .65rem; height: 100%; padding: .9rem 1rem; border-radius: 1rem; background: #fff; border: 1px solid var(--line); font-weight: 700; font-size: .92rem; box-shadow: 0 6px 16px -12px rgba(15,23,42,.4); }
.quran-theme i { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(135deg, #0f766e, #0e7490); font-size: 1.1rem; }
.quran-passages { position: relative; display: grid; gap: 1rem; }
.quran-passage { display: flex; gap: 1rem; }
.quran-passage-num { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 50%; font-weight: 800; color: #fff; background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 6px 14px -6px rgba(217,119,6,.7); }
.quran-passage-body { flex: 1; padding: 1rem 1.2rem; background: #fff; border: 1px solid var(--line); border-radius: 1rem; border-inline-start: 4px solid #0f766e; }
.quran-passage-lessons { display: flex; flex-wrap: wrap; gap: .4rem; }
.quran-passage-lessons span { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; padding: .25rem .6rem; border-radius: 999px; background: #ecfdf5; color: #065f46; }
.quran-ayah.is-flash { animation: ayahFlash 2.2s ease; }
@keyframes ayahFlash { 0%, 60% { background: #fef3c7; } 100% { background: transparent; } }
.video-empty { display: flex; align-items: center; gap: .75rem; padding: 1.25rem; border-radius: 1rem; border: 2px dashed var(--line); color: var(--muted); }
.video-empty i { font-size: 1.6rem; }
.video-card { border-radius: 1rem; overflow: hidden; background: #fff; border: 1px solid var(--line); box-shadow: 0 8px 20px -14px rgba(15,23,42,.4); }
.video-add { padding: .85rem; border-radius: .9rem; background: var(--bg); }
.quran-ring.light { box-shadow: none; }
.quran-progress-row { border-radius: 1rem; margin-bottom: .85rem; }
.quran-progress-bar { position: relative; width: 190px; height: 26px; border-radius: 999px; background: #ecfdf5; overflow: hidden; }
.quran-progress-bar span { position: absolute; inset-block: 0; inset-inline-start: 0; background: linear-gradient(90deg, #10b981, #0f766e); border-radius: 999px; }
.quran-progress-bar b { position: relative; display: block; text-align: center; font-size: .78rem; line-height: 26px; color: #064e3b; }
.quran-chips { display: flex; flex-wrap: wrap; gap: 3px; }
.quran-dot { width: 26px; height: 22px; display: grid; place-items: center; font-size: .65rem; border-radius: 6px; background: #f1f5f9; color: #94a3b8; }
.quran-dot.done { background: #10b981; color: #fff; }
.quran-dot.learning { background: #fbbf24; color: #78350f; }
.quran-record { padding: .75rem; border-radius: .9rem; background: #f0fdf4; }
.avatar-circle { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 50%; font-weight: 800; color: #fff; background: linear-gradient(135deg, #0f766e, #4f46e5); }

/* ---------- Seerah & stories ---------- */
.seerah-hero, .seerah-story-head { position: relative; overflow: hidden; color: #fff; border-radius: 1.25rem; padding: 2rem 1.75rem; background: radial-gradient(circle at 85% 15%, rgba(250,204,21,.25), transparent 35%), linear-gradient(135deg, #1e1b4b, #4c1d95 50%, #7c2d12); box-shadow: 0 16px 36px -16px rgba(76,29,149,.7); }
.seerah-story-head { background: radial-gradient(circle at 85% 15%, rgba(255,255,255,.18), transparent 40%), linear-gradient(135deg, #111827, var(--cat) 120%); }
.seerah-hero-title { font-family: "Amiri", serif; font-weight: 700; font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.4; }
.seerah-stats { display: flex; flex-wrap: wrap; gap: .5rem; }
.seerah-stat { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .85rem; border-radius: 999px; color: #fff; text-decoration: none; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); font-size: .88rem; transition: .2s; }
.seerah-stat b { background: rgba(255,255,255,.22); border-radius: 999px; padding: 0 .5rem; font-size: .78rem; }
.seerah-stat:hover, .seerah-stat.active { color: #fff; background: var(--cat, rgba(255,255,255,.3)); transform: translateY(-1px); }
.seerah-section-head { display: flex; align-items: center; gap: .85rem; margin-bottom: 1.25rem; }
.seerah-section-icon { width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; border-radius: 14px; color: #fff; font-size: 1.35rem; background: var(--cat); box-shadow: 0 8px 18px -8px var(--cat); }
.seerah-timeline { list-style: none; padding: 0; margin: 0; position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.seerah-tl-card { position: relative; display: block; height: 100%; padding: 1.1rem 1.1rem 1rem; padding-inline-start: 3.6rem; border-radius: 1rem; background: #fff; border: 1px solid var(--line); color: inherit; text-decoration: none; transition: .2s; }
.seerah-tl-card:hover { border-color: var(--cat); box-shadow: 0 12px 26px -16px var(--cat); transform: translateY(-2px); }
.seerah-tl-dot { position: absolute; inset-inline-start: 1rem; top: 1.1rem; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--cat); font-size: .95rem; }
.seerah-tl-when { display: block; font-size: .75rem; font-weight: 700; color: var(--cat); margin-bottom: .2rem; }
.seerah-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.seerah-card { display: block; padding: 1.1rem; border-radius: 1rem; background: #fff; border: 1px solid var(--line); color: inherit; text-decoration: none; transition: .2s; border-top: 4px solid var(--cat); }
.seerah-card:hover { transform: translateY(-3px); box-shadow: 0 14px 28px -18px var(--cat); }
.seerah-card-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; margin-bottom: .6rem; color: var(--cat); background: color-mix(in srgb, var(--cat) 12%, #fff); font-size: 1.15rem; }
.seerah-card-sum { display: block; font-size: .82rem; color: var(--muted); margin-top: .4rem; line-height: 1.7; }
.seerah-story-icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px; font-size: 1.8rem; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25); }
.seerah-story-title { font-family: "Amiri", serif; font-weight: 700; font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
.seerah-story-text { font-size: 1.08rem; line-height: 2.1; margin: 0; }
.seerah-box { padding: 1.1rem 1.2rem; border-radius: 1rem; border: 1px solid var(--line); background: #fff; }
.seerah-box ul { padding-inline-start: 1.1rem; line-height: 1.9; }
.seerah-box.facts { background: linear-gradient(180deg, #eff6ff, #fff); border-color: #bfdbfe; }
.seerah-box.facts h3 { color: #1d4ed8; }
.seerah-box.lessons { background: linear-gradient(180deg, #ecfdf5, #fff); border-color: #a7f3d0; }
.seerah-box.lessons h3 { color: #047857; }
.seerah-ref { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; border-radius: .85rem; border: 1px solid var(--line); color: inherit; text-decoration: none; transition: .15s; }
.seerah-ref:hover { border-color: #0f766e; background: #f0fdfa; }
.story-link { display: inline-flex; align-items: center; gap: .2rem; color: #6d28d9; font-weight: 600; text-decoration: none; border-bottom: 1px dashed rgba(109,40,217,.45); }
.story-link i { font-size: .75em; }
.story-link:hover { color: #4c1d95; }

/* ---------- Syllabus page ---------- */
.syl-hero { position: relative; overflow: hidden; color: #fff; border-radius: 1.5rem; padding: 2rem 1.75rem 1.75rem; background: linear-gradient(135deg, #0c4a6e, #155e75 40%, #065f46); box-shadow: 0 18px 40px -18px rgba(12,74,110,.75); }
.syl-hero-glow { position: absolute; inset: -40% -10% auto auto; width: 60%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(250,204,21,.35), transparent 60%); pointer-events: none; }
.syl-badge { display: inline-flex; align-items: center; font-size: .78rem; font-weight: 700; padding: .3rem .75rem; border-radius: 999px; background: rgba(250,204,21,.2); color: #fde68a; margin-bottom: .6rem; }
.syl-title { font-family: "Amiri", serif; font-weight: 700; font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.4; margin: 0; }
.syl-issued { opacity: .8; margin-top: .25rem; }
.syl-stats { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
.syl-stats div { min-width: 110px; padding: .7rem 1rem; border-radius: 1rem; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); }
.syl-stats b { display: block; font-size: 1.6rem; line-height: 1.1; }
.syl-stats span { font-size: .8rem; opacity: .85; }
.syl-note { display: flex; gap: .9rem; align-items: flex-start; padding: 1rem 1.2rem; border-radius: 1rem; background: #fffbeb; border: 1px solid #fde68a; line-height: 1.9; }
.syl-note i { font-size: 1.4rem; color: #d97706; }
.syl-toolbar { display: flex; align-items: center; gap: .75rem; position: sticky; top: .5rem; z-index: 5; }
.syl-nav { display: flex; flex-wrap: wrap; gap: .45rem; }
.syl-nav a { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .75rem; border-radius: 999px; font-size: .85rem; font-weight: 600; text-decoration: none; color: var(--subject); background: color-mix(in srgb, var(--subject) 10%, #fff); border: 1px solid color-mix(in srgb, var(--subject) 25%, #fff); transition: .15s; }
.syl-nav a:hover { color: #fff; background: var(--subject); }
.syl-subject { margin-bottom: 2rem; border-radius: 1.25rem; background: #fff; border: 1px solid var(--line); overflow: hidden; box-shadow: 0 10px 28px -22px rgba(15,23,42,.5); scroll-margin-top: 4.5rem; }
.syl-subject-head { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.25rem; color: #fff; background: linear-gradient(135deg, var(--subject), color-mix(in srgb, var(--subject) 60%, #0f172a)); }
.syl-subject-icon { width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; border-radius: 14px; font-size: 1.3rem; background: rgba(255,255,255,.18); }
.syl-units { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; padding: 1.25rem; }
.syl-unit { padding: 1rem 1.1rem; border-radius: 1rem; background: color-mix(in srgb, var(--subject) 4%, #fff); border: 1px solid color-mix(in srgb, var(--subject) 18%, #fff); }
.syl-unit-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.syl-unit-num { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border-radius: 9px; font-weight: 800; font-size: .85rem; color: #fff; background: var(--subject); }
.syl-unit-count { font-size: .72rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; color: var(--subject); background: color-mix(in srgb, var(--subject) 12%, #fff); }
.syl-topics { margin: 0; padding-inline-start: 1.3rem; font-size: .92rem; line-height: 1.85; }
.syl-topics li::marker { color: var(--subject); font-weight: 700; }
.syl-topics li.syl-hit { background: #fef08a; border-radius: .35rem; }
@media print {
    .sidebar, .topbar, .app-sidebar, .app-topbar, footer { display: none !important; }
    .syl-hero { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .syl-subject { break-inside: avoid-page; box-shadow: none; }
    .syl-subject-head, .syl-unit-num { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Lesson navigation ---------- */
.lesson-nav-top { display: flex; align-items: stretch; gap: .5rem; }
.lesson-nav-arrow { width: 46px; flex: 0 0 46px; display: grid; place-items: center; border-radius: .9rem; background: #fff; border: 1px solid var(--line); color: var(--brand); font-size: 1.2rem; text-decoration: none; transition: .15s; }
.lesson-nav-arrow:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.lesson-nav-arrow.disabled { pointer-events: none; opacity: .35; }
.lesson-nav-current { display: flex; align-items: center; gap: .6rem; padding: .55rem .9rem; border-radius: .9rem; background: #fff; border: 1px solid var(--line); text-align: start; font-weight: 600; color: var(--ink-2); }
.lesson-nav-current::after { margin-inline-start: auto; }
.lesson-nav-pos { flex: none; font-size: .75rem; font-weight: 800; padding: .15rem .55rem; border-radius: 999px; background: var(--brand-50); color: var(--brand); }
.lesson-outline { max-height: 70vh; overflow-y: auto; min-width: min(460px, 92vw); border-radius: 1rem; }
.lesson-outline .dropdown-item { white-space: normal; display: flex; align-items: center; gap: .4rem; font-size: .9rem; }
.lesson-outline .dropdown-header { font-weight: 800; color: var(--brand); white-space: normal; }
.lesson-outline-num { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; font-size: .72rem; font-weight: 700; background: var(--bg); color: var(--muted); }
.lesson-outline .active .lesson-outline-num { background: rgba(255,255,255,.25); color: #fff; }
.lesson-progress { height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; }
.lesson-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 999px; }
.lesson-nav-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.lesson-nav-card { display: flex; flex-direction: column; gap: .25rem; padding: 1rem 1.15rem; border-radius: 1rem; border: 1px solid var(--line); background: #fff; color: inherit; text-decoration: none; transition: .2s; min-height: 84px; }
.lesson-nav-card:hover { border-color: var(--brand); box-shadow: 0 10px 24px -16px rgba(79,70,229,.6); }
.lesson-nav-card.next { text-align: end; color: #fff; border: 0; background: linear-gradient(135deg, var(--brand), #7c3aed); box-shadow: 0 12px 26px -14px rgba(79,70,229,.8); }
.lesson-nav-card.next:hover { transform: translateY(-2px); color: #fff; }
.lesson-nav-card.done { text-align: end; background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.lesson-nav-card.locked { text-align: end; background: var(--bg); }
@media (max-width: 575px) { .lesson-nav-bottom { grid-template-columns: 1fr; } }
.quran-surah.is-off { opacity: .5; filter: grayscale(1); }

/* ---------- Seerah: full story, videos grid ---------- */
.story-tabs { display: flex; flex-wrap: wrap; gap: .4rem; position: sticky; top: .5rem; z-index: 4; padding: .4rem; border-radius: 999px; background: rgba(255,255,255,.9); backdrop-filter: blur(6px); border: 1px solid var(--line); width: fit-content; }
.story-tabs a { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .8rem; border-radius: 999px; font-size: .85rem; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.story-tabs a:hover { background: var(--brand-50); color: var(--brand); }
.story-card .card-body { padding: 1.5rem 1.6rem; }
.story-intro { font-size: 1.15rem; line-height: 2; font-weight: 600; color: var(--ink); border-inline-start: 4px solid #f59e0b; padding-inline-start: 1rem; }
.story-background { padding: 1rem 1.2rem; border-radius: 1rem; background: #f8fafc; border: 1px solid var(--line); margin-bottom: 1.5rem; line-height: 2; }
.story-section { margin-bottom: 1.6rem; }
.story-section-title { display: flex; align-items: center; gap: .6rem; font-size: 1.1rem; font-weight: 800; margin-bottom: .6rem; }
.story-section-title span { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border-radius: 9px; color: #fff; font-size: .85rem; background: linear-gradient(135deg, #7c3aed, #4f46e5); }
.story-body { font-size: 1.04rem; line-height: 2.05; }
.story-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.story-timeline::before { content: ""; position: absolute; inset-block: .4rem; inset-inline-start: 7px; width: 2px; background: color-mix(in srgb, var(--cat) 35%, #fff); }
.story-timeline li { position: relative; padding-inline-start: 1.8rem; padding-bottom: .9rem; line-height: 1.8; }
.story-timeline li::before { content: ""; position: absolute; inset-inline-start: 0; top: .45rem; width: 16px; height: 16px; border-radius: 50%; background: var(--cat); box-shadow: 0 0 0 4px color-mix(in srgb, var(--cat) 18%, #fff); }
.story-when { display: block; font-size: .78rem; font-weight: 800; color: var(--cat); }
.story-lesson { padding: 1rem 1.1rem; border-radius: 1rem; background: linear-gradient(180deg, #ecfdf5, #fff); border: 1px solid #a7f3d0; line-height: 1.9; }
.story-lesson .fw-bold { color: #047857; }
.story-dyk { padding: 1rem 1.2rem; border-radius: 1rem; background: #fffbeb; border: 1px solid #fde68a; line-height: 1.9; }
.story-dyk h2 { color: #b45309; }
.story-person { display: flex; align-items: center; gap: .7rem; }
.story-side { position: sticky; top: 4.5rem; }
.story-opt { text-align: start; padding: .6rem .85rem; border-radius: .75rem; border: 1px solid var(--line); background: #fff; transition: .15s; }
.story-opt:hover { border-color: var(--brand); }
.story-opt.is-right { background: #dcfce7; border-color: #22c55e; }
.story-opt.is-wrong { background: #fee2e2; border-color: #ef4444; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .9rem; }
.video-tile { border-radius: .9rem; overflow: hidden; background: #fff; border: 1px solid var(--line); }
.video-thumb { position: relative; display: block; width: 100%; aspect-ratio: 16/9; padding: 0; border: 0; background: #0f172a; overflow: hidden; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.video-thumb:hover img { transform: scale(1.05); }
.video-thumb-empty { display: grid; place-items: center; height: 100%; color: #94a3b8; font-size: 2rem; }
.video-play { position: absolute; inset: 0; margin: auto; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; color: #fff; font-size: 1.6rem; background: rgba(220,38,38,.9); box-shadow: 0 8px 20px rgba(0,0,0,.35); }
.video-tag { position: absolute; top: .4rem; inset-inline-start: .4rem; font-size: .7rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; color: #fff; background: rgba(4,120,87,.9); }
.video-meta { padding: .55rem .7rem; }
.video-title { font-size: .85rem; font-weight: 600; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-player { border-radius: 1rem; overflow: hidden; background: #fff; border: 1px solid var(--line); box-shadow: 0 14px 30px -18px rgba(15,23,42,.6); }
.quiz-letter { display: inline-grid; place-items: center; min-width: 28px; height: 28px; margin-inline-end: .6rem; padding: 0 .35rem; border-radius: 8px; font-weight: 800; font-size: .9rem; color: var(--brand); background: var(--brand-50); flex: none; }
.quiz-letter.sm { min-width: 22px; height: 22px; font-size: .75rem; margin-inline-end: .4rem; }

/* ===== Non-profit promise on the home page ===== */
.nonprofit-band{background:linear-gradient(120deg,#ecfdf5,#f0fdf4 45%,#eff6ff);border:1px solid #bbf7d0;border-radius:28px;padding:32px}
.nonprofit-band .np-card{background:#fff;border-radius:18px;padding:16px;height:100%;box-shadow:0 1px 3px rgba(15,23,42,.06);display:flex;flex-direction:column;gap:4px}
@media (max-width:576px){.nonprofit-band{padding:20px}}

/* ---- Lesson math: Latin formulas never get reordered by the page's right-to-left text; Arabic notation (س، ص، ١٢٣)
   is written right to left as in the Sudanese books, with the exponent at the upper left. */
.lesson.math-latin .katex { direction: ltr; unicode-bidi: isolate; }
.lesson.math-ar .katex { direction: rtl; unicode-bidi: isolate; }
.lesson.math-ar .katex-display > .katex { text-align: center; }
.lesson.math-ar .katex .text, .lesson.math-ar .katex .text * { font-family: inherit !important; }
.lesson.math-ar .katex .mop { font-family: inherit; }
.lesson .katex-display { overflow-x: auto; overflow-y: hidden; padding: .15rem 0; }
.lesson blockquote { border-inline-start: 4px solid var(--brand-200, #c7d2fe); background: var(--brand-50, #eef2ff); padding: .5rem .9rem; border-radius: .6rem; margin: .25rem 0 1rem; }
.lesson blockquote p { margin: 0; }

/* ---- Math Lab: answer boxes, keypad, feedback, guided steps, graphs, tests */
.lab-item { border-radius: 1rem; transition: box-shadow .2s, border-color .2s; }
.lab-item.lab-ok { border-color: #86efac; box-shadow: 0 0 0 3px rgba(34,197,94,.12); }
.lab-item.lab-bad { border-color: #fecaca; }
.lab-num { display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--brand-600, #4f46e5); color: #fff; font-weight: 700; font-size: .9rem; }
.lab-prompt { font-size: 1.08rem; line-height: 2.1; }
.lab-box-wrap { display: inline-flex; flex-direction: column; vertical-align: middle; position: relative; margin: 0 .25rem; }
.lab-box { min-width: 6.5rem; max-width: 16rem; padding: .35rem .6rem; border: 2px dashed #a5b4fc; border-radius: .6rem; background: #f8faff; font-size: 1.1rem; text-align: center; font-family: inherit; }
.lab-box:focus { outline: none; border-style: solid; border-color: #4f46e5; background: #fff; box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.lab-box.is-ok { border: 2px solid #16a34a; background: #f0fdf4; }
.lab-box.is-bad { border: 2px solid #dc2626; background: #fef2f2; animation: lab-shake .3s; }
@keyframes lab-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.lab-preview { min-height: 1.4rem; font-size: .9rem; color: #475569; text-align: center; }
.lab-keypad { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .35rem; max-width: 22rem; }
.lab-keypad button { min-width: 2.2rem; padding: .25rem .4rem; border: 1px solid #e2e8f0; border-radius: .45rem; background: #fff; font-size: 1rem; }
.lab-keypad button:hover { background: #eef2ff; border-color: #a5b4fc; }
.lab-feedback { margin-top: .8rem; padding: .55rem .9rem; border-radius: .7rem; font-weight: 600; }
.lab-feedback.ok { background: #f0fdf4; color: #15803d; }
.lab-feedback.bad { background: #fef2f2; color: #b91c1c; }
.lab-feedback.warn { background: #fffbeb; color: #b45309; }
.lab-hint { margin-top: .7rem; padding: .6rem .9rem; border-radius: .7rem; background: #fffbeb; border: 1px solid #fde68a; }
.lab-solution { margin-top: .7rem; padding: .7rem .95rem; border-radius: .7rem; background: #eef2ff; border: 1px solid #c7d2fe; }
.lab-answer { font-weight: 700; color: #3730a3; }
.lab-why { display: block; margin: .2rem 0 .4rem; padding: .3rem .7rem; border-inline-start: 3px solid #a5b4fc; background: #f8faff; border-radius: .4rem; color: #334155; }
.lab-steps { margin-top: 1rem; display: grid; gap: .6rem; }
.lab-step { padding: .7rem .9rem; border: 1px solid #e2e8f0; border-radius: .8rem; background: #fff; }
.lab-step.locked { opacity: .45; pointer-events: none; }
.lab-step.ok { border-color: #86efac; }
.lab-step-explain { margin-top: .5rem; padding: .45rem .7rem; background: #f0fdf4; border-radius: .5rem; }
.lab-choice.active { border-color: #4f46e5 !important; background: #eef2ff; }
.lab-choice.correct { border-color: #16a34a !important; background: #f0fdf4; }
.lab-choice.wrong { border-color: #dc2626 !important; background: #fef2f2; }
.lab-graph { margin: .8rem 0; border: 1px solid #e2e8f0; border-radius: 1rem; overflow: hidden; background: #fff; }
.lab-graph svg { display: block; width: 100%; height: auto; touch-action: none; }
.lab-graph .grid { stroke: #eef2f7; stroke-width: 1; }
.lab-graph .axis { stroke: #334155; stroke-width: 1.6; }
.lab-graph .guide { stroke: #94a3b8; stroke-width: 1.2; stroke-dasharray: 5 5; }
.lab-graph .tick { font-size: 11px; fill: #64748b; }
.lab-graph .axis-label { font-size: 14px; font-weight: 700; fill: #334155; }
.lab-graph .curve { fill: none; stroke-width: 3; stroke-linejoin: round; }
.lab-graph .curve-label { font-size: 13px; font-weight: 700; }
.lab-graph .pt { fill: #dc2626; stroke: #fff; stroke-width: 2; }
.lab-graph .pt-label { font-size: 12px; font-weight: 700; fill: #b91c1c; }
.lab-graph .tracer circle { fill: #0f172a; }
.lab-graph .tracer text { font-size: 12px; font-weight: 700; fill: #0f172a; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.lab-graph-controls { padding: .6rem .9rem; border-top: 1px solid #eef2f7; background: #f8fafc; display: grid; gap: .4rem; }
.lab-slider { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: 0; }
.lab-slider input[type=range] { flex: 1; min-width: 160px; accent-color: #4f46e5; }
.lab-graph-caption { font-size: .92rem; color: #334155; }
.lab-timer-bar { position: sticky; top: 64px; z-index: 20; display: flex; align-items: center; gap: .8rem; padding: .6rem 1rem; margin-bottom: 1rem; background: #fff; border: 1px solid #e2e8f0; border-radius: 1rem; box-shadow: 0 6px 20px rgba(15,23,42,.06); }
.lab-timer { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; color: #1e293b; }
.lab-timer.low { color: #dc2626; animation: lab-pulse 1s infinite; }
@keyframes lab-pulse { 50% { opacity: .5; } }
.lab-item [hidden], .lab-graph [hidden], .lab-practice [hidden] { display: none !important; }

/* ---- Public header on phones: compact brand, Sign in always visible, menu button with every link */
.site-mobile-menu { background: #fff; border-top: 1px solid var(--line); box-shadow: 0 18px 40px rgba(15,23,42,.12); padding: 1rem 0 1.2rem; max-height: calc(100vh - 70px); overflow-y: auto; }
.site-mobile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.site-mobile-grid a { display: flex; align-items: center; gap: .6rem; padding: .85rem .9rem; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); font-weight: 600; text-decoration: none; background: #fafbff; }
.site-mobile-grid a i { font-size: 1.2rem; color: var(--brand); }
.site-mobile-grid a:active { background: var(--brand-50); }
.site-nav.menu-open { background: #fff; box-shadow: 0 1px 0 var(--line); }
@media (max-width: 575.98px) {
    .site-nav { padding: .6rem 0; }
    .site-nav .container { gap: .5rem !important; }
    .site-brand { font-size: 1rem; gap: .45rem; min-width: 0; }
    .site-brand > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 9.5rem; }
    .site-brand .brand-mark { width: 36px; height: 36px; font-size: 1.05rem; flex-shrink: 0; }
    .site-nav .btn { padding: .45rem .65rem; font-size: .92rem; }
    .site-signin { white-space: nowrap; }
}
@media (max-width: 359.98px) { .site-signin i { margin: 0 !important; } .site-signin { font-size: 0 !important; } .site-signin i { font-size: 1.1rem; } }

/* ---- Inside the mobile app: the app has its own menus, so the site's sidebar and top bar are hidden. */
body.in-app .sidebar, body.in-app .sidebar-backdrop, body.in-app .topbar { display: none !important; }
body.in-app .main { margin: 0 !important; padding-top: 0 !important; width: 100% !important; }
body.in-app .content, body.in-app main { padding-top: 1rem; }
body.in-app .page-head .crumbs { display: none; }

/* ---------------------------------------------------------------- self-study (learn) */
.learn-offer-card { border: 1px solid var(--line, #e2e8f0); transition: transform .15s, box-shadow .15s; }
.learn-offer-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(15, 23, 42, .08); }
.learn-offer-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; flex: none;
    color: var(--subject, var(--brand)); background: color-mix(in srgb, var(--subject, #4f46e5) 12%, white); }
.learn-unit .card-header { background: transparent; }
.learn-lesson a { padding: .2rem 0; }
.learn-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; font-weight: 700; flex: none;
    background: #f1f5f9; color: var(--muted); }
.learn-lesson.started .learn-dot { background: var(--brand-50); color: var(--brand); }
.learn-lesson.done .learn-dot { background: #dcfce7; color: #16a34a; }
.learn-lesson.done { background: #fcfffd; }
.learn-finish { border: 2px dashed #bbf7d0; background: #f7fef9; }
.learn-finish-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; background: #dcfce7; color: #16a34a; }
.learn-finish .learn-when-done { display: none; }
.learn-finish.is-done { border-style: solid; }
.learn-finish.is-done .learn-when-open { display: none; }
.learn-finish.is-done .learn-when-done { display: block; }
.learn-bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: .4rem; align-items: end; height: 170px; }
.learn-bar { display: flex; flex-direction: column; align-items: center; height: 100%; }
.learn-bar-stack { flex: 1; width: 100%; max-width: 34px; display: flex; flex-direction: column-reverse; border-radius: 8px; background: #f8fafc; overflow: hidden; }
.learn-bar-learn { background: var(--brand); }
.learn-bar-site { background: #a5b4fc; }
.learn-bar-label { font-size: .68rem; color: var(--muted); text-align: center; margin-top: .3rem; line-height: 1.1; }
.learn-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: .3rem; vertical-align: middle; }
.learn-key.learn { background: var(--brand); }
.learn-key.site { background: #a5b4fc; }
@media (max-width: 575.98px) { .learn-bars { gap: .15rem; height: 140px; } .learn-bar-label { font-size: .58rem; } .learn-head-stats .progress { width: 100% !important; } }

/* ---------------------------------------------------------------- student record (attendance, grades, fees) */
.record-card .card-header { background: transparent; }
.record-num { font-size: 1.5rem; font-weight: 800; line-height: 1.15; }
.record-ring { --pct: 0; --ring: #16a34a; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; flex: none;
    background: conic-gradient(var(--ring) calc(var(--pct) * 1%), #eef2f7 0); }
.record-ring span { width: 72px; height: 72px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; }
.record-box { border: 1px solid var(--line, #e2e8f0); border-radius: 14px; padding: .6rem .4rem; height: 100%; }
.record-box.is-bad { border-color: #fecaca; background: #fef2f2; }
.att-strip { display: flex; flex-wrap: wrap; gap: 4px; }
.att-day { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-size: .7rem; font-weight: 700; color: #fff; }
.att-day.p, .att-key.p { background: #22c55e; }
.att-day.a, .att-key.a { background: #ef4444; }
.att-day.l, .att-key.l { background: #f59e0b; }
.att-day.e, .att-key.e { background: #38bdf8; }
.att-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: .3rem; vertical-align: middle; flex: none; }

/* ---------- Class page (Admin/Sections/Details, Classroom/Homeroom) — agent C ---------- */
/* No transform on hover: a transformed tile becomes a new containing block / stacking context, which moved the stretched
   link's click layer around and made the tile feel dead. The tile is opened by a click handler on [data-href] as well. */
.cls-card { transition: border-color .15s, box-shadow .15s; cursor: pointer; }
.cls-card:hover, .cls-card:focus-within { border-color: var(--brand) !important; box-shadow: 0 0 0 3px var(--brand-50), var(--shadow-sm); }
.cls-card a.cls-open:focus-visible { outline: none; }
.cls-card-tools { position: relative; z-index: 2; }
.cls-card-tools a { display: inline-block; padding: .15rem .2rem; border-radius: 6px; }
.cls-card-tools a:hover { background: var(--brand-50); }
.cls-open-btn { font-weight: 600; color: var(--brand); text-decoration: none; }
.cls-empty { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; padding: .4rem .2rem; }
html[dir="rtl"] .cls-flip { display: inline-block; transform: scaleX(-1); }
.cls-min0 { min-width: 0; }
.cls-head h1 { line-height: 1.15; }
.cls-badge { width: 64px; height: 64px; flex: none; border-radius: 18px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.35rem;
    background: linear-gradient(135deg, var(--brand), var(--accent)); box-shadow: var(--shadow); overflow: hidden; }
.cls-badge span { max-width: 58px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 .2rem; }
.cls-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; }
.cls-chips > span { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 600; color: var(--ink-2); background: var(--card);
    border: 1px solid var(--line); border-radius: 999px; padding: .2rem .65rem; }
.cls-chips > span.en { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.cls-chips > span.ar { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.cls-of { font-size: .9rem; font-weight: 600; color: var(--muted); }
.cls-money { font-size: 1.5rem; }
.cls-tabs { gap: .35rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.cls-tabs::-webkit-scrollbar { display: none; }
.cls-tabs .nav-link { white-space: nowrap; color: var(--muted); font-weight: 600; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: .6rem .9rem; background: none; }
.cls-tabs .nav-link:hover { color: var(--ink); }
.cls-tabs .nav-link.active { color: var(--brand); border-bottom-color: var(--brand); }
.cls-count { display: inline-block; min-width: 1.4rem; font-size: .72rem; padding: .1rem .4rem; border-radius: 999px; background: #f1f5f9; color: var(--muted); text-align: center; }
.cls-count.warn { background: #fff1f2; color: #e11d48; }
.cls-search { position: relative; flex: 1 1 220px; max-width: 360px; }
.cls-search i { position: absolute; inset-inline-start: .75rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.cls-search .form-control { padding-inline-start: 2.2rem; border-radius: 999px; }
.cls-roster td { padding-top: .6rem; padding-bottom: .6rem; }
.cls-roster a.text-reset:hover { color: var(--brand) !important; }
.avatar.cls-f { background: linear-gradient(135deg, #db2777, #f59e0b); }
.avatar.cls-photo { object-fit: cover; background: #e2e8f0; }
.avatar.cls-sm { width: 28px; height: 28px; font-size: .7rem; }
.avatar.cls-none { background: #fee2e2; color: #e11d48; }
.cls-subject { border-top: 4px solid var(--c, var(--brand)); }
.cls-date { width: 46px; flex: none; text-align: center; border-radius: 12px; background: #f1f5f9; padding: .25rem 0; line-height: 1.1; }
.cls-date strong { display: block; font-size: 1.05rem; }
.cls-date small { font-size: .65rem; color: var(--muted); }
.cls-pick { display: flex; align-items: center; gap: .65rem; padding: .55rem .75rem; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; margin: 0; }
.cls-pick:hover { border-color: var(--brand); }
.cls-pick:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
[data-bs-theme="dark"] .cls-date, [data-bs-theme="dark"] .cls-count { background: rgba(255,255,255,.08); }
@media (max-width: 575.98px) {
    .cls-badge { width: 48px; height: 48px; border-radius: 14px; font-size: 1.05rem; }
    .cls-actions { width: 100%; }
    .cls-actions > .btn { flex: 1 1 auto; }
    .cls-search { max-width: none; }
}
@media print { .cls-tabs, .cls-actions, .cls-search { display: none !important; } .tab-pane { display: block !important; opacity: 1 !important; } }

/* ===== Course catalog, marketplace and curriculum choices (agent A) ===== */
.catalog-intro { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .75rem; }
.catalog-intro-item { display: flex; gap: .75rem; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1rem; }
.catalog-intro-icon { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.15rem; background: var(--brand-50); color: var(--brand); }
.catalog-intro-icon.ok { background: #ecfdf5; color: #059669; }
.catalog-card { border-top: 4px solid var(--subject, #4f46e5); transition: transform .15s, box-shadow .15s; }
.catalog-card:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -12px rgba(15,23,42,.25); }
.catalog-title { line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.catalog-reply { background: #f8fafc; border-inline-start: 3px solid var(--brand); border-radius: 8px; padding: .6rem .8rem; }
.curriculum-summary { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.curriculum-pill { font-size: .82rem; font-weight: 600; border-radius: 999px; padding: .3rem .75rem; background: #fff; border: 1px solid var(--line); }
.curriculum-pill.ok { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.catalog-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .5rem; }
.catalog-strip-item { display: flex; align-items: center; gap: .6rem; background: #fff; border: 1px dashed #c7d2fe; border-radius: 12px; padding: .6rem .9rem; font-size: .88rem; }
.catalog-strip-item i { color: var(--brand); font-size: 1.1rem; }
.catalog-strip-item span { flex: 1; }
.catalog-strip-item a { font-weight: 600; white-space: nowrap; }
.sale-card.on { border-color: #a7f3d0; background: linear-gradient(120deg, #f0fdf4, #fff); }
.roadmap-hero.us { background: linear-gradient(135deg, #1e3a8a, #2563eb 55%, #dc2626); }
.roadmap-pick-icon.us { background: linear-gradient(135deg, #1e3a8a, #dc2626); font-size: 1.5rem; }
.us-road { overflow-x: auto; padding-bottom: .5rem; scrollbar-width: thin; }
.us-road .roadmap-stop { min-width: 56px; }
@media (max-width: 576px) { .catalog-filters .form-select, .catalog-filters .form-control { font-size: .9rem; } }

/* ===== Accounts & passwords, platform team (agent B) ===== */
.acct-list { display: flex; flex-direction: column; }
.acct-row { display: flex; align-items: center; gap: .9rem; padding: .9rem 1.1rem; color: inherit; text-decoration: none; border-bottom: 1px solid #eef2f7; transition: background .15s; }
.acct-row:last-child { border-bottom: 0; }
.acct-row:hover { background: #f8fafc; color: inherit; }
.acct-row-side { text-align: end; flex: none; max-width: 45%; }
.acct-avatar { width: 44px; height: 44px; flex: none; font-size: 1.05rem; background: linear-gradient(135deg, #6366f1, #14b8a6); }
.acct-avatar.lg { width: 60px; height: 60px; font-size: 1.4rem; }
.acct-facts { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; margin: 0; font-size: .9rem; }
.acct-facts dt { color: var(--muted); font-weight: 500; }
.acct-facts dd { margin: 0; min-width: 0; }
.acct-action-list { display: flex; flex-direction: column; gap: .6rem; }
.acct-action { display: flex; align-items: flex-start; gap: .8rem; padding: .8rem; border: 1px solid #eef2f7; border-radius: 14px; }
.acct-action > .btn { flex: none; align-self: center; }
.acct-action-icon { width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); font-size: 1.1rem; }
.acct-action-icon.danger, .acct-audit-icon.danger { background: #fff1f2; color: #e11d48; }
.acct-action-icon.success, .acct-audit-icon.success { background: #ecfdf5; color: #059669; }
.acct-audit { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .8rem; }
.acct-audit li { display: flex; align-items: flex-start; gap: .7rem; }
.acct-audit-icon { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; background: #f1f5f9; color: var(--muted); }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .6rem; }
.perm-option { display: flex; align-items: flex-start; gap: .65rem; padding: .75rem; border: 1px solid #e2e8f0; border-radius: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.perm-option:hover { border-color: var(--brand); }
.perm-option:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.perm-option .form-check-input { margin-top: .2rem; flex: none; }
.perm-option-icon { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(15, 23, 42, .08); }
.must-change-note { display: flex; gap: .8rem; align-items: flex-start; padding: 1rem 1.1rem; margin-bottom: 1rem; border-radius: 16px; background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.must-change-note > i { font-size: 1.5rem; }
@media (max-width: 576px) {
    .acct-row { flex-wrap: wrap; }
    .acct-row-side { max-width: 100%; text-align: start; padding-inline-start: calc(44px + .9rem); }
    .acct-action { flex-wrap: wrap; }
    .acct-action > .btn { margin-inline-start: auto; }
}

/* ---------------------------------------------------------------- Math Lab: boxes inside formulas, step-by-step corrections */
.lab-slot-math { display: inline-block; vertical-align: middle; position: relative; }
.lab-box-wrap.lab-inmath { display: inline-block; position: relative; font-size: 1rem; line-height: 1.2; }
.lab-box-wrap.lab-inmath .lab-box { width: 3.6em; min-width: 0; height: 1.9em; padding: .1rem .3rem; font-size: .9em; text-align: center; }
.lab-box-wrap.lab-inmath .lab-preview { display: none; }
.lab-box-wrap.lab-inmath .lab-keypad { position: absolute; top: 2.2em; inset-inline-start: 0; z-index: 20; white-space: nowrap; }
.lab-prompt .katex { font-size: 1.15em; }
.lab-sol-title { font-weight: 800; color: var(--brand); margin-bottom: .4rem; }
.lab-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .5rem; margin-bottom: .5rem; }
.lab-compare > div { border-radius: 12px; padding: .5rem .75rem; }
.lab-compare .bad { background: #fef2f2; border: 1px solid #fecaca; }
.lab-compare .ok { background: #f0fdf4; border: 1px solid #bbf7d0; }
.lab-compare span:first-child { font-weight: 700; margin-inline-end: .3rem; }
.lab-sol-steps { margin: .4rem 0 0; padding-inline-start: 1.6rem; display: grid; gap: .35rem; }
[lang=ar] .lab-sol-steps, .math-ar .lab-sol-steps { list-style: arabic-indic; }
.lab-sol-steps li { padding: .35rem .6rem; background: #fff; border-radius: 10px; border: 1px solid var(--line, #e2e8f0); opacity: 0; animation: labStepIn .45s ease forwards; }
@keyframes labStepIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .lab-sol-steps li { animation: none; opacity: 1; } }

/* ---------------------------------------------------------------- lessons: diagrams, conversations, videos */
.lesson-svg { margin: 1rem 0; padding: .75rem; background: #fff; border: 1px solid var(--line, #e2e8f0); border-radius: 16px; text-align: center; }
.lesson-svg svg { width: 100%; max-width: 680px; height: auto; direction: ltr; }
.dialogue-scene { font-style: italic; color: var(--muted); margin-bottom: .75rem; }
.dialogue-line { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: .6rem; }
.dialogue-line.right { align-items: flex-end; }
.dialogue-who { font-size: .78rem; font-weight: 700; color: var(--muted); margin: 0 .5rem .15rem; }
.dialogue-bubble { display: flex; align-items: flex-start; gap: .4rem; max-width: 85%; padding: .55rem .8rem; border-radius: 16px; background: #f1f5f9; }
.dialogue-line.right .dialogue-bubble { background: var(--brand-50, #eef2ff); }
.dialogue-line.speaking .dialogue-bubble { box-shadow: 0 0 0 2px var(--brand, #4f46e5); }
.dialogue-line.my-part .dialogue-bubble { background: #fffbeb; border: 1px dashed #f59e0b; }
.dialogue-text p { margin: 0; }
.dialogue-say { border: 0; background: transparent; color: var(--brand, #4f46e5); padding: 0 .15rem; font-size: 1.05rem; line-height: 1; }
.dialogue-tools .active { background: #f59e0b; color: #fff; }
.lesson-video .video-box { margin: 0; }

/* ==========================================================================
   Content team hiring: public application wizard (/join-our-team) and the platform review pages (Platform/Team)
   ========================================================================== */
.badge-soft.muted { background: #f1f5f9; color: #64748b; }
[dir="rtl"] .flip-rtl { display: inline-block; transform: scaleX(-1); }
.hire-chip { display: inline-flex; align-items: center; background: rgba(255, 255, 255, .18); color: #fff; border-radius: 999px; padding: .3rem .8rem; font-size: .85rem; font-weight: 600; }
.hire-progress-wrap { background: #fff; border-radius: 16px; padding: .75rem 1rem; box-shadow: var(--shadow-sm); }
.hire-progress { height: 8px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.hire-progress .bar { height: 100%; width: 4%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--brand)); transition: width .35s ease; }
.hire-nav { display: flex; justify-content: space-between; gap: .75rem; margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.hire-proxy { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.hire-proxy.is-invalid ~ .invalid-feedback { display: block; }
.hire-chips { display: flex; flex-wrap: wrap; gap: .45rem; max-height: 320px; overflow-y: auto; padding: .25rem; }
.hire-chip-check { position: relative; }
.hire-chip-check input { position: absolute; opacity: 0; }
.hire-chip-check label { display: inline-flex; align-items: center; gap: .4rem; border: 1.5px solid var(--line); border-radius: 999px; padding: .4rem .85rem; cursor: pointer; font-weight: 600; font-size: .9rem; background: #fff; transition: all .15s; }
.hire-chip-check input:checked + label { border-color: var(--brand); background: var(--brand-50); color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .1); }
.hire-chip-check input:focus-visible + label { outline: 3px solid rgba(79, 70, 229, .35); }
.hire-subject-fixed { display: flex; align-items: center; gap: .9rem; border: 2px solid var(--brand); background: var(--brand-50); border-radius: 16px; padding: .85rem 1rem; }
.hire-subject-fixed > i { font-size: 1.6rem; }
.hire-row { border: 1px solid var(--line); border-radius: 18px; padding: 1rem; background: #fcfcfe; animation: fadeUp .25s ease both; }
.hire-row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.hire-row-num { font-weight: 800; font-size: .9rem; color: var(--brand); }
.hire-empty-rows { border: 2px dashed var(--line); border-radius: 16px; padding: 1rem; text-align: center; }
.q-group { border: 1px solid var(--line); border-radius: 18px; padding: 1rem 1.1rem 1.2rem; margin: 0; background: #fff; }
.q-group-title { float: none; width: auto; font-size: 1rem; font-weight: 800; padding: 0 .4rem; margin: 0 0 .25rem; display: inline-flex; align-items: center; gap: .45rem; }
.q-group-title i { color: var(--brand); }
@media (max-width: 575px) { .hire-nav .btn-lg { padding: .55rem 1rem; font-size: 1rem; } .q-group { padding: .8rem; } }

/* platform review */
.hire-app-row { align-items: center; }
.hire-avatar { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 50%; object-fit: cover; background: #f1f5f9; box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--line); }
.hire-avatar-empty { display: grid; place-items: center; color: var(--muted); font-size: 1.4rem; }
.hire-tag { display: inline-block; background: #f1f5f9; color: var(--ink-2); border-radius: 999px; padding: .15rem .6rem; font-size: .75rem; font-weight: 600; }
.hire-tag.sd { background: #ecfdf5; color: #047857; }
.hire-tag.lg { font-size: .9rem; padding: .3rem .85rem; background: var(--brand-50); color: var(--brand); }
.hire-facts { grid-template-columns: repeat(3, auto); gap: .25rem 1rem; color: var(--ink-2); }
.hire-facts i { color: var(--muted); margin-inline-end: .3rem; }
.hire-head .card-body { gap: 1.5rem; }
.hire-photo { width: 112px; height: 112px; border-radius: 24px; object-fit: cover; background: #f1f5f9; box-shadow: var(--shadow); display: grid; place-items: center; font-size: 2.5rem; }
.hire-file { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fff; }
.hire-file.verified { border-color: #a7f3d0; }
.hire-file-view { background: #f8fafc; }
.hire-file-view img { display: block; width: 100%; max-height: 520px; object-fit: contain; background: #f8fafc; }
.hire-file-view iframe { display: block; width: 100%; border: 0; background: #fff; }
.hire-file-ph { display: grid; place-items: center; gap: .3rem; padding: 2rem 1rem; text-align: center; }
.hire-file-ph > i { font-size: 2.6rem; }
.hire-file-bar { display: flex; align-items: center; gap: .35rem; padding: .5rem .6rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.hire-contact { display: flex; flex-direction: column; gap: .15rem; border: 1px solid var(--line); border-radius: 14px; padding: .7rem .9rem; height: 100%; }
.hire-answer { border-inline-start: 3px solid var(--brand-50); padding: .35rem .9rem; }
.hire-answer .q { font-size: .82rem; color: var(--muted); font-weight: 600; margin-bottom: .2rem; }
.hire-answer .a { white-space: pre-line; word-break: break-word; }
.hire-side { position: sticky; top: 1rem; }
.hire-note { background: #fffbeb; border-radius: 12px; padding: .6rem .8rem; margin-bottom: .5rem; font-size: .9rem; }
.hire-history { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.hire-history li { display: flex; gap: .7rem; }
.hire-history li > i { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.hire-settings { background: #f8fafc; border: 1px solid var(--line); border-radius: 14px; padding: .8rem 1rem; }
@media (max-width: 1199px) { .hire-side { position: static; } }
@media print { .hire-side, .sidebar, .page-head .btn, .hire-file-view iframe { display: none !important; } .col-xl-8 { width: 100% !important; } }

/* ---------- Feedback button (every dashboard page) and the feedback pages ---------- */
.feedback-fab { position: fixed; inset-inline-end: 1.25rem; bottom: 1.25rem; z-index: 1040; display: inline-flex; align-items: center; gap: .45rem;
    border: 0; border-radius: 999px; padding: .7rem 1.1rem; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--brand), #0e7a5f);
    box-shadow: 0 10px 24px rgba(30, 27, 75, .25); transition: transform .15s, box-shadow .15s; }
.feedback-fab i { font-size: 1.15rem; }
.feedback-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(30, 27, 75, .3); }
@media (max-width: 575.98px) { .feedback-fab { padding: .75rem; bottom: 1rem; } .feedback-fab span { display: none; } }
@media print { .feedback-fab { display: none; } }
.feedback-cats { display: flex; flex-wrap: wrap; gap: .4rem; }
.fb-thread { display: flex; flex-direction: column; gap: .9rem; }
.fb-msg { max-width: 92%; border-radius: 18px; padding: .8rem 1rem; background: #f1f5f9; white-space: pre-wrap; word-break: break-word; }
.fb-msg.team { align-self: flex-end; background: var(--brand-50); }
.fb-msg.internal { align-self: flex-end; background: #fff7ed; border: 1px dashed #f59e0b; }
.fb-msg .fb-meta { font-size: .78rem; color: var(--muted); margin-bottom: .25rem; white-space: normal; }
.fb-row.unread td:first-child { border-inline-start: 4px solid var(--brand); }
.fb-row.unread .fb-title { font-weight: 700; }

/* ---------- Book corrections page (/corrections) ---------- */
.cx-book { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: .15rem; min-height: 132px; padding: .8rem .6rem;
    border: 2px solid transparent; cursor: pointer; overflow: hidden; text-align: center; transition: transform .15s, border-color .15s, box-shadow .15s; }
.cx-book img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .16; }
.cx-book > span { position: relative; text-shadow: 0 0 6px #fff, 0 0 2px #fff; }
.cx-book:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg, 0 10px 24px rgba(0,0,0,.08)); }
.cx-book.active { border-color: var(--brand); background: var(--brand-50); }
.cx-book-count { font-size: 2rem; font-weight: 800; color: var(--brand); line-height: 1; }
.cx-book-name { font-weight: 700; font-size: .92rem; }
.cx-book-doubt { font-size: .75rem; color: #b45309; }
.cx-shot { display: block; border: 1px solid var(--line, #e2e8f0); border-radius: 14px; overflow: hidden; background: #fff; }
.cx-shot img { width: 100%; height: auto; display: block; }
.cx-box { border-radius: 14px; padding: .7rem .9rem; margin-bottom: .6rem; background: #f8fafc; line-height: 1.85; }
.cx-box.bad { background: #fef2f2; } .cx-box.good { background: #f0fdf4; } .cx-box.doubt { background: #fffbeb; }
.cx-box-h { font-weight: 700; font-size: .85rem; margin-bottom: .2rem; }
.cx-item.cx-flash { animation: cxFlash 2s ease-out 1; }
@keyframes cxFlash { 0% { box-shadow: 0 0 0 4px #f59e0b; } 100% { box-shadow: none; } }

/* ---------- Online student registration (/join/{code}) ---------- */
.join-hero { padding: 7rem 0 4rem; background: radial-gradient(circle at 15% 10%, #e0e7ff, transparent 45%), radial-gradient(circle at 90% 80%, #ccfbf1, transparent 40%); }
.join-logo { width: 64px; height: 64px; border-radius: 18px; object-fit: cover; background: var(--brand); color: #fff; font-size: 1.8rem; box-shadow: 0 8px 20px rgba(30,27,75,.15); }
.join-title { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 800; line-height: 1.3; margin-bottom: .8rem; }
.join-lead { font-size: 1.1rem; color: var(--ink-2, #475569); }
.join-points { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: .6rem; }
.join-points li { display: flex; gap: .6rem; align-items: center; font-weight: 600; }
.join-points i { color: var(--brand); font-size: 1.2rem; }
.join-card { border: 0; border-radius: 24px; box-shadow: 0 20px 50px rgba(30,27,75,.12); }
.join-step { display: flex; align-items: center; gap: .5rem; font-weight: 700; margin: 1rem 0 .5rem; color: var(--ink); }
.join-step span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-size: .8rem; }

/* ---------- Student welcome page (/Student/Welcome) and its "start here" card ---------- */
.wl-celebrate { position: relative; overflow: hidden; text-align: center; padding: 2rem 1.25rem 1.6rem; border-radius: 24px; color: #fff;
    background: linear-gradient(120deg, #f59e0b, #ec4899 45%, #7c3aed); box-shadow: var(--shadow-lg); }
.wl-celebrate h1 { color: #fff; }
.wl-celebrate-icon { width: 64px; height: 64px; margin: 0 auto .8rem; border-radius: 20px; display: grid; place-items: center; font-size: 2rem; background: rgba(255,255,255,.2); animation: wlPop .6s ease-out; }
.wl-confetti span { position: absolute; top: -12px; width: 9px; height: 15px; border-radius: 3px; opacity: .9; animation: wlFall 3.2s linear infinite; }
.wl-confetti span:nth-child(1) { inset-inline-start: 6%; background: #fde68a; animation-delay: 0s; }
.wl-confetti span:nth-child(2) { inset-inline-start: 18%; background: #a7f3d0; animation-delay: .8s; }
.wl-confetti span:nth-child(3) { inset-inline-start: 31%; background: #fff; animation-delay: 1.6s; }
.wl-confetti span:nth-child(4) { inset-inline-start: 44%; background: #bfdbfe; animation-delay: .4s; }
.wl-confetti span:nth-child(5) { inset-inline-start: 58%; background: #fde68a; animation-delay: 2.1s; }
.wl-confetti span:nth-child(6) { inset-inline-start: 71%; background: #fbcfe8; animation-delay: 1.2s; }
.wl-confetti span:nth-child(7) { inset-inline-start: 84%; background: #a7f3d0; animation-delay: 2.6s; }
.wl-confetti span:nth-child(8) { inset-inline-start: 94%; background: #fff; animation-delay: .2s; }
@keyframes wlFall { 0% { transform: translateY(0) rotate(0); } 100% { transform: translateY(260px) rotate(540deg); opacity: 0; } }
@keyframes wlPop { 0% { transform: scale(.4); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .wl-confetti span, .wl-celebrate-icon { animation: none; } .wl-confetti { display: none; } }

.wl-hero { border-radius: 24px; padding: 1.4rem; color: #fff; background: linear-gradient(135deg, var(--brand), #7c3aed 60%, #0ea5e9); box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column; gap: 1.2rem; }
.wl-hero-school { display: flex; align-items: center; gap: .75rem; padding: .55rem .8rem; border-radius: 16px; background: rgba(255,255,255,.14); align-self: flex-start; max-width: 100%; }
.wl-logo { width: 46px; height: 46px; border-radius: 12px; object-fit: contain; background: #fff; padding: 3px; flex: none; }
.wl-logo-fallback { display: grid; place-items: center; color: var(--brand); font-size: 1.4rem; }
.wl-hero-main { display: flex; align-items: center; gap: 1rem; }
.wl-avatar { width: 72px; height: 72px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; font-weight: 800; background: rgba(255,255,255,.22); border: 3px solid rgba(255,255,255,.5); }
.wl-name { color: #fff; font-size: 1.7rem; font-weight: 800; margin: 0 0 .5rem; overflow-wrap: anywhere; }
.wl-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.wl-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border-radius: 999px; background: rgba(255,255,255,.18); font-size: .85rem; font-weight: 600; }
.min-w-0 { min-width: 0; }

.wl-status { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; padding: 1rem 1.1rem; border-radius: 18px; border: 1px solid var(--line); background: #fff; }
.wl-status > div { min-width: 0; flex: 1 1 220px; }
.wl-status-icon { width: 46px; height: 46px; flex: none; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem; }
.wl-status-trial { background: linear-gradient(90deg, #fffbeb, #fff); border-color: #fde68a; } .wl-status-trial .wl-status-icon { background: #fef3c7; color: #b45309; }
.wl-status-ok { background: linear-gradient(90deg, #ecfdf5, #fff); border-color: #a7f3d0; } .wl-status-ok .wl-status-icon { background: #d1fae5; color: #059669; }
.wl-status-ended { background: linear-gradient(90deg, #f1f5f9, #fff); } .wl-status-ended .wl-status-icon { background: #e2e8f0; color: var(--ink-2); }

.wl-course { display: flex; flex-direction: column; padding: 1rem; border-radius: 18px; border: 1px solid var(--line); background: #fff;
    border-top: 5px solid var(--c, var(--brand)); transition: transform .2s, box-shadow .2s; }
.wl-course:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.wl-course-top { display: flex; gap: .75rem; align-items: flex-start; }
.wl-course-icon { width: 44px; height: 44px; flex: none; border-radius: 14px; display: grid; place-items: center; font-size: 1.25rem; color: #fff; background: var(--c, var(--brand)); }
.wl-course-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wl-course > .d-flex:last-child { margin-top: auto !important; padding-top: .75rem; }
.wl-variant { display: inline-block; font-size: .72rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; margin-inline-start: .3rem; vertical-align: middle;
    background: color-mix(in srgb, var(--c, var(--brand)) 14%, #fff); color: var(--c, var(--brand)); }
.wl-course-link:hover { border-color: var(--c, var(--brand)); }

.wl-step { position: relative; height: 100%; padding: 1.1rem 1rem 1rem; border-radius: 18px; background: linear-gradient(160deg, var(--brand-50), #fff 70%); border: 1px solid var(--line); }
.wl-step-no { position: absolute; top: .8rem; inset-inline-end: .9rem; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem;
    color: #fff; background: linear-gradient(135deg, var(--brand), #7c3aed); }
.wl-step-icon { display: block; font-size: 1.6rem; color: var(--brand); margin-bottom: .4rem; }
.wl-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.wl-links a { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .85rem; border-radius: 999px; background: var(--brand-50); color: var(--brand); font-weight: 600; font-size: .9rem; }
.wl-links a:hover { background: #e0e7ff; color: var(--brand-600); }

.wl-message { white-space: pre-line; line-height: 1.9; margin-bottom: .75rem; }
.wl-stage { padding: .6rem .8rem; border-radius: 14px; border: 1px solid var(--line); background: #f8fafc; }
.wl-stage.mine { background: var(--brand-50); border-color: #c7d2fe; color: var(--brand-600); }
.wl-details { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; font-size: .92rem; }
.wl-details dt { color: var(--muted); font-weight: 500; }
.wl-details dd { margin: 0; font-weight: 600; min-width: 0; }

.wl-start-card { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border-radius: 20px; color: #fff !important;
    background: linear-gradient(120deg, var(--brand), #7c3aed 55%, #ec4899); box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.wl-start-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.wl-start-icon { width: 48px; height: 48px; flex: none; border-radius: 16px; display: grid; place-items: center; font-size: 1.5rem; background: rgba(255,255,255,.2); }

@media (max-width: 575.98px) {
    .wl-hero { padding: 1.1rem; border-radius: 20px; }
    .wl-hero-main { flex-direction: column; text-align: center; }
    .wl-chips { justify-content: center; }
    .wl-name { font-size: 1.4rem; }
    .wl-hero-school { align-self: stretch; }
    .wl-details { grid-template-columns: 1fr; gap: .1rem; }
    .wl-details dd { margin-bottom: .45rem; }
}

/* ---------- Welcome page: Quran & Seerah card ---------- */
.wl-quran { border: 0; background: linear-gradient(120deg, #ecfdf5, #f0fdfa 60%, #fffbeb); }
.wl-quran-icon { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; font-size: 1.7rem; color: #fff; background: linear-gradient(135deg, #059669, #0e7a5f); }
.join-programs { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
@media (max-width: 575.98px) { .join-programs { grid-template-columns: 1fr; } }
.join-program { display: flex; gap: .7rem; align-items: center; padding: .8rem; border: 2px solid var(--line, #e2e8f0); border-radius: 16px; cursor: pointer; height: 100%; }
.join-program i { font-size: 1.6rem; color: var(--brand); }
.join-program small { display: block; color: var(--muted); font-size: .8rem; }
.btn-check:checked + .join-program { border-color: var(--brand); background: var(--brand-50); }
.btn-check:disabled + .join-program { opacity: .5; cursor: not-allowed; }

/* ==========================================================================
   Visitors & security / Visitors & activity (Platform/Analytics, Admin/SchoolAnalytics)
   ========================================================================== */
.an-tabs .nav-link { border-radius: 999px; font-weight: 600; }
.an-filters .card-body { row-gap: .75rem; }
.an-filters .an-country { width: 70px; text-transform: uppercase; }
.an-filters .an-filter-wide { min-width: 200px; max-width: 280px; }
.an-range .btn { white-space: nowrap; }
.an-trend { font-size: .82rem; font-weight: 700; margin-top: .15rem; }
.an-trend.up { color: #059669; }
.an-trend.down { color: #e11d48; }
.an-legend { display: inline-flex; gap: 1rem; font-size: .82rem; color: var(--muted); }
.an-legend > span { display: inline-flex; align-items: center; gap: .35rem; }
.an-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.an-swatch-bar { background: var(--brand); }
.an-swatch-line { height: 3px; border-radius: 2px; background: #0d9488; }
.an-chart { width: 100%; height: auto; display: block; overflow: visible; }
.an-chart .an-grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.an-chart .an-axis { fill: var(--muted); font-size: 12px; font-family: var(--font-en); }
.an-chart .an-bar { fill: var(--brand); opacity: .85; transition: opacity .15s; }
.an-chart .an-hit { fill: transparent; }
.an-chart .an-col:hover .an-hit { fill: rgba(79, 70, 229, .06); }
.an-chart .an-col:hover .an-bar { opacity: 1; }
.an-chart .an-line { fill: none; stroke: #0d9488; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.an-chart .an-dot { fill: #0d9488; stroke: var(--card); stroke-width: 2; pointer-events: none; }
.an-live-dot { width: 10px; height: 10px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 0 rgba(16, 185, 129, .6); animation: an-pulse 1.8s infinite; flex: none; }
@keyframes an-pulse { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .55); } 70% { box-shadow: 0 0 0 9px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }
@media (prefers-reduced-motion: reduce) { .an-live-dot { animation: none; } }
.an-live { max-height: 420px; overflow-y: auto; }
.an-flag { font-size: 1.1rem; line-height: 1; flex: none; }
.an-path { color: var(--ink-2); background: transparent; max-width: 100%; }
.an-recent .an-path { max-width: 260px; }
.an-recent .an-who { max-width: 200px; }
.an-row, .an-row-head { position: relative; display: flex; align-items: center; gap: .5rem; padding-top: .45rem; padding-bottom: .45rem; min-width: 0; }
.an-row > *, .an-row-head > * { position: relative; z-index: 1; min-width: 0; }
.an-row::before { content: ""; position: absolute; inset-block: 4px; inset-inline-start: 0; width: var(--w, 0%); background: var(--brand-50); border-radius: 0 6px 6px 0; z-index: 0; }
[dir="rtl"] .an-row::before { border-radius: 6px 0 0 6px; }
.an-num { flex: none; min-width: 3.2rem; text-align: end; font-variant-numeric: tabular-nums; font-weight: 600; }
.an-heat-wrap { overflow-x: auto; }
.an-heat { display: grid; grid-template-columns: 2.6rem repeat(24, minmax(14px, 1fr)); gap: 3px; min-width: 460px; }
.an-heat-h { font-size: .68rem; color: var(--muted); text-align: start; }
.an-heat-d { font-size: .72rem; color: var(--muted); display: flex; align-items: center; white-space: nowrap; overflow: hidden; }
.an-cell { aspect-ratio: 1 / 1; border-radius: 4px; background: rgba(79, 70, 229, var(--a, 0)); outline: 1px solid rgba(148, 163, 184, .18); outline-offset: -1px; }
.an-cell:hover { outline: 2px solid var(--brand); }
.an-scale { width: 120px; height: 10px; border-radius: 5px; background: linear-gradient(90deg, rgba(79, 70, 229, .12), rgba(79, 70, 229, 1)); }
.an-alert { border: 1px solid #fecdd3; }
.an-join { background: linear-gradient(135deg, var(--brand-50), var(--card)); }
.an-funnel { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; text-align: center; }
.an-funnel-n { font-size: 1.5rem; font-weight: 800; line-height: 1.1; color: var(--ink); }
.an-funnel-rate { padding: .35rem .9rem; border-radius: 12px; background: var(--card); box-shadow: var(--shadow-sm); }
.an-funnel-rate .an-funnel-n { color: #059669; }
[dir="rtl"] .an-flip { display: inline-block; transform: scaleX(-1); }
[data-bs-theme="dark"] .an-row::before { background: rgba(99, 102, 241, .18); }
[data-bs-theme="dark"] .an-cell { background: rgba(129, 140, 248, var(--a, 0)); }
[data-bs-theme="dark"] .an-funnel-n { color: inherit; }
@media (max-width: 575.98px) {
    .an-chart .an-axis { font-size: 18px; }
    .an-funnel { gap: .6rem; }
    .an-funnel-n { font-size: 1.2rem; }
}

/* ---------- Mixed Arabic / English text ----------
   Each paragraph, cell, title and field takes its direction from its own text (first strong letter), whatever the
   interface language: English always reads left-to-right, Arabic always right-to-left. Layout direction is unchanged. */
p, li, dd, dt, td, th, h1, h2, h3, h4, h5, h6, blockquote, figcaption, label, legend, option, summary,
.card-title, .card-text, .list-group-item, .lesson-body, .lesson-title, .dropdown-item, .badge-soft, .form-text,
input[type=text], input[type=search], input:not([type]), textarea {
    unicode-bidi: plaintext;
}
/* Numbers, codes, links and math keep their own handling. */
code, pre, kbd, [dir=ltr], .katex, .math, input[type=email], input[type=url], input[type=tel], input[type=number], input[type=password] {
    unicode-bidi: isolate;
}

/* ---------- A lesson keeps its own language direction inside an interface of the other language ----------
   Arabic pages load Bootstrap RTL, where .text-start means "right" and .me-* means a left margin. Inside an English
   (dir=ltr) lesson on an Arabic page — and an Arabic lesson on an English page — put start/end and spacing back
   the way the lesson's language reads, so English options sit on the left with A B C D, and Arabic on the right. */
html[dir=rtl] [dir=ltr] .text-start { text-align: left !important; }
html[dir=rtl] [dir=ltr] .text-end { text-align: right !important; }
html[dir=ltr] [dir=rtl] .text-start { text-align: right !important; }
html[dir=ltr] [dir=rtl] .text-end { text-align: left !important; }
html[dir=rtl] [dir=ltr] .me-1 { margin-left: 0 !important; margin-right: .25rem !important; }
html[dir=rtl] [dir=ltr] .me-2 { margin-left: 0 !important; margin-right: .5rem !important; }
html[dir=rtl] [dir=ltr] .ms-1 { margin-right: 0 !important; margin-left: .25rem !important; }
html[dir=rtl] [dir=ltr] .ms-2 { margin-right: 0 !important; margin-left: .5rem !important; }
html[dir=rtl] [dir=ltr] .ms-auto { margin-right: 0 !important; margin-left: auto !important; }
html[dir=rtl] [dir=ltr] .me-auto { margin-left: 0 !important; margin-right: auto !important; }
html[dir=ltr] [dir=rtl] .me-1 { margin-right: 0 !important; margin-left: .25rem !important; }
html[dir=ltr] [dir=rtl] .me-2 { margin-right: 0 !important; margin-left: .5rem !important; }
html[dir=ltr] [dir=rtl] .ms-1 { margin-left: 0 !important; margin-right: .25rem !important; }
html[dir=ltr] [dir=rtl] .ms-2 { margin-left: 0 !important; margin-right: .5rem !important; }
html[dir=ltr] [dir=rtl] .ms-auto { margin-left: 0 !important; margin-right: auto !important; }
html[dir=ltr] [dir=rtl] .me-auto { margin-right: 0 !important; margin-left: auto !important; }

/* ---------- Lesson quiz feedback: options stay visible; right answer green, wrong choice red, then a clear verdict ---------- */
.quiz-opt.quiz-locked { cursor: default; opacity: .75; }
.quiz-opt.quiz-right { opacity: 1; background: #f0fdf4 !important; border: 2px solid #16a34a !important; color: #14532d !important; }
.quiz-opt.quiz-wrong { opacity: 1; background: #fef2f2 !important; border: 2px solid #dc2626 !important; color: #7f1d1d !important; }
.quiz-opt.quiz-right::after { content: "✓"; margin-inline-start: auto; padding-inline-start: .5rem; font-weight: 800; color: #16a34a; }
.quiz-opt.quiz-wrong::after { content: "✗"; margin-inline-start: auto; padding-inline-start: .5rem; font-weight: 800; color: #dc2626; }
.quiz-opt.quiz-right, .quiz-opt.quiz-wrong { display: flex; align-items: center; }
.quiz-verdict { margin-top: .75rem; padding: .6rem .9rem; border-radius: .75rem; font-size: .95rem; }
.quiz-verdict.ok { background: #f0fdf4; color: #14532d; border: 1px solid #bbf7d0; }
.quiz-verdict.bad { background: #fef2f2; color: #7f1d1d; border: 1px solid #fecaca; }
.quiz-exp { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: .75rem; padding: .75rem .9rem; font-size: .95rem !important; }

/* ---------- The textbook as HTML (lesson "Read it in the book" and /book/{key}) ---------- */
.book-page { scroll-margin-top: 90px; }
.book-page + .book-page { margin-top: 1rem; }
.book-page-no { font-size: .8rem; color: #64748b; border-bottom: 1px dashed #e2e8f0; padding-bottom: .35rem; margin-bottom: .75rem; }
.book-html { line-height: 2; font-size: 1.02rem; }
.book-html h1, .book-html h2, .book-html h3, .book-html h4 { font-family: var(--font-ar-head, inherit); margin: 1rem 0 .5rem; color: #0b4d33; }
.book-html h2 { font-size: 1.3rem; } .book-html h3 { font-size: 1.12rem; } .book-html h4 { font-size: 1rem; }
.book-html img { max-width: 100%; height: auto; display: block; margin: .75rem auto; border-radius: .5rem; }
.book-html figure { margin: 1rem 0; text-align: center; } .book-html figcaption { font-size: .85rem; color: #64748b; }
.book-html table { width: 100%; border-collapse: collapse; margin: .75rem 0; font-size: .95rem; }
.book-html th, .book-html td { border: 1px solid #cbd5e1; padding: .35rem .5rem; vertical-align: top; }
.book-html th { background: #f1f5f9; }
.book-html .box, .book-html aside { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: .75rem; padding: .75rem 1rem; margin: .75rem 0; }
.book-html .def { background: #ecfdf5; border-inline-start: 4px solid #10b981; padding: .6rem .9rem; border-radius: .5rem; margin: .75rem 0; }
.book-html .ex { background: #eff6ff; border-inline-start: 4px solid #3b82f6; padding: .6rem .9rem; border-radius: .5rem; margin: .75rem 0; }
.book-html .poem { text-align: center; line-height: 2.4; }
.book-html .ltr, .book-html [dir=ltr] { direction: ltr; unicode-bidi: isolate; }
.lesson-book-body { max-height: 70vh; overflow: auto; background: #fffdf8; }

/* =====================================================================
   Navigation & dashboards refresh (agent U)
   - Side menu groups (.nav-group / .nav-toggle / .nav-items, folded by _Sidebar's script)
   - Top-bar user menu groups (.user-menu)
   - Student "My day" (.md-*), parent child cards (.pc-*), teacher "Today" (.td-*)
   ===================================================================== */

/* ---------- Side menu groups ---------- */
.nav-group + .nav-group { margin-top: .15rem; }
.nav-group:not(:has(.nav-toggle)) { padding-top: .35rem; }
.nav-toggle { display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%; background: transparent; border: 0; text-align: start; cursor: pointer; border-radius: 8px; transition: color .15s, background .15s; }
.nav-toggle:hover { color: #c7d2fe; background: rgba(255, 255, 255, .04); }
.nav-toggle:focus { outline: none; }
.nav-toggle:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 2px; color: #fff; }
.nav-toggle .nav-caret { margin-inline-start: auto; font-size: .7rem; opacity: .75; transition: transform .2s ease; }
.nav-group.folded .nav-caret { transform: rotate(-90deg); }
html[dir="rtl"] .nav-group.folded .nav-caret { transform: rotate(90deg); }
.nav-group.folded .nav-items { display: none; }
.nav-group.folded .nav-toggle { padding-bottom: .55rem; }
.side-link:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) { .nav-toggle .nav-caret { transition: none; } }

/* ---------- Top-bar user menu ---------- */
.user-menu { min-width: 260px; max-width: min(92vw, 320px); }
.user-menu .dropdown-header { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; padding: .35rem .75rem .25rem; color: var(--muted); font-weight: 700; }
html[lang="ar"] .user-menu .dropdown-header { text-transform: none; letter-spacing: 0; font-size: .78rem; }
.user-menu-who { display: flex; align-items: center; gap: .7rem; padding: .5rem .6rem .6rem; }
.user-menu-who .avatar { width: 42px; height: 42px; font-size: 1rem; }
.user-menu-lang { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; border-radius: 10px; background: #f1f5f9; }
.user-menu-lang a { text-align: center; padding: .35rem .5rem; border-radius: 8px; color: var(--ink-2, #334155); font-weight: 600; font-size: .9rem; }
.user-menu-lang a:hover { background: #fff; color: var(--brand); }
.user-menu-lang a.active { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.user-menu .dropdown-item:focus-visible, .user-menu-lang a:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

/* ---------- Student "My day" ---------- */
.md-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.4rem; border-radius: var(--radius, 18px); color: #fff; background: linear-gradient(120deg, var(--brand), #7c3aed 60%, var(--accent)); box-shadow: 0 14px 34px -18px rgba(79, 70, 229, .8); }
.md-hero h1 { font-size: clamp(1.3rem, 4.2vw, 1.75rem); font-weight: 800; margin: .15rem 0 .25rem; color: #fff; }
.md-hero p { opacity: .9; }
.md-hero-sep { opacity: .6; margin: 0 .25rem; }
.md-hero .md-date { color: rgba(255, 255, 255, .85); }
.md-date { font-size: .85rem; font-weight: 600; color: var(--muted); }
.md-hero-stats { display: flex; gap: .5rem; flex-wrap: wrap; }
.md-pill { display: grid; justify-items: center; min-width: 84px; padding: .55rem .8rem; border-radius: 14px; background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .22); }
.md-pill:hover { background: rgba(255, 255, 255, .26); color: #fff; }
.md-pill strong { font-size: 1.25rem; line-height: 1.1; }
.md-pill span { font-size: .75rem; opacity: .9; }
.md-pill.late { background: rgba(244, 63, 94, .35); border-color: rgba(255, 255, 255, .35); }
.md-section { display: flex; align-items: center; gap: .5rem; font-size: 1rem; font-weight: 800; margin: 0 0 .75rem; color: var(--ink); }
.md-section i { color: var(--brand); }
.md-periods { display: grid; padding: .5rem .75rem .75rem; }
.md-periods.compact { padding: 0; }
.md-period { position: relative; display: flex; align-items: center; gap: .7rem; padding: .5rem .25rem; border-radius: 10px; }
.md-period .md-time { width: 3.1rem; flex: none; font-size: .8rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.md-period .md-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); }
.md-period.brk .md-dot { background: #cbd5e1; box-shadow: none; }
.md-period.past { opacity: .55; }
.md-period.live { background: color-mix(in srgb, var(--c) 10%, white); }
a.md-period:hover { background: #f8fafc; }
.md-sub { font-size: .78rem; font-weight: 700; color: var(--muted); padding: .6rem 1rem .2rem; }
.md-sub.late { color: #e11d48; }
.md-learn { display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; }
.md-learn-icon { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 1.15rem; color: var(--c); background: color-mix(in srgb, var(--c) 14%, white); }
.md-learn-icon.muted { --c: #94a3b8; }
.md-progress { display: flex; height: 6px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.md-progress .progress-bar { background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 999px; }
.md-course { display: block; padding: .6rem .75rem; border-radius: 12px; border: 1px solid var(--line); border-inline-start: 4px solid var(--c); color: inherit; }
.md-course:hover { background: #fafbff; color: inherit; }
.md-clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.md-ql-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .35rem; }
html[lang="ar"] .md-ql-title { text-transform: none; letter-spacing: 0; font-size: .8rem; }
.md-ql { display: flex; flex-wrap: wrap; gap: .4rem; }
.md-ql a { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .7rem; border-radius: 999px; background: var(--brand-50); color: var(--brand); font-size: .85rem; font-weight: 600; }
.md-ql a:hover { background: #e0e7ff; color: var(--brand-600); }
.md-ql a:focus-visible, .md-pill:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (max-width: 575.98px) {
    .md-hero { padding: 1rem; }
    .md-hero-stats { width: 100%; }
    .md-pill { flex: 1; min-width: 0; }
    .md-learn .btn { padding: .25rem .55rem; font-size: .8rem; }
}

/* ---------- Parent: one card per child ---------- */
.pc-band { height: 56px; background: linear-gradient(120deg, var(--brand), var(--accent)); }
.pc-avatar { width: 64px; height: 64px; font-size: 1.5rem; margin-top: -32px; }
.pc-stat { padding: .6rem .7rem; border-radius: 12px; background: #f8fafc; border: 1px solid #eef2f7; height: 100%; }
a.pc-stat:hover { border-color: #c7d2fe; }
.pc-stat-v { font-size: 1.25rem; font-weight: 800; line-height: 1.2; }
.pc-stat-l { font-size: .75rem; color: var(--muted); }
.pc-line { display: flex; align-items: center; gap: .5rem; font-size: .85rem; padding: .3rem 0; border-bottom: 1px dashed #eef2f7; min-width: 0; }
.pc-line:last-child { border-bottom: 0; }
.pc-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.pc-links { display: flex; flex-wrap: wrap; gap: .4rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.pc-links a { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .65rem; border-radius: 999px; background: #f1f5f9; color: var(--ink-2, #334155); font-size: .8rem; font-weight: 600; }
.pc-links a:hover { background: var(--brand-50); color: var(--brand); }

/* ---------- Teacher "Today" ---------- */
.td-today .td-big { font-size: 2rem; font-weight: 800; line-height: 1.1; }

/* ===================== Training courses (student list, public catalog, admin trainees) ===================== */
.tr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 1rem; }
.tr-card { display: flex; flex-direction: column; height: 100%; overflow: hidden; border-radius: 20px; transition: transform .15s ease, box-shadow .15s ease; }
.tr-card:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -18px rgba(30, 27, 75, .35); }
.tr-card-top { padding: 1.1rem 1.2rem .9rem; background: linear-gradient(135deg, var(--brand-50), #f5f3ff 60%, #ecfeff); }
.tr-card-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: #fff; color: var(--brand); font-size: 1.3rem; box-shadow: 0 6px 14px -8px rgba(79, 70, 229, .6); }
.tr-card-title { font-size: 1.08rem; font-weight: 700; line-height: 1.4; margin: .8rem 0 .35rem; }
.tr-card-body { padding: .9rem 1.2rem; flex: 1; }
.tr-card-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .75rem 1.2rem 1rem; border-top: 1px solid #eef2f7; }
.tr-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: .92rem; color: #475569; }
.tr-facts { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .9rem; font-size: .85rem; color: var(--muted); }
.tr-facts .bi { color: var(--brand); }
.tr-seats { font-size: .82rem; }
.tr-tag { display: inline-flex; align-items: center; border-radius: 999px; padding: .3em .85em; font-size: .85rem; font-weight: 700; white-space: nowrap; }
.tr-tag-free { background: #ecfdf5; color: #059669; }
.tr-tag-fee { background: #fff; color: var(--brand); box-shadow: 0 2px 8px -4px rgba(79, 70, 229, .5); }
.tr-text { white-space: pre-line; line-height: 1.8; }
.tr-pay { white-space: pre-line; background: #fffbeb; border: 1px dashed #f59e0b; border-radius: 14px; padding: .85rem 1rem; font-size: .92rem; }
.tr-pay-form > summary { cursor: pointer; color: var(--brand); }
.tr-steps { list-style: none; display: flex; padding: 0; margin: 0 0 1.25rem; counter-reset: trs; }
.tr-steps li { flex: 1; position: relative; text-align: center; font-size: .75rem; color: var(--muted); padding-top: 1.9rem; }
.tr-steps li span { position: absolute; top: 0; inset-inline-start: 50%; width: 1.5rem; height: 1.5rem; margin-inline-start: -.75rem; border-radius: 50%; background: #e2e8f0; z-index: 1; display: grid; place-items: center; }
.tr-steps li::before { content: ""; position: absolute; top: .7rem; inset-inline-start: -50%; width: 100%; height: 3px; background: #e2e8f0; }
.tr-steps li:first-child::before { display: none; }
.tr-steps li.done span, .tr-steps li.now span { background: var(--brand); }
.tr-steps li.done::before, .tr-steps li.now::before { background: var(--brand); }
.tr-steps li.done span::after { content: "\2713"; color: #fff; font-size: .8rem; font-weight: 700; }
.tr-steps li.now span { box-shadow: 0 0 0 4px var(--brand-50); }
.tr-steps li.now { color: var(--brand); font-weight: 700; }
.tr-mine-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .9rem 1.2rem; border-bottom: 1px solid #eef2f7; }
.tr-mine-row:last-child { border-bottom: 0; }
.tr-paybox { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; font-size: .88rem; background: #f8fafc; border-radius: 12px; padding: .55rem .85rem; }
.tr-inline > summary { list-style: none; }
.tr-inline > summary::-webkit-details-marker { display: none; }
.tr-inline[open] { flex-basis: 100%; }
.tr-add-row { display: flex; align-items: center; gap: .5rem; padding: .5rem .65rem; border: 1px solid #eef2f7; border-radius: 12px; }
.tr-contact { display: flex; flex-wrap: wrap; gap: .35rem .75rem; align-items: center; font-size: .95rem; }
@media (max-width: 575.98px) {
    .tr-card-foot { flex-wrap: wrap; }
    .tr-card-foot .btn { flex: 1 1 100%; }
}

/* ---------- User manual & help (/help): topic cards, search, contents list, Markdown body (RTL-aware), print ---------- */
.help-search .card-body { padding: 1rem; }
.help-section-title { font-size: 1.05rem; font-weight: 700; color: var(--ink-2); margin: 0 0 .75rem; display: flex; align-items: center; gap: .5rem; }
.help-section-title .bi { color: var(--brand); }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.help-card { display: flex; align-items: flex-start; gap: .9rem; padding: 1.1rem 1.15rem; text-decoration: none; color: var(--ink); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; height: 100%; }
.help-card:hover, .help-card:focus { transform: translateY(-2px); border-color: var(--brand); box-shadow: 0 12px 28px -14px rgba(79, 70, 229, .45); color: var(--ink); }
.help-card-icon { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem; background: var(--brand-50); color: var(--brand); }
.help-card-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .25rem; }
.help-card-title { font-size: 1rem; }
.help-card-text { color: var(--muted); font-size: .88rem; line-height: 1.55; }
.help-card-go { color: var(--muted); align-self: center; }
.help-footnote { color: var(--muted); font-size: .9rem; margin-top: 1rem; }

.help-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.help-toc { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; padding: 1rem; }
.help-toc-title { font-weight: 700; font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; margin-bottom: .5rem; }
.help-toc nav { display: flex; flex-direction: column; gap: .1rem; }
.help-toc-link { display: block; padding: .3rem .6rem; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: .9rem; line-height: 1.4; border-inline-start: 2px solid transparent; }
.help-toc-link.lvl-3 { padding-inline-start: 1.4rem; font-size: .85rem; color: var(--muted); }
.help-toc-link:hover { background: var(--brand-50); color: var(--brand); }
.help-toc-link.active { color: var(--brand); border-inline-start-color: var(--brand); background: var(--brand-50); font-weight: 600; }

.help-body { min-width: 0; }
.help-body .card-body { padding: 1.5rem 1.75rem; line-height: 1.8; font-size: 1rem; text-align: start; }
.help-body h2 { font-size: 1.35rem; font-weight: 700; margin: 2rem 0 .75rem; padding-bottom: .4rem; border-bottom: 1px solid var(--line); scroll-margin-top: 84px; }
.help-body h3 { font-size: 1.1rem; font-weight: 700; margin: 1.5rem 0 .6rem; color: var(--ink-2); scroll-margin-top: 84px; }
.help-body h4 { font-size: 1rem; font-weight: 700; margin: 1.2rem 0 .5rem; }
.help-body > .card-body > h2:first-child { margin-top: 0; }
.help-anchor { margin-inline-start: .4rem; color: var(--line); text-decoration: none; font-weight: 400; opacity: 0; transition: opacity .15s; }
.help-body h2:hover .help-anchor, .help-body h3:hover .help-anchor { opacity: 1; color: var(--muted); }
.help-body p, .help-body ul, .help-body ol { margin-bottom: .9rem; }
.help-body ul, .help-body ol { padding-inline-start: 1.6rem; padding-inline-end: 0; }
.help-body li { margin-bottom: .3rem; }
.help-body li > ul, .help-body li > ol { margin: .3rem 0 .3rem; }
.help-body ol > li::marker { color: var(--brand); font-weight: 700; }
.help-body strong { color: var(--ink); }
.help-body code { background: #f1f5f9; color: #0f172a; padding: .1rem .35rem; border-radius: 6px; font-size: .88em; direction: ltr; }
.help-body pre { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; overflow-x: auto; line-height: 1.6; direction: inherit; text-align: start; }
.help-body pre code { background: transparent; padding: 0; font-size: .92rem; direction: inherit; white-space: pre; }
.help-body blockquote { margin: 1rem 0; padding: .75rem 1rem; background: var(--accent-50); border-inline-start: 4px solid var(--accent); border-radius: 10px; color: var(--ink-2); }
.help-body blockquote p:last-child { margin-bottom: 0; }
.help-body .help-table { margin: 1rem 0 1.25rem; border: 1px solid var(--line); border-radius: 12px; }
.help-body .help-table .table { margin: 0; font-size: .93rem; }
.help-body .help-table th { background: #f8fafc; font-weight: 700; white-space: nowrap; text-align: start; }
.help-body .help-table th, .help-body .help-table td { padding: .55rem .8rem; vertical-align: top; text-align: start; border-color: var(--line); }
.help-body .help-table td:not(:first-child) { text-align: center; }
.help-body .help-table th:not(:first-child) { text-align: center; }
.help-body .help-table tbody tr:last-child td { border-bottom: 0; }

@media (max-width: 991.98px) {
    .help-layout { grid-template-columns: 1fr; }
    .help-toc { position: static; max-height: none; }
    .help-body .card-body { padding: 1.1rem 1rem; }
}
@media print {
    .sidebar, .topbar, .help-toc, .help-actions, .help-anchor, .sidebar-backdrop, .help-search { display: none !important; }
    .help-layout { display: block; }
    .help-body, .help-body .card-body { border: 0 !important; box-shadow: none !important; padding: 0 !important; }
    .help-body h2, .help-body h3 { break-after: avoid; }
    .help-body .help-table, .help-body pre { break-inside: avoid; }
    .main, .content { margin: 0 !important; padding: 0 !important; }
}

/* ---------- Registration → enrolment (agent R): join form programmes & courses, extra questions, stepper, admin pages ---------- */
.join-counted { counter-reset: jstep; }
.join-counted .join-step span:empty::before { counter-increment: jstep; content: counter(jstep); }
.join-programs.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 767.98px) { .join-programs.three { grid-template-columns: 1fr; } }
.join-account { display: flex; gap: .75rem; align-items: flex-start; padding: .8rem 1rem; border-radius: 16px; background: var(--brand-50, #eef2ff); border: 1px solid var(--line, #e2e8f0); }
.join-account-avatar { font-size: 1.8rem; color: var(--brand); line-height: 1; }
.join-courses { display: grid; gap: .5rem; }
.join-course { display: block; padding: .75rem .9rem; border: 2px solid var(--line, #e2e8f0); border-radius: 14px; cursor: pointer; }
.join-course small { display: flex; flex-wrap: wrap; gap: .25rem 1rem; color: var(--muted); margin-top: .25rem; }
.join-course small i { margin-inline-end: .3rem; }
.btn-check:checked + .join-course { border-color: var(--brand); background: var(--brand-50); }
.btn-check:disabled + .join-course { opacity: .55; cursor: not-allowed; }
.join-flow { padding: 1rem; border-radius: 18px; background: rgba(255,255,255,.7); }

.reg-upload { display: flex; gap: .75rem; align-items: flex-start; padding: .75rem; border: 2px dashed var(--line, #e2e8f0); border-radius: 14px; background: #fafbff; }
.reg-upload > i { font-size: 1.6rem; color: var(--brand); line-height: 1; }
.reg-upload.has-file { border-style: solid; border-color: #a7f3d0; background: #f0fdf4; }
.reg-upload.is-invalid { border-color: #f87171; }

.reg-stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; counter-reset: none; }
.reg-stepper li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .35rem; min-width: 0; }
.reg-stepper li::before { content: ""; position: absolute; top: 19px; inset-inline-start: calc(-50% + 22px); inset-inline-end: calc(50% + 22px); height: 3px; border-radius: 3px; background: var(--line, #e2e8f0); }
.reg-stepper li:first-child::before { display: none; }
.reg-stepper li.done::before, .reg-stepper li.active::before { background: var(--brand); }
.reg-dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 1.1rem; background: #f1f5f9; color: var(--muted, #64748b); border: 2px solid var(--line, #e2e8f0); position: relative; z-index: 1; }
.reg-stepper li.done .reg-dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.reg-stepper li.active .reg-dot { background: #fff; border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50, #eef2ff); }
.reg-stepper li.warn .reg-dot { border-color: #f59e0b; color: #b45309; box-shadow: 0 0 0 4px #fef3c7; }
.reg-step-text { display: flex; flex-direction: column; font-size: .85rem; line-height: 1.3; }
.reg-step-text small { color: var(--muted, #64748b); font-size: .75rem; }
.reg-stepper li.active .reg-step-text b { color: var(--brand); }
.reg-stepper.explain .reg-dot { background: var(--brand-50, #eef2ff); color: var(--brand); border-color: transparent; }
.reg-stepper.explain li::before { background: var(--brand-50, #e0e7ff); }
@media (max-width: 575.98px) {
    .reg-stepper { grid-template-columns: 1fr; gap: .6rem; }
    .reg-stepper li { flex-direction: row; text-align: start; align-items: center; gap: .7rem; }
    .reg-stepper li::before { display: none; }
    .reg-dot { width: 34px; height: 34px; flex: none; }
}

.reg-menu { min-width: 280px; max-width: 90vw; }
.reg-menu .dropdown-item { white-space: normal; }
.reg-grade-picks { display: grid; gap: .6rem; max-height: 340px; overflow: auto; padding: .6rem .75rem; border: 1px solid var(--line, #e2e8f0); border-radius: 12px; }
.reg-dl dt { font-weight: 500; color: var(--muted, #64748b); }
.reg-dl dd { font-weight: 600; }
.reg-answers .reg-missing { background: #fffbeb; border-inline-start: 3px solid #f59e0b; padding-inline: .6rem !important; }

.regf-list .list-group-item { padding: .75rem 1rem; }
.regf-list .regf-hidden { opacity: .6; }
.regf-icon { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50, #eef2ff); color: var(--brand); }
.regf-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .5rem; }
.regf-type { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .7rem .5rem; border: 2px solid var(--line, #e2e8f0); border-radius: 14px; cursor: pointer; text-align: center; font-size: .85rem; font-weight: 600; }
.regf-type i { font-size: 1.3rem; color: var(--brand); }
.btn-check:checked + .regf-type { border-color: var(--brand); background: var(--brand-50); }
.regf-preview { background: linear-gradient(180deg, #f8fafc, #fff); }
.regf-preview .join-step span { font-size: .75rem; }

/* ---------- Class hub (Admin/Sections/Details tabs: overview, syllabus, attendance trend) — agent C, round 2 ---------- */
.cls-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .9rem 1.25rem; }
.cls-facts > div { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.cls-facts small { color: var(--muted); font-size: .75rem; font-weight: 600; }
.cls-facts strong { font-weight: 700; overflow-wrap: anywhere; }
.cls-year-bar { height: 10px; border-radius: 999px; }
.cls-mini { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: .55rem .4rem; height: 100%; }
.cls-mini strong { display: block; font-size: 1.3rem; line-height: 1.2; }
.cls-mini > small { display: block; color: var(--muted); font-size: .72rem; }
.cls-terms { display: flex; gap: .4rem; flex-wrap: wrap; }
.cls-term { flex: 1 1 120px; border: 1px solid var(--line); border-radius: 12px; padding: .45rem .65rem; display: flex; flex-direction: column; }
.cls-term small { color: var(--muted); font-size: .72rem; }
.cls-term.done { background: #f1f5f9; color: var(--muted); }
.cls-term.now { border-color: var(--brand); background: var(--brand-50); }
.cls-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--c, var(--brand)); }
.cls-subj-name { width: 34%; min-width: 90px; font-weight: 600; }
.cls-actions-list .list-group-item { display: grid; grid-template-columns: 1.4rem 1fr auto; align-items: center; column-gap: .5rem; font-weight: 600; font-size: .9rem; }
.cls-actions-list .list-group-item > i { color: var(--brand); }
.cls-actions-list .list-group-item.text-danger > i { color: inherit; }
.cls-actions-list .list-group-item > small { grid-column: 2 / -1; font-weight: 400; color: var(--muted); font-size: .75rem; }
.cls-actions-list form .list-group-item { width: 100%; text-align: start; border-inline: 0; border-bottom: 0; }
.cls-nocourse { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .7rem .9rem; border: 1px dashed var(--line); border-radius: 12px; background: #f8fafc; font-size: .9rem; color: var(--ink-2); }
.cls-nocourse > i { font-size: 1.2rem; color: var(--muted); }
.cls-unit { border: 1px solid var(--line); border-radius: 12px; margin-bottom: .6rem; overflow: hidden; }
.cls-unit-head { display: flex; justify-content: space-between; gap: .5rem; padding: .5rem .75rem; background: #f8fafc; border-bottom: 1px solid var(--line); }
.cls-lessons { list-style: none; margin: 0; padding: .25rem .4rem; }
.cls-lessons li { display: flex; align-items: center; gap: .5rem; padding: .35rem .35rem; border-radius: 8px; font-size: .88rem; min-width: 0; }
.cls-lessons li + li { border-top: 1px dashed var(--line); }
.cls-lessons li a:hover { color: var(--brand) !important; }
.cls-l-ico { width: 1.1rem; flex: none; color: var(--muted); }
.cls-lessons li.done .cls-l-ico { color: #16a34a; }
.cls-lessons li.now { background: var(--brand-50); }
.cls-lessons li.now .cls-l-ico { color: var(--brand); }
.cls-lessons li.draft { opacity: .7; }
.cls-teacher-select { max-width: 55%; }
/* Weekly attendance bars: one series, one hue, rounded data-end, values labelled, tooltip on hover/focus (title). */
.cls-trend { display: flex; align-items: flex-end; gap: 6px; height: 170px; }
.cls-trend-col { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; outline: none; }
.cls-trend-track { flex: 1; width: 100%; max-width: 38px; display: flex; align-items: flex-end; border-bottom: 1px solid var(--line); }
.cls-trend-bar { width: 100%; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; transition: opacity .15s; }
.cls-trend-bar.none { background: transparent; }
.cls-trend-col:hover .cls-trend-bar, .cls-trend-col:focus .cls-trend-bar { opacity: .75; }
.cls-trend-val { font-size: .7rem; font-weight: 700; color: var(--ink-2); }
.cls-trend-lbl { font-size: .66rem; color: var(--muted); white-space: nowrap; }
[data-bs-theme="dark"] .cls-mini, [data-bs-theme="dark"] .cls-unit-head, [data-bs-theme="dark"] .cls-nocourse { background: rgba(255,255,255,.05); }
@media (max-width: 575.98px) {
    .cls-subj-name { width: 40%; }
    .cls-trend { gap: 3px; height: 140px; }
    .cls-trend-val { font-size: .6rem; }
    .cls-teacher-select { max-width: 60%; }
}

/* ===================================================================== Academic calendar (Admin/AcademicYears) */
.ac-hero { background: linear-gradient(135deg, var(--brand-50) 0%, var(--card) 55%); }
.ac-year-menu { min-width: 280px; max-height: 60vh; overflow: auto; }
.ac-timeline { position: relative; padding-top: 1.4rem; }
.ac-track { position: relative; height: 40px; border-radius: 12px; background: repeating-linear-gradient(45deg, #f1f5f9, #f1f5f9 6px, #e9eef5 6px, #e9eef5 12px); }
.ac-term { position: absolute; top: 0; bottom: 0; border-radius: 12px; background: #e0e7ff; border: 1px solid #c7d2fe; color: var(--brand-600);
  display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; overflow: hidden; z-index: 1; }
.ac-term span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 .4rem; }
.ac-done { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; border-radius: 12px; background: rgba(79, 70, 229, .16); z-index: 2; pointer-events: none; }
.ac-today { position: absolute; top: -1.4rem; bottom: -6px; width: 2px; background: var(--rose); z-index: 3; }
.ac-today span { position: absolute; top: 0; inset-inline-start: 50%; transform: translateX(-50%); background: var(--rose); color: #fff; font-size: .68rem;
  font-weight: 700; padding: .05rem .45rem; border-radius: 999px; white-space: nowrap; }
[dir="rtl"] .ac-today span { transform: translateX(50%); }
.ac-holiday-row { position: relative; height: 8px; margin-top: 4px; }
.ac-hmark { position: absolute; top: 0; height: 8px; border-radius: 4px; background: var(--warm); }
.ac-hmark.exam { background: var(--rose); top: 0; opacity: .85; }
.ac-months { position: relative; height: 1.2rem; margin-top: 2px; font-size: .7rem; color: var(--muted); }
.ac-months span { position: absolute; top: 0; white-space: nowrap; padding-inline-start: 2px; border-inline-start: 1px solid var(--line); }
.ac-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; vertical-align: middle; margin-inline-end: .35rem; background: var(--brand); }
.ac-dot.term { background: #c7d2fe; } .ac-dot.holiday { background: var(--warm); } .ac-dot.exam { background: var(--rose); } .ac-dot.today { background: var(--rose); width: 3px; }
.ac-dot.event { background: var(--brand); } .ac-dot.activity { background: #10b981; } .ac-dot.meeting { background: var(--accent); } .ac-dot.deadline { background: #a855f7; }
.ac-swatch { width: 14px; height: 10px; border-radius: 3px; display: inline-block; vertical-align: middle; margin-inline-end: .35rem; border: 1px solid var(--line); }
.ac-swatch.we { background: #f1f5f9; } .ac-swatch.brk { background: repeating-linear-gradient(45deg, #f8fafc, #f8fafc 3px, #e2e8f0 3px, #e2e8f0 6px); }
.ac-stat { display: block; height: 100%; padding: .8rem .9rem; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--line); color: inherit; text-decoration: none; }
.ac-stat.link:hover { border-color: #c7d2fe; box-shadow: var(--shadow-sm); color: inherit; }
.ac-stat-label { font-size: .78rem; color: var(--muted); font-weight: 600; }
.ac-stat-value { font-size: 1.6rem; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
.ac-stat-value small { font-size: .9rem; color: var(--muted); font-weight: 600; }
.ac-stat-sub { font-size: .75rem; color: var(--muted); }

/* Month grid: CSS grid follows the page direction, so Arabic pages read right-to-left automatically. */
.ac-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.ac-dow { text-align: center; font-size: .75rem; font-weight: 700; color: var(--muted); padding: .3rem 0; }
.ac-dow.we { color: #b45309; }
.ac-day { min-height: 92px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); padding: 4px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ac-day[data-ac-day] { cursor: pointer; }
.ac-day[data-ac-day]:hover, .ac-day[data-ac-day]:focus-visible { border-color: #a5b4fc; outline: none; box-shadow: 0 0 0 3px var(--brand-50); }
.ac-day.out { background: transparent; border-style: dashed; opacity: .45; }
.ac-day.we { background: #f8fafc; }
.ac-day.hol { background: #fffbeb; border-color: #fde68a; }
.ac-day.nocl { background: #fff7ed; }
.ac-day.brk { background: repeating-linear-gradient(45deg, #fafbfc, #fafbfc 5px, #f1f5f9 5px, #f1f5f9 10px); }
.ac-day.oy { background: transparent; opacity: .5; }
.ac-day.today { border: 2px solid var(--brand); }
.ac-num { font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.ac-day.today .ac-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; }
.ac-chip { font-size: .7rem; line-height: 1.25; border-radius: 6px; padding: 1px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ac-chip-btn { all: unset; display: block; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; }
.ac-chip-btn:focus-visible { outline: 2px solid currentColor; border-radius: 4px; }
.ac-more { font-size: .68rem; color: var(--muted); font-weight: 700; padding-inline-start: 4px; }
@media (max-width: 767.98px) {
  .ac-grid { gap: 2px; }
  .ac-day { min-height: 54px; padding: 2px; border-radius: 6px; }
  .ac-chip { font-size: 0; height: 5px; padding: 0; border-radius: 3px; }
  .ac-chip-btn { font-size: 0; height: 5px; }
  .ac-more { font-size: .6rem; }
}

/* Kind colours: chips, pills, date tiles, kind picker */
.k-holiday { background: #fef3c7; color: #92400e; }
.k-exam { background: #ffe4e6; color: #be123c; }
.k-event { background: #e0e7ff; color: #4338ca; }
.k-activity { background: #d1fae5; color: #047857; }
.k-meeting { background: #ccfbf1; color: #0f766e; }
.k-parentmeeting { background: #e0f2fe; color: #0369a1; }
.k-deadline { background: #f3e8ff; color: #7e22ce; }
.k-other { background: #f1f5f9; color: #475569; }
.k-term { background: transparent; color: var(--brand-600); border: 1px dashed #a5b4fc; }
@media (max-width: 767.98px) {
  .ac-chip.k-holiday { background: #f59e0b; } .ac-chip.k-exam { background: #f43f5e; } .ac-chip.k-event { background: #6366f1; }
  .ac-chip.k-activity { background: #10b981; } .ac-chip.k-meeting { background: #14b8a6; } .ac-chip.k-parentmeeting { background: #0ea5e9; }
  .ac-chip.k-deadline { background: #a855f7; } .ac-chip.k-other { background: #94a3b8; } .ac-chip.k-term { border-color: #6366f1; }
}
.ac-pill { display: inline-block; font-size: .75rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; white-space: nowrap; }
.ac-up { display: flex; align-items: center; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.ac-up:last-child { border-bottom: 0; }
.ac-up-date { width: 46px; flex: none; border-radius: 10px; text-align: center; padding: .25rem 0; line-height: 1.1; display: inline-flex; flex-direction: column; align-items: center; }
.ac-up-date b { font-size: 1.05rem; }
.ac-up-date span { font-size: .68rem; font-weight: 600; }
.ac-term-no { width: 30px; height: 30px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); font-weight: 800; }
.ac-term-now { background: linear-gradient(90deg, var(--brand-50), transparent); }
.ac-table .ac-past { opacity: .55; }
.ac-kinds { display: flex; flex-wrap: wrap; gap: .4rem; }
.ac-kind { cursor: pointer; padding: .35rem .75rem; border-radius: 999px; font-size: .82rem; font-weight: 700; border: 2px solid transparent; }
.btn-check:checked + .ac-kind { border-color: currentColor; box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
.btn-check:focus-visible + .ac-kind { outline: 2px solid var(--brand); outline-offset: 2px; }
.ac-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; counter-reset: acstep; }
.ac-steps li { position: relative; counter-increment: acstep; padding: 1rem 1rem 1rem 1rem; padding-inline-start: 3.3rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); }
.ac-steps li::before { content: counter(acstep); position: absolute; inset-inline-start: 1rem; top: 1rem; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--brand-50); color: var(--brand); font-weight: 800; font-size: .85rem; }
.ac-steps li.done { border-color: #a7f3d0; background: linear-gradient(180deg, #f0fdf4, var(--card)); }
.ac-steps li.done::before { content: "\2713"; background: #10b981; color: #fff; }
.ac-warn-list { padding-inline-start: 1.2rem; }
.ac-warn-list li { margin-bottom: .35rem; }
.ac-mini { border: 1px solid var(--line); border-radius: 10px; padding: .4rem; }
.ac-mini b { display: block; font-size: 1.2rem; }
[data-bs-theme="dark"] .ac-track { background: repeating-linear-gradient(45deg, #1e293b, #1e293b 6px, #243044 6px, #243044 12px); }
[data-bs-theme="dark"] .ac-term { background: rgba(99, 102, 241, .25); border-color: rgba(129, 140, 248, .5); color: #c7d2fe; }
[data-bs-theme="dark"] .ac-day.we, [data-bs-theme="dark"] .ac-swatch.we { background: rgba(255, 255, 255, .03); }
[data-bs-theme="dark"] .ac-day.hol { background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .35); }
[data-bs-theme="dark"] .ac-day.nocl { background: rgba(249, 115, 22, .1); }
[data-bs-theme="dark"] .ac-day.brk { background: repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(255,255,255,.04) 5px, rgba(255,255,255,.04) 10px); }
[data-bs-theme="dark"] .ac-steps li.done { background: rgba(16, 185, 129, .08); border-color: rgba(16, 185, 129, .35); }
[data-bs-theme="dark"] .ac-hero { background: linear-gradient(135deg, rgba(99, 102, 241, .14) 0%, var(--card) 55%); }

/* ==========================================================================
   Student: My institutions & requests (/Student/Institutions) — si-*
   Admin: Student requests (/Admin/StudentRequests) — sr-*
   ========================================================================== */
.si-section { margin-bottom: 2rem; scroll-margin-top: 80px; }
.si-jump { display: flex; flex-wrap: wrap; gap: .4rem; }
.si-jump a { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .8rem; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink-2); font-size: .85rem; font-weight: 600; }
.si-jump a:hover { border-color: var(--brand); color: var(--brand); }
.si-jump a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.si-dot { background: var(--warm); color: #fff; border-radius: 999px; padding: 0 .45rem; font-size: .72rem; }
.si-inst { transition: box-shadow .15s, border-color .15s; }
.si-inst:hover { box-shadow: var(--shadow); }
.si-inst.current { border: 2px solid var(--brand); }
.si-logo { width: 44px; height: 44px; object-fit: contain; border-radius: 12px; background: #fff; border: 1px solid var(--line); flex: none; }
.si-fact { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .55rem; border-radius: 8px; background: #f1f5f9; color: var(--ink-2); font-size: .8rem; }
.si-grades { display: flex; flex-wrap: wrap; gap: .5rem; }
.si-grade { display: inline-flex; flex-direction: column; padding: .45rem .75rem; border-radius: 12px; border: 1px solid var(--line); background: var(--card); min-width: 110px; }
.si-grade small { color: var(--muted); font-size: .74rem; }
.si-grade.mine { border-color: var(--brand); background: var(--brand-50); }
.si-grade.mine small { color: var(--brand); font-weight: 700; }
.si-req.danger { border-color: #fecdd3; }
.si-reqrow .si-decision.ok { color: #047857; }
.si-reqrow .si-decision.no { color: #b91c1c; }
.si-offers { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; font-size: .85rem; }
.si-offers li { display: flex; align-items: center; gap: .45rem; }
.si-offers i { color: var(--brand); }
.si-blocked { color: #b45309; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: .4rem .6rem; }
.sr-card.withdraw { border-inline-start: 4px solid var(--rose); }
.sr-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); font-size: 1.2rem; flex: none; }
.sr-card.withdraw .sr-icon { background: #fff1f2; color: var(--rose); }
.sr-move { display: inline-flex; flex-wrap: wrap; align-items: center; padding: .3rem .65rem; border-radius: 10px; background: #f8fafc; border: 1px solid var(--line); font-size: .88rem; }
.sr-reason { background: #f8fafc; border-radius: 10px; padding: .5rem .75rem; font-size: .88rem; white-space: pre-line; }
.sr-decide { border-top: 1px dashed var(--line); padding-top: .75rem; }
@media (max-width: 575.98px) {
    .si-grade { min-width: calc(50% - .25rem); }
    .sr-decide .btn { flex: 1; }
}
[data-bs-theme="dark"] .si-fact, [data-bs-theme="dark"] .sr-move, [data-bs-theme="dark"] .sr-reason { background: rgba(255, 255, 255, .05); color: inherit; }
[data-bs-theme="dark"] .si-grade.mine { background: rgba(99, 102, 241, .18); }
[data-bs-theme="dark"] .si-blocked { background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .35); color: #fcd34d; }
[data-bs-theme="dark"] .si-logo { background: #fff; }
[data-bs-theme="dark"] .sr-card.withdraw .sr-icon { background: rgba(244, 63, 94, .15); }
[data-bs-theme="dark"] .si-reqrow .si-decision.ok { color: #34d399; }
[data-bs-theme="dark"] .si-reqrow .si-decision.no { color: #fca5a5; }

/* ===== Lesson videos (record / upload / link on library lessons; player in lessons) ===== */
.lv-player { margin: 0; }
.lv-player .lv-video { display: block; width: 100%; max-height: 70vh; border-radius: 14px; background: #0f172a; aspect-ratio: 16 / 9; object-fit: contain; }
.lv-player .ratio { border-radius: 14px; overflow: hidden; background: #0f172a; }
.lv-player figcaption { margin-top: .5rem; font-size: .9rem; }
.lv-missing { display: flex; align-items: center; justify-content: center; gap: .5rem; aspect-ratio: 16 / 9; border-radius: 14px; background: #f1f5f9; color: var(--muted); }
.lesson-media .lv-player { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: .6rem; }
.lv-panel .lv-panel-icon, .lv-q-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: #fff1f2; color: #e11d48; font-size: 1.25rem; flex: none; }
.lv-q-icon { width: 34px; height: 34px; border-radius: 10px; font-size: 1rem; }
.lv-tabs .nav-link { border-radius: 999px; font-weight: 600; }
.lv-stage { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #0f172a; display: grid; place-items: center; }
.lv-stage video { width: 100%; height: 100%; object-fit: contain; background: #0f172a; }
.lv-stage video.mirror { transform: scaleX(-1); }
.lv-stage-empty { display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 1.5rem; text-align: center; color: #cbd5e1; max-width: 420px; }
.lv-stage-empty i { font-size: 2.4rem; color: #fff; opacity: .85; }
.lv-badge { position: absolute; top: .75rem; inset-inline-start: .75rem; display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem; border-radius: 999px; background: rgba(15, 23, 42, .75); color: #fff; font-weight: 600; font-size: .85rem; }
.lv-dot { width: .65rem; height: .65rem; border-radius: 50%; background: #ef4444; animation: lv-blink 1s infinite; }
.lv-badge.paused .lv-dot { background: #f59e0b; animation: none; }
@keyframes lv-blink { 50% { opacity: .25; } }
.lv-controls { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin-top: .75rem; }
.lv-controls .btn-group .btn.active { background: var(--brand); color: #fff; }
.lv-drop { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 2rem 1rem; border: 2px dashed var(--line); border-radius: 16px; cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.lv-drop:hover { border-color: var(--brand); background: var(--brand-50); }
.lv-drop i { font-size: 2rem; color: var(--brand); }
.lv-file-preview { width: 100%; max-height: 320px; border-radius: 14px; background: #0f172a; }
.lv-captions summary { cursor: pointer; }
.lv-compare summary { cursor: pointer; list-style: none; }
.lv-history td { vertical-align: top; }
@media (max-width: 575.98px) {
    .lv-controls, .lv-controls .btn-group, .lv-controls > div { width: 100%; }
    .lv-controls .btn { flex: 1 1 auto; }
    .lv-panel .btn { width: 100%; }
}
[data-bs-theme="dark"] .lv-missing { background: rgba(255, 255, 255, .05); }
[data-bs-theme="dark"] .lv-panel .lv-panel-icon, [data-bs-theme="dark"] .lv-q-icon { background: rgba(244, 63, 94, .15); }

/* ---- Always let long pages scroll on computers (a scrollbar is always shown, the page can never be locked by mistake) ---- */
@media (min-width: 992px) {
    html { overflow-y: scroll; }
    body:not(.modal-open) { overflow-y: visible !important; }
}

/* ===== Lesson sections: collapsible groups with a check mark per section (agent G, _LessonView + js/lesson-groups.js) ===== */
.lg-bar { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: .85rem 1rem; margin-bottom: 1rem; box-shadow: var(--shadow-sm); }
.lg-bar.is-done { border-color: #86efac; background: linear-gradient(120deg, #f0fdf4, #fff 70%); }
.lg-bar-icon { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 1.15rem; background: var(--brand-50); color: var(--brand); }
.lg-bar.is-done .lg-bar-icon { background: #dcfce7; color: #16a34a; }
.lg-bar-text { font-size: .98rem; line-height: 1.4; }
.lg-bar-progress { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: .4rem; max-width: 360px; }
.lg-bar-progress span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #22c55e, #16a34a); transition: width .4s ease; }
.lg-bar .btn-group .btn { font-size: .8rem; }
.lg-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .7rem; }
.lg-chips:empty { display: none; }
.lg-chip { display: inline-flex; align-items: center; gap: .35rem; max-width: 100%; padding-block: .2rem; padding-inline: .25rem .65rem; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink-2); font-size: .8rem; font-weight: 600; text-decoration: none; transition: background .15s, border-color .15s, color .15s; }
.lg-chip:hover { border-color: var(--brand); color: var(--brand); }
.lg-chip.is-open { border-color: #c7d2fe; background: var(--brand-50); }
.lg-chip-n { width: 20px; height: 20px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; background: #fff; border: 1px solid var(--line); color: var(--muted); }
.lg-chip-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 16rem; }
.lg-chip.is-done .lg-chip-n { background: #16a34a; border-color: #16a34a; color: transparent; position: relative; }
.lg-chip.is-done .lg-chip-n::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: .72rem; font-weight: 800; }

.lg-group { --lg-c: var(--brand); --lg-bg: var(--brand-50); margin-bottom: .85rem; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: var(--shadow-sm); scroll-margin-top: 84px; transition: border-color .2s, box-shadow .2s; }
.lg-group[data-tone="overview"] { --lg-c: #4f46e5; --lg-bg: #eef2ff; }
.lg-group[data-tone="explain"]  { --lg-c: #d97706; --lg-bg: #fef3c7; }
.lg-group[data-tone="part"]     { --lg-c: #7c3aed; --lg-bg: #f3e8ff; }
.lg-group[data-tone="example"]  { --lg-c: #2563eb; --lg-bg: #dbeafe; }
.lg-group[data-tone="activity"] { --lg-c: #0d9488; --lg-bg: #ccfbf1; }
.lg-group[data-tone="video"]    { --lg-c: #e11d48; --lg-bg: #ffe4e6; }
.lg-group[data-tone="book"]     { --lg-c: #047857; --lg-bg: #d1fae5; }
.lg-group[data-tone="practice"] { --lg-c: #7c3aed; --lg-bg: #ede9fe; }
.lg-group[data-tone="vocab"]    { --lg-c: #0891b2; --lg-bg: #cffafe; }
.lg-group[data-tone="quiz"]     { --lg-c: #db2777; --lg-bg: #fce7f3; }
.lg-group[data-tone="test"]     { --lg-c: #ea580c; --lg-bg: #ffedd5; }
.lg-group[data-tone="summary"]  { --lg-c: #475569; --lg-bg: #f1f5f9; }
.lg-group.is-open { box-shadow: var(--shadow); }
.lg-group.is-done { border-color: #bbf7d0; }
.lg-h { margin: 0; font-size: inherit; font-weight: inherit; line-height: inherit; }
.lg-head { display: flex; align-items: center; gap: .8rem; width: 100%; min-height: 64px; padding: .7rem 1rem; border: 0; border-radius: 18px; background: transparent; color: var(--ink); text-align: start; cursor: pointer; }
.lg-group.is-open .lg-head { border-end-start-radius: 0; border-end-end-radius: 0; }
.lg-head:hover { background: color-mix(in srgb, var(--lg-bg) 45%, transparent); }
.lg-head:focus-visible { outline: 3px solid color-mix(in srgb, var(--lg-c) 45%, transparent); outline-offset: -3px; }
.lg-icon { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 1.15rem; background: var(--lg-bg); color: var(--lg-c); }
.lg-titles { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.lg-title { font-weight: 800; font-size: 1.02rem; line-height: 1.35; overflow-wrap: anywhere; }
.lg-sub { font-size: .8rem; color: var(--muted); line-height: 1.3; margin-top: .1rem; }
.lg-sub:empty { display: none; }
.lg-check { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 2px solid #cbd5e1; color: transparent; font-size: 1rem; transition: background .25s, border-color .25s, color .25s, transform .25s; }
.lg-check .bi { line-height: 1; }
.lg-group.is-done .lg-check { background: #16a34a; border-color: #16a34a; color: #fff; transform: scale(1.04); box-shadow: 0 4px 12px -4px rgba(22,163,74,.6); }
.lg-chev { flex: none; color: var(--muted); font-size: 1rem; transition: transform .2s; }
.lg-group.is-open .lg-chev { transform: rotate(180deg); }
.lg-body { border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 65%, var(--card)); border-end-start-radius: 18px; border-end-end-radius: 18px; }
.lg-inner { padding: 1rem 1rem .25rem; }
.lg-inner > .lesson-steps > .lesson-step:last-child, .lg-inner > .card:last-child { margin-bottom: .75rem !important; }
.lg-end { display: block; height: 1px; width: 100%; pointer-events: none; }
.lg-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .65rem 1rem .85rem; border-top: 1px dashed var(--line); }
.lg-foot-done { display: none; color: #15803d; font-weight: 700; font-size: .88rem; }
.lg-group.is-done .lg-foot-done { display: inline-flex; align-items: center; }
.lg-group.is-done .lg-mark { display: none; }
.lg-group:last-of-type .lg-next { display: none; }
@media (max-width: 575.98px) {
    .lg-head { gap: .6rem; padding: .6rem .75rem; min-height: 58px; }
    .lg-icon { width: 34px; height: 34px; font-size: 1rem; border-radius: 10px; }
    .lg-inner { padding: .75rem .6rem .1rem; }
    .lg-title { font-size: .96rem; }
    .lg-bar .btn-group { width: 100%; }
    .lg-bar .btn-group .btn { flex: 1 1 0; }
    .lg-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; padding-bottom: .25rem; }
    .lg-chip { flex: none; }
    .lg-chip-t { max-width: 11rem; }
}
[data-bs-theme="dark"] .lg-chip-n { background: transparent; }
[data-bs-theme="dark"] .lg-bar.is-done { background: rgba(22,163,74,.08); }
@media print {
    .lesson .lg-group .lg-body[hidden] { display: block !important; }
    .lg-bar, .lg-foot, .lg-chev, .lg-check { display: none !important; }
    .lg-group { box-shadow: none !important; break-inside: auto; }
    .lg-body { background: #fff; }
}

/* ---- A clearly visible page scrollbar on computers (the default light-grey one was hard to see on the pale page) ---- */
@media (min-width: 992px) and (pointer: fine) {
    html { scrollbar-color: #64748b #e2e8f0; scrollbar-width: auto; }
    html::-webkit-scrollbar { width: 14px; }
    html::-webkit-scrollbar-track { background: #e2e8f0; }
    html::-webkit-scrollbar-thumb { background: #64748b; border-radius: 8px; border: 3px solid #e2e8f0; }
    html::-webkit-scrollbar-thumb:hover { background: #475569; }
}

/* Careers: open positions grouped by subject (collapsible) */
.job-groups{display:flex;flex-direction:column;gap:.75rem}
.job-group{border:1px solid var(--bs-border-color,#e5e7eb);border-radius:1rem;background:var(--bs-body-bg,#fff);overflow:hidden}
.job-group>summary{list-style:none;display:flex;align-items:center;gap:.85rem;padding:1rem 1.15rem;cursor:pointer;user-select:none}
.job-group>summary::-webkit-details-marker{display:none}
.job-group>summary:hover{background:rgba(99,102,241,.05)}
.job-group-icon{width:42px;height:42px;flex:none;border-radius:12px;display:grid;place-items:center;background:rgba(99,102,241,.12);color:#4f46e5;font-size:1.15rem}
.job-group-name{display:block;font-weight:700;font-size:1.08rem}
.job-group-roles{display:block;font-size:.82rem;color:var(--bs-secondary-color,#6b7280)}
.job-group-count{flex:none;min-width:2rem;text-align:center;font-weight:700;border-radius:999px;padding:.15rem .6rem;background:#4f46e5;color:#fff;font-size:.85rem}
.job-group-chevron{flex:none;transition:transform .2s}
.job-group[open] .job-group-chevron{transform:rotate(180deg)}
.job-group[open]>summary{border-bottom:1px solid var(--bs-border-color,#e5e7eb)}
.job-group-body{padding:.75rem;display:grid;gap:.75rem;grid-template-columns:1fr}
@media (min-width:768px){.job-group-body{grid-template-columns:1fr 1fr}}
.job-item{border:1px solid var(--bs-border-color,#e5e7eb);border-radius:.85rem;padding:1rem;display:flex;flex-direction:column}
.job-item>.d-flex:last-child{margin-top:auto}

/* Help → Demo accounts: institution type picker */
.demo-types{display:flex;flex-wrap:wrap;gap:.5rem}
.demo-type{display:inline-flex;align-items:center;gap:.5rem;padding:.6rem 1rem;border:1px solid var(--bs-border-color,#e5e7eb);border-radius:999px;text-decoration:none;color:inherit;background:var(--bs-body-bg,#fff);font-weight:600}
.demo-type:hover{border-color:#4f46e5}
.demo-type.on{background:#4f46e5;border-color:#4f46e5;color:#fff}
.demo-type i{font-size:1.1rem}

/* Accounting dashboard: 12-month income/expense bars */
.acc-bars{display:flex;align-items:flex-end;gap:.4rem;height:180px}
.acc-bar{flex:1;display:flex;flex-direction:column;align-items:center;height:100%}
.acc-bar-pair{flex:1;width:100%;display:flex;align-items:flex-end;justify-content:center;gap:2px}
.acc-bar-pair span{width:42%;border-radius:4px 4px 0 0;min-height:2px}
.acc-bar-pair .in,.acc-key.in{background:#10b981}
.acc-bar-pair .out,.acc-key.out{background:#ef4444}
.acc-bar-label{font-size:.7rem;color:var(--bs-secondary-color,#6b7280);margin-top:.25rem}
.acc-key{display:inline-block;width:.8rem;height:.8rem;border-radius:3px;vertical-align:middle;margin-inline-end:.3rem}
@media print{.no-print,.sidebar,.topbar{display:none!important}}

/* ---- Private marketing material: floating share bar, guided tour (slides + table of contents) */
.mkt-bar { position: fixed; inset-block-end: 1rem; inset-inline-start: 1rem; z-index: 1060; display: flex; align-items: center; gap: .6rem; background: #fff8e1; border: 1px solid #f5d77a; border-radius: 999px; padding: .4rem .5rem .4rem .9rem; box-shadow: 0 8px 30px rgba(15,23,42,.15); font-size: .85rem; max-width: calc(100vw - 2rem); }
.tour-slides { position: relative; min-height: 100vh; padding-top: 5.5rem; display: flex; flex-direction: column; background: radial-gradient(1200px 600px at 80% 0%, #e0e7ff, transparent), radial-gradient(900px 500px at 0% 100%, #ccfbf1, transparent), #f8fafc; }
.tour-track { flex: 1; position: relative; }
.tour-slide { position: absolute; inset: 0; display: flex; align-items: center; opacity: 0; transform: translateX(30px); transition: opacity .45s, transform .45s; pointer-events: none; }
[dir=rtl] .tour-slide { transform: translateX(-30px); }
.tour-slide.on { opacity: 1; transform: none; pointer-events: auto; }
.tour-slide .s-icon { width: 84px; height: 84px; border-radius: 24px; display: grid; place-items: center; font-size: 2.4rem; color: #fff; background: linear-gradient(135deg, var(--brand), #14b8a6); box-shadow: 0 18px 40px rgba(79,70,229,.3); }
.tour-slide h2 { font-size: clamp(1.8rem, 4vw, 3.2rem); font-weight: 800; letter-spacing: -.02em; }
.tour-slide .lead { font-size: clamp(1.05rem, 1.6vw, 1.35rem); color: var(--ink-2); }
.tour-slide .s-points { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; }
.tour-slide .s-point { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: .9rem 1rem; display: flex; gap: .7rem; align-items: flex-start; box-shadow: 0 6px 20px rgba(15,23,42,.05); }
.tour-slide .s-point i { color: var(--brand); font-size: 1.3rem; }
.tour-ctrl { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 1.2rem 0 1.6rem; }
.tour-dots { display: flex; gap: .4rem; }
.tour-dots button { width: 10px; height: 10px; border-radius: 99px; border: 0; background: #cbd5e1; padding: 0; transition: width .25s, background .25s; }
.tour-dots button.on { width: 28px; background: var(--brand); }
.tour-count { font-variant-numeric: tabular-nums; color: var(--ink-3, #64748b); min-width: 3.5rem; text-align: center; }
.tour-body { display: grid; grid-template-columns: 250px 1fr; gap: 2rem; align-items: start; }
.tour-toc { position: sticky; top: 6rem; }
.tour-toc a { display: flex; gap: .55rem; align-items: center; padding: .5rem .75rem; border-radius: 10px; color: var(--ink-2); font-weight: 600; text-decoration: none; font-size: .95rem; }
.tour-toc a:hover, .tour-toc a.on { background: var(--brand-50); color: var(--brand); }
.tour-sec { scroll-margin-top: 6rem; padding-bottom: 2.5rem; }
.tour-sec h2 { font-weight: 800; }
.tour-feat { border: 1px solid var(--line); border-radius: 18px; padding: 1.2rem; background: #fff; height: 100%; }
.tour-feat ul { padding-inline-start: 1.1rem; margin: .5rem 0 0; color: var(--ink-2); }
.tour-role { border: 1px solid var(--line); border-radius: 16px; padding: 1rem; background: #fff; display: flex; flex-direction: column; gap: .5rem; height: 100%; }
.tour-role .r-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); font-size: 1.25rem; }
@media (max-width: 991px) { .tour-body { grid-template-columns: 1fr; } .tour-toc { position: static; display: flex; flex-wrap: wrap; gap: .3rem; } .tour-slide { position: relative; display: none; } .tour-slide.on { display: flex; } }
@media print { .tour-slides, .tour-toc, .mkt-bar { display: none !important; } }
.tour-shot { margin: 0; border-radius: 14px; overflow: hidden; background: #fff; border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(15,23,42,.18); }
.tour-shot img { display: block; width: 100%; height: auto; }
.tour-shot-bar { display: flex; gap: 6px; padding: 8px 12px; background: #f1f5f9; border-bottom: 1px solid var(--line); direction: ltr; }
.tour-shot-bar span { width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; }
.tour-shot-bar span:first-child { background: #f87171; } .tour-shot-bar span:nth-child(2) { background: #fbbf24; } .tour-shot-bar span:nth-child(3) { background: #34d399; }
.offer-card { border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.1rem; background: #fff; }
.offer-card:hover { border-color: #c7d2fe; box-shadow: 0 6px 20px rgba(79,70,229,.07); }
.offer-card .form-control, .offer-card .form-select { min-height: 42px; }
/* Dates, times and numbers read left-to-right even on Arabic pages (otherwise the digits and the calendar icon get jumbled). */
[dir=rtl] input[type=date], [dir=rtl] input[type=time], [dir=rtl] input[type=datetime-local], [dir=rtl] input[type=month], [dir=rtl] input[type=number] { direction: ltr; text-align: right; }
.q-card { border: 1px solid var(--line); border-radius: 16px; padding: 1rem; background: #fafbff; }
/* Tour slides: each slide's parts come in one after the other */
@keyframes tourUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes tourPop { from { opacity: 0; transform: scale(.6) rotate(-8deg); } to { opacity: 1; transform: none; } }
@keyframes tourZoom { from { opacity: 0; transform: scale(.94) translateY(12px); } to { opacity: 1; transform: none; } }
.tour-slide.on .s-icon { animation: tourPop .6s cubic-bezier(.2,.9,.3,1.3) both; }
.tour-slide.on h2 { animation: tourUp .6s .12s both; }
.tour-slide.on .lead, .tour-slide.on .text-uppercase { animation: tourUp .6s .24s both; }
.tour-slide.on .tour-shot, .tour-slide.on .hero-photo { animation: tourZoom .8s .2s both; }
.tour-slide.on .s-point { animation: tourUp .5s both; }
.tour-slide.on .s-point:nth-child(1) { animation-delay: .45s; } .tour-slide.on .s-point:nth-child(2) { animation-delay: .6s; }
.tour-slide.on .s-point:nth-child(3) { animation-delay: .75s; } .tour-slide.on .s-point:nth-child(4) { animation-delay: .9s; }
.tour-progress { position: absolute; inset-inline: 0; bottom: 0; height: 4px; background: rgba(79,70,229,.12); }
.tour-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), #14b8a6); }
.tour-progress.run span { animation: tourBar var(--tour-ms, 7000ms) linear forwards; }
@keyframes tourBar { to { width: 100%; } }
.tour-video { border-radius: 18px; overflow: hidden; background: #0f172a; box-shadow: 0 24px 60px rgba(15,23,42,.25); }
.tour-video video { display: block; width: 100%; height: auto; }
@media (prefers-reduced-motion: reduce) { .tour-slide.on * { animation: none !important; } }
