/*!
 * QuadraEdge — Unified Master Stylesheet (qe.css)
 *
 * Single source of truth for the entire platform. Every PHP view loads
 * only this file; no page ships its own <style> block any more.
 *
 * ARCHITECTURE (layers, in cascade order):
 *   01  TOKENS            — global design system at :root (colors, type,
 *                           spacing, radii, shadows, motion, brand aliases)
 *   02  DESIGN SYSTEM v3  — reset, base, components, layouts
 *   03  A11Y / UX OVERLAY — focus rings, status pills, quiz review
 *   04  NAV + FRONT PAGE  — mobile-first navigation + home sections
 *   05  ADMIN CONSOLE     — /admin/* layout, tables, forms, KPIs
 *   06  AUTH              — login / register / team-pass split screens
 *   07  COURSE PLAYER     — learn.php lesson layout & resources
 *   08  CERTIFICATE       — certificate.php printable sheet
 *   09  TRAINING CATALOGUE— training_catalogue.php sections
 *   09b TRAINING CATEGORIES— category filters, section headers, accents
 *   10  FREE COURSES      — free-courses.php sections
 *   11  AI COURSE FACTORY — ai_course_factory/admin/* (scoped .acf-page)
 *   13  MEDIA & BLOCKS    — shared embeds, galleries, knowledge checks,
 *                           media.php's "Open separately" viewer
 *   14  AUTHORING         — media library grid + microlearning builder
 *   15  MICROLEARNING     — mobile-first single-step player
 *   16  AUTHORING FORMS   — field sizing for admin/instructor forms,
 *                           admin/help.php
 *   17  IMPORTED LESSONS  — qel-* lessons converted for import
 *                           (scripts/convert_qel_lessons.py)
 *   18  ABOUT PAGE        — about.php hero, facts, ACS LLC, practice
 *
 * Layers 05–11 were migrated from per-page inline <style> blocks and
 * re-expressed with the layer-01 tokens so admin & satellite modules
 * share one visual identity with the main site.
 *
 * NOTE ON INTENTIONAL OVERRIDES: a few selectors (e.g. .qe-nav) appear
 * twice — the later "production fix" blocks are authoritative and are
 * documented inline where they occur. Do not merge them blindly.
 * ========================================================================= */

/*
 * QuadraEdge — Design System v3.0
 * Drop-in replacement for qe.css
 * Mobile-first. Fully responsive. No JS dependencies for layout.
 */

/* ═══════════════════════════════════════════════════════
   TOKENS
═══════════════════════════════════════════════════════ */
:root {
  /* Brand palette */
  --cobalt:       #2563eb;
  --cobalt-lt:    #3b82f6;
  --cobalt-pale:  #eff4ff;
  --cobalt-deep:  #1d4ed8;
  --teal:         #0ea5e9;
  --teal-pale:    #f0f9ff;
  --orange:       #f97316;
  --orange-lt:    #fb923c;
  --orange-pale:  #fff7ed;
  --success:      #16a34a;
  --success-lt:   #22c55e;
  --success-pale: #f0fdf4;
  --warn:         #d97706;
  --warn-pale:    #fffbeb;
  --danger:       #dc2626;
  --danger-pale:  #fef2f2;

  /* Surface scale */
  --slate-950:    #0a0f1e;
  --slate-900:    #111827;
  --slate-800:    #1e2a3a;
  --slate-700:    #2d3a4f;
  --off-white:    #f6f8fb;
  --blue-tint:    #eef2ff;
  --surface:      #ffffff;

  /* Text */
  --ink:          #0f172a;
  --ink-2:        #1e293b;
  --ink-3:        #334155;
  --muted:        #64748b;
  --muted-lt:     #94a3b8;
  --line:         #e2e8f0;
  --line-lt:      #f1f5f9;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Shape */
  --r:      12px;
  --r-sm:   8px;
  --r-xs:   6px;
  --r-lg:   18px;
  --r-xl:   24px;
  --r-pill: 999px;

  /* Shadows */
  --sh-xs: 0 1px 3px rgba(10,15,30,.06), 0 1px 2px rgba(10,15,30,.04);
  --sh-sm: 0 2px 8px rgba(10,15,30,.08), 0 1px 3px rgba(10,15,30,.05);
  --sh:    0 8px 24px rgba(10,15,30,.10), 0 2px 6px rgba(10,15,30,.06);
  --sh-lg: 0 20px 48px rgba(10,15,30,.14), 0 6px 16px rgba(10,15,30,.08);
  --sh-xl: 0 32px 72px rgba(10,15,30,.18);
  --sh-cobalt: 0 4px 16px rgba(37,99,235,.28);
  --sh-orange: 0 4px 14px rgba(249,115,22,.28);

  /* Motion */
  --t:      200ms cubic-bezier(.25,.8,.25,1);
  --t-fast: 120ms cubic-bezier(.25,.8,.25,1);
  --t-slow: 350ms cubic-bezier(.25,.8,.25,1);

  /* Typography */
  --font-d: 'DM Sans', system-ui, sans-serif;
  --font-b: 'Inter', system-ui, -apple-system, sans-serif;
  --font-ar:'Tajawal', system-ui, sans-serif;

  /* Layout */
  --nav-h:  84px;
  --sidebar-w: 240px;
  --max-w:  1200px;
  --max-w-sm: 840px;
  --max-w-xs: 520px;

  /* ── Brand aliases & extended accents ─────────────────────────────
     Canonical names used by the migrated page layers below. Several
     pages historically referenced --font-display and their own local
     palettes (catalogue coral/teal/navy, free-course palette, logo
     palette); they now all resolve to the core tokens above so every
     surface of the platform draws from one palette. */
  --font-display:       var(--font-d);

  --orange-deep:        #ea580c;   /* pressed / hover state of --orange   */
  --orange-ink:         #9a3412;   /* readable text on --orange-pale      */
  --brand-green:        #10b981;   /* logo green                          */
  --brand-green-dark:   #059669;
  --violet:             #7c3aed;   /* category accent (Governance)         */
  --violet-lt:          #8b5cf6;
  --violet-pale:        #f5f3ff;
  --hero-accent:        #bfd7fe;   /* eyebrow / accent text on dark heroes */

  /* Logo palette (index / catalogue / free-courses brand visuals) */
  --qe-logo-blue:       var(--cobalt-lt);
  --qe-logo-green:      var(--brand-green);
  --qe-logo-green-dark: var(--brand-green-dark);
  --qe-logo-slate:      var(--muted);

  /* Legacy per-page palette names, remapped onto the core system.
     Kept as aliases so the migrated markup needs no class changes. */
  --qe-white:           #ffffff;
  --qe-teal:            var(--teal);
  --qe-coral-light:     var(--orange-lt);
  --qe-coral:           var(--orange);
  --qe-navy:            var(--slate-900);

  --catalogue-white:            #ffffff;
  --catalogue-teal:             var(--teal);
  --catalogue-coral-light:      var(--orange-lt);
  --catalogue-coral:            var(--orange);
  --catalogue-navy:             var(--slate-900);
  --catalogue-background:       var(--off-white);
  --catalogue-border:           rgba(15, 23, 42, 0.13);
  --catalogue-muted:            var(--muted);
  --catalogue-shadow:           0 14px 36px rgba(15, 23, 42, 0.09);
  --catalogue-green-soft:       rgba(16, 185, 129, 0.12);
  --catalogue-blue-soft:        rgba(59, 130, 246, 0.10);
  --catalogue-coral-soft:       rgba(249, 115, 22, 0.11);
  --catalogue-coral-light-soft: rgba(251, 146, 60, 0.24);
  --catalogue-navy-soft:        rgba(15, 23, 42, 0.09);

  --free-background:            var(--off-white);
  --free-text:                  var(--slate-900);
  --free-muted:                 var(--muted);
  --free-border:                rgba(15, 23, 42, 0.13);
  --free-green-soft:            rgba(16, 185, 129, 0.12);
  --free-blue-soft:             rgba(59, 130, 246, 0.10);
  --free-shadow:                0 14px 36px rgba(15, 23, 42, 0.09);
}

/* ═══════════════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  font-family: var(--font-b);
  background: var(--off-white);
  color: var(--ink-3);
  /* .qe-nav is position: sticky (see the "Mobile header/menu production
     fix" block below), i.e. it occupies its own space in normal flow.
     Previously this padding-top assumed a position:fixed nav removed from
     flow, which double-reserved space and rendered as a blank white stripe
     above the header, most visible on mobile where the gap was largest. */
  padding-top: 0;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body.lang-ar { font-family: var(--font-ar); direction: rtl; }
body.no-pad { padding-top: 0; }
a { color: inherit; text-decoration: none; }
img, video, iframe { display: block; max-width: 100%; height: auto; }
ul { list-style: none; }
input, textarea, select, button { font-family: inherit; }
h1,h2,h3,h4,h5 {
  font-family: var(--font-d);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  letter-spacing: -.015em;
}

/* ═══════════════════════════════════════════════════════
   TYPOGRAPHY UTILITIES
═══════════════════════════════════════════════════════ */
.eyebrow {
  display: inline-block;
  font-family: var(--font-d);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cobalt);
  margin-bottom: .75rem;
}
.on-dark .eyebrow { color: var(--teal); }
.on-dark h1, .on-dark h2, .on-dark h3, .on-dark h4 { color: #fff; }
.on-dark p { color: rgba(255,255,255,.65); }

/* Blanket rule: headings on every dark hero/section always render white */
.hero h1,
.learn-hero h1, .learn-hero h2, .learn-hero h3,
.dash-hero h1, .dash-hero h2,
.section-dark h1, .section-dark h2, .section-dark h3, .section-dark h4,
.auth-left h1, .auth-left h2, .auth-left h3,
.tp-left h1, .tp-left h2, .tp-left h3 {
  color: #fff;
}
.lead { font-size: .97rem; line-height: 1.78; color: var(--muted); }
.text-sm { font-size: .83rem; }
.text-xs { font-size: .75rem; }
.text-muted { color: var(--muted); }
.text-ink { color: var(--ink); }
.font-d { font-family: var(--font-d); }
.font-bold { font-weight: 700; }
.font-800 { font-weight: 800; }

/* ═══════════════════════════════════════════════════════
   NAV — polished & mobile-perfect
═══════════════════════════════════════════════════════ */
.qe-nav {
  /* NOTE: position is set to sticky (not fixed) further down in the
     "Mobile header/menu production fix" block, which applies at all
     widths. Declared here as sticky too so the source doesn't contradict
     itself — see that block for the authoritative nav positioning rules. */
  position: sticky;
  top: 0; left: 0; right: 0;
  z-index: 300;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(10,15,30,.96);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,.07);
  transition: box-shadow var(--t);
}
.qe-nav.scrolled {
  box-shadow: 0 2px 24px rgba(0,0,0,.3);
}
.qe-nav .inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-right: auto;
  text-decoration: none;
}
[dir=rtl] .nav-logo { margin-right: 0; margin-left: auto; }
.nav-logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--cobalt), var(--cobalt-deep));
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(37,99,235,.4);
}
.nav-logo-icon svg { width: 18px; height: 18px; }
.nav-brand {
  font-family: var(--font-d);
  font-weight: 800;
  font-size: .95rem;
  color: #fff;
  line-height: 1.1;
}
.nav-brand small {
  display: block;
  font-size: .58rem;
  font-weight: 500;
  color: rgba(255,255,255,.36);
  letter-spacing: .04em;
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-links a, .nav-links button {
  font-family: var(--font-d);
  font-size: .82rem;
  font-weight: 600;
  color: rgba(255,255,255,.68);
  padding: 7px 12px;
  border-radius: 7px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: color var(--t), background var(--t);
  white-space: nowrap;
  text-decoration: none;
}
.nav-links a:hover, .nav-links button:hover {
  color: #fff;
  background: rgba(255,255,255,.09);
}
.nav-links a.active {
  color: #fff;
  background: rgba(255,255,255,.11);
}
.nav-sep {
  width: 1px; height: 18px;
  background: rgba(255,255,255,.1);
  margin: 0 4px;
  flex-shrink: 0;
}

/* Pill buttons in nav */
.nav-pill {
  font-family: var(--font-d) !important;
  font-size: .8rem !important;
  font-weight: 700 !important;
  padding: 7px 15px !important;
  border-radius: var(--r-sm) !important;
}
.nav-pill-orange {
  background: var(--orange) !important;
  color: #fff !important;
  box-shadow: var(--sh-orange);
}
.nav-pill-orange:hover { background: var(--orange-lt) !important; }
.nav-pill-ghost {
  background: rgba(255,255,255,.08) !important;
  color: rgba(255,255,255,.85) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
}
.nav-pill-ghost:hover {
  background: rgba(255,255,255,.14) !important;
  border-color: rgba(255,255,255,.24) !important;
}
.nav-lang-form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}
.nav-lang {
  font-family: var(--font-d);
  font-size: .72rem !important;
  padding: 5px 22px 5px 9px !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  border-radius: 6px !important;
  color: rgba(255,255,255,.85) !important;
  background: rgba(255,255,255,.06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23ffffff' stroke-opacity='.6' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center !important;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  color-scheme: dark;
}
.nav-lang:hover {
  border-color: rgba(255,255,255,.4) !important;
  color: #fff !important;
}
/* The dropdown's option list is a native OS popup that ignores most of the
   select's own styling (background/appearance above only paints the closed
   control). color-scheme:dark asks browsers to render that popup dark, but
   support is inconsistent — without an explicit background+color pair on
   the options themselves, some browsers fall back to a light popup while
   still inheriting the select's light text colour, making every option
   unreadable except the one currently highlighted. */
.nav-lang option {
  background-color: #0a0f1e;
  color: #fff;
}
[dir="rtl"] .nav-lang {
  padding: 5px 9px 5px 22px !important;
  background-position: left 8px center !important;
}

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  padding: 7px 9px;
  cursor: pointer;
  color: #fff;
  flex-shrink: 0;
  transition: background var(--t), border-color var(--t);
}
.nav-toggle:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.35);
}


/* ═══════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--font-d);
  font-weight: 700;
  font-size: .88rem;
  padding: 11px 22px;
  border-radius: var(--r-sm);
  border: none;
  cursor: pointer;
  transition: background var(--t), transform var(--t-fast), box-shadow var(--t), border-color var(--t);
  text-decoration: none;
  white-space: nowrap;
  min-height: 44px; /* touch target */
  letter-spacing: -.01em;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--cobalt);
  color: #fff;
  box-shadow: var(--sh-cobalt);
}
.btn-primary:hover {
  background: var(--cobalt-deep);
  box-shadow: 0 6px 20px rgba(37,99,235,.38);
}

.btn-orange {
  background: var(--orange);
  color: #fff;
  box-shadow: var(--sh-orange);
}
.btn-orange:hover {
  background: #ea6c10;
  box-shadow: 0 6px 18px rgba(249,115,22,.38);
}

.btn-white  { background: #fff; color: var(--cobalt); }
.btn-white:hover { box-shadow: var(--sh); }

.btn-outline {
  background: transparent;
  color: var(--cobalt);
  border: 1.5px solid var(--cobalt);
}
.btn-outline:hover { background: var(--cobalt-pale); }

.btn-ghost-dark {
  background: rgba(255,255,255,.09);
  color: rgba(255,255,255,.9);
  border: 1px solid rgba(255,255,255,.16);
}
.btn-ghost-dark:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.28); }

.btn-outline-white {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.38);
}
.btn-outline-white:hover {
  border-color: rgba(255,255,255,.7);
  background: rgba(255,255,255,.07);
}

.btn-danger  { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-muted   { background: var(--off-white); color: var(--muted); border: 1px solid var(--line); }
.btn-muted:hover { border-color: var(--cobalt); color: var(--cobalt); }

.btn-sm  { padding: 8px 16px; font-size: .8rem; min-height: 36px; }
.btn-lg  { padding: 14px 30px; font-size: 1rem; min-height: 52px; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { padding: 9px; aspect-ratio: 1; }

/* ═══════════════════════════════════════════════════════
   FORMS
═══════════════════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label {
  font-family: var(--font-d);
  font-size: .8rem;
  font-weight: 700;
  color: var(--ink);
}
.form-hint  { font-size: .74rem; color: var(--muted); }
.form-control {
  width: 100%;
  font-family: var(--font-b);
  font-size: .92rem;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  padding: 11px 14px;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
  min-height: 44px; /* touch target */
}
.form-control:focus {
  border-color: var(--cobalt);
  box-shadow: 0 0 0 3px rgba(37,99,235,.13);
  background: var(--surface);
}
.form-control:hover:not(:focus) { border-color: var(--muted-lt); }
.form-control.is-error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220,38,38,.1); }
textarea.form-control { resize: vertical; min-height: 110px; }
select.form-control { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 40px; }
.form-error { font-size: .76rem; color: var(--danger); margin-top: 3px; display: flex; align-items: center; gap: 4px; }
.form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }

.form-pass-wrap { position: relative; }
.form-pass-wrap input { padding-right: 44px; }
.form-pass-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--muted); padding: 4px;
  transition: color var(--t);
}
.form-pass-toggle:hover { color: var(--cobalt); }

/* ═══════════════════════════════════════════════════════
   ALERTS
═══════════════════════════════════════════════════════ */
.alert {
  padding: 13px 16px;
  border-radius: 10px;
  font-size: .89rem;
  line-height: 1.55;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert-success { background: var(--success-pale); color: #166534; border-color: #bbf7d0; }
.alert-error   { background: var(--danger-pale);  color: #991b1b; border-color: #fecaca; }
.alert-warn    { background: var(--warn-pale);    color: #92400e; border-color: #fde68a; }
.alert-info    { background: var(--cobalt-pale);  color: #1e40af; border-color: #bfdbfe; }

/* ═══════════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
}
.card-body { padding: var(--space-6); }
.card-hover { transition: box-shadow var(--t), transform var(--t); }
.card-hover:hover { box-shadow: var(--sh); transform: translateY(-2px); }

/* ═══════════════════════════════════════════════════════
   BADGES
═══════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-d);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--r-pill);
}
.badge-blue   { background: var(--cobalt-pale); color: var(--cobalt); }
.badge-green  { background: var(--success-pale); color: #166534; }
.badge-orange { background: var(--orange-pale);  color: #c2410c; }
.badge-gray   { background: var(--off-white);    color: var(--muted); border: 1px solid var(--line); }
.badge-teal   { background: var(--teal-pale);    color: #0369a1; }

/* ═══════════════════════════════════════════════════════
   PROGRESS
═══════════════════════════════════════════════════════ */
.progress {
  height: 7px;
  background: var(--line);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--r-pill);
  transition: width .7s cubic-bezier(.4,0,.2,1);
}
.progress-fill-cobalt,
.pf-cobalt { background: linear-gradient(90deg, var(--cobalt), var(--cobalt-lt)); }
.pf-green  { background: linear-gradient(90deg, var(--success), var(--success-lt)); }
.pf-orange { background: linear-gradient(90deg, #ea580c, var(--orange)); }
/* Tall variant for section headers */
.progress-lg { height: 10px; }

/* ═══════════════════════════════════════════════════════
   TABLES
═══════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r); border: 1px solid var(--line); }
.qe-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.qe-table th {
  font-family: var(--font-d);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  background: var(--line-lt);
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.qe-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-size: .89rem;
  color: var(--ink-2);
  vertical-align: middle;
}
.qe-table tr:last-child td { border-bottom: none; }
.qe-table tr:hover td { background: var(--line-lt); }
[dir=rtl] .qe-table th, [dir=rtl] .qe-table td { text-align: right; }

/* ═══════════════════════════════════════════════════════
   LAYOUT PRIMITIVES
═══════════════════════════════════════════════════════ */
.section    { padding: 80px 0; }
.section-sm { padding: 52px 0; }
.section-alt  { background: var(--surface); }
.section-dark { background: var(--slate-900); }
.container    { max-width: var(--max-w);    margin: 0 auto; padding: 0 var(--space-6); }
.container-sm { max-width: var(--max-w-sm); margin: 0 auto; padding: 0 var(--space-6); }
.container-xs { max-width: var(--max-w-xs); margin: 0 auto; padding: 0 var(--space-6); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 52px; }
.section-head h2 {
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -.025em;
  margin-bottom: .85rem;
}
.section-head p { font-size: .96rem; line-height: 1.78; color: var(--muted); }

/* Grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

/* ═══════════════════════════════════════════════════════
   COURSE CARDS — upgraded
═══════════════════════════════════════════════════════ */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 18px;
}
.course-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--t), transform var(--t), border-color var(--t);
}
.course-card:hover {
  box-shadow: var(--sh-lg);
  transform: translateY(-3px);
  border-color: rgba(37,99,235,.2);
}
.course-card.hidden { display: none; }

/* Color accent strip */
.cc-band { height: 5px; flex-shrink: 0; }
.cc-band-blue   { background: linear-gradient(90deg, var(--cobalt), var(--teal)); }
.cc-band-orange { background: linear-gradient(90deg, var(--orange), #fbbf24); }
.cc-band-green  { background: linear-gradient(90deg, var(--success), var(--teal)); }
.cc-band-purple { background: linear-gradient(90deg, #7c3aed, var(--cobalt)); }

.cc-body { padding: 18px 18px 16px; flex: 1; display: flex; flex-direction: column; }
.cc-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 6px; flex-wrap: wrap; }
.cc-cat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-d);
  font-size: .63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 3px 9px;
  border-radius: var(--r-pill);
}
.cc-level {
  font-family: var(--font-d);
  font-size: .65rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--off-white);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: 2px 7px;
}
.cc-title {
  font-family: var(--font-d);
  font-size: .96rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 7px;
  letter-spacing: -.01em;
}
.cc-desc {
  font-size: .82rem;
  line-height: 1.66;
  color: var(--muted);
  flex: 1;
  margin-bottom: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cc-stats {
  display: flex;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  margin-top: auto;
}
.cc-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-d);
  font-size: .7rem;
  font-weight: 600;
  color: var(--muted);
}
.cc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  gap: 8px;
}
.cc-free {
  font-family: var(--font-d);
  font-size: .7rem;
  font-weight: 700;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ═══════════════════════════════════════════════════════
   STAT / METRIC CARDS
═══════════════════════════════════════════════════════ */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin: 18px 0 28px; }
.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 20px;
  box-shadow: var(--sh-xs);
  transition: box-shadow var(--t), transform var(--t);
}
.metric:hover { box-shadow: var(--sh-sm); transform: translateY(-1px); }
.metric-num {
  font-family: var(--font-d);
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 5px;
  letter-spacing: -.03em;
}
.metric-lbl { font-size: .78rem; color: var(--muted); font-family: var(--font-d); font-weight: 500; }

.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; box-shadow: var(--sh-xs); }
.stat-card-num { font-family: var(--font-d); font-size: 2rem; font-weight: 800; color: var(--ink); line-height: 1; margin-bottom: 4px; }
.stat-card-label { font-size: .8rem; color: var(--muted); }
.stat-card-icon { font-size: 1.5rem; margin-bottom: 10px; }

/* ═══════════════════════════════════════════════════════
   ADMIN SHELL
═══════════════════════════════════════════════════════ */
.admin-layout { display: flex; min-height: calc(100vh - var(--nav-h)); }
.admin-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--slate-900);
  padding: 20px 0;
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,.05);
}
.admin-main { flex: 1; min-width: 0; padding: 32px 40px 80px; }
.adm-lbl {
  font-family: var(--font-d);
  font-size: .59rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.22);
  padding: 4px 18px;
  display: block;
  margin-top: 18px;
  margin-bottom: 3px;
}
.adm-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  font-family: var(--font-d);
  font-size: .83rem;
  font-weight: 600;
  color: rgba(255,255,255,.58);
  transition: background var(--t), color var(--t);
  text-decoration: none;
  border-left: 2px solid transparent;
  margin: 1px 0;
}
.adm-link:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.9); }
.adm-link.active { background: rgba(37,99,235,.22); color: var(--cobalt-lt); border-left-color: var(--cobalt); }
.adm-icon { font-size: .92rem; width: 18px; text-align: center; flex-shrink: 0; }
.page-title { font-family: var(--font-d); font-size: 1.6rem; font-weight: 800; color: var(--ink); margin-bottom: 4px; letter-spacing: -.02em; }
.page-sub   { font-size: .86rem; color: var(--muted); margin-bottom: 28px; }
.admin-section { margin-bottom: 36px; }

/* Admin mobile drawer */
.admin-menu-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--slate-900);
  color: rgba(255,255,255,.8);
  border: none;
  padding: 12px 16px;
  font-family: var(--font-d);
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: left;
  margin-bottom: 16px;
  border-radius: var(--r-sm);
}

/* ═══════════════════════════════════════════════════════
   AUTH PAGES
═══════════════════════════════════════════════════════ */
.auth-split { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-page  { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }

.auth-left {
  background: var(--slate-900);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 56px;
  position: relative;
  overflow: hidden;
}
.auth-left::before {
  content: '';
  position: absolute;
  top: -20%; left: -10%;
  width: 60%; height: 80%;
  background: radial-gradient(ellipse, rgba(37,99,235,.22) 0%, transparent 65%);
  pointer-events: none;
}
.auth-left::after {
  content: '';
  position: absolute;
  bottom: -10%; right: -5%;
  width: 40%; height: 55%;
  background: radial-gradient(ellipse, rgba(14,165,233,.14) 0%, transparent 60%);
  pointer-events: none;
}
.auth-left-inner { position: relative; z-index: 1; }
.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 36px; }
.auth-logo-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--cobalt), var(--cobalt-deep));
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(37,99,235,.4);
}
.auth-logo-icon svg { width: 22px; height: 22px; }
.auth-logo-text { font-family: var(--font-d); font-weight: 800; font-size: 1.1rem; color: #fff; }
.auth-headline {
  font-family: var(--font-d);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 1rem;
  letter-spacing: -.025em;
}
.auth-headline em {
  font-style: normal;
  background: linear-gradient(90deg, var(--cobalt-lt), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-bullets { margin-top: 28px; display: flex; flex-direction: column; gap: 10px; }
.auth-bullet { display: flex; align-items: center; gap: 10px; font-size: .88rem; color: rgba(255,255,255,.7); }
.auth-bullet-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(37,99,235,.2);
  border: 1px solid rgba(37,99,235,.4);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: .7rem;
  color: var(--cobalt-lt);
  font-weight: 700;
}
.auth-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 56px;
  background: var(--off-white);
  overflow-y: auto;
}
.auth-right-inner { max-width: 420px; width: 100%; }
.auth-title { font-family: var(--font-d); font-size: 1.7rem; font-weight: 800; color: var(--ink); margin-bottom: .4rem; letter-spacing: -.025em; }
.auth-sub   { font-size: .87rem; color: var(--muted); margin-bottom: 24px; }
.auth-sub a { color: var(--cobalt); font-weight: 600; }
.auth-card  { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; box-shadow: var(--sh); }
.auth-divider {
  text-align: center;
  font-size: .77rem;
  color: var(--muted);
  margin: 16px 0;
  position: relative;
}
.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: var(--line);
}
.auth-divider span { background: var(--surface); padding: 0 12px; position: relative; }
.auth-switch { text-align: center; margin-top: 18px; font-size: .84rem; color: var(--muted); }
.auth-switch a { color: var(--cobalt); font-weight: 600; }
.auth-team-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--off-white);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 13px 16px;
  font-family: var(--font-d);
  font-size: .87rem;
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
  width: 100%;
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
  text-decoration: none;
  min-height: 60px;
}
.auth-team-btn:hover {
  border-color: var(--cobalt);
  background: var(--cobalt-pale);
  color: var(--cobalt);
  box-shadow: var(--sh-sm);
}
.auth-team-icon { font-size: 1.3rem; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════
   DASHBOARD
═══════════════════════════════════════════════════════ */
.dash-hero {
  background: linear-gradient(135deg, var(--slate-900) 0%, var(--slate-800) 100%);
  color: #fff;
  padding: 44px 0 40px;
  position: relative;
  overflow: hidden;
}
.dash-hero::before {
  content: '';
  position: absolute;
  top: -30%; right: -5%;
  width: 50%; height: 160%;
  background: radial-gradient(ellipse, rgba(37,99,235,.15) 0%, transparent 70%);
  pointer-events: none;
}
.dash-hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -.025em; margin-bottom: .4rem; color: #fff; }
.dash-hero p  { color: rgba(255,255,255,.65); font-size: .95rem; }
.dash-body    { padding: 32px 0 80px; }

/* ═══════════════════════════════════════════════════════
   COURSE CARD (dashboard view with progress)
═══════════════════════════════════════════════════════ */
.course-card-body { padding: 20px 20px 16px; flex: 1; display: flex; flex-direction: column; }
.course-card-body h3 { font-family: var(--font-d); font-size: .96rem; font-weight: 800; margin: 8px 0 6px; color: var(--ink); letter-spacing: -.01em; }
.course-card-body p  { font-size: .82rem; color: var(--muted); line-height: 1.6; margin-bottom: 12px; flex: 1; }
.course-card-body .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

/* ═══════════════════════════════════════════════════════
   LEARN PAGE
═══════════════════════════════════════════════════════ */
.learn-hero { background: var(--slate-900); color: #fff; padding: 48px 0; }
.learn-hero h1 { font-family: var(--font-d); font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 800; max-width: 850px; letter-spacing: -.025em; color: #fff; }
.learn-hero p   { color: rgba(255,255,255,.7); max-width: 780px; font-size: .96rem; margin-top: .6rem; }
.learn-body     { padding: 32px 0 80px; }
.learn-layout   { display: grid; grid-template-columns: 270px 1fr; gap: 24px; }

/* Sidebar lesson list */
.lesson-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px;
  height: max-content;
  position: sticky;
  top: calc(var(--nav-h) + 16px);
  max-height: calc(100vh - var(--nav-h) - 32px);
  overflow-y: auto;
}
.lesson-list-head {
  font-family: var(--font-d);
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  padding: 6px 8px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.lesson-link {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 10px;
  border-radius: 9px;
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 600;
  font-size: .84rem;
  transition: background var(--t), color var(--t);
  line-height: 1.4;
}
.lesson-link:hover { background: var(--off-white); }
.lesson-link.done  { color: var(--muted); }

/* Lesson cards */
.lesson-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px;
  margin-bottom: 18px;
  transition: box-shadow var(--t);
}
.lesson-card:hover { box-shadow: var(--sh-sm); }
.lesson-card h2 { font-family: var(--font-d); font-size: 1.2rem; font-weight: 800; margin: 8px 0 14px; letter-spacing: -.015em; }
.lesson-content { color: var(--ink-2); line-height: 1.75; font-size: .94rem; }
.lesson-content p + p { margin-top: .75em; }
.resource-list { display: grid; gap: 10px; margin: 16px 0; }
.resource-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--off-white);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color var(--t);
}
.resource-item:hover { border-color: var(--cobalt); }
.complete-box {
  margin: 20px 0;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--success-pale);
  border: 1px solid #bbf7d0;
  color: #166534;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .9rem;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════
   HERO (landing page)
═══════════════════════════════════════════════════════ */
.hero {
  background: var(--slate-900);
  min-height: 82vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 56px 0 0;
}
.hero::before {
  content: '';
  position: absolute;
  top: -20%; left: -10%;
  width: 55%; height: 80%;
  background: radial-gradient(ellipse, rgba(37,99,235,.22) 0%, transparent 65%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -10%; right: -5%;
  width: 40%; height: 55%;
  background: radial-gradient(ellipse, rgba(14,165,233,.13) 0%, transparent 60%);
  pointer-events: none;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 56px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(37,99,235,.16);
  border: 1px solid rgba(37,99,235,.32);
  border-radius: var(--r-pill);
  padding: 4px 13px 4px 7px;
  margin-bottom: 22px;
}
.hero-kicker-dot {
  width: 7px; height: 7px;
  background: var(--cobalt-lt);
  border-radius: 50%;
  animation: pdot 2s ease-in-out infinite;
}
@keyframes pdot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .45; transform: scale(.75); }
}
.hero-kicker span { font-family: var(--font-d); font-size: .72rem; font-weight: 600; color: var(--cobalt-lt); }
.hero h1 {
  font-family: var(--font-d);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.06;
  letter-spacing: -.03em;
  margin-bottom: 1rem;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--cobalt-lt), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-lead { font-size: .99rem; line-height: 1.78; color: rgba(255,255,255,.66); max-width: 500px; margin-bottom: 1.75rem; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 1.5rem; }
.hero-proof { display: flex; flex-wrap: wrap; gap: 5px 14px; }
.hero-proof-item {
  font-size: .76rem;
  color: rgba(255,255,255,.48);
  font-family: var(--font-d);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ═══════════════════════════════════════════════════════
   FILTER BAR
═══════════════════════════════════════════════════════ */
.filter-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  position: sticky;
  top: var(--nav-h);
  z-index: 100;
}
.filter-inner { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-pill {
  font-family: var(--font-d);
  font-size: .78rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--t);
  min-height: 36px;
}
.filter-pill:hover { border-color: var(--cobalt); color: var(--cobalt); background: var(--cobalt-pale); }
.filter-pill.active { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }

/* Search bar */
.search-wrap { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  font-size: .85rem;
  font-family: var(--font-b);
  background: var(--off-white);
  color: var(--ink);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
  min-height: 40px;
}
.search-input:focus { border-color: var(--cobalt); box-shadow: 0 0 0 3px rgba(37,99,235,.12); background: var(--surface); }

/* ═══════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════ */
.qe-footer {
  background: var(--slate-950);
  color: rgba(255,255,255,.48);
  padding: 52px 0 24px;
}
.qe-footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 36px;
}
.qe-footer-brand { display: inline-block; font-family: var(--font-d); font-size: .95rem; font-weight: 800; color: #fff; margin-bottom: 8px; }
.qe-footer-desc  { font-size: .8rem; line-height: 1.72; max-width: 34ch; }
.qe-footer-suite { font-size: .75rem; line-height: 1.6; color: rgba(255,255,255,.24); margin-top: 10px; }
.qe-footer-col-head {
  font-family: var(--font-d);
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.25);
  margin-bottom: 14px;
  display: block;
}
.qe-footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.qe-footer-col a { font-size: .81rem; color: rgba(255,255,255,.48); transition: color var(--t); }
.qe-footer-col a:hover { color: rgba(255,255,255,.9); }
.qe-footer-ext { font-size: .72em; opacity: .6; margin-inline-start: 2px; }
.qe-footer-bottom {
  border-top: 1px solid rgba(255,255,255,.07);
  padding-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.qe-footer-bottom p { font-size: .76rem; }
.qe-footer-links    { display: flex; gap: 18px; }
.qe-footer-links a  { font-size: .76rem; color: rgba(255,255,255,.3); transition: color var(--t); }
.qe-footer-links a:hover { color: rgba(255,255,255,.8); }

/* ═══════════════════════════════════════════════════════
   TEAM PASS PAGE
═══════════════════════════════════════════════════════ */
.tp-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.tp-left { background: linear-gradient(145deg, var(--slate-900), var(--slate-800)); display: flex; flex-direction: column; justify-content: center; padding: 64px 56px; }
.tp-card { background: var(--surface); border-radius: var(--r-xl); padding: 40px; box-shadow: var(--sh-xl); }

/* ═══════════════════════════════════════════════════════
   CERTIFICATE PAGE
═══════════════════════════════════════════════════════ */
.cert-wrapper {
  background: var(--off-white);
  padding: 40px 0 80px;
}
.cert-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.cert-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 48px;
  box-shadow: var(--sh-lg);
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
  border: 1px solid var(--line);
}

/* ═══════════════════════════════════════════════════════
   MOBILE NAV DRAWER
═══════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  :root {
    --nav-h: 74px;
    --sidebar-w: 0;
  }

  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(10,15,30,.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 14px 18px 20px;
    gap: 4px;
    z-index: 299;
    border-bottom: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 12px 32px rgba(0,0,0,.4);
  }
  .nav-links.open a,
  .nav-links.open button {
    width: 100%;
    padding: 12px 16px;
    border-radius: 9px;
    font-size: .9rem;
  }
  .nav-links.open .nav-sep { display: none; }
  .nav-links.open .nav-pill { margin-top: 4px; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  .nav-brand small { display: none; } /* save space */

  /* Sections */
  .section    { padding: 52px 0; }
  .section-sm { padding: 36px 0; }
  .container, .container-sm, .container-xs { padding: 0 16px; }

  /* Grids collapse */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row, .form-grid { grid-template-columns: 1fr; }

  /* Auth */
  .auth-split, .auth-page, .tp-page {
    grid-template-columns: 1fr;
  }
  .auth-left, .tp-left { display: none; }
  .auth-right { padding: 32px 20px; min-height: 100vh; justify-content: flex-start; padding-top: 48px; }
  .auth-right-inner { max-width: 100%; }
  .tp-card { padding: 28px 20px; }

  /* Learn */
  .learn-layout { grid-template-columns: 1fr; }
  .lesson-list  { position: static; max-height: none; }
  .learn-hero   { padding: 32px 0; }
  .lesson-card  { padding: 20px 18px; }

  /* Admin */
  .admin-sidebar { display: none; }
  .admin-sidebar.open {
    display: block;
    position: fixed;
    top: var(--nav-h);
    left: 0; bottom: 0;
    z-index: 200;
    width: min(280px, 80vw);
    box-shadow: var(--sh-xl);
  }
  .admin-main  { padding: 18px 16px 60px; }
  .admin-menu-toggle { display: flex; }

  /* Hero */
  .hero { min-height: auto; padding: 48px 0 28px; }
  .hero-inner { grid-template-columns: 1fr; gap: 28px; }
  .hero-visual { display: none; }
  .hero h1 { font-size: clamp(1.7rem, 7vw, 2.4rem); }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }

  /* Dash hero */
  .dash-hero { padding: 32px 0 28px; }

  /* Footer */
  .qe-footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .qe-footer-bottom { flex-direction: column; align-items: flex-start; }

  /* Cert */
  .cert-card { padding: 28px 20px; }
  .cert-actions { flex-direction: column; }

  /* Touch targets everywhere */
  .btn { min-height: 48px; }
  .form-control { min-height: 48px; font-size: 16px; } /* prevents iOS zoom */
  .filter-pill  { min-height: 40px; }

  /* Tables */
  .table-wrap { border-radius: var(--r-sm); }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .qe-footer-grid  { grid-template-columns: 1fr 1fr; }
  .hero-inner      { grid-template-columns: 1fr 320px; gap: 36px; }
  .learn-layout    { grid-template-columns: 240px 1fr; }
  .admin-sidebar   { width: 200px; }
  .admin-main      { padding: 24px 24px 60px; }
  .auth-left       { padding: 48px 40px; }
  .auth-right      { padding: 48px 40px; }
}

/* ═══════════════════════════════════════════════════════
   MISC / UTILS
═══════════════════════════════════════════════════════ */
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.items-center { align-items: center; }
.gap-2      { gap: 8px; }
.gap-3      { gap: 12px; }
.gap-4      { gap: 16px; }
.mt-auto    { margin-top: auto; }
.sr-only    { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Scroll overlay on admin sidebar for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 199;
}
.sidebar-overlay.open { display: block; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0ms !important;
    animation: none !important;
  }
}

/* Print */
@media print {
  .qe-nav, .qe-footer, .admin-sidebar, .print-actions, .lesson-list, .filter-bar { display: none !important; }
  body { background: #fff !important; padding-top: 0 !important; }
  .admin-main { padding: 0 !important; }
  .cert-card { box-shadow: none !important; border: 2px solid #000 !important; }
}
/* =========================================================
   QuadraEdge — Mobile header/menu production fix
   ========================================================= */

.qe-nav {
  width: 100%;
  max-width: 100vw;
  background: rgba(10, 15, 30, .96);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.qe-nav .inner {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: 84px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 18px;
}

.qe-nav .nav-logo {
  flex: 0 1 auto;
  min-width: 0;
}

.qe-nav .nav-logo img {
  height: 78px !important;
  max-width: 300px !important;
  width: auto;
  object-fit: contain;
}

.qe-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.qe-nav .nav-toggle {
  display: none;
}

/* =========================================================================
 * NAVIGATION — mobile-first
 * Replaces the old .open / .is-open inline cascades with one canonical state.
 * ========================================================================= */
@media (max-width: 900px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .qe-nav .inner {
    padding: 0 14px;
    min-height: 74px;
    justify-content: space-between;
  }

  .qe-nav .nav-logo img {
    height: 56px;
    max-width: 210px;
  }

  .qe-nav .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-inline-start: auto;
    border: 1px solid rgba(255, 255, 255, .22);
    background: rgba(255, 255, 255, .10);
    color: #fff;
    border-radius: 12px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .qe-nav .nav-toggle:hover { background: rgba(255, 255, 255, .18); }

  .qe-nav .nav-links {
    display: none;
    position: fixed;
    top: 78px;
    left: 12px;
    right: 12px;
    max-width: calc(100vw - 24px);
    margin: 0;
    padding: 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: #0a0f1e;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
    z-index: 1001;
  }
  .qe-nav .nav-links.is-open { display: flex; }

  .qe-nav .nav-links a,
  .qe-nav .nav-links button {
    width: 100%;
    min-height: 46px;
    box-sizing: border-box;
    justify-content: flex-start;
    text-align: start;
    padding: 10px 14px;
  }
  .qe-nav .nav-sep {
    width: 100%;
    height: 1px;
    margin: 6px 0;
    background: rgba(255, 255, 255, .12);
  }
}

@media (max-width: 420px) {
  .qe-nav .nav-logo img { height: 48px; max-width: 180px; }
}


/* =========================================================================
 * ACCESSIBILITY & UX LAYER
 * (formerly qe-a11y.css; merged so a single CSS request serves the page)
 * ========================================================================= */

:root {
  --focus-ring:        #1d4ed8;   /* cobalt-deep — 3:1+ against white & off-white */
  --focus-ring-light:  #ffffff;   /* for dark navs / heroes */
  --status-done-bg:    #dcfce7;
  --status-done-ink:   #14532d;   /* ~10:1 on the bg above */
  --status-prog-bg:    #fef9c3;
  --status-prog-ink:   #854d0e;   /* ~8:1 */
  --status-todo-bg:    #eef2f7;
  --status-todo-ink:   #334155;   /* ~9:1 */
}

/* ═══════════════════════════════════════════════════════
   1 · KEYBOARD FOCUS  (the unplug-the-mouse test)
   :focus-visible only fires for keyboard / programmatic focus, so mouse
   users never see a ring, but keyboard & screen-reader users always do.
   These selectors are 1-class+1-pseudo (0,2,0) and therefore override the
   (0,1,0) `outline:none` declarations already in qe-v3.css with no !important.
═══════════════════════════════════════════════════════ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.nav-links a:focus-visible,
.nav-pill:focus-visible,
.nav-lang:focus-visible,
.nav-toggle:focus-visible,
.filter-pill:focus-visible,
.search-input:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--r-xs, 6px);
}

/* On dark surfaces a cobalt ring disappears — switch to a white ring. */
.qe-nav :focus-visible,
.on-dark :focus-visible,
.hero :focus-visible,
.learn-hero :focus-visible,
.dash-hero :focus-visible,
.section-dark :focus-visible,
.auth-left :focus-visible,
.qe-footer :focus-visible {
  outline-color: var(--focus-ring-light);
}

/* Inputs already carry a soft inner glow on :focus; keep it and add the
   sharp outer ring only for keyboard focus so the field stays obvious. */
.form-control:focus-visible {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}

/* ═══════════════════════════════════════════════════════
   2 · SKIP LINK
═══════════════════════════════════════════════════════ */
.qe-skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  transform: translateY(-160%);
  background: var(--cobalt);
  color: #fff;
  font-family: var(--font-d);
  font-weight: 700;
  font-size: .9rem;
  padding: 12px 20px;
  border-radius: var(--r-sm);
  box-shadow: var(--sh-lg);
  transition: transform 160ms cubic-bezier(.25, .8, .25, 1);
  text-decoration: none;
}
.qe-skip-link:focus {
  transform: translateY(0);
  outline: 3px solid #fff;
  outline-offset: 2px;
}
[dir="rtl"] .qe-skip-link { left: auto; right: 8px; }

/* A focus target landed on by the skip link should not draw its own box. */
:target,
[tabindex="-1"]:focus { outline: none; }

/* ═══════════════════════════════════════════════════════
   3 · STATUS PILLS — colour + icon + TEXT (colour-blind safe)
   Use anywhere a "where am I" signal is needed: dashboards, course maps,
   lesson lists. The label text is mandatory; colour is reinforcement only.
═══════════════════════════════════════════════════════ */
.qe-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-d);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .01em;
  padding: 3px 10px 3px 8px;
  border-radius: var(--r-pill);
  line-height: 1.4;
  white-space: nowrap;
}
.qe-status::before {
  font-size: .8em;
  font-weight: 900;
  line-height: 1;
}
.qe-status--done   { background: var(--status-done-bg); color: var(--status-done-ink); }
.qe-status--done::before   { content: "\2713"; }              /* ✓ */
.qe-status--prog   { background: var(--status-prog-bg); color: var(--status-prog-ink); }
.qe-status--prog::before   { content: "\25D0"; }              /* ◐ half-filled */
.qe-status--todo   { background: var(--status-todo-bg); color: var(--status-todo-ink); }
.qe-status--todo::before   { content: "\25CB"; }              /* ○ */
.qe-status--locked { background: var(--status-todo-bg); color: var(--status-todo-ink); }
.qe-status--locked::before { content: "\1F512"; }            /* 🔒 */

/* High-contrast border so the pill survives forced-colours / greyscale. */
@media (forced-colors: active) {
  .qe-status { border: 1px solid currentColor; }
}

/* ═══════════════════════════════════════════════════════
   4 · PROGRESS BAR — works with role="progressbar"
   Keeps the qe-v3 look but makes the fill readable and adds a colour-blind
   safe striped texture option for the "in progress" state.
═══════════════════════════════════════════════════════ */
.progress[role="progressbar"] { position: relative; }
.progress-fill-prog {
  background: var(--warn, #d97706);
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, .25) 0,
    rgba(255, 255, 255, .25) 6px,
    transparent 6px,
    transparent 12px
  );
}
.progress-fill-done { background: var(--success, #16a34a); }

/* ═══════════════════════════════════════════════════════
   5 · ACCESSIBLE QUIZ OPTION CARDS
   The whole row is the click/tap target (≥44px). Selected state is shown by
   a filled control + border + tint + a check glyph — four redundant signals,
   not colour alone. Native radio/checkbox stays in the DOM for AT + keyboard.
═══════════════════════════════════════════════════════ */
.qe-question {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
  margin: 0 0 16px;
  box-shadow: var(--sh-xs);
}
.qe-question > legend,
.qe-question .qe-q-text {
  font-family: var(--font-d);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--ink);
  line-height: 1.45;
  margin-bottom: 14px;
  padding: 0;
}
.qe-q-num {
  display: inline-block;
  min-width: 1.6em;
  color: var(--cobalt);
  font-weight: 800;
}
.qe-options { display: grid; gap: 10px; }
.qe-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 44px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--t), background var(--t);
}
.qe-option:hover { border-color: var(--cobalt-lt); background: var(--cobalt-pale); }
.qe-option input { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--cobalt); flex-shrink: 0; }
.qe-option-text { color: var(--ink-2); line-height: 1.5; }
/* Selected card: the :has() selector lights the whole card on modern browsers;
   the input's own accent-color covers everywhere else. */
.qe-option:has(input:checked) {
  border-color: var(--cobalt);
  background: var(--cobalt-pale);
  box-shadow: inset 0 0 0 1px var(--cobalt);
}
.qe-option:has(input:focus-visible) {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Live "answered N of M" helper bar */
.qe-quiz-progress {
  position: sticky;
  top: calc(var(--nav-h) + 8px);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 16px;
  margin-bottom: 18px;
  box-shadow: var(--sh-sm);
}
.qe-quiz-progress .progress { flex: 1; height: 8px; }
.qe-quiz-count { font-family: var(--font-d); font-weight: 700; font-size: .85rem; color: var(--ink-2); white-space: nowrap; }

/* ═══════════════════════════════════════════════════════
   6 · ASSESSMENT REVIEW — explicit [Correct] / [Incorrect]
   Verdict is a TEXT label first; the colour and the left bar are extra.
   Incorrect uses a dashed bar so it differs from Correct in greyscale too.
═══════════════════════════════════════════════════════ */
.qe-review-item {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 18px 18px 22px;
  margin-bottom: 14px;
  background: var(--surface);
  border-left: 6px solid var(--muted-lt);
}
.qe-review-item.is-correct   { border-left: 6px solid var(--success); border-left-style: solid; }
.qe-review-item.is-incorrect { border-left: 6px dashed var(--danger); }
.qe-verdict {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-d);
  font-weight: 800;
  font-size: .76rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  margin-bottom: 10px;
}
.qe-verdict--correct   { background: var(--status-done-bg); color: var(--status-done-ink); }
.qe-verdict--correct::before   { content: "\2713 "; }
.qe-verdict--incorrect { background: var(--danger-pale); color: #991b1b; }
.qe-verdict--incorrect::before { content: "\2717 "; }
.qe-review-q { font-family: var(--font-d); font-weight: 700; color: var(--ink); margin: 4px 0 12px; line-height: 1.45; }
.qe-answer-row { display: flex; gap: 8px; font-size: .9rem; margin: 4px 0; color: var(--ink-2); }
.qe-answer-row .lbl { color: var(--muted); min-width: 122px; font-weight: 600; }
.qe-answer-row .val { font-weight: 600; }
.qe-answer-row .val.correct { color: var(--status-done-ink); }
.qe-answer-row .val.wrong   { color: #991b1b; text-decoration: line-through; text-decoration-color: rgba(153,27,27,.5); }
.qe-explain {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--off-white);
  border-radius: var(--r-sm);
  font-size: .9rem;
  color: var(--ink-3);
  line-height: 1.6;
}
.qe-explain b { color: var(--ink); }

.qe-score-hero {
  text-align: center;
  padding: 30px 24px;
  border-radius: var(--r-lg);
  margin-bottom: 22px;
  border: 1px solid var(--line);
}
.qe-score-hero.passed     { background: var(--status-done-bg); border-color: #86efac; }
.qe-score-hero.not-passed { background: var(--danger-pale); border-color: #fecaca; }
.qe-score-num { font-family: var(--font-d); font-size: 3rem; font-weight: 800; line-height: 1; color: var(--ink); }
.qe-score-verdict { font-family: var(--font-d); font-weight: 800; font-size: 1.05rem; margin-top: 8px; }
.qe-score-hero.passed .qe-score-verdict     { color: var(--status-done-ink); }
.qe-score-hero.not-passed .qe-score-verdict { color: #991b1b; }

/* ═══════════════════════════════════════════════════════
   7 · COURSE MAP (learn.php) — vertical progress tree
═══════════════════════════════════════════════════════ */
.qe-coursemap { display: flex; flex-direction: column; gap: 2px; }
.qe-coursemap a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-weight: 600;
  font-size: .9rem;
  line-height: 1.35;
  transition: background var(--t);
}
.qe-coursemap a:hover { background: var(--off-white); }
.qe-coursemap a[aria-current="true"] {
  background: var(--cobalt-pale);
  color: var(--cobalt-deep);
  box-shadow: inset 3px 0 0 var(--cobalt);
}
.qe-map-dot {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 900;
  border: 1.5px solid var(--line);
  color: var(--muted);
  background: var(--surface);
}
.qe-map-dot.done { background: var(--success); border-color: var(--success); color: #fff; }
.qe-map-dot.done::before { content: "\2713"; }
.qe-map-dot.todo::before { content: ""; }
.qe-map-num { font-size: .72rem; }

/* Focus mode: collapse the map for distraction-free reading */
.learn-layout.focus-mode { grid-template-columns: 1fr; }
.learn-layout.focus-mode .lesson-list { display: none; }
.qe-focus-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  padding: 8px 16px;
  font-family: var(--font-d);
  font-weight: 700;
  font-size: .82rem;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color var(--t), color var(--t);
}
.qe-focus-toggle:hover { border-color: var(--cobalt); color: var(--cobalt); }

/* ═══════════════════════════════════════════════════════
   8 · RESUME CARD (dashboard) — single-click continue
═══════════════════════════════════════════════════════ */
.qe-resume {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(120deg, var(--slate-900), var(--slate-800));
  color: #fff;
  border-radius: var(--r-lg);
  padding: 22px 26px;
  margin-bottom: 26px;
  box-shadow: var(--sh);
  flex-wrap: wrap;
}
.qe-resume-body { flex: 1 1 280px; min-width: 0; }
.qe-resume-eyebrow {
  font-family: var(--font-d);
  font-size: .68rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--teal);
}
.qe-resume h2 { color: #fff; font-size: 1.35rem; margin: 4px 0 6px; }
.qe-resume p { color: rgba(255, 255, 255, .72); font-size: .9rem; margin: 0; }
.qe-resume .progress { margin-top: 12px; max-width: 360px; background: rgba(255, 255, 255, .16); }

/* ═══════════════════════════════════════════════════════
   9 · CARD MICRO-INTERACTIONS  (alive, but subtle)
═══════════════════════════════════════════════════════ */
.course-card { transition: transform var(--t), box-shadow var(--t); }
.course-card:hover { transform: translateY(-3px); box-shadow: var(--sh); }
.course-card:focus-within { box-shadow: var(--sh), 0 0 0 3px rgba(37, 99, 235, .18); }

/* Make completed mark-as-done buttons read as a finished state, with a tick. */
.btn-muted.is-done::before { content: "\2713 "; font-weight: 900; }

/* ═══════════════════════════════════════════════════════
   10 · USER PREFERENCES — motion & contrast
═══════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .course-card:hover { transform: none; }
}

@media (prefers-contrast: more) {
  :root { --line: #94a3b8; --muted: #475569; }
  .btn-outline { border-width: 2px; }
  .qe-status, .badge { border: 1px solid currentColor; }
  .form-control { border-width: 2px; }
  a:not(.btn) { text-decoration: underline; }
}

/* Honour the OS "increase contrast" on Windows high-contrast mode too. */
@media (forced-colors: active) {
  .btn { border: 1px solid currentColor; }
  .progress-fill { forced-color-adjust: none; }
}

/* =========================================================================
 * HOME PAGE — sections built fresh for the new index.php
 *
 * The hero is type-led, no mock-dashboard right rail. Bilingual eyebrow is
 * permanent (the dual-script tagline is a design signature, not a translation
 * footnote). Cobalt is used for emphasis; gradient text is intentionally
 * avoided. Mobile-first.
 * ========================================================================= */

/* The bilingual eyebrow — EN + AR shown together, separated by a hair rule.
   This is the design signature for the home page. */
.qe-bi-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 7px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  font-family: var(--font-d);
  font-size: .72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .82);
  letter-spacing: .06em;
}
.qe-bi-eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, .18);
}
.qe-bi-eyebrow .qe-bi-sep {
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, .22);
  margin: 0 4px;
}
.qe-bi-eyebrow .qe-bi-ar {
  font-family: var(--font-ar);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: 0;
}

/* ── HOME HERO ── */
.qe-home-hero {
  position: relative;
  background: var(--slate-900);
  color: #fff;
  padding: 96px 0 80px;
  overflow: hidden;
  isolation: isolate;
}
/* Two ambient washes, no busy patterns */
.qe-home-hero::before,
.qe-home-hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
}
.qe-home-hero::before {
  top: -25%;
  inset-inline-start: -10%;
  width: 60%;
  height: 90%;
  background: radial-gradient(ellipse at center, rgba(37, 99, 235, .26) 0%, transparent 65%);
}
.qe-home-hero::after {
  bottom: -15%;
  inset-inline-end: -6%;
  width: 50%;
  height: 70%;
  background: radial-gradient(ellipse at center, rgba(14, 165, 233, .14) 0%, transparent 60%);
}

.qe-home-hero-inner {
  position: relative;
  display: grid;
  gap: 24px;
  max-width: 900px;
}
.qe-home-hero h1 {
  font-family: var(--font-d);
  font-size: clamp(2.4rem, 6.4vw, 4.6rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.025em;
  color: #fff;
  margin: 4px 0 0;
}
/* The accent word: a clean cobalt swap. No gradient. */
.qe-home-hero h1 .qe-accent {
  color: var(--cobalt-lt);
}
/* RTL: the heading flips, but we keep the accent treatment */
body.lang-ar .qe-home-hero h1 { font-family: var(--font-ar); letter-spacing: 0; }

.qe-home-hero-sub {
  font-size: 1.08rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, .72);
  max-width: 620px;
  margin: 0;
}
body.lang-ar .qe-home-hero-sub { font-family: var(--font-ar); }

.qe-home-hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}

/* Promise row — tied to actual differentiators, not generic SaaS bullets */
.qe-home-promise {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, .10);
}
.qe-home-promise-item { min-width: 0; }
.qe-home-promise-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  margin-bottom: 10px;
}
.qe-home-promise-h {
  font-family: var(--font-d);
  font-weight: 700;
  font-size: .92rem;
  color: #fff;
  margin: 0 0 4px;
  letter-spacing: -.005em;
}
.qe-home-promise-p {
  font-size: .82rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, .55);
  margin: 0;
}

/* ── ACCESS PATHS ── three clear ways in, each gets its own card */
.qe-access-section { padding: 64px 0; background: var(--off-white); }
.qe-access-head { max-width: 720px; margin: 0 auto 36px; text-align: center; }
.qe-access-head h2 {
  font-family: var(--font-d);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 8px 0 10px;
}
.qe-access-head p { color: var(--muted); margin: 0; }

.qe-access-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.qe-access-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.qe-access-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh);
  border-color: transparent;
}
.qe-access-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-d);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  align-self: flex-start;
}
.qe-access-card-tag.free  { background: var(--success-pale); color: #166534; }
.qe-access-card-tag.vip   { background: var(--cobalt-pale); color: var(--cobalt-deep); }
.qe-access-card-tag.team  { background: var(--orange-pale); color: #9a3412; }
.qe-access-card h3 {
  font-family: var(--font-d);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -.012em;
  margin: 0;
  color: var(--ink);
}
.qe-access-card p {
  font-size: .92rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}
.qe-access-card .btn { margin-top: auto; align-self: flex-start; }

/* ── DIFFERENTIATION ── communication platform, not just an LMS */
.qe-diff-section {
  padding: 80px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.qe-diff-head { max-width: 820px; margin: 0 0 40px; }
.qe-diff-head h2 {
  font-family: var(--font-d);
  font-size: clamp(1.7rem, 3.6vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.15;
  margin: 8px 0 14px;
  color: var(--ink);
  max-width: 680px;
}
.qe-diff-head p { color: var(--ink-3); font-size: 1.05rem; line-height: 1.75; margin: 0; }

.qe-diff-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.qe-diff-col {
  background: var(--off-white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px 28px;
}
.qe-diff-col h3 {
  font-family: var(--font-d);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -.012em;
  color: var(--ink);
  margin: 0 0 14px;
}
.qe-diff-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.qe-diff-list li {
  position: relative;
  padding-inline-start: 22px;
  font-size: .95rem;
  line-height: 1.6;
  color: var(--ink-3);
}
.qe-diff-list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: .55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cobalt);
}
.qe-diff-aim {
  margin: 32px 0 0;
  padding-inline-start: 18px;
  border-inline-start: 3px solid var(--orange);
  max-width: 820px;
  font-size: 1.02rem;
  line-height: 1.7;
  font-weight: 600;
  color: var(--ink-2);
}

/* ── ABOUT: model cards + presentations/resources ──
 * Icon tiles use the official logo quadrant colours (brand proof sheet). */
.qe-brand-tile {
  width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
.qe-brand-tile.blue    { background: #005FD6; }
.qe-brand-tile.teal    { background: #05705F; }
.qe-brand-tile.amber   { background: #FCA619; color: #0B1220; }
.qe-brand-tile.crimson { background: #EA2756; }

.qe-model-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.qe-model-card,
.qe-res-card {
  background: var(--off-white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.qe-model-card h3,
.qe-res-card h3 {
  font-family: var(--font-d); font-size: 1.05rem; font-weight: 700;
  letter-spacing: -.012em; line-height: 1.3; color: var(--ink); margin: 4px 0 0;
}
.qe-model-card p,
.qe-res-card p { margin: 0; font-size: .93rem; line-height: 1.6; color: var(--ink-3); }

.qe-res-section { padding: 80px 0; background: var(--surface); border-bottom: 1px solid var(--line); }
.qe-res-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.qe-res-card { background: var(--surface); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.qe-res-card:hover { border-color: var(--cobalt); box-shadow: 0 12px 28px rgba(15, 23, 42, .08); transform: translateY(-2px); }
.qe-res-link { margin-top: auto; padding-top: 6px; font-family: var(--font-d); font-weight: 700; font-size: .9rem; color: var(--cobalt-deep); }
.qe-res-note { margin: 14px 0 0; font-size: .88rem; color: var(--muted); }

.qe-res-cal {
  margin-top: 32px;
  display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center;
  padding: 26px 30px; border-radius: 18px; text-decoration: none; color: #fff;
  background: radial-gradient(120% 160% at 15% 0%, #0c2b63 0%, #071021 60%, #050b17 100%);
  transition: transform .15s, box-shadow .15s;
}
.qe-res-cal:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(7, 16, 33, .25); }
.qe-res-cal-icon {
  width: 56px; height: 56px; border-radius: 15px; background: #12C4AC; color: #0B1220;
  display: inline-flex; align-items: center; justify-content: center;
}
.qe-res-cal-text { display: flex; flex-direction: column; gap: 4px; }
.qe-res-cal-tag {
  font-family: var(--font-d); font-weight: 700; font-size: .72rem; letter-spacing: .1em;
  text-transform: uppercase; color: #12C4AC;
}
body.lang-ar .qe-res-cal-tag { letter-spacing: 0; }
.qe-res-cal-text strong { font-family: var(--font-d); font-size: 1.25rem; font-weight: 800; letter-spacing: -.015em; }
.qe-res-cal-text span:last-child { color: #c7d2e6; font-size: .95rem; line-height: 1.6; max-width: 640px; }
.qe-res-cal-cta {
  white-space: nowrap; font-family: var(--font-d); font-weight: 700; font-size: .92rem;
  background: #12C4AC; color: #0B1220; padding: 12px 18px; border-radius: 999px;
}

/* ── PILLARS ── why this LMS, tied to the NGO/SME story */
.qe-pillars-section {
  padding: 80px 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.qe-pillars-head { max-width: 820px; margin: 0 0 48px; }
.qe-pillars-head h2 {
  font-family: var(--font-d);
  font-size: clamp(1.7rem, 3.6vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.15;
  margin: 8px 0 12px;
  color: var(--ink);
  max-width: 600px;
}
.qe-pillars-head p { color: var(--muted); font-size: 1rem; line-height: 1.7; margin: 0; max-width: 580px; }

.qe-pillars-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.qe-pillar {
  padding-inline-start: 18px;
  border-inline-start: 3px solid var(--cobalt);
}
.qe-pillar-num {
  font-family: var(--font-d);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .14em;
  color: var(--cobalt);
  display: block;
  margin-bottom: 10px;
}
.qe-pillar h3 {
  font-family: var(--font-d);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.012em;
  color: var(--ink);
  margin: 0 0 8px;
}
.qe-pillar p {
  font-size: .94rem;
  line-height: 1.65;
  color: var(--ink-3);
  margin: 0;
}

/* ── COURSE PREVIEW STRIP ── real data when available */
.qe-courses-preview { padding: 80px 0; background: var(--off-white); }
.qe-courses-preview-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.qe-courses-preview-head h2 {
  font-family: var(--font-d);
  font-size: clamp(1.6rem, 3.2vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -.022em;
  margin: 6px 0 6px;
}
.qe-courses-preview-head p { color: var(--muted); margin: 0; }

/* ── TRUST BAR — text-based credibility line, no institutional emblems ── */
.qe-trust {
  padding: 36px 0 28px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.qe-trust-label {
  font-family: var(--font-d);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  margin: 0 0 16px;
}
.qe-trust-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.qe-trust-badge {
  font-family: var(--font-d);
  font-size: .82rem;
  font-weight: 700;
  color: var(--ink-2);
  background: var(--off-white);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  letter-spacing: -.005em;
}
.qe-trust-footnote {
  text-align: center;
  font-size: .74rem;
  color: var(--muted-lt);
  margin: 16px 0 0;
  line-height: 1.5;
}

/* ── FINAL CTA BAND ── confident, single-purpose */
.qe-cta-band {
  padding: 72px 0;
  background: var(--slate-900);
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.qe-cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(37, 99, 235, .22), transparent 70%);
  pointer-events: none;
}
.qe-cta-band > .container { position: relative; }
.qe-cta-band h2 {
  font-family: var(--font-d);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -.022em;
  color: #fff;
  margin: 0 0 14px;
}
.qe-cta-band p {
  color: rgba(255, 255, 255, .7);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 560px;
  margin: 0 auto 24px;
}
.qe-cta-band .qe-cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── HOME RESPONSIVE ── mobile-first refinements */
@media (max-width: 900px) {
  .qe-home-hero { padding: 64px 0 56px; }
  .qe-home-promise {
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
    margin-top: 28px;
    padding-top: 24px;
  }
  .qe-access-grid { grid-template-columns: 1fr; }
  .qe-pillars-grid { grid-template-columns: 1fr; gap: 22px; }
  .qe-diff-grid { grid-template-columns: 1fr; gap: 18px; }
  .qe-diff-section { padding: 56px 0; }
  .qe-model-grid,
  .qe-res-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .qe-res-section { padding: 56px 0; }
  .qe-res-cal { grid-template-columns: auto 1fr; padding: 22px; }
  .qe-res-cal-cta { grid-column: 1 / -1; justify-self: start; }
  .qe-pillars-section { padding: 56px 0; }
  .qe-courses-preview { padding: 56px 0; }
  .qe-cta-band { padding: 52px 0; }
}

@media (max-width: 480px) {
  .qe-home-hero { padding: 48px 0 44px; }
  .qe-home-promise { grid-template-columns: 1fr; gap: 16px; }
  .qe-model-grid,
  .qe-res-grid { grid-template-columns: 1fr; }
  .qe-res-cal { grid-template-columns: 1fr; }
  .qe-bi-eyebrow { font-size: .68rem; padding: 6px 12px 6px 6px; }
  .qe-bi-eyebrow .qe-bi-ar { font-size: .72rem; }
  .qe-home-hero-cta .btn { width: 100%; }
}

/* ========================================================================= 
 * COURSES CATALOG — refined for the rewritten courses.php
 * ========================================================================= */
.qe-catalog-hero {
  background: var(--slate-900);
  color: #fff;
  padding: 64px 0 48px;
  position: relative;
  overflow: hidden;
}
.qe-catalog-hero::before {
  content: "";
  position: absolute;
  top: -30%; inset-inline-start: -10%;
  width: 50%; height: 80%;
  background: radial-gradient(ellipse at center, rgba(37, 99, 235, .22), transparent 65%);
  pointer-events: none;
}
.qe-catalog-hero > .container { position: relative; }
.qe-catalog-hero h1 {
  font-family: var(--font-d);
  font-size: clamp(2rem, 4.4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -.025em;
  color: #fff;
  margin: 8px 0 8px;
}
.qe-catalog-hero p {
  color: rgba(255, 255, 255, .72);
  font-size: 1rem;
  line-height: 1.65;
  max-width: 600px;
  margin: 0;
}

.qe-catalog-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 18px 0;
  position: sticky;
  top: calc(var(--nav-h) + 0px);
  z-index: 5;
  background: rgba(246, 248, 251, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  margin: 0 0 28px;
}
.qe-catalog-toolbar .qe-catalog-count {
  font-family: var(--font-d);
  font-weight: 700;
  font-size: .9rem;
  color: var(--ink);
}
.qe-catalog-toolbar .qe-catalog-count em { color: var(--cobalt); font-style: normal; }
.qe-catalog-toolbar .qe-catalog-search {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
  margin-inline-start: auto;
}
.qe-catalog-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.qe-filter-chip {
  font-family: var(--font-d);
  font-size: .8rem;
  font-weight: 600;
  padding: 7px 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: all var(--t);
  min-height: 36px;
}
.qe-filter-chip:hover { border-color: var(--cobalt); color: var(--cobalt); }
.qe-filter-chip[aria-pressed="true"] {
  background: var(--cobalt);
  border-color: var(--cobalt);
  color: #fff;
}

.qe-catalog-body { padding: 0 0 80px; }
.qe-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

/* Catalog course card — distinct from the dashboard course-card,
   tuned to communicate AT-A-GLANCE: level + duration + free/paid + title. */
.qe-cc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  position: relative;
}
.qe-cc:hover { transform: translateY(-3px); box-shadow: var(--sh); }
.qe-cc-band {
  height: 6px;
  background: linear-gradient(90deg, var(--cobalt), var(--teal));
}
.qe-cc.is-free .qe-cc-band {
  background: linear-gradient(90deg, var(--success), #4ade80);
}
.qe-cc-body { padding: 22px 22px 20px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.qe-cc-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.qe-cc-tag {
  font-family: var(--font-d);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--cobalt-pale);
  color: var(--cobalt-deep);
}
.qe-cc.is-free .qe-cc-tag { background: var(--success-pale); color: #166534; }
.qe-cc-meta {
  font-size: .76rem;
  color: var(--muted);
  font-family: var(--font-d);
  font-weight: 600;
}
.qe-cc h3 {
  font-family: var(--font-d);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -.012em;
  color: var(--ink);
  margin: 0;
  line-height: 1.35;
}
.qe-cc p {
  font-size: .9rem;
  color: var(--ink-3);
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.qe-cc-foot { margin-top: auto; padding-top: 4px; }

/* Empty / no-results state for the catalog */
.qe-catalog-empty {
  text-align: center;
  padding: 60px 20px;
  border: 1.5px dashed var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--muted);
}
.qe-catalog-empty strong {
  display: block;
  font-family: var(--font-d);
  font-size: 1.05rem;
  color: var(--ink);
  margin-bottom: 6px;
}

@media (max-width: 600px) {
  .qe-catalog-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .qe-catalog-toolbar .qe-catalog-search { max-width: none; margin-inline-start: 0; }
  .qe-catalog-filters { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .qe-filter-chip { flex-shrink: 0; }
}

/* ========================================================================= 
 * AI COURSE FACTORY SPOTLIGHT — surfaces a shipped feature that had no
 * front-page presence. Distinct tinted band so it reads as a differentiator,
 * not just another pillar.
 * ========================================================================= */
.qe-ai-spotlight {
  padding: 72px 0;
  background: var(--cobalt-pale);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.qe-ai-spotlight-inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
}
.qe-ai-spotlight-text h2 {
  font-family: var(--font-d);
  font-size: clamp(1.6rem, 3.2vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -.022em;
  line-height: 1.18;
  color: var(--ink);
  margin: 8px 0 12px;
}
.qe-ai-spotlight-text p {
  color: var(--ink-3);
  font-size: .98rem;
  line-height: 1.7;
  margin: 0;
  max-width: 480px;
}
.qe-ai-spotlight-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}
.qe-ai-spotlight-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: .92rem;
  font-weight: 600;
  color: var(--ink-2);
  line-height: 1.5;
}
.qe-ai-spotlight-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--cobalt-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sh);
}

@media (max-width: 900px) {
  .qe-ai-spotlight { padding: 52px 0; }
  .qe-ai-spotlight-inner { grid-template-columns: 1fr; gap: 28px; }
}

/* ========================================================================= 
 * PRICING — three tiers matching Free / Personal / Team Pass access paths.
 * Reuses .qe-access-card-tag colours for visual continuity with the
 * "Choose your path" section above it.
 * ========================================================================= */
.qe-pricing-section { padding: 80px 0; background: var(--off-white); }

.qe-pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch;
}
.qe-pricing-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.qe-pricing-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh);
}
.qe-pricing-card.featured {
  border-color: var(--orange);
  border-width: 2px;
  padding-top: 38px;
}
.qe-pricing-featured-flag {
  position: absolute;
  top: -13px;
  left: 24px;
  background: var(--orange);
  color: #fff;
  font-family: var(--font-d);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
}
.qe-pricing-card h3 {
  font-family: var(--font-d);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -.012em;
  color: var(--ink);
  margin: 4px 0 0;
}
.qe-pricing-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 4px 0 0;
}
.qe-pricing-price .amount {
  font-family: var(--font-d);
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.02em;
}
.qe-pricing-price .period {
  font-size: .9rem;
  font-weight: 600;
  color: var(--muted);
}
.qe-pricing-sub {
  font-size: .88rem;
  color: var(--muted);
  margin: 0 0 6px;
  line-height: 1.5;
}
.qe-pricing-features {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  gap: 9px;
  flex: 1;
}
.qe-pricing-features li {
  font-size: .88rem;
  color: var(--ink-3);
  line-height: 1.5;
  padding-inline-start: 22px;
  position: relative;
}
.qe-pricing-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .45em;
  width: 12px;
  height: 8px;
  border-left: 2px solid var(--success);
  border-bottom: 2px solid var(--success);
  transform: rotate(-45deg);
}
[dir="rtl"] .qe-pricing-features li { padding-inline-start: 22px; }
[dir="rtl"] .qe-pricing-features li::before { left: auto; right: 0; }

.qe-pricing-card .btn { margin-top: auto; align-self: flex-start; }

.qe-pricing-footnote {
  text-align: center;
  max-width: 640px;
  margin: 32px auto 0;
  font-size: .86rem;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 900px) {
  .qe-pricing-section { padding: 56px 0; }
  .qe-pricing-grid { grid-template-columns: 1fr; }
  .qe-pricing-card.featured { padding-top: 30px; }
}

/* ========================================================================= 
 * RTL fine-tuning for new sections
 * ========================================================================= */
[dir="rtl"] .qe-pillar { border-inline-start: 3px solid var(--cobalt); padding-inline-start: 18px; }
[dir="rtl"] .qe-catalog-toolbar .qe-catalog-search { margin-inline-start: auto; }


/* ═══════════════════════════════════════════════════════════════════════
   05 · ADMIN CONSOLE  (/admin/*)
   Migrated from the inline <style> block in admin/_admin_header.php and
   re-expressed with the layer-01 tokens so the console shares the main
   site's surfaces, radii, spacing, and brand colors.
═══════════════════════════════════════════════════════════════════════ */
.admin-wrap { padding: var(--space-8, 34px) 0 70px; }

.admin-grid {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 22px;
}
/* Grid items default to min-width:auto, so a wide table's intrinsic width
   would blow the track open (668px on a 390px phone) and get clipped by the
   global overflow-x:hidden — the sidebar and content became unreachable.
   Zeroing min-width lets tracks shrink; wide tables then scroll inside
   .table-wrap as designed. */
.admin-grid > * { min-width: 0; }

.admin-side,
.admin-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
}

.admin-side {
  align-self: start;
  position: sticky;
  top: calc(var(--nav-h) + 8px);
}
.admin-side a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--ink-2);
  font-weight: 650;
  transition: background var(--t-fast), color var(--t-fast);
}
.admin-side a:hover,
.admin-side a.active { background: var(--blue-tint); color: var(--cobalt-deep); }
.admin-side .admin-side-label {
  font-family: var(--font-d);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  padding: 12px 12px 4px;
}

.admin-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.kpi {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}
.kpi b { font-family: var(--font-d); font-size: 1.6rem; color: var(--ink); }

.qe-table { width: 100%; border-collapse: collapse; }
.qe-table th,
.qe-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}
.qe-table th {
  font-family: var(--font-d);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* Dense data views: keep cells readable when the table scrolls sideways. */
.table-wrap .qe-table { min-width: 640px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-grid label { display: block; font-weight: 650; color: var(--ink-2); }
.form-grid input,
.form-grid textarea,
.form-grid select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.form-grid input:focus,
.form-grid textarea:focus,
.form-grid select:focus {
  border-color: var(--cobalt);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.form-grid textarea { min-height: 90px; }
.form-full { grid-column: 1 / -1; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.alert { padding: 12px 14px; border-radius: var(--r); margin: 10px 0; border: 1px solid transparent; }
.alert-success { background: var(--success-pale); color: #166534; border-color: rgba(22, 163, 74, .25); }
.alert-error   { background: var(--danger-pale);  color: #991b1b; border-color: rgba(220, 38, 38, .25); }
.alert-info    { background: var(--blue-tint);    color: #3730a3; border-color: rgba(37, 99, 235, .2); }
.alert-warn    { background: var(--warn-pale);    color: var(--orange-ink); border-color: rgba(217, 119, 6, .25); }

.mini { font-size: .9rem; color: var(--muted); }
.danger { background: var(--danger) !important; color: #fff !important; }

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.resource-box,
.lesson-box {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px;
  margin: 12px 0;
  background: var(--surface);
}
.resource-box { background: var(--cobalt-pale); }

.status-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: var(--line-lt);
  font-size: .82rem;
  font-weight: 700;
}

.inline-form { display: inline; }
.compact-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

@media (max-width: 950px) {
  .admin-grid,
  .admin-kpis,
  .form-grid { grid-template-columns: 1fr; }
  .admin-side { position: static; }
  .form-full { grid-column: auto; }
}
@media (max-width: 560px) {
  .admin-wrap { padding: 20px 0 48px; }
  .admin-side,
  .admin-card { padding: 12px; }
  .qe-table th,
  .qe-table td { padding: 8px 6px; font-size: .88rem; }
}

/* ═══════════════════════════════════════════════════════════════════════
   06 · AUTH  (login.php · register.php · codelogin/team-pass.php)
   One canonical split-screen layout. login.php, register.php, and the
   Team-Pass page previously each shipped a diverging copy of these rules
   (team-pass under a .tp-* namespace); all three now share .auth-*.
   NOTE: where a selector also exists in the v3 AUTH PAGES section above,
   the version here is the one production actually rendered (the pages'
   inline styles used to override the stylesheet); it intentionally wins
   the cascade. Byte-identical duplicates have been removed.
═══════════════════════════════════════════════════════════════════════ */


.auth-left {
  background: var(--slate-900);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 64px 56px;
  position: relative;
  overflow: hidden;
}
.auth-left::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -10%;
  width: 60%;
  height: 80%;
  background: radial-gradient(ellipse, rgba(37, 99, 235, .22) 0%, transparent 65%);
  pointer-events: none;
}
.auth-left::after {
  content: '';
  position: absolute;
  bottom: -10%;
  right: -5%;
  width: 40%;
  height: 55%;
  background: radial-gradient(ellipse, rgba(14, 165, 233, .12) 0%, transparent 60%);
  pointer-events: none;
}


.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; }
.auth-logo-icon {
  width: 44px;
  height: 44px;
  background: var(--cobalt);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-logo-icon svg { width: 24px; height: 24px; }
.auth-logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
}

.auth-headline {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 1rem;
  letter-spacing: -.02em;
}


.auth-bullets { display: flex; flex-direction: column; gap: 12px; margin-top: 28px; }
.auth-bullet { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: rgba(255, 255, 255, .7); }
.auth-bullet-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(34, 197, 94, .2);
  border: 1.5px solid rgba(34, 197, 94, .4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: .65rem;
  color: var(--success);
}

.auth-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 56px;
  background: var(--off-white);
  overflow-y: auto;   /* long forms (register / team-pass) stay reachable */
}


.auth-title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: .4rem;
}
.auth-sub { font-size: .9rem; color: var(--muted); margin-bottom: 28px; }


.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 28px;
  box-shadow: var(--sh);
}

.auth-divider { text-align: center; font-size: .8rem; color: var(--muted); margin: 16px 0; position: relative; }

.auth-divider span { background: var(--surface); padding: 0 10px; position: relative; }

.auth-switch { text-align: center; margin-top: 16px; font-size: .85rem; color: var(--muted); }


.auth-team-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--off-white);
  border: 1.5px solid var(--line);
  border-radius: 9px;
  padding: 12px 16px;
  font-family: var(--font-display);
  font-size: .88rem;
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
  width: 100%;
  transition: border-color var(--t), background var(--t);
  text-decoration: none;
}
.auth-team-btn:hover { border-color: var(--cobalt); background: var(--cobalt-pale); color: var(--cobalt); }
.auth-team-icon { font-size: 1.2rem; flex-shrink: 0; }

/* Login / Register tab switcher (Team-Pass page) */
.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--line);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 22px;
}
.auth-tab {
  flex: 1;
  padding: 9px;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-family: var(--font-display);
  font-size: .85rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--t);
}
.auth-tab.active { background: var(--surface); color: var(--cobalt); box-shadow: var(--sh-xs); }
.auth-form { display: none; }
.auth-form.active { display: block; }



.form-pass-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
}

@media (max-width: 767px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .auth-right {
    padding: 32px 20px;
    min-height: 100vh;
    justify-content: flex-start;
    padding-top: 48px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   07 · COURSE PLAYER  (learn.php)
   Migrated from the learn.php inline <style> block. This is the newer
   iteration of the v3 LEARN PAGE section above (adds focus mode, stacked
   resources, quiz gate boxes, unlock flash); overlapping selectors here
   intentionally refine the earlier ones.
═══════════════════════════════════════════════════════════════════════ */
.learn-hero{background:var(--slate-900);color:#fff;padding:44px 0}
.learn-hero h1{font-family:var(--font-d);font-size:clamp(1.8rem,4vw,2.6rem);font-weight:800;max-width:850px}
.learn-hero p{color:rgba(255,255,255,.7);max-width:780px}
.learn-body{padding:28px 0 70px}
.learn-toolbar{display:flex;justify-content:flex-end;align-items:center;margin:0 0 14px}
.learn-layout{display:grid;grid-template-columns:300px 1fr;gap:26px}
.learn-layout.focus-mode{grid-template-columns:1fr}
.learn-layout.focus-mode .lesson-list{display:none}
.lesson-list{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:14px;height:max-content;position:sticky;top:calc(var(--nav-h) + 16px)}
.lesson-list-head{display:flex;align-items:center;justify-content:space-between;margin:4px 8px 12px}
.lesson-list-head strong{font-family:var(--font-d);font-size:.95rem}
.lesson-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:24px;margin-bottom:18px;scroll-margin-top:calc(var(--nav-h) + 16px)}
.lesson-card h2{font-family:var(--font-d);font-size:1.25rem}
.lesson-content{color:var(--ink-2);line-height:1.75}
.lesson-content > * + *{margin-top:.85em}

/* ── Resources block (stacked: type / description / button) ── */
.resource-list-head{font-family:var(--font-d);font-weight:700;font-size:.78rem;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);margin:18px 0 6px}
.resource-list{display:grid;gap:12px;margin:6px 0 4px}
.resource-item{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:10px;
  border:1px solid var(--line);
  border-left:3px solid var(--cobalt);
  border-radius:10px;
  padding:14px 16px;
  background:var(--off-white);
}
.resource-type{
  font-family:var(--font-d);
  font-weight:700;
  font-size:.72rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--cobalt);
}
.resource-desc{
  color:var(--ink-2);
  line-height:1.55;
  font-size:.93rem;
  margin:0;
  word-break:break-word;
}
.resource-desc:empty{display:none}
.resource-action{margin-top:2px}

.complete-box{margin-top:0;margin-bottom:18px;padding:14px;border-radius:12px;background:var(--status-done-bg);border:1px solid #86efac;color:var(--status-done-ink)}
.quiz-prompt-box{margin-bottom:18px;padding:14px 16px;border-radius:12px;background:#eff6ff;border:1px solid #93c5fd;color:#1e3a8a}
.quiz-prompt-box a{font-weight:700}
.assess-card{border:1px solid var(--line);border-radius:var(--r);padding:16px 18px;margin-bottom:12px;background:var(--surface);display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
.assess-locked-note{display:inline-flex;align-items:center;gap:8px;font-size:.85rem;color:var(--muted);border:1px dashed var(--line);border-radius:8px;padding:8px 12px}
/* qe.css sets display on .btn etc., which would defeat the hidden attribute. */
.learn-body [hidden]{display:none !important}
.qe-cert-hero-slot:empty{display:none}
@keyframes qe-flash{0%{box-shadow:0 0 0 0 rgba(37,99,235,.45)}100%{box-shadow:0 0 0 14px rgba(37,99,235,0)}}
.qe-just-unlocked{animation:qe-flash .9s ease-out 2}
@media(max-width:850px){
  .learn-toolbar{justify-content:stretch}
  .learn-toolbar .qe-focus-toggle{width:100%}
  .learn-layout{grid-template-columns:1fr}
  .lesson-list{position:static}
  .lesson-card{padding:18px}
  .learn-hero{padding:30px 0}
  .resource-action .btn{width:100%}
}

/* ═══════════════════════════════════════════════════════════════════════
   08 · CERTIFICATE  (certificate.php)
   Migrated from the certificate.php inline <style> block.
═══════════════════════════════════════════════════════════════════════ */
/* ── Certificate sheet ─────────────────────────────────────────── */
.cert-page{padding:56px 0;background:var(--off-white)}
.cert-sheet{
  position:relative;
  max-width:960px;
  margin:0 auto;
  background:#fdfcf8;
  border:1px solid #d9d2c2;
  box-shadow:0 14px 40px rgba(15,23,42,.12);
  padding:14px;
}
.cert-inner{
  border:3px double #1e3a5f;             /* navy double frame */
  outline:1px solid #c9a24b;             /* gold hairline */
  outline-offset:-10px;
  padding:52px 60px 40px;
  text-align:center;
  position:relative;
}
.cert-provider{
  font-family:var(--font-d, 'Inter', sans-serif);
  font-weight:800;
  font-size:1rem;
  letter-spacing:.28em;
  text-transform:uppercase;
  color:#1e3a5f;
}
.cert-provider small{
  display:block;
  font-weight:600;
  font-size:.62rem;
  letter-spacing:.22em;
  color:#8a7b55;
  margin-top:6px;
}
.cert-rule{
  width:90px;height:2px;background:#c9a24b;border:0;margin:22px auto;
}
.cert-heading{
  font-family:Georgia,'Times New Roman',serif;
  font-size:clamp(1.7rem,4vw,2.5rem);
  font-weight:700;
  letter-spacing:.06em;
  color:#132a45;
  margin:0 0 4px;
}
.cert-sub{
  font-size:.82rem;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:#6b7280;
}
.cert-lead{color:#374151;margin-top:26px;font-size:.95rem}
.cert-name{
  font-family:Georgia,'Times New Roman',serif;
  font-size:clamp(1.8rem,4.4vw,2.7rem);
  font-weight:700;
  color:#1e3a5f;
  margin:10px auto 6px;
  padding-bottom:8px;
  max-width:640px;
  border-bottom:1px solid #c9a24b;
}
.cert-course{
  font-family:Georgia,'Times New Roman',serif;
  font-size:clamp(1.15rem,2.6vw,1.5rem);
  font-weight:700;
  color:#132a45;
  margin:8px auto 0;
  max-width:700px;
}
.cert-facts{
  display:flex;
  justify-content:center;
  gap:0;
  flex-wrap:wrap;
  margin:34px auto 0;
  border-top:1px solid #e2dccb;
  padding-top:22px;
  max-width:760px;
}
.cert-fact{
  padding:0 26px;
  border-left:1px solid #e2dccb;
  min-width:150px;
}
.cert-fact:first-child{border-left:0}
.cert-fact .lbl{
  display:block;
  font-size:.62rem;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:#8a7b55;
  margin-bottom:5px;
}
.cert-fact .val{
  font-family:Georgia,'Times New Roman',serif;
  font-size:.98rem;
  font-weight:700;
  color:#132a45;
}
.cert-seal{
  position:absolute;
  right:46px;
  bottom:96px;
  width:92px;height:92px;
  border-radius:50%;
  border:2px solid #c9a24b;
  display:flex;align-items:center;justify-content:center;
  text-align:center;
  color:#8a7b55;
  font-size:.55rem;
  letter-spacing:.14em;
  text-transform:uppercase;
  line-height:1.5;
  background:radial-gradient(circle,#fbf7ec 55%,#f3ecd9 100%);
  box-shadow:inset 0 0 0 4px #fdfcf8, inset 0 0 0 5px #d9c894;
}
.cert-seal-img{
  width:78%;
  height:78%;
  object-fit:contain;
}
.cert-verify{
  margin-top:30px;
  font-size:.7rem;
  color:#6b7280;
  letter-spacing:.04em;
}
.cert-verify a{color:#1e3a5f;text-decoration:underline;word-break:break-all}
@media(max-width:720px){
  .cert-inner{padding:34px 20px 26px}
  .cert-fact{border-left:0;padding:8px 12px;min-width:44%}
  .cert-seal{position:static;margin:24px auto 0}
}
/* ── Print: only the sheet, fitted to landscape A4 ── */
@media print{
  @page{size:A4 landscape;margin:8mm}
  body{background:#fff !important}
  .qe-nav, nav, header.qe-header, .qe-footer, footer, .print-actions, .cert-notfound-actions{display:none !important}
  .cert-page{padding:0;background:#fff}
  .cert-sheet{box-shadow:none;max-width:none;border-color:#bbb}
  main{padding:0 !important}
}

/* ═══════════════════════════════════════════════════════════════════════
   09 · TRAINING CATALOGUE  (training_catalogue.php)
   Migrated from the page's inline <style> block; the former standalone
   teal/coral palette is remapped onto the layer-01 brand tokens.
═══════════════════════════════════════════════════════════════════════ */
/*
|--------------------------------------------------------------------------
| Hero
|--------------------------------------------------------------------------
*/

.catalogue-hero {
    position: relative;
    overflow: hidden;
    padding: 72px 0 68px;
    background:
        radial-gradient(
            circle at 89% 18%,
            rgba(59, 130, 246, 0.25) 0,
            rgba(59, 130, 246, 0) 31%
        ),
        radial-gradient(
            circle at 72% 112%,
            rgba(16, 185, 129, 0.23) 0,
            rgba(16, 185, 129, 0) 38%
        ),
        linear-gradient(
            125deg,
            var(--catalogue-navy) 0%,
            var(--slate-800) 52%,
            var(--cobalt-deep) 100%
        );
    color: var(--catalogue-white);
}

.catalogue-hero::before {
    position: absolute;
    top: -125px;
    right: -95px;
    width: 365px;
    height: 365px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.catalogue-hero::after {
    position: absolute;
    right: 175px;
    bottom: -220px;
    width: 395px;
    height: 395px;
    border: 1px solid rgba(14, 165, 233, 0.16);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.catalogue-hero .container {
    position: relative;
    z-index: 2;
}

.catalogue-hero-layout {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(260px, 390px);
    align-items: center;
    gap: 48px;
}

.catalogue-hero-copy {
    max-width: 770px;
}

.catalogue-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: var(--hero-accent);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.catalogue-eyebrow::before {
    width: 34px;
    height: 4px;
    border-radius: 999px;
    background:
        linear-gradient(
            90deg,
            var(--qe-logo-blue),
            var(--qe-logo-green),
            var(--qe-logo-green-dark)
        );
    content: "";
}

.catalogue-hero h1 {
    max-width: 750px;
    margin: 0 0 17px;
    color: var(--catalogue-white);
    font-size: clamp(38px, 5vw, 58px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.catalogue-hero p {
    max-width: 740px;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 17px;
    line-height: 1.68;
}

.catalogue-hero-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 25px;
}

.catalogue-hero-highlight {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 37px;
    padding: 8px 13px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--catalogue-white);
    font-size: 12px;
    font-weight: 700;
    backdrop-filter: blur(7px);
}

.catalogue-hero-highlight::before {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--qe-logo-green);
    box-shadow:
        0 0 0 4px rgba(16, 185, 129, 0.13);
    content: "";
}

/*
|--------------------------------------------------------------------------
| Branded hero visual
|--------------------------------------------------------------------------
*/

.catalogue-brand-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.catalogue-brand-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(100%, 340px);
    aspect-ratio: 1 / 0.82;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 28px;
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.11),
            rgba(255, 255, 255, 0.035)
        );
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(12px);
}

.catalogue-brand-panel::before {
    position: absolute;
    inset: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    content: "";
}

.catalogue-brand-mark {
    position: relative;
    width: 128px;
    height: 128px;
}

.catalogue-brand-ring {
    position: absolute;
    top: 9px;
    left: 7px;
    width: 91px;
    height: 91px;
    border: 15px solid var(--qe-logo-blue);
    border-right-color: var(--qe-logo-green);
    border-bottom-color: var(--qe-logo-green-dark);
    border-radius: 50%;
    transform: rotate(-28deg);
}

.catalogue-brand-ring::after {
    position: absolute;
    right: -25px;
    bottom: -25px;
    width: 48px;
    height: 15px;
    border-radius: 999px;
    background:
        linear-gradient(
            90deg,
            var(--qe-logo-green),
            var(--qe-logo-green-dark)
        );
    content: "";
    transform: rotate(47deg);
    transform-origin: left center;
}

.catalogue-brand-dot {
    position: absolute;
    top: 52px;
    left: 48px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--catalogue-white);
    box-shadow:
        0 0 0 7px rgba(255, 255, 255, 0.08);
}

.catalogue-brand-caption {
    position: absolute;
    right: 21px;
    bottom: 18px;
    left: 21px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-align: center;
    text-transform: uppercase;
}

/*
|--------------------------------------------------------------------------
| Main catalogue
|--------------------------------------------------------------------------
*/

.catalogue-main {
    min-height: 500px;
    padding: 42px 0 68px;
    background:
        linear-gradient(
            180deg,
            var(--off-white) 0%,
            var(--catalogue-background) 100%
        );
}

/*
|--------------------------------------------------------------------------
| Alerts
|--------------------------------------------------------------------------
*/

.catalogue-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 22px;
    padding: 16px 18px;
    border: 1px solid var(--catalogue-border);
    border-radius: 13px;
    background: var(--catalogue-white);
    color: var(--catalogue-navy);
    box-shadow:
        0 7px 20px rgba(15, 23, 42, 0.06);
    font-size: 14px;
    line-height: 1.55;
}

.catalogue-alert::before {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: var(--catalogue-white);
    font-size: 13px;
    font-weight: 900;
}

.catalogue-alert-success {
    border-left: 5px solid var(--qe-logo-green);
}

.catalogue-alert-success::before {
    background: var(--qe-logo-green);
    content: "✓";
}

.catalogue-alert-error {
    border-left: 5px solid var(--catalogue-coral);
}

.catalogue-alert-error::before {
    background: var(--catalogue-coral);
    content: "!";
}

/*
|--------------------------------------------------------------------------
| Learning Pass panel
|--------------------------------------------------------------------------
*/

.learning-pass-panel {
    position: relative;
    overflow: hidden;
    margin-bottom: 32px;
    padding: 26px;
    border: 1px solid rgba(59, 130, 246, 0.20);
    border-radius: 19px;
    background:
        linear-gradient(
            135deg,
            var(--catalogue-white) 0%,
            var(--cobalt-pale) 55%,
            var(--success-pale) 100%
        );
    box-shadow: var(--catalogue-shadow);
}

.learning-pass-panel::after {
    position: absolute;
    top: -70px;
    right: -60px;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background:
        linear-gradient(
            135deg,
            rgba(59, 130, 246, 0.10),
            rgba(16, 185, 129, 0.12)
        );
    content: "";
    pointer-events: none;
}

.learning-pass-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.learning-pass-title-wrap {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.learning-pass-icon {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 50px;
    height: 50px;
    border-radius: 15px;
    background:
        linear-gradient(
            135deg,
            var(--qe-logo-blue),
            var(--qe-logo-green)
        );
    color: var(--catalogue-white);
    box-shadow:
        0 10px 22px rgba(16, 185, 129, 0.19);
    font-size: 15px;
    font-weight: 900;
}

.learning-pass-icon::after {
    position: absolute;
    inset: 5px;
    border: 1px solid rgba(255, 255, 255, 0.30);
    border-radius: 11px;
    content: "";
}

.learning-pass-panel h2 {
    margin: 0 0 7px;
    color: var(--catalogue-navy);
    font-size: 24px;
    letter-spacing: -0.02em;
}

.learning-pass-panel p {
    max-width: 750px;
    margin: 0;
    color: var(--catalogue-muted);
    font-size: 14px;
    line-height: 1.6;
}

.catalogue-my-learning {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 43px;
    padding: 10px 16px;
    border: 0;
    border-radius: 11px;
    background:
        linear-gradient(
            100deg,
            var(--qe-logo-blue),
            var(--qe-logo-green)
        );
    color: var(--catalogue-white);
    box-shadow:
        0 9px 20px rgba(16, 185, 129, 0.17);
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    transition:
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.catalogue-my-learning::after {
    margin-left: 8px;
    content: "→";
}

.catalogue-my-learning:hover,
.catalogue-my-learning:focus-visible {
    color: var(--catalogue-white);
    box-shadow:
        0 12px 25px rgba(16, 185, 129, 0.24);
    outline: none;
    transform: translateY(-1px);
}

.learning-pass-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    margin-top: 21px;
}

.learning-pass-item {
    position: relative;
    overflow: hidden;
    padding: 17px;
    border: 1px solid rgba(59, 130, 246, 0.16);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow:
        0 7px 20px rgba(15, 23, 42, 0.045);
}

.learning-pass-item::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    background:
        linear-gradient(
            180deg,
            var(--qe-logo-blue),
            var(--qe-logo-green)
        );
    content: "";
}

.learning-pass-item strong {
    display: block;
    margin-bottom: 7px;
    color: var(--catalogue-navy);
    font-size: 15px;
}

.learning-pass-item span {
    color: var(--catalogue-muted);
    font-size: 12px;
    line-height: 1.55;
}

/*
|--------------------------------------------------------------------------
| Heading and legend
|--------------------------------------------------------------------------
*/

.catalogue-heading-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 22px;
}

.catalogue-heading-row h2 {
    margin: 0 0 6px;
    color: var(--catalogue-navy);
    font-size: 30px;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.catalogue-heading-row p {
    margin: 0;
    color: var(--catalogue-muted);
    font-size: 14px;
    line-height: 1.55;
}

.catalogue-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid var(--catalogue-border);
    border-radius: 999px;
    background: var(--catalogue-white);
    color: var(--catalogue-navy);
    box-shadow:
        0 5px 14px rgba(15, 23, 42, 0.04);
    font-size: 12px;
    font-weight: 700;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-free {
    background:
        linear-gradient(
            135deg,
            var(--qe-logo-blue),
            var(--qe-logo-green)
        );
}

.legend-pass {
    background: var(--catalogue-coral);
}

.legend-organisation {
    background: var(--catalogue-coral-light);
}

.legend-restricted {
    background: var(--catalogue-navy);
}

/*
|--------------------------------------------------------------------------
| Course grid
|--------------------------------------------------------------------------
*/

.catalogue-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(290px, 1fr));
    gap: 23px;
}

.catalogue-card {
    --course-accent: var(--catalogue-navy);
    --course-accent-secondary: var(--catalogue-navy);
    --course-soft: var(--catalogue-navy-soft);
    --course-text: var(--catalogue-navy);

    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    min-height: 400px;
    border: 1px solid var(--catalogue-border);
    border-radius: 19px;
    background: var(--catalogue-white);
    box-shadow: var(--catalogue-shadow);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.catalogue-card::before {
    display: block;
    width: 100%;
    height: 7px;
    background:
        linear-gradient(
            90deg,
            var(--course-accent),
            var(--course-accent-secondary)
        );
    content: "";
}

.catalogue-card:hover {
    border-color: color-mix(
        in srgb,
        var(--course-accent) 34%,
        transparent
    );
    box-shadow:
        0 20px 46px rgba(15, 23, 42, 0.14);
    transform: translateY(-5px);
}

.catalogue-card-free {
    --course-accent: var(--qe-logo-blue);
    --course-accent-secondary: var(--qe-logo-green);
    --course-soft:
        linear-gradient(
            135deg,
            var(--catalogue-blue-soft),
            var(--catalogue-green-soft)
        );
    --course-text: var(--qe-logo-green-dark);
}

.catalogue-card-pass {
--course-accent: var(--catalogue-coral);
--course-accent-secondary: var(--catalogue-navy);
--course-soft:
    linear-gradient(
        135deg,
        rgba(249, 115, 22, 0.13),
        rgba(15, 23, 42, 0.08)
    );
--course-text: var(--orange-deep);

border-color: rgba(249, 115, 22, 0.30);
background:
    linear-gradient(
        180deg,
        rgba(251, 146, 60, 0.17) 0,
        var(--catalogue-white) 34%
    );
box-shadow:
    0 18px 44px rgba(15, 23, 42, 0.14);
}

.catalogue-card-pass::before {
height: 9px;
background:
    linear-gradient(
        90deg,
        var(--catalogue-coral) 0%,
        var(--orange-lt) 38%,
        var(--catalogue-navy) 100%
    );
}

.catalogue-card-pass:hover {
border-color: rgba(249, 115, 22, 0.52);
box-shadow:
    0 25px 58px rgba(15, 23, 42, 0.19),
    0 8px 24px rgba(249, 115, 22, 0.13);
transform: translateY(-7px);
}

.catalogue-card-organisation {
    --course-accent: var(--orange-lt);
    --course-accent-secondary: var(--catalogue-coral-light);
    --course-soft: var(--catalogue-coral-light-soft);
    --course-text: var(--orange-ink);
}

.catalogue-card-restricted {
    --course-accent: var(--catalogue-navy);
    --course-accent-secondary: var(--ink-3);
    --course-soft: var(--catalogue-navy-soft);
    --course-text: var(--catalogue-navy);
}

.catalogue-card-pass .catalogue-card-header {
position: relative;
padding-top: 24px;
}

.catalogue-card-pass .course-type-icon {
width: 54px;
height: 54px;
border-radius: 16px;
background:
    linear-gradient(
        135deg,
        var(--catalogue-coral) 0%,
        var(--orange-deep) 52%,
        var(--catalogue-navy) 100%
    );
color: var(--catalogue-white);
box-shadow:
    0 12px 25px rgba(249, 115, 22, 0.25);
font-size: 14px;
}

.catalogue-card-pass .course-type-icon::after {
position: absolute;
inset: 5px;
border: 1px solid rgba(255, 255, 255, 0.28);
border-radius: 12px;
content: "";
}

.course-type-icon {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 50px;
    height: 50px;
    border-radius: 15px;
    background: var(--course-soft);
    color: var(--course-text);
    font-size: 15px;
    font-weight: 900;
}

.catalogue-card-pass .catalogue-badge:not(
.catalogue-badge-featured
) {
border: 1px solid rgba(249, 115, 22, 0.23);
background:
    linear-gradient(
        100deg,
        rgba(249, 115, 22, 0.13),
        rgba(251, 146, 60, 0.28)
    );
color: var(--orange-deep);
}

.catalogue-card-pass h3 {
color: var(--catalogue-navy);
font-size: 22px;
}

.catalogue-card-pass .catalogue-description {
color: var(--ink-3);
}

.catalogue-card-pass .course-meta {
padding: 11px 12px;
border: 1px solid rgba(249, 115, 22, 0.13);
border-radius: 10px;
background: rgba(251, 146, 60, 0.10);
}

.catalogue-card-pass .course-meta span::before {
background: var(--catalogue-coral);
}

.catalogue-card-pass .catalogue-button {
min-height: 49px;
background:
    linear-gradient(
        100deg,
        var(--catalogue-coral) 0%,
        var(--orange-deep) 48%,
        var(--catalogue-navy) 100%
    );
background-size: 170% 100%;
box-shadow:
    0 12px 25px rgba(249, 115, 22, 0.23);
}

.catalogue-card-pass .catalogue-button:hover,
.catalogue-card-pass .catalogue-button:focus-visible {
background-position: 100% 0;
box-shadow:
    0 15px 31px rgba(15, 23, 42, 0.26),
    0 8px 18px rgba(249, 115, 22, 0.20);
}

.catalogue-card-free .course-type-icon {
    background:
        linear-gradient(
            135deg,
            var(--qe-logo-blue),
            var(--qe-logo-green)
        );
    color: var(--catalogue-white);
    box-shadow:
        0 9px 20px rgba(16, 185, 129, 0.20);
}

.catalogue-card-free .course-type-icon::after {
    position: absolute;
    inset: 5px;
    border: 1px solid rgba(255, 255, 255, 0.30);
    border-radius: 11px;
    content: "";
}

.catalogue-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.catalogue-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--course-soft);
    color: var(--course-text);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.catalogue-card-free .catalogue-badge {
    border-color: rgba(16, 185, 129, 0.18);
    background: var(--catalogue-green-soft);
    color: var(--qe-logo-green-dark);
}

.catalogue-badge-featured {
    border-color: transparent;
    background: var(--catalogue-navy) !important;
    color: var(--catalogue-white) !important;
}

.catalogue-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 18px 21px 21px;
}

.catalogue-card h3 {
    margin: 0 0 11px;
    color: var(--catalogue-navy);
    font-size: 21px;
    line-height: 1.32;
    letter-spacing: -0.018em;
}

.catalogue-description {
    margin: 0 0 18px;
    color: var(--catalogue-muted);
    font-size: 14px;
    line-height: 1.64;
}

.course-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: auto 0 19px;
    padding-top: 5px;
    color: var(--catalogue-navy);
    font-size: 12px;
    font-weight: 700;
}

.course-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.course-meta span::before {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--course-accent);
    content: "";
}

/*
|--------------------------------------------------------------------------
| Course actions
|--------------------------------------------------------------------------
*/

.catalogue-action {
    margin-top: auto;
}

.catalogue-action form {
    margin: 0;
}

.pass-select-label {
    display: block;
    margin-bottom: 11px;
    color: var(--catalogue-navy);
    font-size: 12px;
    font-weight: 800;
}

.pass-select-label select {
    display: block;
    width: 100%;
    min-height: 43px;
    margin-top: 7px;
    padding: 9px 36px 9px 12px;
    border: 1px solid var(--catalogue-border);
    border-radius: 10px;
    background: var(--catalogue-white);
    color: var(--catalogue-navy);
    font: inherit;
}

.pass-select-label select:focus {
    border-color: var(--catalogue-coral);
    box-shadow:
        0 0 0 3px rgba(249, 115, 22, 0.12);
    outline: none;
}

.catalogue-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 46px;
    overflow: hidden;
    padding: 11px 17px;
    border: 0;
    border-radius: 11px;
    background:
        linear-gradient(
            100deg,
            var(--course-accent),
            var(--course-accent-secondary)
        );
    background-size: 150% 100%;
    color: var(--catalogue-white);
    box-shadow:
        0 9px 19px rgba(15, 23, 42, 0.14);
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    cursor: pointer;
    transition:
        background-position 0.25s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.catalogue-button:not(:disabled)::after {
    margin-left: 9px;
    font-size: 17px;
    line-height: 1;
    content: "→";
    transition: transform 0.2s ease;
}

.catalogue-button:hover,
.catalogue-button:focus-visible {
    background-position: 100% 0;
    color: var(--catalogue-white);
    box-shadow:
        0 12px 24px rgba(15, 23, 42, 0.21);
    outline: none;
    transform: translateY(-1px);
}

.catalogue-button:hover::after,
.catalogue-button:focus-visible::after {
    transform: translateX(3px);
}

.catalogue-button-outline {
    border: 2px solid var(--course-accent);
    background: var(--catalogue-white);
    color: var(--course-text);
    box-shadow: none;
}

.catalogue-button-outline:hover,
.catalogue-button-outline:focus-visible {
    background: var(--course-soft);
    color: var(--course-text);
}

.catalogue-button:disabled {
    border: 1px solid var(--line);
    background: var(--line-lt);
    color: var(--muted);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 1;
    transform: none;
}

/*
|--------------------------------------------------------------------------
| Empty state
|--------------------------------------------------------------------------
*/

.catalogue-empty {
    grid-column: 1 / -1;
    padding: 44px 28px;
    border: 1px dashed rgba(59, 130, 246, 0.34);
    border-radius: 19px;
    background: var(--catalogue-white);
    box-shadow:
        0 10px 28px rgba(15, 23, 42, 0.05);
    color: var(--catalogue-muted);
    text-align: center;
}

.catalogue-empty-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin: 0 auto 16px;
    border-radius: 18px;
    background:
        linear-gradient(
            135deg,
            var(--catalogue-blue-soft),
            var(--catalogue-green-soft)
        );
    color: var(--qe-logo-green-dark);
    font-size: 17px;
    font-weight: 900;
}

.catalogue-empty h3 {
    margin: 0 0 8px;
    color: var(--catalogue-navy);
    font-size: 21px;
}

.catalogue-empty p {
    max-width: 540px;
    margin: 0 auto;
    color: var(--catalogue-muted);
    font-size: 14px;
    line-height: 1.62;
}

/*
|--------------------------------------------------------------------------
| Responsive layout
|--------------------------------------------------------------------------
*/

@media (max-width: 900px) {
    .catalogue-hero-layout {
        grid-template-columns: 1fr;
    }

    .catalogue-brand-visual {
        display: none;
    }

    .catalogue-hero {
        padding: 57px 0 54px;
    }
}

@media (max-width: 800px) {
    .learning-pass-header,
    .catalogue-heading-row {
        align-items: stretch;
        flex-direction: column;
    }

    .catalogue-legend {
        justify-content: flex-start;
    }

    .catalogue-my-learning {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .catalogue-hero {
        padding: 43px 0;
    }

    .catalogue-hero h1 {
        font-size: 36px;
    }

    .catalogue-hero p {
        font-size: 15px;
    }

    .catalogue-hero-highlights {
        align-items: stretch;
        flex-direction: column;
    }

    .catalogue-hero-highlight {
        width: 100%;
        border-radius: 11px;
    }

    .catalogue-main {
        padding: 27px 0 45px;
    }

    .learning-pass-panel {
        padding: 19px;
    }

    .learning-pass-title-wrap {
        gap: 11px;
    }

    .learning-pass-icon {
        width: 43px;
        height: 43px;
    }

    .catalogue-heading-row h2 {
        font-size: 25px;
    }

    .catalogue-grid {
        grid-template-columns: 1fr;
    }

    .catalogue-card {
        min-height: 0;
    }

    .catalogue-card-header {
        padding: 18px 18px 0;
    }

    .catalogue-card-body {
        padding: 17px 18px 19px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .catalogue-card,
    .catalogue-button,
    .catalogue-button::after,
    .catalogue-my-learning {
        transition: none;
    }

    .catalogue-card:hover,
    .catalogue-button:hover,
    .catalogue-my-learning:hover {
        transform: none;
    }
}

/*
|--------------------------------------------------------------------------
| Final visual refinement
|--------------------------------------------------------------------------
*/

.catalogue-main .container {
    position: relative;
}

.catalogue-heading-row {
    padding: 0 2px;
}

.catalogue-heading-row > div:first-child {
    max-width: 620px;
}

.catalogue-legend {
    padding: 5px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
    backdrop-filter: blur(8px);
}

.legend-item {
    border-color: transparent;
    box-shadow: none;
    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.legend-item:hover {
    transform: translateY(-1px);
}

.legend-item-free {
    background: rgba(16, 185, 129, 0.08);
}

.legend-item-pass {
    background: rgba(249, 115, 22, 0.09);
}

.legend-item-organisation {
    background: rgba(251, 146, 60, 0.18);
}

.legend-item-restricted {
    background: rgba(15, 23, 42, 0.07);
}

.catalogue-grid {
    align-items: stretch;
}

.catalogue-card {
    isolation: isolate;
}

.catalogue-card::after {
    position: absolute;
    top: 7px;
    right: 0;
    left: 0;
    z-index: -1;
    height: 116px;
    background:
        linear-gradient(
            180deg,
            rgba(15, 23, 42, 0.025),
            transparent
        );
    content: "";
    pointer-events: none;
}

/*
|--------------------------------------------------------------------------
| Free course: clean, accessible and restrained
|--------------------------------------------------------------------------
*/

.catalogue-card-free {
    border-color: rgba(16, 185, 129, 0.19);
    box-shadow: 0 11px 28px rgba(15, 23, 42, 0.075);
}

.catalogue-card-free::before {
    height: 6px;
}

.catalogue-card-free:hover {
    border-color: rgba(16, 185, 129, 0.32);
    box-shadow: 0 17px 38px rgba(15, 23, 42, 0.11);
    transform: translateY(-4px);
}

.catalogue-card-free .course-type-icon {
    width: 48px;
    height: 48px;
    box-shadow: 0 8px 17px rgba(16, 185, 129, 0.16);
}

.catalogue-card-free .catalogue-button {
    box-shadow: 0 8px 18px rgba(16, 185, 129, 0.16);
}

/*
|--------------------------------------------------------------------------
| Paid Learning Pass course: premium emphasis
|--------------------------------------------------------------------------
*/

.catalogue-card-pass {
    min-height: 430px;
    border: 1px solid rgba(249, 115, 22, 0.37);
    background:
        radial-gradient(
            circle at 94% 3%,
            rgba(251, 146, 60, 0.32),
            transparent 28%
        ),
        linear-gradient(
            180deg,
            var(--orange-pale) 0%,
            var(--catalogue-white) 42%
        );
    box-shadow:
        0 22px 52px rgba(15, 23, 42, 0.17),
        0 9px 25px rgba(249, 115, 22, 0.10);
}

.catalogue-card-pass::before {
    height: 10px;
    background:
        linear-gradient(
            90deg,
            var(--catalogue-coral) 0%,
            var(--orange-lt) 38%,
            var(--catalogue-navy) 100%
        );
}

.catalogue-card-pass::after {
    top: 10px;
    height: 155px;
    background:
        linear-gradient(
            180deg,
            rgba(249, 115, 22, 0.08),
            transparent
        );
}

.catalogue-card-pass:hover {
    border-color: rgba(249, 115, 22, 0.60);
    box-shadow:
        0 29px 65px rgba(15, 23, 42, 0.22),
        0 12px 30px rgba(249, 115, 22, 0.16);
    transform: translateY(-8px);
}

.catalogue-card-pass .catalogue-card-header {
    padding-top: 31px;
}

.catalogue-card-pass .catalogue-card-header::before {
    position: absolute;
    top: 0;
    left: 21px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 11px;
    border-radius: 0 0 10px 10px;
    background:
        linear-gradient(
            100deg,
            var(--catalogue-coral),
            var(--orange-lt)
        );
    color: var(--catalogue-white);
    box-shadow: 0 6px 14px rgba(249, 115, 22, 0.20);
    content: "PROFESSIONAL TRAINING";
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.10em;
}

.catalogue-card-pass .course-type-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    box-shadow:
        0 15px 30px rgba(249, 115, 22, 0.27),
        inset 0 0 0 1px rgba(255, 255, 255, 0.12);
    font-size: 13px;
    letter-spacing: 0.04em;
}

.catalogue-card-pass .catalogue-badge:not(
    .catalogue-badge-featured
) {
    min-height: 30px;
    padding-right: 12px;
    padding-left: 12px;
    box-shadow: 0 5px 12px rgba(249, 115, 22, 0.08);
}

.catalogue-card-pass h3 {
    margin-bottom: 12px;
    font-size: 23px;
    line-height: 1.27;
}

.catalogue-card-pass .catalogue-description {
    margin-bottom: 15px;
    color: var(--ink-3);
}

.paid-course-value {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 17px;
    padding: 12px 13px;
    border: 1px solid rgba(249, 115, 22, 0.14);
    border-left: 4px solid var(--catalogue-coral);
    border-radius: 0 11px 11px 0;
    background:
        linear-gradient(
            90deg,
            rgba(249, 115, 22, 0.09),
            rgba(251, 146, 60, 0.08)
        );
    color: var(--orange-ink);
}

.paid-course-value-icon {
    flex: 0 0 auto;
    color: var(--catalogue-coral);
    font-size: 11px;
    line-height: 1.65;
}

.paid-course-value div {
    min-width: 0;
}

.paid-course-value strong,
.paid-course-value span {
    display: block;
}

.paid-course-value strong {
    margin-bottom: 2px;
    color: var(--catalogue-navy);
    font-size: 12px;
    line-height: 1.35;
}

.paid-course-value span {
    color: var(--orange-ink);
    font-size: 11px;
    line-height: 1.45;
}

.catalogue-card-pass .course-meta {
    margin-top: 0;
    margin-bottom: 18px;
    padding: 12px 13px;
    border-color: rgba(249, 115, 22, 0.17);
    background:
        linear-gradient(
            100deg,
            rgba(251, 146, 60, 0.12),
            rgba(255, 255, 255, 0.70)
        );
}

.catalogue-card-pass .catalogue-button {
    min-height: 51px;
    border-radius: 12px;
    box-shadow:
        0 14px 29px rgba(249, 115, 22, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
    font-size: 14px;
    letter-spacing: 0.01em;
}

.catalogue-card-pass .catalogue-button-outline {
    border: 2px solid var(--catalogue-coral);
    background: rgba(255, 255, 255, 0.88);
    color: var(--orange-deep);
    box-shadow: none;
}

.catalogue-card-pass .catalogue-button-outline:hover,
.catalogue-card-pass .catalogue-button-outline:focus-visible {
    background: rgba(251, 146, 60, 0.17);
    color: var(--orange-deep);
}

/*
|--------------------------------------------------------------------------
| Organisation and restricted cards
|--------------------------------------------------------------------------
*/

.catalogue-card-organisation {
    background:
        linear-gradient(
            180deg,
            rgba(251, 146, 60, 0.12),
            var(--catalogue-white) 34%
        );
}

.catalogue-card-restricted {
    background:
        linear-gradient(
            180deg,
            rgba(15, 23, 42, 0.055),
            var(--catalogue-white) 34%
        );
}

/*
|--------------------------------------------------------------------------
| Better small-screen presentation
|--------------------------------------------------------------------------
*/

@media (max-width: 800px) {
    .catalogue-legend {
        justify-content: flex-start;
        border-radius: 16px;
    }
}

@media (max-width: 560px) {
    .catalogue-legend {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .legend-item {
        justify-content: flex-start;
        width: 100%;
        border-radius: 10px;
    }

    .catalogue-card-pass {
        min-height: 0;
    }

    .catalogue-card-pass .catalogue-card-header {
        padding-top: 30px;
    }

    .catalogue-card-pass .catalogue-card-header::before {
        left: 18px;
    }

    .catalogue-card-pass .course-type-icon {
        width: 52px;
        height: 52px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   09b · TRAINING CATEGORIES  (training_catalogue.php, admin/categories.php)
   Strategic groupings of the catalogue. Each category carries an accent
   chosen from a fixed whitelist in includes/db.php; the whitelist keys map
   to the .qe-cat-accent-* classes below so no user-entered value ever
   reaches a style attribute. Every colour resolves to a layer-01 token.
═══════════════════════════════════════════════════════════════════════ */

/*
|--------------------------------------------------------------------------
| Accent map — shared by the catalogue and the admin console
|--------------------------------------------------------------------------
*/

.qe-cat-accent-cobalt {
    --cat-accent: var(--cobalt);
    --cat-accent-soft: rgba(37, 99, 235, 0.10);
    --cat-accent-line: rgba(37, 99, 235, 0.28);
}

.qe-cat-accent-green {
    --cat-accent: var(--brand-green-dark);
    --cat-accent-soft: rgba(16, 185, 129, 0.12);
    --cat-accent-line: rgba(16, 185, 129, 0.30);
}

.qe-cat-accent-violet {
    --cat-accent: var(--violet);
    --cat-accent-soft: rgba(124, 58, 237, 0.10);
    --cat-accent-line: rgba(124, 58, 237, 0.28);
}

.qe-cat-accent-orange {
    --cat-accent: var(--orange-deep);
    --cat-accent-soft: rgba(249, 115, 22, 0.11);
    --cat-accent-line: rgba(249, 115, 22, 0.30);
}

.qe-cat-accent-teal {
    --cat-accent: var(--teal);
    --cat-accent-soft: rgba(14, 165, 233, 0.11);
    --cat-accent-line: rgba(14, 165, 233, 0.30);
}

.qe-cat-accent-slate {
    --cat-accent: var(--muted);
    --cat-accent-soft: rgba(100, 116, 139, 0.10);
    --cat-accent-line: rgba(100, 116, 139, 0.28);
}

/* Admin console: small colour chip in the category table */
.qe-cat-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 7px;
    border-radius: 50%;
    background: var(--cat-accent, var(--muted));
    vertical-align: baseline;
}

/*
|--------------------------------------------------------------------------
| Category filter bar
|--------------------------------------------------------------------------
*/

.catalogue-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 26px;
    padding: 6px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
    backdrop-filter: blur(8px);
}

.catalogue-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 15px;
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--catalogue-navy);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition:
        background-color var(--t),
        color var(--t),
        transform var(--t);
}

.catalogue-filter:hover {
    background: rgba(15, 23, 42, 0.05);
    transform: translateY(-1px);
}

.catalogue-filter.is-active {
    background: var(--catalogue-navy);
    color: var(--catalogue-white);
}

.catalogue-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--r-pill);
    background: rgba(15, 23, 42, 0.08);
    color: inherit;
    font-size: 11px;
    font-weight: 800;
}

.catalogue-filter.is-active .catalogue-filter-count {
    background: rgba(255, 255, 255, 0.22);
}

/*
|--------------------------------------------------------------------------
| Category section
|--------------------------------------------------------------------------
*/

.catalogue-category {
    --cat-accent: var(--muted);
    --cat-accent-soft: rgba(100, 116, 139, 0.10);
    --cat-accent-line: rgba(100, 116, 139, 0.28);

    margin: 0 0 38px;
}

.catalogue-category:last-of-type {
    margin-bottom: 0;
}

.catalogue-category-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    padding: 0 0 12px;
    border-bottom: 1px solid var(--cat-accent-line);
}

.catalogue-category-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 38px;
    height: 38px;
    padding: 0 9px;
    border-radius: var(--r-sm);
    background: var(--cat-accent-soft);
    color: var(--cat-accent);
    font-family: var(--font-d);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.catalogue-category-head h3 {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    color: var(--catalogue-navy);
    font-size: 21px;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.catalogue-category-count {
    flex: 0 0 auto;
    padding: 5px 11px;
    border-radius: var(--r-pill);
    background: var(--cat-accent-soft);
    color: var(--cat-accent);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.catalogue-empty-action {
    margin: 18px 0 0;
}

@media (max-width: 560px) {
    .catalogue-filters {
        border-radius: var(--r-lg);
    }

    .catalogue-filter {
        flex: 1 1 auto;
        justify-content: space-between;
    }

    /* Badge and title stay together on the first line; the count wraps
       beneath only when there is genuinely no room for it. */
    .catalogue-category-head {
        flex-wrap: wrap;
        gap: 9px 10px;
    }

    .catalogue-category-head h3 {
        flex: 1 1 auto;
        font-size: 19px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .catalogue-filter {
        transition: none;
    }

    .catalogue-filter:hover {
        transform: none;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   10 · FREE COURSES  (free-courses.php)
   Migrated from the page's inline <style> block; palette unified with
   layer 09 through the shared brand tokens.
═══════════════════════════════════════════════════════════════════════ */
/*
|--------------------------------------------------------------------------
| Page hero
|--------------------------------------------------------------------------
*/

.free-training-hero {
    position: relative;
    overflow: hidden;
    padding: 70px 0 68px;
    background:
        radial-gradient(
            circle at 88% 18%,
            rgba(59, 130, 246, 0.25) 0,
            rgba(59, 130, 246, 0) 30%
        ),
        radial-gradient(
            circle at 72% 110%,
            rgba(16, 185, 129, 0.24) 0,
            rgba(16, 185, 129, 0) 38%
        ),
        linear-gradient(
            125deg,
            var(--qe-navy) 0%,
            var(--slate-800) 52%,
            var(--cobalt-deep) 100%
        );
    color: var(--qe-white);
}

.free-training-hero::before {
    position: absolute;
    top: -125px;
    right: -95px;
    width: 365px;
    height: 365px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.free-training-hero::after {
    position: absolute;
    right: 170px;
    bottom: -215px;
    width: 390px;
    height: 390px;
    border: 1px solid rgba(14, 165, 233, 0.16);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.free-training-hero .container {
    position: relative;
    z-index: 2;
}

.free-hero-layout {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(260px, 390px);
    align-items: center;
    gap: 48px;
}

.free-hero-copy {
    max-width: 760px;
}

.free-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: var(--hero-accent);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.free-eyebrow::before {
    width: 34px;
    height: 4px;
    border-radius: 999px;
    background:
        linear-gradient(
            90deg,
            var(--qe-logo-blue),
            var(--qe-logo-green),
            var(--qe-logo-green-dark)
        );
    content: "";
}

.free-training-hero h1 {
    max-width: 720px;
    margin: 0 0 17px;
    color: var(--qe-white);
    font-size: clamp(38px, 5vw, 58px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.free-training-hero p {
    max-width: 730px;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 17px;
    line-height: 1.68;
}

.free-hero-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 25px;
}

.free-hero-highlight {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 37px;
    padding: 8px 13px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--qe-white);
    font-size: 12px;
    font-weight: 700;
    backdrop-filter: blur(7px);
}

.free-hero-highlight::before {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--qe-logo-green);
    box-shadow:
        0 0 0 4px rgba(16, 185, 129, 0.13);
    content: "";
}

/*
|--------------------------------------------------------------------------
| Branded hero symbol
|--------------------------------------------------------------------------
*/

.free-brand-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.free-brand-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(100%, 340px);
    aspect-ratio: 1 / 0.82;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 28px;
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.11),
            rgba(255, 255, 255, 0.035)
        );
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(12px);
}

.free-brand-panel::before {
    position: absolute;
    inset: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    content: "";
}

.free-brand-mark {
    position: relative;
    width: 128px;
    height: 128px;
}

.free-brand-ring {
    position: absolute;
    top: 9px;
    left: 7px;
    width: 91px;
    height: 91px;
    border:
        15px solid
        var(--qe-logo-blue);
    border-right-color: var(--qe-logo-green);
    border-bottom-color: var(--qe-logo-green-dark);
    border-radius: 50%;
    transform: rotate(-28deg);
}

.free-brand-ring::after {
    position: absolute;
    right: -25px;
    bottom: -25px;
    width: 48px;
    height: 15px;
    border-radius: 999px;
    background:
        linear-gradient(
            90deg,
            var(--qe-logo-green),
            var(--qe-logo-green-dark)
        );
    content: "";
    transform: rotate(47deg);
    transform-origin: left center;
}

.free-brand-dot {
    position: absolute;
    top: 52px;
    left: 48px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--qe-white);
    box-shadow:
        0 0 0 7px rgba(255, 255, 255, 0.08);
}

.free-brand-caption {
    position: absolute;
    right: 21px;
    bottom: 18px;
    left: 21px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-align: center;
    text-transform: uppercase;
}

/*
|--------------------------------------------------------------------------
| Main course section
|--------------------------------------------------------------------------
*/

.free-training-main {
    min-height: 500px;
    padding: 42px 0 68px;
    background:
        linear-gradient(
            180deg,
            var(--off-white) 0%,
            var(--free-background) 100%
        );
}

.free-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 23px;
}

.free-section-heading h2 {
    margin: 0 0 7px;
    color: var(--qe-navy);
    font-size: 30px;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.free-section-heading p {
    max-width: 680px;
    margin: 0;
    color: var(--free-muted);
    font-size: 14px;
    line-height: 1.6;
}

.free-course-count {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    min-height: 37px;
    padding: 8px 13px;
    border: 1px solid rgba(16, 185, 129, 0.28);
    border-radius: 999px;
    background: var(--qe-white);
    color: var(--qe-navy);
    box-shadow:
        0 5px 15px rgba(15, 23, 42, 0.04);
    font-size: 12px;
    font-weight: 800;
}

.free-course-count::before {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background:
        linear-gradient(
            135deg,
            var(--qe-logo-blue),
            var(--qe-logo-green)
        );
    content: "";
}

/*
|--------------------------------------------------------------------------
| Course grid
|--------------------------------------------------------------------------
*/

.free-course-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(290px, 1fr));
    gap: 23px;
}

.free-course-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    min-height: 380px;
    border: 1px solid var(--free-border);
    border-radius: 19px;
    background: var(--qe-white);
    box-shadow: var(--free-shadow);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.free-course-card::before {
    display: block;
    width: 100%;
    height: 7px;
    background:
        linear-gradient(
            90deg,
            var(--qe-logo-blue) 0%,
            var(--qe-logo-green) 53%,
            var(--qe-logo-green-dark) 100%
        );
    content: "";
}

.free-course-card:hover {
    border-color: rgba(16, 185, 129, 0.33);
    box-shadow:
        0 20px 46px rgba(15, 23, 42, 0.14);
    transform: translateY(-5px);
}

.free-course-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 13px;
    padding: 20px 21px 0;
}

.free-course-icon {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 50px;
    height: 50px;
    border-radius: 15px;
    background:
        linear-gradient(
            135deg,
            var(--qe-logo-blue),
            var(--qe-logo-green)
        );
    color: var(--qe-white);
    box-shadow:
        0 9px 19px rgba(16, 185, 129, 0.20);
    font-size: 16px;
    font-weight: 900;
}

.free-course-icon::after {
    position: absolute;
    inset: 5px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 11px;
    content: "";
}

.free-course-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.free-course-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border: 1px solid rgba(16, 185, 129, 0.18);
    border-radius: 999px;
    background: var(--free-green-soft);
    color: var(--qe-logo-green-dark);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.free-course-badge-featured {
    border-color: transparent;
    background: var(--qe-navy);
    color: var(--qe-white);
}

.free-course-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 18px 21px 21px;
}

.free-course-card h3 {
    margin: 0 0 11px;
    color: var(--qe-navy);
    font-size: 21px;
    line-height: 1.32;
    letter-spacing: -0.018em;
}

.free-course-description {
    margin: 0 0 18px;
    color: var(--free-muted);
    font-size: 14px;
    line-height: 1.64;
}

.free-course-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: auto 0 19px;
    padding-top: 5px;
    color: var(--qe-navy);
    font-size: 12px;
    font-weight: 700;
}

.free-course-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.free-course-meta span::before {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--qe-logo-green);
    content: "";
}

/*
|--------------------------------------------------------------------------
| Course button
|--------------------------------------------------------------------------
*/

.free-course-action {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 46px;
    overflow: hidden;
    padding: 11px 17px;
    border: 0;
    border-radius: 11px;
    background:
        linear-gradient(
            100deg,
            var(--qe-logo-blue) 0%,
            var(--qe-logo-green) 55%,
            var(--qe-logo-green-dark) 100%
        );
    background-size: 150% 100%;
    color: var(--qe-white);
    box-shadow:
        0 9px 19px rgba(16, 185, 129, 0.18);
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    transition:
        background-position 0.25s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.free-course-action::after {
    margin-left: 9px;
    font-size: 17px;
    line-height: 1;
    content: "→";
    transition: transform 0.2s ease;
}

.free-course-action:hover,
.free-course-action:focus-visible {
    background-position: 100% 0;
    box-shadow:
        0 12px 24px rgba(16, 185, 129, 0.26);
    color: var(--qe-white);
    outline: none;
    transform: translateY(-1px);
}

.free-course-action:hover::after,
.free-course-action:focus-visible::after {
    transform: translateX(3px);
}

/*
|--------------------------------------------------------------------------
| Empty state
|--------------------------------------------------------------------------
*/

.free-empty-state {
    grid-column: 1 / -1;
    padding: 44px 28px;
    border: 1px dashed rgba(16, 185, 129, 0.42);
    border-radius: 19px;
    background: var(--qe-white);
    box-shadow:
        0 10px 28px rgba(15, 23, 42, 0.05);
    text-align: center;
}

.free-empty-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin: 0 auto 16px;
    border-radius: 18px;
    background:
        linear-gradient(
            135deg,
            var(--free-blue-soft),
            var(--free-green-soft)
        );
    color: var(--qe-logo-green-dark);
    font-size: 20px;
    font-weight: 900;
}

.free-empty-state h3 {
    margin: 0 0 8px;
    color: var(--qe-navy);
    font-size: 21px;
}

.free-empty-state p {
    max-width: 530px;
    margin: 0 auto;
    color: var(--free-muted);
    font-size: 14px;
    line-height: 1.62;
}

/*
|--------------------------------------------------------------------------
| Mobile layout
|--------------------------------------------------------------------------
*/

@media (max-width: 880px) {
    .free-hero-layout {
        grid-template-columns: 1fr;
    }

    .free-brand-visual {
        display: none;
    }

    .free-training-hero {
        padding: 57px 0 54px;
    }
}

@media (max-width: 760px) {
    .free-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .free-training-hero {
        padding: 43px 0;
    }

    .free-training-hero h1 {
        font-size: 36px;
    }

    .free-training-hero p {
        font-size: 15px;
    }

    .free-hero-highlights {
        align-items: stretch;
        flex-direction: column;
    }

    .free-hero-highlight {
        width: 100%;
        border-radius: 11px;
    }

    .free-training-main {
        padding: 27px 0 45px;
    }

    .free-section-heading h2 {
        font-size: 25px;
    }

    .free-course-grid {
        grid-template-columns: 1fr;
    }

    .free-course-card {
        min-height: 0;
    }

    .free-course-card-header {
        padding: 18px 18px 0;
    }

    .free-course-card-body {
        padding: 17px 18px 19px;
    }
}

.qe-nav .nav-logo img { display:block; width:100%; max-width:200px; height:auto; }
@media (prefers-reduced-motion: reduce) {
    .free-course-card,
    .free-course-action,
    .free-course-action::after {
        transition: none;
    }

    .free-course-card:hover,
    .free-course-action:hover {
        transform: none;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   11 · AI COURSE FACTORY  (ai_course_factory/admin/*)
   The factory console was a fully separate mini-site (own navy palette,
   Arial). Its stylesheet now lives here, scoped under body.acf-page and
   rethemed with the platform tokens; its local --qe-* variables resolve
   to the core system.
═══════════════════════════════════════════════════════════════════════ */
.acf-page {
    --qe-navy: var(--slate-900);
    --qe-navy-light: var(--slate-800);
    --qe-blue: var(--cobalt);
    --qe-blue-dark: var(--cobalt-deep);
    --qe-background: var(--off-white);
    --qe-surface: var(--surface);
    --qe-border: var(--line);
    --qe-text: var(--ink);
    --qe-muted: var(--muted);
    --qe-light-text: rgba(255, 255, 255, .78);
    --qe-shadow: var(--sh-sm);
    --qe-radius: var(--r-lg);
}

.acf-page, .acf-page * {
    box-sizing: border-box;
}

body.acf-page {
    margin: 0;
    min-height: 100vh;
    background: var(--qe-background);
    color: var(--qe-text);
    font-family: var(--font-d);
}

.acf-page a {
    color: inherit;
}

.acf-page .site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background: var(--qe-navy);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 3px 14px rgba(12, 20, 35, 0.14);
}

.acf-page .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
    max-width: 1240px;
    min-height: 68px;
    margin: 0 auto;
    padding: 0 28px;
}

.acf-page .brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    flex-shrink: 0;
    color: #ffffff;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.acf-page .brand-mark {
    display: grid;
    place-items: center;
    width: 39px;
    height: 39px;
    border-radius: 11px;
    background: var(--qe-blue);
    color: #ffffff;
    font-size: 17px;
    font-weight: 800;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.acf-page .brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.acf-page .brand-name {
    font-size: 18px;
}

.acf-page .brand-section {
    margin-top: 4px;
    color: #aebbd0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.acf-page .main-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.acf-page .main-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 9px 12px;
    border-radius: 9px;
    color: #dce4f1;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.acf-page .main-nav a:hover,
.acf-page .main-nav a:focus-visible {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    outline: none;
}

.acf-page .main-nav a.active {
    background: var(--qe-blue);
    color: #ffffff;
}

.acf-page .menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
}

.acf-page .menu-toggle:hover,
.acf-page .menu-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.acf-page .menu-icon,
.acf-page .menu-icon::before,
.acf-page .menu-icon::after {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.2s ease;
}

.acf-page .menu-icon {
    position: relative;
}

.acf-page .menu-icon::before,
.acf-page .menu-icon::after {
    position: absolute;
    left: 0;
    content: "";
}

.acf-page .menu-icon::before {
    top: -7px;
}

.acf-page .menu-icon::after {
    top: 7px;
}

.acf-page .menu-toggle[aria-expanded="true"] .menu-icon {
    background: transparent;
}

.acf-page .menu-toggle[aria-expanded="true"] .menu-icon::before {
    top: 0;
    transform: rotate(45deg);
}

.acf-page .menu-toggle[aria-expanded="true"] .menu-icon::after {
    top: 0;
    transform: rotate(-45deg);
}

.acf-page .wrap {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 28px;
}

.acf-page .hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 22px;
    padding: 30px;
    border-radius: 18px;
    background:
        linear-gradient(
            135deg,
            var(--qe-navy) 0%,
            var(--qe-navy-light) 100%
        );
    color: #ffffff;
    box-shadow: var(--qe-shadow);
}

.acf-page .hero::after {
    position: absolute;
    right: -65px;
    bottom: -105px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(47, 115, 217, 0.25);
    content: "";
    pointer-events: none;
}

.acf-page .hero-content {
    position: relative;
    z-index: 1;
    max-width: 850px;
}

.acf-page .hero-content.centered {
    max-width: 640px;
    margin-inline: auto;
}

.acf-page .eyebrow {
    margin: 0 0 9px;
    color: #a9c9ff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.acf-page .hero h1 {
    margin: 0 0 10px;
    color: #ffffff;
    font-size: clamp(27px, 4vw, 36px);
    line-height: 1.15;
}

.acf-page .hero p {
    max-width: 850px;
    margin: 0;
    color: var(--qe-light-text);
    font-size: 15px;
    line-height: 1.65;
}

.acf-page .stats {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.acf-page .stat {
    min-width: 0;
    padding: 17px;
    border: 1px solid var(--qe-border);
    border-radius: 14px;
    background: var(--qe-surface);
    box-shadow: 0 2px 8px rgba(20, 30, 50, 0.035);
}

.acf-page .num {
    margin-bottom: 4px;
    color: var(--qe-text);
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

.acf-page .label {
    color: var(--qe-muted);
    font-size: 13px;
    line-height: 1.35;
}

.acf-page .quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 22px;
}

.acf-page .grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.acf-page .card {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--qe-border);
    border-radius: var(--qe-radius);
    background: var(--qe-surface);
    box-shadow: var(--qe-shadow);
}

.acf-page .card h2 {
    margin: 0 0 9px;
    color: var(--qe-text);
    font-size: 18px;
    line-height: 1.3;
}

.acf-page .card p {
    margin: 0 0 13px;
    color: var(--qe-muted);
    font-size: 14px;
    line-height: 1.6;
}

.acf-page .card-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 31px;
    height: 31px;
    margin-bottom: 13px;
    border-radius: 9px;
    background: #eaf2ff;
    color: var(--qe-blue-dark);
    font-size: 14px;
    font-weight: 800;
}

.acf-page .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    margin-top: 4px;
    padding: 10px 15px;
    border: 1px solid var(--qe-navy);
    border-radius: 10px;
    background: var(--qe-navy);
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    transition:
        transform 0.15s ease,
        background-color 0.2s ease,
        border-color 0.2s ease;
}

.acf-page .btn:hover,
.acf-page .btn:focus-visible {
    border-color: var(--qe-blue-dark);
    background: var(--qe-blue-dark);
    outline: none;
    transform: translateY(-1px);
}

.acf-page .btn.secondary {
    border-color: #d9e1ec;
    background: #eef2f7;
    color: var(--qe-text);
}

.acf-page .btn.secondary:hover,
.acf-page .btn.secondary:focus-visible {
    border-color: #cbd5e3;
    background: #e1e8f1;
    color: var(--qe-text);
}

.acf-page .system-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.acf-page .footer {
    margin-top: 22px;
    padding: 16px 0 5px;
    border-top: 1px solid var(--qe-border);
    color: #667085;
    font-size: 13px;
    text-align: center;
}

@media (max-width: 1050px) {
  .acf-page .stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .acf-page .main-nav a {
        padding-right: 9px;
        padding-left: 9px;
        font-size: 13px;
  }


}

@media (max-width: 820px) {
  .acf-page .header-inner {
        position: relative;
        min-height: 64px;
        padding: 0 18px;
  }

  .acf-page .menu-toggle {
        display: inline-flex;
  }

  .acf-page .main-nav {
        position: absolute;
        top: calc(100% + 1px);
        right: 0;
        left: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 12px 18px 18px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        background: var(--qe-navy);
        box-shadow: 0 10px 20px rgba(12, 20, 35, 0.18);
  }

  .acf-page .main-nav.open {
        display: flex;
  }

  .acf-page .main-nav a {
        width: 100%;
        min-height: 44px;
        padding: 11px 13px;
        font-size: 14px;
  }

  .acf-page .grid {
        grid-template-columns: 1fr;
  }


}

@media (max-width: 620px) {
  .acf-page .wrap {
        padding: 18px 14px 24px;
  }

  .acf-page .brand-section {
        display: none;
  }

  .acf-page .brand-name {
        font-size: 17px;
  }

  .acf-page .hero {
        padding: 24px 20px;
        border-radius: 15px;
  }

  .acf-page .hero p {
        font-size: 14px;
  }

  .acf-page .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .acf-page .stat {
        padding: 15px;
  }

  .acf-page .num {
        font-size: 25px;
  }

  .acf-page .card {
        padding: 19px;
  }

  .acf-page .quick-links,
.acf-page .system-actions {
        flex-direction: column;
  }

  .acf-page .quick-links .btn,
.acf-page .system-actions .btn {
        width: 100%;
  }


}

@media (max-width: 380px) {
  .acf-page .stats {
        grid-template-columns: 1fr;
  }

  .acf-page .brand-mark {
        width: 36px;
        height: 36px;
  }


}

@media (prefers-reduced-motion: reduce) {
  .acf-page, .acf-page *,
.acf-page *::before,
.acf-page *::after {
        scroll-behavior: auto !important;
        transition: none !important;
  }


}


/* ── ACF shared page components ──────────────────────────────────────────
   The smaller factory pages (builder, settings, templates, SCORM export)
   were standalone Arial documents; they now render inside the shared
   .acf-page shell below using these components. */
.acf-page .card {
  background: var(--qe-surface);
  border: 1px solid var(--qe-border);
  border-radius: var(--qe-radius);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--qe-shadow);
}
.acf-page label { display: block; font-weight: 700; margin-top: 14px; color: var(--ink-2); }
.acf-page input,
.acf-page select,
.acf-page textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  margin-top: 6px;
  box-sizing: border-box;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.acf-page input:focus,
.acf-page select:focus,
.acf-page textarea:focus {
  border-color: var(--cobalt);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.acf-page table { width: 100%; border-collapse: collapse; }
.acf-page td,
.acf-page th { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; }
.acf-page th {
  font-family: var(--font-d);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.acf-page pre {
  background: var(--slate-900);
  color: #f9fafb;
  padding: 14px;
  border-radius: var(--r-sm);
  overflow: auto;
}
.acf-page .err,
.acf-page .bad  { background: var(--danger-pale);  color: #991b1b; padding: 12px; border-radius: var(--r-sm); margin: 10px 0; }
.acf-page .ok   { background: var(--success-pale); color: #166534; padding: 12px; border-radius: var(--r-sm); margin: 10px 0; }
.acf-page .note { background: var(--blue-tint);    color: #3730a3; padding: 12px; border-radius: var(--r-sm); margin: 10px 0; }
.acf-page .muted { color: var(--muted); font-size: 13px; }
.acf-page .acf-breadcrumb { margin: 0 0 14px; font-size: .9rem; color: var(--muted); }
.acf-page .acf-breadcrumb a { color: var(--cobalt); font-weight: 600; text-decoration: none; }
.acf-page .acf-breadcrumb a:hover { text-decoration: underline; }
.acf-page h1 {
  font-family: var(--font-d);
  letter-spacing: -.02em;
  color: var(--ink);
}

/* ═══════════════════════════════════════════════════════════════════════
   12 · UTILITY PAGES  (forgot-password.php · terms.php · privacy.php ·
                        scorm_player.php)
   Migrated from per-page inline <style> blocks. terms.php and privacy.php
   previously each shipped an identical copy of the .legal rules — the
   duplicate now lives here once.
═══════════════════════════════════════════════════════════════════════ */

/* Standalone centred auth card (password reset). Scoped under .auth-wrap
   so it never bleeds into the split-screen .auth-card of layer 06. */
.auth-wrap {
  min-height: 70vh;
  display: grid;
  place-items: center;
  padding: 46px 16px;
}
.auth-wrap .auth-card {
  max-width: 460px;
  width: 100%;
  box-shadow: var(--sh-xs);
}
.auth-wrap .auth-card h1 { font-family: var(--font-display); font-size: 1.6rem; }
.auth-wrap .auth-card p { color: var(--muted); }
.auth-wrap .field { margin: 16px 0; }
.auth-wrap .field input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}

/* Legal documents (terms / privacy) */
.legal { padding: 56px 0 76px; }
.legal article {
  max-width: 900px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 34px;
  margin: auto;
}
.legal h1 { font-family: var(--font-display); font-size: 2rem; }
.legal h2 { font-size: 1.05rem; margin-top: 24px; }
.legal p,
.legal li { color: var(--ink-2); line-height: 1.7; }

/* SCORM player shell */
.scorm-wrap { padding: 24px 0 50px; }
.scorm-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.scorm-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.scorm-frame {
  width: 100%;
  height: calc(100vh - 210px);
  min-height: 520px;
  border: 0;
}
.scorm-status { font-size: .9rem; color: var(--muted); }
@media (max-width: 850px) {
  .scorm-frame { height: 70vh; min-height: 420px; }
  .scorm-top { display: block; }
  .scorm-top .btn { margin-top: 10px; width: 100%; justify-content: center; }
}

/*!
 * QuadraEdge — layers 13–15, appended to the master stylesheet (qe.css).
 *
 *   13  MEDIA & CONTENT BLOCKS — shared embed rendering used by learn.php,
 *                                microlearning.php and media.php's viewer
 *   14  AUTHORING              — media library grid + microlearning builder
 *   15  MICROLEARNING PLAYER   — mobile-first, one step at a time
 *
 * Written against the layer-01 tokens only, so these views inherit the
 * platform's palette, radii and shadows rather than introducing their own.
 * ========================================================================= */

/* ═══════════════════════════════════════════════════════
   13 · MEDIA & CONTENT BLOCKS
═══════════════════════════════════════════════════════ */

.qe-blocks { display: flex; flex-direction: column; gap: var(--space-6); margin-top: var(--space-5); }

.qe-block { min-width: 0; }
.qe-block-heading {
  font-family: var(--font-d, inherit);
  font-size: 1.05rem;
  margin: 0 0 var(--space-2);
  color: var(--ink);
}
.qe-block-text > :first-child { margin-top: 0; }
.qe-block-text > :last-child  { margin-bottom: 0; }
.qe-block-divider { border: 0; border-top: 1px solid var(--line); margin: var(--space-2) 0; }

/* Media figure — one shape for every kind, so an image, a video and a PDF
   preview all sit on the same grid. */
.qe-media { margin: 0; min-width: 0; }
.qe-media--small  { max-width: 260px; }
.qe-media--medium { max-width: 440px; }
.qe-media--large  { max-width: 680px; }
.qe-media--full   { max-width: 100%; }

.qe-media-img,
.qe-media-video {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: var(--r);
  background: var(--off-white);
}
.qe-media-audio { display: block; width: 100%; margin-top: var(--space-1); }

/* Responsive 16:9 frame for YouTube. aspect-ratio with a padding fallback so
   older mobile browsers still get the right box instead of a 150px iframe. */
.qe-media-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--slate-900);
}
@supports not (aspect-ratio: 16 / 9) {
  .qe-media-embed { height: 0; padding-bottom: 56.25%; }
}
.qe-media-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.qe-media-doc {
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--off-white);
}
.qe-media-doc iframe { display: block; width: 100%; height: 70vh; min-height: 380px; border: 0; }

.qe-media-text {
  max-height: 24rem;
  overflow: auto;
  padding: var(--space-4);
  background: var(--off-white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-size: .86rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.qe-media-fallback,
.qe-media-note {
  margin: var(--space-2) 0 0;
  font-size: .84rem;
  color: var(--muted);
}

.qe-media-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-2);
  font-size: .84rem;
  color: var(--muted);
}
.qe-media-caption-text { flex: 1 1 14rem; min-width: 0; }
.qe-media-separate {
  flex: 0 0 auto;
  font-weight: 600;
  color: var(--cobalt);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.qe-media-separate::after { content: " \2197"; text-decoration: none; }

.qe-gallery {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.qe-gallery--small  { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.qe-gallery--full   { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.qe-gallery .qe-media { max-width: 100%; }

/* Callout */
.qe-callout {
  border-left: 4px solid var(--cobalt);
  background: var(--cobalt-pale);
  border-radius: var(--r-sm);
  padding: var(--space-4);
}
.qe-callout--success { border-left-color: var(--brand-green); background: #ecfdf5; }
.qe-callout--warning { border-left-color: #f59e0b;            background: #fffbeb; }
.qe-callout-title { margin: 0 0 var(--space-2); font-weight: 700; color: var(--ink); }
.qe-callout .qe-block-text > :last-child { margin-bottom: 0; }

/* Knowledge check */
.qe-check {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--space-4);
  background: var(--surface);
}
.qe-check-q { margin: 0 0 var(--space-3); font-weight: 600; color: var(--ink); }
.qe-check-options { display: flex; flex-direction: column; gap: var(--space-2); }
.qe-check-opt {
  font: inherit;
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.qe-check-opt:hover { border-color: var(--muted-lt); }
.qe-check-opt.is-correct { border-color: var(--brand-green); background: #ecfdf5; }
.qe-check-opt.is-wrong   { border-color: #ef4444;            background: #fef2f2; }
.qe-check-feedback {
  margin: var(--space-3) 0 0;
  font-size: .86rem;
  color: var(--muted);
}
.qe-check-feedback:empty { display: none; }
.qe-check-static { margin: 0; padding-left: 1.2em; font-size: .88rem; color: var(--ink-3); }
.qe-check-why { margin: var(--space-2) 0 0; font-size: .84rem; color: var(--muted); }

/* Legacy course_resources rendered inline */
.qe-resource { margin: 0; }
.qe-resource + .qe-resource { margin-top: var(--space-4); }

/* media.php "Open separately" viewer */
.qe-viewer { padding: var(--space-8) 0; }
.qe-viewer-head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}
.qe-viewer-kind { margin: 0; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.qe-viewer-head h1 { margin: var(--space-1) 0 0; }
.qe-viewer-desc { margin: var(--space-2) 0 0; color: var(--muted); }
.qe-viewer-stage { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--space-5); }
.qe-viewer-note { margin-top: var(--space-4); font-size: .84rem; color: var(--muted); }


/* ═══════════════════════════════════════════════════════
   14 · AUTHORING  (media library + microlearning builder)
═══════════════════════════════════════════════════════ */

.qe-media-admin-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: start;
}
.qe-media-upload h2 { margin-top: 0; }

.qe-media-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin-bottom: var(--space-4);
}
.qe-media-filters input,
.qe-media-filters select { min-width: 0; flex: 1 1 12rem; }

.qe-media-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.qe-media-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
.qe-media-card-thumb {
  aspect-ratio: 4 / 3;
  background: var(--off-white);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
@supports not (aspect-ratio: 4 / 3) {
  .qe-media-card-thumb { height: 150px; }
}
.qe-media-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.qe-media-card-ext {
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .08em;
  color: var(--muted);
}
.qe-media-card figcaption { padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-1); }
.qe-media-card figcaption strong { font-size: .92rem; word-break: break-word; }

/* Microlearning builder */
.qe-ml-layout {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 900px) {
  .qe-ml-layout { grid-template-columns: minmax(0, 1fr); }
}
.qe-ml-steps { border: 1px solid var(--line); border-radius: var(--r); padding: var(--space-4); background: var(--surface); }
.qe-ml-steps h2, .qe-ml-steps h3 { margin-top: 0; }
.qe-ml-steps h2 { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); font-size: 1rem; }
.qe-ml-steps h2 .mini { font-weight: 400; }

/* Draggable tile strip — the "visual tile editor". Each tile is a real
   link/buttons first (works with JS off); qe_block_editor.js layers drag
   reorder on top and POSTs the result to the same reorder_steps action the
   ↑/↓ buttons use one step at a time. */
.qe-ml-tiles { list-style: none; margin: 0 0 var(--space-5); padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.qe-ml-tile {
  padding: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--surface);
}
.qe-ml-tile.is-active { border-color: var(--cobalt); background: var(--cobalt-pale); }
.qe-ml-tile.is-dragging { opacity: .4; }
.qe-ml-tile-handle {
  flex: 0 0 auto;
  cursor: grab;
  color: var(--muted-lt);
  padding: 0 var(--space-1);
  font-size: .8rem;
  line-height: 1;
  touch-action: none;
}
.qe-ml-tile-body {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: 40px 1fr;
  grid-template-rows: auto auto;
  column-gap: var(--space-2);
  align-items: center;
}
.qe-ml-tile-thumb {
  position: relative;
  grid-row: 1 / 3;
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--off-white);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}
.qe-ml-tile-thumb img { width: 100%; height: 100%; object-fit: cover; }
.qe-ml-tile-icon { font-size: .6rem; font-weight: 700; text-transform: uppercase; color: var(--muted); text-align: center; padding: 0 2px; }
.qe-ml-tile-num {
  position: absolute;
  bottom: 1px;
  right: 1px;
  min-width: 14px;
  padding: 0 3px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}
.qe-ml-tile-title { font-weight: 600; min-width: 0; word-break: break-word; }
.qe-ml-tile .mini { grid-column: 2; }
.qe-ml-step-move { flex: 0 0 auto; display: flex; flex-direction: column; gap: 2px; }
.qe-ml-step-move form { display: flex; gap: 2px; }

.qe-ml-publish-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--off-white);
}
.qe-ml-publish-bar .mini { flex-basis: 100%; order: 5; }
.status-pill--live { background: #ecfdf5; color: var(--brand-green-dark); }

.qe-ml-preview { margin-bottom: var(--space-5); }
.qe-ml-preview-label { margin: 0 0 var(--space-2); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.qe-ml-preview-frame {
  max-width: 300px;
  border: 6px solid var(--ink);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--sh-xs);
  overflow: hidden;
}
.qe-ml-preview-tile { max-height: 460px; overflow-y: auto; padding: var(--space-4); }
.qe-ml-preview-tile h1 { margin: 0 0 var(--space-2); font-size: 1.1rem; }
.qe-ml-preview-tile .qe-blocks { gap: var(--space-4); }

.qe-ml-canvas { min-width: 0; }
.qe-ml-block {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  background: var(--surface);
}
.qe-ml-block-head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.qe-ml-block-tools { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.qe-ml-type-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.qe-ml-type {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: var(--space-3);
  background: var(--off-white);
}
.qe-ml-type > summary { cursor: pointer; font-weight: 600; }


/* ═══════════════════════════════════════════════════════
   15 · MICROLEARNING STORY PLAYER  (microlearning.php)

   Full-screen, swipeable tiles in the spirit of Instagram Stories: a
   segmented top progress bar, tap zones and horizontal swipe (JS
   enhancement — see qe_micro_player.js), one step per tile. Without JS
   every control here is still a real link or form, so the player is fully
   usable by keyboard, screen reader or with scripting disabled; swipe/tap
   only add a faster way to reach the same navigation.
═══════════════════════════════════════════════════════ */

/* This page supplies its own header (qe-story-head) and hides the site
   chrome; $no_nav already drops the top bar, this drops the marketing
   footer so the story fills the viewport edge to edge. */
.qe-story-page .qe-footer { display: none; }

.qe-story-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100dvh;
  background: var(--ink);
  padding: var(--space-6) var(--space-4);
}

.qe-story {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 460px;
  min-height: min(840px, calc(100dvh - var(--space-10)));
  max-height: calc(100dvh - var(--space-10));
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 60px rgba(15, 23, 42, .35);
  overflow: hidden;
}

/* Segmented progress — one thin bar per step, IG-style. */
.qe-story-segments {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: var(--space-3) var(--space-3) 0;
}
.qe-story-seg { flex: 1 1 0; height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.qe-story-seg a { display: block; width: 100%; height: 100%; }
.qe-story-seg.is-done    { background: var(--cobalt); }
.qe-story-seg.is-current { background: var(--cobalt-lt); }

.qe-story-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3) var(--space-1);
}
.qe-story-meta { min-width: 0; }
.qe-story-course {
  margin: 0;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qe-story-count { margin: var(--space-1) 0 0; font-size: .78rem; color: var(--ink-2); }
.qe-story-exit {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-pill);
  font-size: 1.2rem;
  line-height: 1;
  color: var(--muted);
  background: var(--off-white);
}
.qe-story-exit:hover { background: var(--line); color: var(--ink); }

/* The tile itself — the only part that scrolls, so the segments/header/
   controls stay put while a long step's content scrolls underneath. */
.qe-story-stage {
  position: relative;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-4) var(--space-4) var(--space-6);
}
.qe-story-tile h1 { margin: 0 0 var(--space-3); font-size: 1.3rem; line-height: 1.28; color: var(--ink); }
.qe-micro-lead { margin: 0 0 var(--space-4); color: var(--muted); }
.qe-micro-empty { color: var(--muted); font-style: italic; }
.qe-story-tile--empty { display: flex; flex-direction: column; justify-content: center; min-height: 100%; text-align: center; }

.qe-micro-summary h1 { margin: 0 0 var(--space-2); font-size: 1.3rem; }
.qe-micro-summary h2 { margin: var(--space-5) 0 var(--space-3); font-size: 1.05rem; }

.qe-micro-steplist { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.qe-micro-steplist li {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.qe-micro-steplist li a { flex: 1 1 10rem; min-width: 0; font-weight: 600; }

/* Bottom control bar — prev/next icon buttons flank the primary action, like
   the tap zones they mirror for keyboard, screen-reader and no-JS use. */
.qe-story-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.qe-micro-complete { flex: 1 1 auto; margin: 0; }
.qe-micro-complete .btn,
.qe-story-controls > a.btn { width: 100%; justify-content: center; }
.qe-story-nav-btn {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--off-white);
  color: var(--ink-2);
  font-size: 1.15rem;
}
.qe-story-nav-btn:hover { background: var(--line); }
.qe-story-nav-btn.is-hidden { visibility: hidden; }

@media (max-width: 560px) {
  .qe-story-wrap { padding: 0; background: var(--surface); }
  .qe-story { max-width: none; min-height: 100dvh; max-height: 100dvh; border-radius: 0; box-shadow: none; }
  .qe-media-doc iframe { height: 60vh; min-height: 300px; }
}

/* Opt-in, no-op elsewhere: browsers that support it cross-fade between the
   step page loads instead of a hard cut. Everything above already works
   without it. */
@view-transition { navigation: auto; }

/* ── Course title section (title image + subtitle) ───────────────────
   One picture per course, shown as the classic player's banner, the
   microlearning opening tile, and the top of the catalogue card. */

/* Classic player banner: the image sits behind the text under a dark
   gradient so the white title stays readable on any photo. */
.learn-hero--cover { position: relative; overflow: hidden; padding: 96px 0 48px; }
.learn-hero--cover .learn-hero-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
}
.learn-hero--cover::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(15,23,42,.35) 0%, rgba(15,23,42,.88) 100%);
}
.learn-hero--cover .container { position: relative; z-index: 2; }
.learn-hero .learn-hero-subtitle { color: rgba(255,255,255,.92); font-size: 1.1rem; font-weight: 600; }

/* Microlearning opening tile. */
.qe-story-cover { display: flex; flex-direction: column; min-height: 100%; }
.qe-story-cover-img {
  display: block; width: calc(100% + 2 * var(--space-4)); max-width: none;
  margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-4)) var(--space-4);
  aspect-ratio: 4 / 5; object-fit: cover;
}
.qe-story-tile--empty .qe-story-cover-img { width: 100%; margin: 0 0 var(--space-4); aspect-ratio: 16 / 9; border-radius: var(--r-lg); }
.qe-story-cover:not(.has-image) { justify-content: center; text-align: center; }
.qe-story-cover h1 { font-size: 1.6rem; }
.qe-story-cover-subtitle { margin: 0 0 var(--space-3); font-weight: 600; color: var(--ink-2); }
.qe-story-cover-meta { margin: 0; font-size: .82rem; color: var(--muted); }

/* Catalogue card picture. */
.catalogue-card-cover { margin: 0; aspect-ratio: 16 / 9; overflow: hidden; background: var(--off-white); }
.catalogue-card-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Editor card (admin). */
.qe-title-section-editor { margin-top: 16px; }
.qe-title-section-grid { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: 20px; align-items: start; }
.qe-title-section-preview {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  background: var(--slate-900); color: #fff; min-height: 150px;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.qe-title-section-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.qe-title-section-preview.has-image::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(15,23,42,.85) 100%);
}
.qe-title-section-preview-text { position: relative; z-index: 1; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.qe-title-section-preview .mini { position: relative; z-index: 1; margin: 0 14px 14px; color: rgba(255,255,255,.7); }
@media (max-width: 760px) {
  .qe-title-section-grid { grid-template-columns: 1fr; }
  .learn-hero--cover { padding-top: 72px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   16 · AUTHORING FORMS + HELP  (/admin/*, ai_course_factory/admin/*)
   Field sizing for instructor and admin forms, and the help page.
═══════════════════════════════════════════════════════════════════════ */

/* Two columns only when the form itself is wide enough for two ~16rem
   fields; otherwise one. Sizing by the form's own width (not the viewport)
   matters where forms sit in narrow places: the media library's side-by-side
   upload cards, the builder's step sidebar and the "Add a block" cards. */
.form-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, max(16rem, calc((100% - 18px) / 2))), 1fr));
  gap: 14px 18px;
  align-items: start;
}
/* Headings, notes, alerts and button rows always take the full width. */
.form-grid > :is(h2, h3, h4, p, hr, .alert) { grid-column: 1 / -1; margin: 0; }

/* Space between a label's text and its control, and quiet hint text. */
.form-grid label > :is(input, select, textarea) { display: block; margin-top: 6px; }
.form-grid label .mini,
.acf-page label .mini { display: block; margin-top: 4px; font-weight: 400; font-size: .84rem; line-height: 1.45; }
.form-grid label > .mini { margin-top: 6px; }

/* 16px text stops iOS zooming into a field on focus; 44px is the minimum
   comfortable touch target. */
:is(.form-grid, .acf-page) :is(input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea) {
  font-size: 1rem;
  font-weight: 400; /* labels are bold; typed text and placeholders should not be */
  line-height: 1.45;
}
:is(.form-grid, .acf-page) :is(input:not([type=checkbox]):not([type=radio]):not([type=file]), select:not([multiple])) {
  min-height: 44px;
}
:is(.form-grid, .acf-page) textarea { resize: vertical; line-height: 1.55; }

/* Short values get short fields instead of a full column. */
.form-grid input[type=number] { max-width: 12rem; }
.form-grid input[type=date]   { max-width: 16rem; }

/* Checkboxes and radios were stretched to 100% width by the rule above. */
:is(.form-grid, .acf-page) input:is([type=checkbox], [type=radio]) {
  width: 1.15rem;
  height: 1.15rem;
  min-height: 0;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--cobalt);
}
:is(.form-grid, .acf-page) label:has(> input:is([type=checkbox], [type=radio])) {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

/* File pickers read as a drop area with a real button. */
:is(.form-grid, .acf-page) input[type=file] {
  padding: 10px;
  border: 1px dashed var(--muted-lt);
  background: var(--off-white);
  font-size: .92rem;
  cursor: pointer;
}
:is(.form-grid, .acf-page) input[type=file]::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* HTML and JSON editing fields. */
.qe-field-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace !important;
  font-size: .86rem !important;
  line-height: 1.6;
  tab-size: 2;
}
.form-grid textarea.qe-field-code { min-height: 14rem; }
.acf-page textarea.qe-field-code { min-height: 18rem; }

/* An opened "Add a block" card spans the whole row, so its form gets the
   full canvas width rather than a 240px cell. */
.qe-ml-type[open] { grid-column: 1 / -1; background: var(--surface); }
.qe-ml-type[open] > summary { margin-bottom: var(--space-2); }

/* Help page. */
.qe-help section { margin-top: var(--space-8); scroll-margin-top: calc(var(--nav-h) + 16px); }
.qe-help h2 { font-size: 1.2rem; margin: 0 0 var(--space-3); }
.qe-help h3 { font-size: 1rem; margin: var(--space-5) 0 var(--space-2); }
.qe-help :is(p, ul, ol) { margin: 0 0 var(--space-3); line-height: 1.65; }
.qe-help :is(ul, ol) { padding-left: 1.3rem; }
.qe-help li + li { margin-top: 4px; }
.qe-help .table-wrap { margin: 0 0 var(--space-4); }
.qe-help .table-wrap .qe-table { min-width: 520px; }
.qe-help code { font-size: .88em; background: var(--line-lt); padding: 1px 5px; border-radius: 4px; }
.qe-help .alert code { background: rgba(255, 255, 255, .6); }
.qe-help-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: var(--space-4) 0; }
.qe-help-toc a {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--off-white);
  color: var(--ink-2);
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
}
.qe-help-toc a:hover { background: var(--blue-tint); color: var(--cobalt-deep); }
.qe-help-code {
  overflow-x: auto;
  margin: 0 0 var(--space-4);
  padding: var(--space-4);
  border-radius: var(--r);
  background: var(--slate-900);
  color: #e2e8f0;
  font-size: .82rem;
  line-height: 1.55;
}
.qe-help-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: var(--space-3); margin-bottom: var(--space-3); }
.qe-help-cols .alert { margin: 0; }

/* ═══════════════════════════════════════════════════════════════════════
   16 · CONVERSION  (October 2026)
   pilot.php, founder block, course end panel, catalogue access filters,
   contact/register friction fixes. Existing tokens only; logical
   properties throughout so Arabic (RTL) mirrors without extra rules.
═══════════════════════════════════════════════════════════════════════ */

/* Long, sentence-style hero headline (home + pilot) */
.qe-home-hero h1.qe-hero-h1--long {
  font-size: clamp(1.9rem, 4.2vw, 3.3rem);
  line-height: 1.1;
  max-width: 24ch;
}
.qe-home-hero h1.qe-hero-h1--long span { display: inline; }
.qe-home-hero h1.qe-hero-h1--long span + span::before { content: " "; }

/* Pilot: how it works */
.qe-pilot-steps { list-style: none; margin: 0; padding: 0; }

/* Pilot: form + sample */
.qe-pilot-form-section {
  padding: var(--space-16) 0;
  background: var(--off-white);
  border-top: 1px solid var(--line);
}
.qe-pilot-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: var(--space-8);
  align-items: start;
}
.qe-pilot-card,
.qe-pilot-aside {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  padding: var(--space-8);
}
.qe-pilot-card h2,
.qe-pilot-aside h2 {
  font-family: var(--font-d);
  font-size: 1.35rem;
  margin: 0 0 var(--space-2);
  color: var(--ink);
}
.qe-pilot-intro { color: var(--muted); margin: 0 0 var(--space-6); }
.qe-pilot-field { margin-bottom: var(--space-4); }
.qe-pilot-doc {
  border: 1px dashed var(--line);
  border-radius: var(--r);
  padding: var(--space-4);
  margin: 0 0 var(--space-4);
  min-width: 0;
}
.qe-pilot-doc legend { padding: 0 var(--space-2); }
.qe-pilot-doc .qe-pilot-field:last-child { margin-bottom: 0; }
.qe-pilot-file { padding: 10px; min-height: 48px; }
.qe-pilot-submit { margin: var(--space-6) 0 var(--space-2); }
.qe-pilot-reply,
.qe-form-reply {
  font-weight: 600;
  color: var(--ink-3);
  margin: 0 0 var(--space-3);
}
.qe-pilot-errors ul { margin: var(--space-2) 0 0; padding-inline-start: 1.2rem; }
.qe-pilot-errors a { color: inherit; text-decoration: underline; }
.qe-pilot-errors:focus { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.qe-pilot-success:focus { outline: none; }
.qe-pilot-success p { color: var(--ink-2); line-height: 1.7; }
.qe-pilot-aside p { color: var(--ink-3); line-height: 1.65; }
.qe-pilot-call,
.qe-form-call { font-size: .9rem; color: var(--muted); margin: var(--space-4) 0 0; }
.qe-pilot-call a,
.qe-form-call a,
.qe-pricing-call a { color: var(--cobalt); font-weight: 600; }
.qe-pricing-call { margin: var(--space-3) 0 0; font-size: .85rem; }

/* Honeypot: off-screen for people, present for bots */
.qe-hp {
  position: absolute;
  inset-inline-start: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Founder block */
.qe-founder {
  padding: var(--space-16) 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.qe-founder-inner {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: var(--space-8);
  align-items: center;
  max-width: 860px;
  margin: 0 auto;
}
.qe-founder-photo img,
.qe-founder-monogram {
  display: block;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--cobalt-pale);
}
.qe-founder-monogram {
  display: grid;
  place-items: center;
  background: var(--slate-900);
  color: var(--surface);
  font-family: var(--font-d);
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: .04em;
}
.qe-founder-name {
  font-family: var(--font-d);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}
.qe-founder-role { color: var(--cobalt-deep); font-weight: 600; margin: 4px 0 var(--space-3); }
.qe-founder-bio { color: var(--ink-2); line-height: 1.7; margin: 0 0 var(--space-3); max-width: 62ch; }
.qe-founder-link { margin: 0; }
.qe-founder-link a { color: var(--cobalt); font-weight: 600; }

/* Course end panel (learn.php, microlearning.php) */
.qe-end-panel {
  margin: var(--space-8) 0 var(--space-4);
  padding: var(--space-6);
  border-radius: var(--r-lg);
  background: var(--cobalt-pale);
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--cobalt);
}
.qe-end-panel[hidden] { display: none; }
.qe-end-panel h2 {
  font-family: var(--font-d);
  font-size: 1.25rem;
  margin: 0 0 var(--space-2);
  color: var(--ink);
}
.qe-end-panel p { color: var(--ink-2); margin: 0 0 var(--space-4); }
.qe-end-panel .btn-row { margin: 0; }

/* Catalogue access filters (hero chips become real toggles) */
.qe-access-filters[hidden] { display: none; }
button.qe-access-filter {
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  color: inherit;
}
button.qe-access-filter[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--surface);
}
button.qe-access-filter[aria-pressed="true"]::before { background: var(--cobalt); }
.qe-catalogue-note { margin: var(--space-3) 0 0; font-size: .9rem; opacity: .8; }
.catalogue-card[hidden],
.catalogue-category[hidden],
.qe-filter-empty[hidden] { display: none !important; }

/* Contact: optional details disclosure */
.qe-form-more {
  margin-top: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--space-3) var(--space-4);
  background: var(--off-white);
}
.qe-form-more summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--cobalt-deep);
}
.qe-form-more[open] summary { margin-bottom: var(--space-2); }

/* Register */
.qe-register-next { margin: var(--space-3) 0 0; line-height: 1.6; }
[dir="rtl"] .form-pass-wrap input { padding-right: 14px; padding-left: 44px; }
[dir="rtl"] .form-pass-toggle { right: auto; left: 12px; }

@media (max-width: 900px) {
  .qe-pilot-layout { grid-template-columns: 1fr; }
  .qe-pilot-card,
  .qe-pilot-aside { padding: var(--space-6) var(--space-4); }
  .qe-pilot-form-section,
  .qe-founder { padding: var(--space-12) 0; }
}
@media (max-width: 560px) {
  .qe-founder-inner { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .qe-founder-photo img,
  .qe-founder-monogram { width: 120px; height: 120px; }
  .qe-founder-monogram { font-size: 2rem; }
  .qe-pilot-submit .btn { width: 100%; }
}

/* ═══════════════════════════════════════════════════════
   17  IMPORTED LESSONS (qel)
   Styles for lessons converted from standalone "qel" HTML files by
   scripts/convert_qel_lessons.py (e.g. the IMAS 09.60 course). The
   sanitizer strips <style>, forms and <details>, so the markup keeps the
   original qel-* class names and this layer re-creates the original layout
   in the QuadraEdge palette. assets/js/qe_lesson_widgets.js adds .qel-js
   to the root and turns tabs, quizzes, reveals and checklists back into
   interactive widgets; without it everything is shown, fully readable.
═══════════════════════════════════════════════════════ */
.qel {
  --qel-accent:      var(--cobalt);
  --qel-accent-deep: var(--cobalt-deep);
  --qel-accent-pale: var(--cobalt-pale);
  --qel-hot:         var(--orange);
  --qel-hot-ink:     var(--orange-ink);
  --qel-hot-pale:    var(--orange-pale);
  --qel-amber:       #f59e0b;
  --qel-amber-ink:   #92400e;
  --qel-amber-pale:  var(--warn-pale);
  --qel-line-strong: #cbd5e1;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink-2);
}
.lesson-content > .qel + .qel { margin-top: 0; }
.lesson-content > .qel:last-child > :last-child { margin-bottom: 0; }
/* Fallback helpers from the converter: separators and .alert frames keep a
   lesson readable without this layer; with it they are neutralised here and
   each component below draws its own box. */
.qel .qel-sep { display: none !important; }
.qel .qel-ico { font-style: normal; }
.qel .alert {
  display: block; gap: 0; font-size: inherit; line-height: inherit; color: inherit;
  background: none; border: 0; border-radius: 0; margin: 0; padding: 0;
}
.qel, .qel *, .qel *::before, .qel *::after { box-sizing: border-box; }
.qel img, .qel table, .qel pre, .qel figure { max-width: 100%; }

.qel h3, .qel h4, .qel h5 { font-family: var(--font-d); line-height: 1.25; color: var(--ink); margin: 0 0 var(--space-3); letter-spacing: -.01em; }
.qel h3 { font-size: clamp(1.2rem, 2.6vw, 1.45rem); font-weight: 800; }
.qel h4 { font-size: 1.08rem; font-weight: 700; }
.qel h5 { font-size: 1rem; font-weight: 700; }
.qel p, .qel p + p { margin: 0 0 var(--space-4); }
.qel ul, .qel ol { margin: 0 0 var(--space-4); padding-left: 1.4rem; }
.qel ul { list-style: disc; }
.qel ol { list-style: decimal; }
.qel li { margin-bottom: var(--space-2); }
.qel strong { font-weight: 700; color: var(--ink); }
.qel a { color: var(--qel-accent); text-decoration: underline; text-underline-offset: 2px; }
.qel a:hover { color: var(--qel-accent-deep); }
.qel :focus-visible { outline: 3px solid var(--qel-accent); outline-offset: 3px; border-radius: var(--r-xs); }

/* Hero */
.qel .qel-hero {
  position: relative; overflow: hidden;
  background-color: var(--cobalt-deep);
  background-image:
    radial-gradient(circle at 92% 115%, rgba(255,255,255,.10) 0, rgba(255,255,255,.10) 22%, transparent 22.5%),
    radial-gradient(circle at 80% 130%, rgba(255,255,255,.07) 0, rgba(255,255,255,.07) 34%, transparent 34.5%),
    linear-gradient(135deg, var(--slate-900) 0%, var(--cobalt-deep) 60%, var(--cobalt) 100%);
  color: #fff;
  border-radius: var(--r-lg);
  padding: var(--space-8) var(--space-6);
  margin-bottom: var(--space-8);
}
.qel .qel-hero p { color: rgba(255,255,255,.88); max-width: 62ch; font-size: 1.05rem; }
.qel .qel-eyebrow {
  display: inline-block;
  font-family: var(--font-d); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--cobalt-deep); background: #fff;
  border-radius: var(--r-pill); padding: .2rem .75rem; margin-bottom: var(--space-4);
}
.qel .qel-meta { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; padding: 0; margin: var(--space-4) 0 0; }
.qel .qel-meta li {
  margin: 0; font-size: .85rem; color: #fff;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.32);
  border-radius: var(--r-pill); padding: .25rem .75rem;
}

/* Objectives */
.qel .qel-objectives {
  background: var(--surface);
  border: 1px solid var(--line); border-left: 6px solid var(--qel-hot);
  border-radius: var(--r); box-shadow: var(--sh-xs);
  padding: var(--space-4) var(--space-6); margin-bottom: var(--space-8);
}
.qel .qel-objectives h3 { font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.qel .qel-objectives ul { margin-bottom: 0; }

/* Sections */
.qel .qel-section { margin-bottom: var(--space-12); }
.qel .qel-kicker {
  display: block; font-family: var(--font-d); font-size: .78rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--qel-accent); margin-bottom: var(--space-1);
}
.qel .qel-lead { font-size: 1.08rem; color: var(--muted); }
.qel .qel-hint { font-size: .85rem; color: var(--muted); margin: var(--space-2) 0 0; }

/* Pathway */
.qel .qel-path { display: flex; flex-wrap: wrap; gap: var(--space-3); list-style: none; padding: 0; margin: 0 0 var(--space-5); counter-reset: qelpath; }
.qel .qel-path li {
  counter-increment: qelpath; position: relative; flex: 1 1 150px; min-width: 0; margin: 0;
  background: var(--surface); border: 1px solid var(--qel-line-strong); border-radius: var(--r);
  padding: var(--space-3) var(--space-4) var(--space-3) 3.1rem; font-weight: 600; line-height: 1.35; color: var(--ink);
}
.qel .qel-path li::before {
  content: counter(qelpath); position: absolute; left: var(--space-3); top: 50%; transform: translateY(-50%);
  width: 1.8rem; height: 1.8rem; line-height: 1.8rem; text-align: center; border-radius: 50%;
  background: var(--qel-accent-pale); color: var(--qel-accent-deep); font-size: .85rem; font-weight: 700;
}
.qel .qel-path li span { display: block; font-weight: 400; font-size: .85rem; color: var(--muted); }
.qel .qel-path li.is-current { border-color: var(--qel-accent); background: var(--qel-accent-pale); }
.qel .qel-path li.is-current::before { background: var(--qel-accent); color: #fff; }

/* Cards */
.qel .qel-cards { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-bottom: var(--space-5); }
.qel .qel-card {
  flex: 1 1 200px; min-width: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); padding: var(--space-5); box-shadow: var(--sh-xs);
}
.qel .qel-card p:last-child { margin-bottom: 0; }
.qel .qel-card .qel-tag {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--qel-accent-deep); background: var(--qel-accent-pale); border-radius: var(--r-pill);
  padding: .15rem .6rem; margin-bottom: var(--space-3);
}
.qel .qel-card.is-question { border-top: 4px solid var(--qel-hot); }
.qel .qel-card.is-question p { font-family: var(--font-d); font-size: 1.08rem; font-weight: 700; color: var(--ink); margin: 0; }

/* Compare */
.qel .qel-compare { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-bottom: var(--space-5); }
.qel .qel-compare > div {
  flex: 1 1 240px; min-width: 0; border-radius: var(--r); padding: var(--space-5);
  border: 2px solid var(--qel-line-strong); background: var(--surface);
}
.qel .qel-compare .is-in { border-color: var(--qel-accent); }
.qel .qel-compare .is-out { border-color: var(--qel-hot); }
.qel .qel-compare .is-suspect { border-style: dashed; border-color: var(--qel-amber); background: var(--qel-amber-pale); }
.qel .qel-compare .is-confirmed { border-color: var(--danger); background: var(--danger-pale); }
.qel .qel-compare h4 { margin-bottom: var(--space-2); }
.qel .qel-compare p:last-child, .qel .qel-compare ul:last-child { margin-bottom: 0; }
.qel .qel-big { display: block; font-family: var(--font-d); font-size: 2rem; font-weight: 800; line-height: 1; margin-bottom: var(--space-2); color: var(--ink); }

/* Callouts */
.qel .qel-callout {
  border-radius: var(--r); padding: var(--space-4) var(--space-5); margin: 0 0 var(--space-5);
  border-left: 6px solid var(--ink-3); background: var(--off-white);
}
.qel .qel-callout p:last-child { margin-bottom: 0; }
.qel .qel-callout-title {
  display: block; font-family: var(--font-d); font-weight: 800; font-size: .8rem;
  letter-spacing: .06em; text-transform: uppercase; margin-bottom: var(--space-1);
}
.qel .qel-callout.is-principle { background: var(--qel-amber-pale); border-left-color: var(--qel-amber); }
.qel .qel-callout.is-principle .qel-callout-title { color: var(--qel-amber-ink); }
.qel .qel-callout.is-boundary { background: var(--qel-hot-pale); border-left-color: var(--qel-hot); }
.qel .qel-callout.is-boundary .qel-callout-title { color: var(--qel-hot-ink); }
.qel .qel-callout.is-info { background: var(--qel-accent-pale); border-left-color: var(--qel-accent); }
.qel .qel-callout.is-info .qel-callout-title { color: var(--qel-accent-deep); }

/* Case study */
.qel .qel-case { background: var(--slate-900); color: #f8fafc; border-radius: var(--r-lg); padding: var(--space-6); margin-bottom: var(--space-5); }
.qel .qel-case h4, .qel .qel-case strong { color: #fff; }
.qel .qel-case p { color: #e2e8f0; }
.qel .qel-case p:last-child { margin-bottom: 0; }
.qel .qel-case-label {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #fff; background: var(--orange-deep); border-radius: var(--r-pill); padding: .15rem .6rem; margin-bottom: var(--space-3);
}
.qel .qel-facts { list-style: none; padding: 0; margin: 0 0 var(--space-4); }
.qel .qel-facts li { position: relative; padding-left: 1.4rem; color: #e2e8f0; }
.qel .qel-facts li::before {
  content: ""; position: absolute; left: .2rem; top: .62em;
  width: .5rem; height: .5rem; border-radius: 50%; background: var(--orange-lt);
}

/* Tabs: stacked panels by default; the widget script builds the tab bar */
.qel .qel-tabs { margin-bottom: var(--space-5); }
.qel .qel-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: var(--space-5); margin-bottom: var(--space-3);
}
.qel .qel-panel p:last-child, .qel .qel-panel ul:last-child { margin-bottom: 0; }
.qel .qel-tab-label {
  font-family: var(--font-d); font-size: .78rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--qel-accent); margin-bottom: var(--space-2);
}
.qel-js .qel-tablist { display: flex; flex-wrap: wrap; gap: var(--space-2); border-bottom: 2px solid var(--line); }
.qel-js .qel-tab {
  font: inherit; font-family: var(--font-d); font-weight: 700; cursor: pointer;
  padding: var(--space-3) var(--space-4); color: var(--muted); background: transparent;
  border: 2px solid transparent; border-bottom: none; border-radius: var(--r) var(--r) 0 0; margin-bottom: -2px;
  transition: background-color var(--t-fast), color var(--t-fast);
}
.qel-js .qel-tab:hover { background: var(--qel-accent-pale); color: var(--qel-accent-deep); }
.qel-js .qel-tab[aria-selected="true"] { background: var(--surface); color: var(--qel-accent-deep); border-color: var(--line); border-top: 4px solid var(--qel-accent); }
.qel-js .qel-tabs .qel-panel { border-width: 2px; border-top: none; border-radius: 0 0 var(--r) var(--r); margin-bottom: 0; }
.qel-js .qel-tabs .qel-panel[hidden] { display: none; }
.qel-js .qel-tabs .qel-tab-label { display: none; }

/* Reveals (were <details>): open by default, collapsible with the script */
.qel .qel-acc { margin-bottom: var(--space-5); }
.qel .qel-reveal { background: var(--surface); border: 1px solid var(--qel-line-strong); border-radius: var(--r); margin-bottom: var(--space-3); }
.qel .qel-reveal-title { margin: 0; padding: var(--space-4) var(--space-5); font-family: var(--font-d); font-weight: 700; color: var(--ink); border-bottom: 1px solid var(--line); }
.qel .qel-sum-sub { display: block; font-family: var(--font-b); font-weight: 400; font-size: .9rem; color: var(--muted); }
.qel .qel-details-body { padding: var(--space-4) var(--space-5) var(--space-5); }
.qel .qel-details-body > :last-child { margin-bottom: 0; }
.qel .qel-reveal.is-model { border: 2px dashed var(--qel-accent); background: var(--qel-accent-pale); }
.qel .qel-reveal.is-model .qel-reveal-title { color: var(--qel-accent-deep); }
.qel-js .qel-reveal-title { padding: 0; border-bottom: none; }
.qel-js .qel-reveal-btn {
  display: block; width: 100%; text-align: left; font: inherit; font-family: var(--font-d); font-weight: 700; color: inherit;
  background: transparent; border: 0; cursor: pointer; position: relative;
  padding: var(--space-4) 3rem var(--space-4) var(--space-5); border-radius: var(--r);
  transition: background-color var(--t-fast);
}
.qel-js .qel-reveal-btn:hover { background: var(--qel-accent-pale); }
.qel-js .qel-reveal-btn::after {
  content: ""; position: absolute; right: 1.25rem; top: 50%; width: .6rem; height: .6rem;
  border-right: 3px solid var(--qel-accent); border-bottom: 3px solid var(--qel-accent);
  transform: translateY(-70%) rotate(45deg); transition: transform var(--t-fast);
}
.qel-js .qel-reveal-btn[aria-expanded="true"]::after { transform: translateY(-30%) rotate(-135deg); }
.qel-js .qel-reveal-btn[aria-expanded="true"] { border-bottom: 1px solid var(--line); border-radius: var(--r) var(--r) 0 0; }
.qel-js .qel-details-body[hidden] { display: none; }

/* Tooltips */
.qel .qel-term { position: relative; display: inline-block; border-bottom: 2px dotted var(--qel-accent); cursor: help; font-weight: 600; color: var(--ink); }
.qel .qel-tip {
  position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%);
  width: min(280px, 80vw); background: var(--slate-900); color: #fff;
  font-size: .85rem; font-weight: 400; line-height: 1.45; text-align: left;
  padding: var(--space-3) var(--space-4); border-radius: var(--r-xs); box-shadow: var(--sh);
  opacity: 0; visibility: hidden; transition: opacity var(--t-fast), visibility var(--t-fast); z-index: 5;
}
.qel .qel-tip::after { content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 7px solid transparent; border-top-color: var(--slate-900); }
.qel .qel-term:hover .qel-tip, .qel .qel-term:focus .qel-tip, .qel .qel-term:focus-within .qel-tip { opacity: 1; visibility: visible; }

/* Definitions / roles (were <dl>) */
.qel .qel-defs { margin: 0 0 var(--space-5); }
.qel .qel-defs > div { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); padding: var(--space-4) 0; border-bottom: 1px solid var(--line); }
.qel .qel-defs > div:first-child { border-top: 1px solid var(--line); }
.qel .qel-dt { flex: 0 0 200px; min-width: 0; font-family: var(--font-d); font-weight: 800; color: var(--qel-accent-deep); }
.qel .qel-dd { flex: 1 1 300px; min-width: 0; }

/* Knowledge check (were radio fieldsets) */
.qel .qel-check { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--space-6); box-shadow: var(--sh-xs); margin-bottom: var(--space-5); }
.qel .qel-q { margin: 0 0 var(--space-8); }
.qel .qel-q:last-child { margin-bottom: 0; }
.qel .qel-q-stem { font-weight: 700; color: var(--ink); margin-bottom: var(--space-3); }
.qel .qel-qnum { display: inline-block; margin-right: var(--space-2); color: var(--qel-accent); font-family: var(--font-d); font-weight: 800; }
.qel .qel-options { list-style: none; padding: 0; margin: 0; }
.qel .qel-opt { margin: 0 0 var(--space-2); }
.qel .qel-opt-text,
.qel .qel-opt-btn {
  display: block; position: relative; width: 100%; text-align: left; font: inherit; color: var(--ink-2);
  border: 2px solid var(--qel-line-strong); border-radius: var(--r); background: var(--surface);
  padding: var(--space-3) var(--space-4) var(--space-3) 3rem;
  transition: border-color var(--t-fast), background-color var(--t-fast);
}
.qel .qel-opt-text::before,
.qel .qel-opt-btn::before {
  content: ""; position: absolute; left: 1rem; top: 50%; width: 1.1rem; height: 1.1rem; margin-top: -.55rem;
  border: 2px solid var(--ink-3); border-radius: 50%; background: var(--surface);
}
.qel .qel-opt-btn { cursor: pointer; }
.qel .qel-opt-btn:hover { border-color: var(--qel-accent); background: var(--qel-accent-pale); }
.qel .qel-opt.is-chosen .qel-opt-btn::before { border-width: 6px; }
.qel .qel-opt.is-chosen.is-right .qel-opt-btn { border-color: var(--success); background: var(--success-pale); }
.qel .qel-opt.is-chosen.is-right .qel-opt-btn::before { border-color: var(--success); }
.qel .qel-opt.is-chosen.is-wrong .qel-opt-btn { border-color: var(--danger); background: var(--danger-pale); }
.qel .qel-opt.is-chosen.is-wrong .qel-opt-btn::before { border-color: var(--danger); }
.qel .qel-opt-fb { border-radius: var(--r); padding: var(--space-3) var(--space-4); margin: var(--space-2) 0 var(--space-3); }
.qel .qel-opt-fb.is-right { background: var(--success-pale); border-left: 6px solid var(--success); }
.qel .qel-opt-fb.is-wrong { background: var(--danger-pale); border-left: 6px solid var(--danger); }
.qel .qel-opt-fb strong { display: block; }
.qel .qel-opt-fb.is-right strong { color: var(--success); }
.qel .qel-opt-fb.is-wrong strong { color: var(--danger); }
.qel .qel-opt-fb p { margin: 0; }
.qel-js .qel-opt-fb { display: none; }
.qel-js .qel-opt.is-chosen .qel-opt-fb { display: block; }

/* Task + checklist */
.qel .qel-task { background: var(--qel-amber-pale); border: 2px solid var(--qel-amber); border-radius: var(--r-lg); padding: var(--space-6); margin-bottom: var(--space-4); }
.qel .qel-task h4 { margin-bottom: var(--space-2); }
.qel .qel-task > p:last-child { margin-bottom: 0; }
.qel .qel-time {
  display: inline-block; font-size: .8rem; font-weight: 700; color: var(--qel-amber-ink); background: var(--surface);
  border: 1px solid var(--qel-amber); border-radius: var(--r-pill); padding: .1rem .6rem; margin-bottom: var(--space-3);
}
.qel .qel-checklist { list-style: none; padding: 0; margin: 0 0 var(--space-3); }
.qel .qel-checklist li {
  position: relative; margin: 0 0 var(--space-2); background: var(--surface); color: var(--ink);
  border: 1px solid var(--qel-line-strong); border-radius: var(--r);
  padding: var(--space-3) var(--space-4) var(--space-3) 3rem;
  transition: background-color var(--t-fast), border-color var(--t-fast);
}
.qel .qel-checklist li::before {
  content: ""; position: absolute; left: 1rem; top: .95rem; width: 1.15rem; height: 1.15rem;
  border: 2px solid var(--ink-3); border-radius: 4px; background: var(--surface);
}
.qel .qel-checklist li::after {
  content: ""; position: absolute; left: 1.4rem; top: 1.05rem; width: .35rem; height: .7rem;
  border-right: 3px solid #fff; border-bottom: 3px solid #fff; transform: rotate(45deg); opacity: 0;
}
.qel .qel-checklist li > span { display: block; font-size: .92rem; color: var(--muted); }
.qel-js .qel-checklist li { cursor: pointer; }
.qel .qel-checklist li.is-done { background: var(--success-pale); border-color: var(--success); }
.qel .qel-checklist li.is-done::before { background: var(--success); border-color: var(--success); }
.qel .qel-checklist li.is-done::after { opacity: 1; }

/* Code / prompt */
.qel pre {
  background: var(--slate-900); color: #e2e8f0; border-radius: var(--r);
  padding: var(--space-4) var(--space-5); overflow-x: auto; white-space: pre-wrap; word-wrap: break-word; margin: 0 0 var(--space-4);
}
.qel pre code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; line-height: 1.6; background: none; color: inherit; padding: 0; }
.qel .qel-pre-label { display: block; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--space-2); }

/* Takeaways, next, source */
.qel .qel-takeaways { background: var(--surface); border: 1px solid var(--line); border-top: 6px solid var(--qel-accent); border-radius: var(--r-lg); padding: var(--space-6); box-shadow: var(--sh-xs); margin-bottom: var(--space-5); }
.qel .qel-takeaways ul { list-style: none; padding: 0; margin: 0; }
.qel .qel-takeaways li { position: relative; padding-left: 2.2rem; margin-bottom: var(--space-3); }
.qel .qel-takeaways li:last-child { margin-bottom: 0; }
.qel .qel-takeaways li::before { content: ""; position: absolute; left: 0; top: .2em; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--qel-accent); }
.qel .qel-takeaways li::after { content: ""; position: absolute; left: .5rem; top: .42em; width: .35rem; height: .7rem; border-right: 3px solid #fff; border-bottom: 3px solid #fff; transform: rotate(45deg); }
.qel .qel-next { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); background: var(--qel-accent-pale); border-radius: var(--r); padding: var(--space-4) var(--space-5); margin-bottom: var(--space-5); }
.qel .qel-next .qel-alert-body { flex: 1 1 260px; min-width: 0; }
.qel .qel-next p { margin: 0; }
.qel .qel-next strong { color: var(--qel-accent-deep); }
.qel .qel-source { font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: var(--space-4); }
.qel .qel-source p { margin-bottom: var(--space-2); }

@media (max-width: 767px) {
  .qel .qel-hero { padding: var(--space-6) var(--space-4); border-radius: var(--r); }
  .qel .qel-path li, .qel .qel-card, .qel .qel-compare > div { flex-basis: 100%; }
  .qel .qel-dt { flex-basis: 100%; }
  .qel .qel-check, .qel .qel-task, .qel .qel-takeaways, .qel .qel-case { padding: var(--space-4); }
  .qel-js .qel-tablist { border-bottom: none; margin-bottom: var(--space-2); }
  .qel-js .qel-tab { flex: 1 1 100%; text-align: left; border: 2px solid var(--line); border-radius: var(--r-xs); margin-bottom: 0; }
  .qel-js .qel-tab[aria-selected="true"] { border: 2px solid var(--qel-accent); }
  .qel-js .qel-tabs .qel-panel { border-top: 2px solid var(--line); border-radius: var(--r); }
}
@media (prefers-reduced-motion: reduce) {
  .qel *, .qel *::before, .qel *::after { transition: none !important; }
}
@media print {
  .qel-js .qel-tablist { display: none; }
  .qel-js .qel-tabs .qel-panel[hidden], .qel-js .qel-details-body[hidden] { display: block; }
  .qel-js .qel-tabs .qel-tab-label { display: block; }
  .qel-js .qel-opt-fb { display: block; }
}

/* ═══════════════════════════════════════════════════════
   18  ABOUT PAGE
   About is the company-story page: a light hero with an "at a glance"
   card, founder, ACS LLC, approach and practice. It deliberately avoids
   the home page's dark hero and promise cards so the two pages read
   differently.
═══════════════════════════════════════════════════════ */
.qe-about-hero {
  padding: var(--space-16) 0 var(--space-12);
  background:
    radial-gradient(circle at 100% 0, rgba(37,99,235,.10) 0, transparent 45%),
    linear-gradient(180deg, var(--cobalt-pale) 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--line);
}
.qe-about-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: var(--space-10);
  align-items: center;
}
.qe-about-hero h1 {
  font-family: var(--font-d);
  font-size: clamp(2rem, 4.4vw, 3rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -.025em;
  color: var(--ink);
  margin: 0 0 var(--space-4);
}
.qe-about-hero h1 span { display: block; }
.qe-about-hero h1 .qe-accent { color: var(--cobalt); }
.qe-about-hero-sub { font-size: 1.08rem; line-height: 1.7; color: var(--ink-3); max-width: 60ch; margin: 0 0 var(--space-6); }
.qe-about-hero-cta { display: flex; flex-wrap: wrap; gap: var(--space-3); }

.qe-about-facts {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--orange);
  border-radius: var(--r-lg);
  box-shadow: var(--sh);
  padding: var(--space-6);
}
.qe-about-facts-h {
  font-family: var(--font-d);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--space-4);
}
.qe-about-facts ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.qe-about-facts li {
  display: flex; gap: var(--space-3); align-items: flex-start;
  font-weight: 600; color: var(--ink); line-height: 1.45;
}
.qe-about-facts-tick {
  flex: 0 0 22px; width: 22px; height: 22px; margin-top: 1px;
  border-radius: 50%; background: var(--cobalt); position: relative;
}
.qe-about-facts-tick::after {
  content: ""; position: absolute; inset-inline-start: 8px; top: 4px;
  width: 5px; height: 10px; border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(45deg);
}

/* On About the founder follows the hero directly, so it carries the story. */
.qe-about .qe-founder { border-top: 0; }

/* ACS LLC */
.qe-company { padding: var(--space-12) 0; background: var(--slate-900); }
.qe-company-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-8);
  align-items: center;
  max-width: 860px;
  margin: 0 auto;
}
.qe-company-mark {
  display: grid; place-items: center;
  width: 120px; height: 120px; border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--cobalt) 0%, var(--cobalt-deep) 100%);
  color: #fff; font-family: var(--font-d); font-size: 1.9rem; font-weight: 800; letter-spacing: .06em;
  box-shadow: var(--sh-cobalt);
}
.qe-company .eyebrow { color: var(--teal); }
.qe-company h2 { font-family: var(--font-d); font-size: clamp(1.4rem, 3vw, 1.8rem); font-weight: 800; color: #fff; margin: 0 0 var(--space-3); }
.qe-company p { color: rgba(255,255,255,.8); line-height: 1.7; margin: 0 0 var(--space-4); max-width: 62ch; }
.qe-company-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); margin: 0; }
.qe-company-chip {
  display: inline-block; padding: .3rem .8rem; border-radius: var(--r-pill);
  border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.08);
  color: #fff; font-size: .85rem; font-weight: 600;
}
.qe-company-meta a { color: #93c5fd; font-weight: 700; }
.qe-company-meta a:hover { color: #fff; }

/* How we work */
.qe-practice { padding: var(--space-16) 0; background: var(--surface); }
.qe-practice-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: var(--space-10);
  align-items: center;
}
.qe-practice h2 { font-family: var(--font-d); font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; line-height: 1.2; color: var(--ink); margin: 0 0 var(--space-4); }
.qe-practice p { color: var(--ink-3); line-height: 1.7; margin: 0 0 var(--space-3); }
.qe-practice-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.qe-practice-list li {
  display: flex; gap: var(--space-4); align-items: center;
  padding: var(--space-4) var(--space-5);
  background: var(--off-white); border: 1px solid var(--line); border-radius: var(--r);
  font-weight: 600; color: var(--ink);
}
.qe-practice-num {
  flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--orange-pale); color: var(--orange-ink); font-family: var(--font-d); font-weight: 800;
}

/* Presentations sit on a tinted band after the white "how we work". */
.qe-about .qe-res-section { background: var(--off-white); }

@media (max-width: 900px) {
  .qe-about-hero-grid, .qe-practice-grid { grid-template-columns: 1fr; gap: var(--space-8); }
}
@media (max-width: 560px) {
  .qe-about-hero { padding: var(--space-10) 0 var(--space-8); }
  .qe-company-card { grid-template-columns: 1fr; gap: var(--space-5); text-align: center; justify-items: center; }
  .qe-company-mark { width: 88px; height: 88px; font-size: 1.4rem; }
  .qe-company-meta { justify-content: center; }
  .qe-about-hero-cta .btn { width: 100%; }
}

/* ═══════════════════════════════════════════════════════
   19 · SERVICES-FIRST PAGES  (October 2026)
   advisory.php, partners.php, learners.php, the "Ways to work with us"
   pricing grid, ACS credentials, "Where we work", case study, pilot
   inclusions and contact-form classes (formerly inline styles).
   Existing tokens only; logical properties so Arabic mirrors without
   extra rules.
═══════════════════════════════════════════════════════ */

/* Light page hero shared by advisory / partners / learners: the About hero
   without its two-column "at a glance" grid. */
.qe-svc-hero .qe-about-hero-sub { max-width: 68ch; }
.qe-svc-hero h1 { max-width: 26ch; }

/* Advisory service cards */
.qe-svc-section { padding: var(--space-16) 0; background: var(--off-white); }
.qe-svc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
}
.qe-svc-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--space-8) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.qe-svc-card h2,
.qe-svc-card-h {
  font-family: var(--font-d);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -.012em;
  color: var(--ink);
  margin: 0;
}
.qe-svc-card > p { color: var(--ink-3); line-height: 1.65; margin: 0; }
.qe-svc-subhead {
  font-family: var(--font-d);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: var(--space-2) 0 0;
}
body.lang-ar .qe-svc-subhead { letter-spacing: 0; }
.qe-svc-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  margin: auto 0 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}
.qe-svc-meta dt { font-size: .78rem; font-weight: 600; color: var(--muted); }
.qe-svc-meta dd { margin: 2px 0 0; font-weight: 700; color: var(--ink); }
.qe-svc-meta .qe-svc-price { color: var(--cobalt-deep); }
.qe-svc-actions { margin: var(--space-10) 0 0; }
.qe-svc-list { margin: 0; }
.qe-svc-closing { padding: var(--space-12) 0; background: var(--surface); }
.qe-svc-closing .qe-svc-actions { margin: 0; justify-content: center; }
.qe-pillar > p { font-weight: 600; color: var(--ink); }

/* Home: four "Ways to work with us" cards */
.qe-pricing-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.qe-pricing-price .amount.qe-pricing-label { font-size: 1.25rem; line-height: 1.3; }

/* ACS LLC credentials (dark .qe-company band + definition list) */
.qe-acs-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3) var(--space-6);
  margin: 0 0 var(--space-4);
}
.qe-acs-row {
  padding: var(--space-3) var(--space-4);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--r);
  background: rgba(255,255,255,.05);
}
.qe-acs-row dt { font-size: .8rem; color: rgba(255,255,255,.7); line-height: 1.4; }
.qe-acs-row dd {
  margin: 4px 0 0;
  font-family: var(--font-d);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: .04em;
  color: #fff;
  text-align: start;
}

/* Where we work */
.qe-where { padding: var(--space-16) 0; background: var(--off-white); border-top: 1px solid var(--line); }
.qe-where .qe-pillars-head { margin-bottom: var(--space-8); }
.qe-where-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
}
.qe-where-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--cobalt);
  border-radius: var(--r-lg);
  padding: var(--space-6);
}
.qe-where-item h3 { font-family: var(--font-d); font-size: 1.1rem; font-weight: 800; color: var(--ink); margin: 0 0 var(--space-2); }
.qe-where-item p { color: var(--ink-3); line-height: 1.65; margin: 0; }

/* Case study (hidden until QE_CASE_STUDY_ENABLED) */
.qe-case { padding: var(--space-16) 0; background: var(--surface); border-top: 1px solid var(--line); }
.qe-case-client { font-weight: 700; color: var(--cobalt-deep); }
.qe-case-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--space-8);
  align-items: start;
}
.qe-case-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); margin: 0; }
.qe-case-fact { padding: var(--space-4); background: var(--off-white); border: 1px solid var(--line); border-radius: var(--r); }
.qe-case-fact dt { font-size: .78rem; font-weight: 600; color: var(--muted); }
.qe-case-fact dd { margin: 4px 0 0; color: var(--ink-2); line-height: 1.6; }
.qe-case-fact--num dd { font-family: var(--font-d); font-size: 1.6rem; font-weight: 800; color: var(--ink); }
.qe-case-quote {
  margin: 0;
  padding: var(--space-6);
  background: var(--cobalt-pale);
  border-inline-start: 4px solid var(--cobalt);
  border-radius: var(--r);
}
.qe-case-quote blockquote { margin: 0; }
.qe-case-quote p { font-size: 1.05rem; line-height: 1.7; color: var(--ink); margin: 0 0 var(--space-3); }
.qe-case-quote figcaption { font-weight: 600; color: var(--muted); }

/* Learners: Learning Pass card beside the event calendar */
.qe-learners-pass-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: var(--space-6);
  align-items: stretch;
}
.qe-learners-pass .qe-res-cal { margin-top: 0; grid-template-columns: auto minmax(0, 1fr); }
.qe-learners-pass .qe-res-cal-cta { grid-column: 1 / -1; justify-self: start; }

/* Pilot: what the pilot includes */
.qe-pilot-includes {
  margin: 0 0 var(--space-8);
  padding: var(--space-6) var(--space-8);
  background: var(--surface);
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--orange);
  border-radius: var(--r-lg);
}
.qe-pilot-includes h2 { font-family: var(--font-d); font-size: 1.25rem; color: var(--ink); margin: 0 0 var(--space-4); }
.qe-pilot-includes .qe-pricing-features { margin: 0; }
.qe-pilot-limit { margin: var(--space-4) 0 0; font-weight: 600; color: var(--ink-3); }

/* Contact form (formerly inline styles) */
.qe-contact-types { margin-bottom: var(--space-5); }
.qe-contact-type {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  cursor: pointer;
}
.qe-contact-type input { margin-top: 4px; flex-shrink: 0; }
.qe-contact-gap { margin-top: 14px; }
.qe-contact-submit { margin-top: var(--space-5); }
.qe-contact-direct { margin: var(--space-6) 0 0; color: var(--ink-3); }
.qe-contact-direct a { color: var(--cobalt); font-weight: 600; }
.qe-contact-direct-sep { margin: 0 var(--space-2); color: var(--muted); }

@media (max-width: 1100px) {
  .qe-pricing-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .qe-svc-grid,
  .qe-where-grid,
  .qe-case-grid,
  .qe-learners-pass-grid,
  .qe-pricing-grid--4 { grid-template-columns: 1fr; }
  .qe-svc-section,
  .qe-where,
  .qe-case { padding: var(--space-12) 0; }
}
@media (max-width: 560px) {
  .qe-svc-card { padding: var(--space-6) var(--space-4); }
  .qe-acs-list,
  .qe-case-facts { grid-template-columns: 1fr; }
  .qe-acs .qe-company-text { text-align: start; justify-self: stretch; }
  .qe-pilot-includes { padding: var(--space-5) var(--space-4); }
  .qe-svc-actions .btn,
  .qe-svc-hero .qe-about-hero-cta .btn { width: 100%; }
}
