/* ==========================================================================
   Smart.edu-gate.pro — theme inspired by Registration.edu-gate.pro
   Navy #1B3A6B · Gold #D4A843 · Plus Jakarta Sans / Tajawal · RTL ready
   ========================================================================== */
:root {
  --eg-primary: #1B3A6B;
  --eg-primary-2: #2C5AA0;
  --eg-primary-light: #3B6DB5;
  --eg-primary-dark: #0F2347;
  --eg-gold: #D4A843;
  --eg-gold-light: #E8C76A;
  --eg-gold-dark: #B8922E;
  --eg-green: #2A9D6E;
  --eg-red: #e74c3c;
  --eg-purple: #6d28d9;
  --eg-orange: #e67e22;
  --eg-ink: #0F1B2D;
  --eg-muted: #5A6878; /* 5.3:1 on paper — WCAG AA for small text (was #6B7A8D, 4.0:1) */
  --eg-gold-text: #8B6914; /* gold for TEXT on light backgrounds (5.1:1); --eg-gold stays for fills */
  --eg-green-text: #1E7A55;
  --eg-red-text: #C0392B;
  --eg-orange-text: #A65300;
  --eg-focus: #2C5AA0;
  --eg-silver: #8C9BAA;
  --eg-paper: #F4F6FA;
  --eg-card: #FFFFFF;
  --eg-line: rgba(27, 58, 107, .10);
  --eg-shadow: 0 24px 70px rgba(27, 58, 107, .12);
  --eg-soft-shadow: 0 14px 36px rgba(27, 58, 107, .07);
  --eg-gold-glow: 0 18px 40px rgba(212, 168, 67, .18);
  --eg-radius: 18px;
  --bs-primary: #1B3A6B;
  --bs-primary-rgb: 27, 58, 107;
  --bs-link-color: #2C5AA0;
  --bs-link-hover-color: #1B3A6B;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', 'Tajawal', system-ui, sans-serif;
  color: var(--eg-ink);
  background: var(--eg-paper);
  -webkit-font-smoothing: antialiased;
}
html[dir="rtl"] body { font-family: 'Tajawal', 'Plus Jakarta Sans', system-ui, sans-serif; }
a { text-decoration: none; }
.text-muted { color: var(--eg-muted) !important; }
.text-gold { color: var(--eg-gold) !important; }
.text-navy { color: var(--eg-primary) !important; }
.bg-navy { background: var(--eg-primary) !important; }
.bg-paper { background: var(--eg-paper) !important; }
.fw-800 { font-weight: 800; }
.small-caps { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }

/* ---------- buttons ---------- */
.btn { border-radius: 12px; font-weight: 600; padding: .6rem 1.2rem; }
.btn-sm { border-radius: 10px; padding: .35rem .8rem; }
.btn-primary { background: linear-gradient(135deg, var(--eg-primary), var(--eg-primary-2)); border: 0; }
.btn-primary:hover, .btn-primary:focus { background: linear-gradient(135deg, var(--eg-primary-dark), var(--eg-primary)); }
.btn-gold { background: linear-gradient(135deg, var(--eg-gold), var(--eg-gold-light)); color: var(--eg-primary-dark); border: 0; box-shadow: var(--eg-gold-glow); }
.btn-gold:hover, .btn-gold:focus { background: linear-gradient(135deg, var(--eg-gold-dark), var(--eg-gold)); color: var(--eg-primary-dark); }
.btn-outline-primary { color: var(--eg-primary); border-color: var(--eg-primary); }
.btn-outline-primary:hover { background: var(--eg-primary); border-color: var(--eg-primary); }
.btn-ghost { background: rgba(27,58,107,.06); color: var(--eg-primary); border: 0; }
.btn-ghost:hover { background: rgba(27,58,107,.12); color: var(--eg-primary); }
.btn-glass { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25); backdrop-filter: blur(6px); }
.btn-glass:hover { background: rgba(255,255,255,.2); color: #fff; }

/* ---------- navbar ---------- */
.eg-nav { background: rgba(255,255,255,.92); backdrop-filter: blur(14px); border-bottom: 1px solid var(--eg-line); z-index: 1030; }
.eg-nav .nav-link { color: var(--eg-ink); font-weight: 600; font-size: .93rem; padding: .5rem .85rem !important; border-radius: 10px; }
.eg-nav .nav-link:hover, .eg-nav .nav-link.active { color: var(--eg-primary); background: rgba(27,58,107,.06); }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; color: var(--eg-primary); font-size: 1.15rem; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--eg-primary), var(--eg-primary-2)); position: relative; box-shadow: var(--eg-soft-shadow); }
.brand-mark::after { content: ""; position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--eg-gold); top: -3px; inset-inline-end: -3px; border: 2px solid #fff; }
.brand small { display: block; font-size: .66rem; letter-spacing: .14em; color: var(--eg-gold-text); font-weight: 700; text-transform: uppercase; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: .9rem; flex-shrink: 0; }
.avatar-lg { width: 72px; height: 72px; font-size: 1.6rem; }
.search-pill { background: var(--eg-paper); border: 1px solid var(--eg-line); border-radius: 999px; padding: .45rem 1rem; min-width: 240px; }
.search-pill input { border: 0; background: transparent; outline: none; width: 100%; font-size: .9rem; }

/* ---------- hero ---------- */
.hero { background: linear-gradient(135deg, #1B3A6B 0%, #0F2347 100%); color: #fff; position: relative; overflow: hidden; padding: 90px 0 120px; }
.hero::before { content: ""; position: absolute; width: 620px; height: 620px; border-radius: 50%; background: radial-gradient(circle, rgba(212,168,67,.28), transparent 65%); top: -220px; inset-inline-end: -160px; }
.hero::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: 26px 26px; pointer-events: none; }
.hero > .container { position: relative; z-index: 2; }
.hero h1 { font-weight: 800; font-size: clamp(2.1rem, 4.4vw, 3.6rem); line-height: 1.1; letter-spacing: -.02em; }
.hero h1 .accent { background: linear-gradient(135deg, var(--eg-gold), var(--eg-gold-light)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { color: rgba(255,255,255,.78); font-size: 1.12rem; }
.hero-badge { display: inline-flex; gap: .5rem; align-items: center; padding: .4rem .9rem; border-radius: 999px; background: rgba(212,168,67,.15); color: var(--eg-gold-light); font-weight: 700; font-size: .8rem; border: 1px solid rgba(212,168,67,.35); }
.hero-stats .num { font-size: 1.8rem; font-weight: 800; color: #fff; }
.hero-stats .lbl { color: rgba(255,255,255,.6); font-size: .82rem; }
.hero-wave { position: absolute; bottom: -1px; left: 0; right: 0; z-index: 3; }

.orchestra-card { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); border-radius: 24px; padding: 22px; backdrop-filter: blur(10px); }
.orchestra-node { display: flex; align-items: center; gap: .6rem; padding: .55rem .8rem; border-radius: 12px; background: rgba(255,255,255,.08); font-size: .85rem; font-weight: 600; color: #fff; }
.orchestra-node i { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: rgba(212,168,67,.2); color: var(--eg-gold-light); }
.orchestra-core { text-align: center; padding: 14px; border-radius: 16px; background: linear-gradient(135deg, var(--eg-gold), var(--eg-gold-light)); color: var(--eg-primary-dark); font-weight: 800; box-shadow: var(--eg-gold-glow); }
.pulse { animation: pulse 2.4s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(212,168,67,.5); } 50% { box-shadow: 0 0 0 12px rgba(212,168,67,0); } }

/* ---------- sections ---------- */
.section { padding: 80px 0; }
.section-title { font-weight: 800; letter-spacing: -.01em; color: var(--eg-ink); }
.section-kicker { color: var(--eg-gold-text); font-weight: 800; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; }
.eg-card { background: var(--eg-card); border: 1px solid var(--eg-line); border-radius: var(--eg-radius); box-shadow: var(--eg-soft-shadow); }
.eg-card-hover { transition: transform .25s ease, box-shadow .25s ease; }
.eg-card-hover:hover { transform: translateY(-4px); box-shadow: var(--eg-shadow); }
.icon-tile { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; font-size: 1.35rem;
  color: var(--tile-color, var(--eg-primary)); background: color-mix(in srgb, var(--tile-color, var(--eg-primary)) 12%, white); }
.icon-tile.sm { width: 38px; height: 38px; border-radius: 11px; font-size: 1rem; }
.step-num { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: var(--eg-primary-dark); background: linear-gradient(135deg, var(--eg-gold), var(--eg-gold-light)); }

/* ---------- course cards ---------- */
.course-card { overflow: hidden; height: 100%; display: flex; flex-direction: column; }
.course-cover { height: 150px; position: relative; display: grid; place-items: center; color: #fff; font-size: 3rem;
  background: linear-gradient(135deg, var(--tile-color, var(--eg-primary)), color-mix(in srgb, var(--tile-color, var(--eg-primary)) 55%, #0F2347)); }
.course-cover::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px); background-size: 18px 18px; }
.course-cover .badge-pos { position: absolute; top: 12px; inset-inline-start: 12px; z-index: 2; }
.course-cover .ai-badge { position: absolute; bottom: 12px; inset-inline-end: 12px; z-index: 2; background: rgba(15,35,71,.55); border: 1px solid rgba(255,255,255,.25); color: #fff; font-size: .7rem; padding: .25rem .55rem; border-radius: 999px; font-weight: 700; }
.course-body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; }
.course-title { font-weight: 700; color: var(--eg-ink); font-size: 1rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-title:hover { color: var(--eg-primary); }
.stars { color: var(--eg-gold); font-size: .82rem; letter-spacing: 1px; }
.price { font-weight: 800; color: var(--eg-primary); font-size: 1.1rem; }
.badge-soft { background: rgba(27,58,107,.08); color: var(--eg-primary); font-weight: 700; border-radius: 8px; padding: .35em .6em; }
.badge-gold { background: linear-gradient(135deg, var(--eg-gold), var(--eg-gold-light)); color: var(--eg-primary-dark); font-weight: 800; border-radius: 8px; }
.badge-green { background: rgba(42,157,110,.12); color: var(--eg-green-text); font-weight: 700; border-radius: 8px; }
.badge-red { background: rgba(231,76,60,.12); color: var(--eg-red-text); font-weight: 700; border-radius: 8px; }
.badge-orange { background: rgba(230,126,34,.12); color: var(--eg-orange-text); font-weight: 700; border-radius: 8px; }
.badge-purple { background: rgba(109,40,217,.1); color: var(--eg-purple); font-weight: 700; border-radius: 8px; }

.progress { height: 8px; border-radius: 99px; background: rgba(27,58,107,.08); }
.progress-bar { background: linear-gradient(90deg, var(--eg-primary-2), var(--eg-gold)); border-radius: 99px; }

/* ---------- page header ---------- */
.page-head { background: linear-gradient(135deg, #1B3A6B, #0F2347); color: #fff; padding: 48px 0 56px; position: relative; overflow: hidden; }
.page-head::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: 24px 24px; }
.page-head > .container { position: relative; z-index: 2; }
.page-head h1 { font-weight: 800; }
.page-head .breadcrumb a { color: var(--eg-gold-light); }
.page-head .breadcrumb-item.active, .page-head .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,.6); }

/* ---------- forms ---------- */
.form-control, .form-select { border-radius: 12px; border-color: rgba(27,58,107,.16); padding: .62rem .9rem; }
.form-control:focus, .form-select:focus { border-color: var(--eg-primary-2); box-shadow: 0 0 0 .2rem rgba(44,90,160,.15); }
.form-label { font-weight: 600; font-size: .88rem; color: var(--eg-ink); }
.auth-wrap { min-height: calc(100vh - 72px); display: grid; place-items: center; padding: 40px 0; background: linear-gradient(160deg, var(--eg-paper), #fff); }
.auth-card { max-width: 980px; width: 100%; overflow: hidden; }
.auth-side { background: linear-gradient(160deg, var(--eg-primary), var(--eg-primary-dark)); color: #fff; padding: 40px; position: relative; }
.auth-side::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px); background-size: 22px 22px; }
.role-option { border: 2px solid var(--eg-line); border-radius: 14px; padding: 14px; cursor: pointer; transition: .2s; height: 100%; }
.role-option:has(input:checked) { border-color: var(--eg-gold); background: rgba(212,168,67,.08); }
.role-option { position: relative; }
/* visually hidden but still focusable & announced (display:none removed the radios from keyboard and screen readers) */
.role-option input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.role-option:has(input:focus-visible) { outline: 3px solid var(--eg-focus); outline-offset: 2px; }

/* ---------- dashboard shell ---------- */
.dash { display: flex; min-height: calc(100vh - 72px); }
.dash-side { width: 262px; flex-shrink: 0; background: linear-gradient(180deg, var(--eg-primary), var(--eg-primary-dark)); color: rgba(255,255,255,.85); padding: 22px 14px; position: sticky; top: 72px; height: calc(100vh - 72px); overflow-y: auto; }
.dash-side .side-label { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--eg-gold-light); font-weight: 800; margin: 18px 10px 8px; }
.dash-side a { display: flex; align-items: center; gap: .7rem; color: rgba(255,255,255,.78); padding: .6rem .8rem; border-radius: 11px; font-weight: 600; font-size: .9rem; }
.dash-side a:hover { background: rgba(255,255,255,.08); color: #fff; }
.dash-side a.active { background: linear-gradient(135deg, var(--eg-gold), var(--eg-gold-light)); color: var(--eg-primary-dark); }
.dash-main { flex: 1; padding: 28px; min-width: 0; }
.dash-title { font-weight: 800; margin: 0; }
.kpi { padding: 20px; border-radius: var(--eg-radius); background: #fff; border: 1px solid var(--eg-line); box-shadow: var(--eg-soft-shadow); height: 100%; position: relative; overflow: hidden; }
.kpi .kpi-label { color: var(--eg-muted); font-size: .8rem; font-weight: 600; }
.kpi .kpi-value { font-size: 1.7rem; font-weight: 800; color: var(--eg-ink); line-height: 1.2; }
.kpi .kpi-delta { font-size: .78rem; font-weight: 700; }
.kpi .kpi-icon { position: absolute; top: 16px; inset-inline-end: 16px; }
.kpi.navy { background: linear-gradient(135deg, var(--eg-primary), var(--eg-primary-dark)); color: #fff; border: 0; }
.kpi.navy .kpi-label { color: rgba(255,255,255,.7); } .kpi.navy .kpi-value { color: #fff; }
.kpi.gold { background: linear-gradient(135deg, var(--eg-gold), var(--eg-gold-light)); border: 0; }
.kpi.gold .kpi-label { color: rgba(15,35,71,.7); }
.table-eg { --bs-table-bg: transparent; margin: 0; }
.table-eg th { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--eg-muted); font-weight: 700; border-bottom: 1px solid var(--eg-line); white-space: nowrap; }
.table-eg td { vertical-align: middle; border-color: var(--eg-line); font-size: .9rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--eg-line); }
.card-head h6 { margin: 0; font-weight: 800; }
.chart-box { position: relative; height: 280px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ---------- course player ---------- */
.player { display: grid; grid-template-columns: 320px 1fr 400px; min-height: calc(100vh - 72px); }
.player-nav { background: #fff; border-inline-end: 1px solid var(--eg-line); overflow-y: auto; max-height: calc(100vh - 72px); position: sticky; top: 72px; }
.player-nav .sec { padding: 12px 18px; font-weight: 800; font-size: .82rem; background: var(--eg-paper); border-bottom: 1px solid var(--eg-line); }
.player-nav a.lesson { display: flex; gap: .6rem; padding: 10px 18px; color: var(--eg-ink); font-size: .88rem; border-bottom: 1px solid var(--eg-line); align-items: flex-start; }
.player-nav a.lesson:hover { background: rgba(27,58,107,.04); }
.player-nav a.lesson.active { background: rgba(212,168,67,.12); border-inline-start: 4px solid var(--eg-gold); }
.player-nav a.lesson .done { color: var(--eg-green); }
.player-content { padding: 32px 40px; min-width: 0; }
.player-chat { border-inline-start: 1px solid var(--eg-line); background: #fff; position: sticky; top: 72px; height: calc(100vh - 72px); display: flex; flex-direction: column; }
.lesson-body { font-size: 1.02rem; line-height: 1.8; }
.lesson-body h3, .lesson-body h4 { font-weight: 800; margin-top: 1.4rem; }
/* lesson pictures: emoji-art icons beside headings, wider illustrations, vocabulary tables */
.md-icon { display: block; height: 4.5rem; width: auto; margin: .35rem 0 .6rem; }
.md-img { display: block; max-width: 100%; height: auto; border-radius: 12px; margin: .6rem 0; }
.lesson-body > .md-icon:first-child, .lesson-body > p:first-child > .md-icon:only-child, .st-slide-body > p:first-child > .md-icon:only-child { height: 6.5rem; }
.md-table { width: auto; min-width: 60%; }
.md-table th { background: #f3f6fb; }
.lesson-body pre.code, .md pre.code { background: #0F1B2D; color: #E8C76A; padding: 16px; border-radius: 12px; overflow-x: auto; font-size: .86rem; direction: ltr; text-align: left; }
.lesson-body code, .md code { background: rgba(27,58,107,.08); color: var(--eg-primary); padding: .1rem .35rem; border-radius: 6px; font-size: .88em; }
.lesson-body pre code, .md pre code { background: none; color: inherit; padding: 0; }
.video-frame { aspect-ratio: 16/9; border-radius: 16px; overflow: hidden; background: #0F1B2D; box-shadow: var(--eg-shadow); }
.video-frame iframe { width: 100%; height: 100%; border: 0; }

/* ---------- smart chat ---------- */
.chat-head { padding: 14px 16px; border-bottom: 1px solid var(--eg-line); background: linear-gradient(135deg, var(--eg-primary), var(--eg-primary-dark)); color: #fff; }
.chat-modes { display: flex; gap: 6px; overflow-x: auto; padding: 10px 12px; border-bottom: 1px solid var(--eg-line); scrollbar-width: thin; }
.chat-modes button { border: 1px solid var(--eg-line); background: #fff; border-radius: 999px; font-size: .78rem; font-weight: 700; padding: .3rem .75rem; white-space: nowrap; color: var(--eg-primary); }
.chat-modes button.active { background: var(--eg-primary); color: #fff; border-color: var(--eg-primary); }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; background: var(--eg-paper); }
.msg { margin-bottom: 14px; display: flex; gap: 10px; }
.msg.user { flex-direction: row-reverse; }
.msg .bubble { max-width: 88%; padding: 12px 14px; border-radius: 16px; font-size: .9rem; line-height: 1.6; }
.msg.user .bubble { background: linear-gradient(135deg, var(--eg-primary), var(--eg-primary-2)); color: #fff; border-end-end-radius: 4px; }
.msg.bot .bubble { background: #fff; border: 1px solid var(--eg-line); border-end-start-radius: 4px; box-shadow: 0 4px 14px rgba(27,58,107,.05); }
.msg .bot-avatar { width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; background: linear-gradient(135deg, var(--eg-gold), var(--eg-gold-light)); color: var(--eg-primary-dark); }
.md h3, .md h4, .md h5 { font-size: 1rem; font-weight: 800; margin: .6rem 0 .35rem; color: var(--eg-primary); }
.md p { margin-bottom: .5rem; } .md ul, .md ol { padding-inline-start: 1.2rem; margin-bottom: .5rem; }
.md table { width: 100%; font-size: .85rem; margin: .4rem 0; } .md td, .md th { border: 1px solid var(--eg-line); padding: 4px 8px; }
.md hr { margin: .6rem 0; opacity: .15; }
.md .cite { display: inline-block; font-size: .7rem; font-weight: 800; background: rgba(212,168,67,.18); color: var(--eg-gold-text); border-radius: 6px; padding: 0 .35rem; cursor: help; }
.chain { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; align-items: center; }
.chain .node { font-size: .68rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; background: rgba(27,58,107,.07); color: var(--eg-primary); display: inline-flex; gap: .25rem; align-items: center; }
.chain .arrow { color: var(--eg-silver); font-size: .7rem; }
html[dir="rtl"] .chain .arrow { transform: scaleX(-1); }
.msg-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; font-size: .72rem; color: var(--eg-muted); }
.conf { display: inline-flex; align-items: center; gap: 4px; }
.conf .bar { width: 46px; height: 5px; border-radius: 9px; background: rgba(27,58,107,.1); overflow: hidden; }
.conf .bar span { display: block; height: 100%; }
.sources { margin-top: 8px; border-top: 1px dashed var(--eg-line); padding-top: 6px; }
.sources a { display: block; font-size: .75rem; color: var(--eg-primary-2); }
.fb-btn { border: 0; background: none; color: var(--eg-muted); padding: 0 6px; min-width: 32px; min-height: 32px; border-radius: 8px; }
.fb-btn:hover, .fb-btn.on, .fb-btn[aria-pressed="true"] { color: var(--eg-primary); background: rgba(27,58,107,.08); }
.chat-input { padding: 12px; border-top: 1px solid var(--eg-line); background: #fff; }
.chat-input textarea { resize: none; border-radius: 14px; font-size: .9rem; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--eg-silver); display: inline-block; margin: 0 2px; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,80%,100% { opacity: .3; } 40% { opacity: 1; } }
.trace { font-size: .7rem; color: var(--eg-muted); background: var(--eg-paper); border-radius: 8px; padding: 6px 8px; margin-top: 6px; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.suggest button { border: 1px dashed rgba(27,58,107,.25); background: #fff; border-radius: 999px; font-size: .78rem; padding: .3rem .7rem; color: var(--eg-primary); }

/* ---------- quiz ---------- */
.q-card { padding: 22px; margin-bottom: 16px; }
.q-option { display: flex; gap: .7rem; align-items: center; padding: 12px 14px; border: 1.5px solid var(--eg-line); border-radius: 12px; margin-bottom: 8px; cursor: pointer; transition: .15s; }
.q-option:hover { border-color: var(--eg-primary-2); }
.q-option:has(input:checked) { border-color: var(--eg-gold); background: rgba(212,168,67,.08); }
.q-option.correct { border-color: var(--eg-green); background: rgba(42,157,110,.08); }
.q-option.wrong { border-color: var(--eg-red); background: rgba(231,76,60,.06); }
.score-ring { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; margin: auto;
  background: conic-gradient(var(--ring-color, var(--eg-green)) calc(var(--p) * 1%), rgba(27,58,107,.08) 0); }
.score-ring > div { width: 120px; height: 120px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 800; font-size: 2rem; }

/* ---------- skills ---------- */
.skill-row { display: grid; grid-template-columns: 180px 1fr 50px; gap: 12px; align-items: center; margin-bottom: 10px; font-size: .88rem; }
.plan-week { border-inline-start: 3px solid var(--eg-gold); padding-inline-start: 18px; margin-bottom: 22px; position: relative; }
.plan-week::before { content: ""; position: absolute; inset-inline-start: -8px; top: 4px; width: 13px; height: 13px; border-radius: 50%; background: var(--eg-gold); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--eg-gold); }
.plan-item { display: flex; gap: 10px; align-items: center; padding: 9px 12px; background: #fff; border: 1px solid var(--eg-line); border-radius: 11px; margin-bottom: 6px; font-size: .88rem; }

/* ---------- certificate ---------- */
.certificate { max-width: 1000px; margin: 30px auto; background: #fff; padding: 56px 64px; border: 12px solid var(--eg-primary); outline: 3px solid var(--eg-gold); outline-offset: -26px; position: relative; text-align: center; }
.certificate h1 { font-weight: 800; color: var(--eg-primary); letter-spacing: .08em; }
.certificate .name { font-size: 2.6rem; font-weight: 800; color: var(--eg-ink); border-bottom: 2px solid var(--eg-gold); display: inline-block; padding: 0 30px 6px; }
.certificate .seal { width: 110px; height: 110px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--eg-gold), var(--eg-gold-light)); color: var(--eg-primary-dark); font-size: 2.6rem; margin: 0 auto; box-shadow: var(--eg-gold-glow); }
@media print { .no-print { display: none !important; } body { background: #fff; } .certificate { margin: 0; } }

/* ---------- footer ---------- */
.eg-footer { background: var(--eg-primary-dark); color: rgba(255,255,255,.7); padding: 60px 0 24px; }
.eg-footer h6 { color: #fff; font-weight: 800; margin-bottom: 14px; }
.eg-footer a { color: rgba(255,255,255,.7); display: block; padding: 3px 0; font-size: .9rem; }
.eg-footer a:hover { color: var(--eg-gold-light); }

/* ---------- misc ---------- */
.flash-wrap { position: fixed; top: 84px; inset-inline-end: 20px; z-index: 2000; max-width: 380px; }
.empty { text-align: center; padding: 48px 20px; color: var(--eg-muted); }
.empty i { font-size: 2.6rem; color: var(--eg-silver); }
.agent-card { padding: 20px; height: 100%; }
.pricing-card { padding: 32px; height: 100%; }
.pricing-card.featured { border: 2px solid var(--eg-gold); transform: scale(1.03); box-shadow: var(--eg-shadow); }
.check-list li { list-style: none; padding: 5px 0; } .check-list { padding: 0; }
.check-list li i { color: var(--eg-green); margin-inline-end: 8px; }
.filter-card { position: sticky; top: 90px; }
.nav-pills .nav-link { border-radius: 10px; font-weight: 600; color: var(--eg-primary); }
.nav-pills .nav-link.active { background: var(--eg-primary); }
.draft-box { white-space: pre-wrap; font-size: .9rem; background: var(--eg-paper); border-radius: 12px; padding: 14px; max-height: 420px; overflow: auto; }
.timeline-item { border-inline-start: 2px solid var(--eg-line); padding: 0 0 14px 16px; position: relative; font-size: .88rem; }
html[dir="rtl"] .timeline-item { padding: 0 16px 14px 0; }
.timeline-item::before { content: ""; position: absolute; inset-inline-start: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--eg-primary-2); }

@media (max-width: 1399px) { .player { grid-template-columns: 280px 1fr 360px; } }
@media (max-width: 1199px) {
  .player { grid-template-columns: 1fr; }
  .player-nav, .player-chat { position: static; height: auto; max-height: none; }
  .player-chat { height: 640px; }
}
@media (max-width: 991px) {
  .dash { flex-direction: column; }
  .dash-side { width: 100%; height: auto; position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .dash-side .side-label { width: 100%; margin: 6px; }
  .dash-main { padding: 18px; }
  .skill-row { grid-template-columns: 120px 1fr 40px; }
  .certificate { padding: 30px; }
}

/* ---------- Smart-Edu-Gate brand lockup ---------- */
.brand-lockup { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-word { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; font-weight: 800; letter-spacing: -.02em; color: #0B2E7A; font-size: 1.28rem; }
.brand-word .gold { background: linear-gradient(135deg, #E08A00, #FFC52A); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-tag { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; font-size: .52rem; letter-spacing: .28em; color: #3a4658; font-weight: 700; margin-top: .3rem; white-space: nowrap; }
.brand-tag i { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: #E0A100; vertical-align: middle; margin: 0 .25rem; }
.brand-footer .brand-word { color: #fff; font-size: 1.5rem; } .brand-footer .brand-tag { color: rgba(255,255,255,.7); }
.brand-hero .brand-word, .brand-certificate .brand-word { font-size: 2.2rem; } .brand-certificate .brand-tag { font-size: .7rem; }
.brand-logo img { display: block; } .brand-logo.on-dark { background: #fff; border-radius: 14px; padding: 6px 10px; display: inline-block; }
@media (max-width: 575px) { .brand-nav .brand-tag { display: none; } .brand-nav .brand-word { font-size: 1.05rem; } }
/* ---------- AI-native course hub & AI Lab ---------- */
.course-hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.hub-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 14px; background: #fff; border: 1px solid var(--eg-line); color: var(--eg-primary); font-size: .74rem; font-weight: 700; text-align: center; transition: .15s; }
.hub-tile i { font-size: 1.25rem; color: var(--eg-gold-dark); }
.hub-tile:hover { border-color: var(--eg-gold); box-shadow: var(--eg-gold-glow); color: var(--eg-primary); }
.hub-tile.active { background: linear-gradient(135deg, var(--eg-primary), var(--eg-primary-2)); color: #fff; border-color: transparent; }
.hub-tile.active i { color: var(--eg-gold-light); }
.hub-tile.disabled { opacity: .45; pointer-events: none; }
.lab-card { border: 2px solid rgba(109,40,217,.25); }
.lab-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.academy-card .emoji { font-size: 2rem; line-height: 1; }
.flagship-badge { background: linear-gradient(135deg, #0B2E7A, #1F5BC0); color: #FFC52A; font-weight: 800; border-radius: 8px; font-size: .7rem; padding: .3em .55em; }
/* ---------- help center ---------- */
.help-doc table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .88rem; display: block; overflow-x: auto; }
.help-doc th, .help-doc td { border: 1px solid var(--eg-line); padding: 6px 10px; }
.help-doc th { background: var(--eg-paper); }
.help-doc h3 { color: var(--eg-primary); margin-top: 1.6rem; } .help-doc h4 { margin-top: 1.4rem; }
.help-doc blockquote, .help-doc p:has(> strong:first-child) { unicode-bidi: plaintext; }
.help-doc p, .help-doc li { unicode-bidi: plaintext; text-align: start; }

/* ---------- Accessibility Agent (A22) preferences ---------- */
/* text size scales the root: Bootstrap sizes everything in rem, so a body font-size alone changed almost nothing */
html.a11y-large { font-size: 112.5%; }
html.a11y-xlarge { font-size: 125%; }
body.a11y-contrast { --eg-paper: #ffffff; --eg-muted: #1a1a1a; --eg-line: rgba(0,0,0,.55); --eg-gold-text: #5c4400; --eg-focus: #000; color: #000; }
body.a11y-contrast .form-control, body.a11y-contrast .form-select, body.a11y-contrast .btn-ghost { border: 2px solid #000 !important; }
body.a11y-contrast .dash-side a:not(.active), body.a11y-contrast .eg-footer a { color: #fff; text-decoration: underline; }
body.a11y-contrast :focus-visible { outline: 4px solid #000 !important; box-shadow: 0 0 0 7px #ffd400 !important; }
body.a11y-contrast .text-muted, body.a11y-contrast .text-white-50 { color: #1a1a1a !important; }
body.a11y-contrast a { text-decoration: underline; }
body.a11y-contrast .eg-card { border: 2px solid #000 !important; box-shadow: none !important; }
body.a11y-dyslexia { font-family: "Verdana", "Tahoma", "Segoe UI", sans-serif; letter-spacing: .03em; word-spacing: .12em; line-height: 1.8; }
body.a11y-dyslexia p, body.a11y-dyslexia li { max-width: 72ch; }
body.a11y-reduce-motion *, body.a11y-reduce-motion *::before, body.a11y-reduce-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) { [data-aos] { opacity: 1 !important; transform: none !important; } }

/* ---------- L-E-A-R-N loop & remediation steps ---------- */
.learn-loop { display: flex; flex-direction: column; gap: 14px; }
.learn-loop .step { display: flex; gap: 12px; align-items: flex-start; }
.learn-loop .num { flex: 0 0 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--eg-gold, #D4A843); color: #0F2347; font-weight: 800; }
.learn-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.learn-strip button { border: 1px solid rgba(27,58,107,.15); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: .85rem; display: inline-flex; gap: 6px; align-items: center; }
.learn-strip button b { color: var(--eg-gold, #D4A843); font-size: 1rem; }
.learn-strip button:hover { border-color: var(--eg-gold, #D4A843); }

/* ---------- notification bell ---------- */
.nav-bell { position: relative; }
.nav-bell .dot { position: absolute; top: 2px; inset-inline-end: 0; min-width: 16px; height: 16px; border-radius: 8px; background: var(--eg-red-text); color: #fff; font-size: .65rem; display: grid; place-items: center; padding: 0 4px; }
.discussion-post { border-inline-start: 3px solid rgba(27,58,107,.12); padding-inline-start: 12px; }
.discussion-post.ai { border-color: var(--eg-gold, #D4A843); }

/* ---------- payments, reports & operations ---------- */
.method-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap;
  color: var(--m, #1B3A6B); background: color-mix(in srgb, var(--m, #1B3A6B) 12%, transparent); }
.pay-option { cursor: pointer; border: 2px solid #e3e8f0; border-radius: 14px; padding: 14px; display: flex; gap: 12px; align-items: flex-start; transition: .15s; height: 100%; }
.pay-option:hover { border-color: #D4A843; }
.pay-option input { margin-top: 4px; }
.pay-option:has(input:checked) { border-color: #D4A843; background: #fffaf0; box-shadow: 0 6px 18px rgba(212,168,67,.18); }
.pay-option.disabled { opacity: .5; cursor: not-allowed; }
.pay-fields { display: none; }
.pay-fields.show { display: block; }
.voucher { border: 2px dashed #D4A843; border-radius: 16px; padding: 18px; background: #fffdf7; }
.voucher .ref { font-size: 1.6rem; font-weight: 800; letter-spacing: .06em; color: #1B3A6B; }
.kv { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 6px 14px; font-size: .9rem; }
.kv dt { color: var(--eg-muted); font-weight: 600; }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.timeline-mini { list-style: none; padding: 0; margin: 0; }
.timeline-mini li { position: relative; padding-inline-start: 18px; padding-bottom: 10px; font-size: .85rem; }
.timeline-mini li::before { content: ''; position: absolute; inset-inline-start: 3px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: #D4A843; }
.wf-row.overdue { background: #fff5f5; }
.agent-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.console-out { white-space: pre-wrap; background: #0F1B2D; color: #E8EEF7; border-radius: 12px; padding: 14px; font-size: .88rem; max-height: 420px; overflow: auto; }
.report-meta { font-size: .8rem; color: var(--eg-muted); }
@media print {
  .eg-navbar, .navbar, .dash-side, .flash-wrap, .nav-pills, form.no-print, .btn, footer, .eg-footer { display: none !important; }
  .dash { display: block !important; }
  .dash-main { padding: 0 !important; margin: 0 !important; width: 100% !important; }
  .eg-card { box-shadow: none !important; border: 1px solid #dde3ec !important; break-inside: avoid; }
  .table-responsive { max-height: none !important; overflow: visible !important; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
.pw-reset > summary { list-style: none; } .pw-reset > summary::-webkit-details-marker { display: none; } .pw-reset[open] > form { position: absolute; z-index: 20; inset-inline-end: 1rem; }

/* ---------- human trainers: directory, profile page, photos ---------- */
.avatar-img { object-fit: cover; background: #E9EEF6; padding: 0; }
.avatar-xl { width: 120px; height: 120px; font-size: 2.6rem; }
.avatar-xxl { width: 148px; height: 148px; font-size: 3.2rem; border: 4px solid rgba(255,255,255,.85); box-shadow: 0 10px 30px rgba(15,35,71,.25); }
.trainer-card { position: relative; display: flex; flex-direction: column; align-items: center; }
.trainer-card .trainer-featured { position: absolute; top: 12px; inset-inline-end: 12px; }
.trainer-photo-link { border-radius: 50%; transition: transform .2s ease, box-shadow .2s ease; }
.trainer-photo-link:hover, .trainer-photo-link:focus-visible { transform: scale(1.04); box-shadow: 0 0 0 4px rgba(212,168,67,.45); outline: none; }
.trainer-domain { color: var(--eg-gold-text); font-weight: 600; font-size: .85rem; }
.text-gold-light { color: #E8C76A; }
@media (max-width: 575.98px) { .avatar-xxl { width: 112px; height: 112px; font-size: 2.4rem; } }
@media (prefers-reduced-motion: reduce) { .trainer-photo-link { transition: none; } .trainer-photo-link:hover { transform: none; } }

/* ---------- Home-page Smart-Edu-Gate Chatbot (floating) ---------- */
.public-chat { position: fixed; inset-inline-end: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 1900; }
.public-chat .pc-launcher { border-radius: 999px; padding: .7rem 1.1rem; font-weight: 700; }
.public-chat .pc-panel { width: min(390px, calc(100vw - 32px)); height: min(580px, calc(100vh - 120px)); display: flex; flex-direction: column; overflow: hidden; padding: 0; box-shadow: 0 18px 50px rgba(15,35,71,.25); }
.public-chat .pc-panel[hidden], .public-chat .pc-launcher[hidden] { display: none !important; }
@media (max-width: 480px) { .public-chat { inset-inline-end: 16px; } }

/* ==========================================================================
   Accessibility & UX layer (WCAG 2.2 AA): skip link, focus, landmarks, motion,
   mobile dashboard menu, quick accessibility menu, AI vision & AI images
   ========================================================================== */
.skip-link { position: absolute; inset-inline-start: 12px; top: -80px; z-index: 3000; background: var(--eg-primary-dark); color: #fff; padding: .65rem 1.1rem; border-radius: 10px; font-weight: 700; box-shadow: var(--eg-shadow); }
.skip-link:focus { top: 12px; color: #fff; }
#main:focus { outline: none; }
[id] { scroll-margin-top: 88px; }
:focus-visible { outline: 3px solid var(--eg-focus); outline-offset: 2px; }
.btn:focus-visible, .nav-link:focus-visible, .dropdown-item:focus-visible { outline: 3px solid var(--eg-focus); outline-offset: 2px; box-shadow: none; }
.dash-side a:focus-visible, .hero :focus-visible, .page-head :focus-visible, .eg-footer :focus-visible, .chat-head :focus-visible, .kpi.navy :focus-visible, .auth-side :focus-visible { outline-color: var(--eg-gold-light); }
/* links inside running text are underlined (colour alone is not enough — WCAG 1.4.1) */
.md a, .lesson-body a, .help-doc a, .prose a { text-decoration: underline; text-underline-offset: 2px; }
.stars { display: inline-flex; gap: 1px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .eg-card-hover:hover { transform: none; }
}
html.a11y-reduce-motion { scroll-behavior: auto; }
html.a11y-reduce-motion [data-aos] { opacity: 1 !important; transform: none !important; }
label:has(> input[data-attach]:focus-visible) { outline: 3px solid var(--eg-focus); outline-offset: 2px; }

/* mobile dashboard: the side menu collapses behind a toggle instead of pushing the page below a wall of links */
.dash-toggle { display: none; }
@media (max-width: 991px) {
  .dash-toggle { display: flex; align-items: center; gap: .6rem; width: 100%; border: 0; padding: .8rem 1rem; color: #fff; font-weight: 700; text-align: start;
    background: linear-gradient(135deg, var(--eg-primary), var(--eg-primary-dark)); }
  .dash-toggle .bi-chevron-down { margin-inline-start: auto; transition: transform .2s; }
  .dash-toggle[aria-expanded="true"] .bi-chevron-down { transform: rotate(180deg); }
  .js .dash-side:not(.open) { display: none; }
  .dash-side a { flex: 1 1 calc(50% - 4px); min-height: 44px; }
}
@media (max-width: 480px) { .dash-side a { flex-basis: 100%; } }

/* quick accessibility menu (navbar) */
.a11y-menu { width: min(320px, calc(100vw - 24px)); }
.a11y-menu .seg { display: flex; gap: 4px; }
.a11y-menu .seg label { flex: 1; text-align: center; border: 1.5px solid var(--eg-line); border-radius: 10px; padding: .35rem 0; cursor: pointer; font-weight: 700; position: relative; }
.a11y-menu .seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.a11y-menu .seg label:has(input:checked) { border-color: var(--eg-primary); background: rgba(27,58,107,.08); color: var(--eg-primary); }
.a11y-menu .seg label:has(input:focus-visible) { outline: 3px solid var(--eg-focus); outline-offset: 1px; }

/* chat: live updates, read-aloud and image attachments (AI Vision) */
.chat-attach-preview { display: flex; align-items: center; gap: .5rem; padding: .35rem .5rem; margin-bottom: .4rem; border: 1px dashed var(--eg-line); border-radius: 12px; background: var(--eg-paper); font-size: .78rem; }
.chat-attach-preview img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.msg .bubble img.msg-img { max-width: 160px; max-height: 120px; border-radius: 10px; display: block; margin-bottom: 6px; }
.flag-form { display: flex; gap: 6px; margin-top: 8px; }
.flag-form input { font-size: .8rem; }

/* course covers: uploaded or AI-generated images (always with alt text and an AI label) */
.course-cover img.cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.course-cover:has(img.cover-img)::after { display: none; }
.ai-image-label { position: absolute; bottom: 10px; inset-inline-start: 10px; z-index: 3; background: rgba(15,35,71,.78); color: #fff; font-size: .68rem; font-weight: 700; padding: .2rem .5rem; border-radius: 999px; }
.cover-preview { aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; position: relative; background: var(--eg-paper); display: grid; place-items: center; max-width: 100%; }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.cover-preview.course-cover { height: auto; }
.course-card h3 { font-size: 1rem; }

/* roles & components page, accessibility compliance icon */
.a11y-badge { display: inline-block; line-height: 0; border-radius: 12px; }
.a11y-badge img { display: block; height: 48px; width: auto; }
.a11y-chip { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; font-size: .72rem; font-weight: 800; color: var(--eg-green-text); background: rgba(30,122,85,.1); border: 1px solid rgba(30,122,85,.35); border-radius: 999px; padding: .15rem .55rem; text-decoration: none; }
.a11y-chip:hover { background: rgba(30,122,85,.18); color: var(--eg-green-text); }
.role-card { overflow: hidden; display: flex; flex-direction: column; }
.role-art { position: relative; aspect-ratio: 16 / 10; display: grid; place-items: center; color: #fff; font-size: 3.2rem;
  background: linear-gradient(135deg, var(--tile-color, var(--eg-primary)), color-mix(in srgb, var(--tile-color, var(--eg-primary)) 50%, #0F2347)); }
.role-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.role-art-a11y { position: absolute; top: 10px; inset-inline-end: 10px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 1.15rem; color: #fff; background: rgba(15,35,71,.8); border: 2px solid var(--eg-gold-light); }

/* ---------- lesson pictures: zoomable pictures, figure galleries, picture viewer, lesson jump list ---------- */
.md-pic { position: relative; display: block; margin: .9rem 0; }
.md-pic > .md-img { margin: 0; cursor: zoom-in; background: #fff; border: 1px solid var(--eg-line); box-shadow: 0 4px 18px rgba(15,35,71,.10); transition: box-shadow .15s, transform .15s; }
.md-pic > .md-img:hover { box-shadow: 0 10px 28px rgba(15,35,71,.18); }
.md-pic > .md-img:focus-visible { outline: 3px solid var(--eg-gold); outline-offset: 3px; }
.md-pic-zoom { position: absolute; inset-block-start: .55rem; inset-inline-end: .55rem; width: 2.3rem; height: 2.3rem; border-radius: 50%; background: rgba(15,35,71,.78); color: #fff; display: grid; place-items: center; pointer-events: none; font-size: 1rem; }
.md-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; margin: .8rem 0 1.4rem; counter-reset: fig; }
.md-gallery .md-pic { margin: 0; counter-increment: fig; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--eg-line); border-radius: 14px; padding: .45rem; transition: border-color .15s, box-shadow .15s; }
.md-gallery .md-pic:hover { border-color: var(--eg-gold); box-shadow: var(--eg-gold-glow, 0 6px 20px rgba(212,168,67,.25)); }
.md-gallery .md-pic::before { content: counter(fig); position: absolute; inset-block-start: .7rem; inset-inline-start: .7rem; z-index: 1; min-width: 1.6rem; height: 1.6rem; padding: 0 .35rem; border-radius: 999px; background: var(--eg-gold); color: #0F2347; font-weight: 800; font-size: .78rem; display: grid; place-items: center; }
.md-gallery .md-img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; border: 0; border-radius: 10px; box-shadow: none; background: var(--eg-paper); }
.md-gallery .md-pic-zoom { inset-block-start: .7rem; inset-inline-end: .7rem; width: 2rem; height: 2rem; font-size: .85rem; }
.md-pic-cap { font-size: .78rem; line-height: 1.4; color: var(--eg-muted); margin-top: .4rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.st-slide-body .md-gallery { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.lesson-body .md-h-icon { display: inline-block; height: 2.6rem; width: auto; margin: 0; margin-inline-end: .55rem; vertical-align: middle; }
.lesson-body h4, .lesson-body h5 { scroll-margin-top: 90px; }
.lesson-body h4 { padding-top: .9rem; border-top: 1px dashed var(--eg-line); }
.lesson-body > h4:first-child { border-top: 0; padding-top: 0; }
.lesson-toc { margin-bottom: 1.1rem; }
.lesson-toc .toc-label { font-size: .8rem; font-weight: 800; color: var(--eg-muted); margin-bottom: .35rem; }
.lesson-toc .toc-chips { display: flex; gap: .45rem; overflow-x: auto; padding-bottom: .35rem; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.lesson-toc a { flex: 0 0 auto; max-width: 17rem; scroll-snap-align: start; display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .8rem; border: 1px solid var(--eg-line); border-radius: 999px; background: #fff; color: var(--eg-primary); font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; min-height: 44px; }
.lesson-toc a:hover, .lesson-toc a:focus-visible { border-color: var(--eg-gold); }
.lesson-toc a img { height: 1.35rem; width: auto; flex: 0 0 auto; }
.lesson-toc a span { overflow: hidden; text-overflow: ellipsis; }
.concept-chips button.badge { cursor: pointer; font-size: .8rem; padding: .45em .75em; }
.concept-chips button.badge:hover { box-shadow: 0 0 0 2px var(--eg-gold); }

.eg-lightbox { position: fixed; inset: 0; z-index: 2000; background: rgba(8,14,28,.95); color: #fff; display: grid; grid-template-rows: auto 1fr auto; }
.eg-lightbox[hidden] { display: none; }
body.lb-open { overflow: hidden; }
.eg-lightbox .lb-bar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: calc(.5rem + env(safe-area-inset-top, 0px)) .75rem .5rem; }
.eg-lightbox .lb-count { font-weight: 700; font-size: .9rem; }
.eg-lightbox .lb-tools { display: flex; gap: .35rem; }
.eg-lightbox button.lb-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; display: grid; place-items: center; font-size: 1.15rem; }
.eg-lightbox button.lb-btn:hover, .eg-lightbox button.lb-btn:focus-visible { background: rgba(255,255,255,.2); outline: 2px solid var(--eg-gold); }
.eg-lightbox .lb-stage { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; touch-action: none; user-select: none; }
.eg-lightbox .lb-img { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center center; transition: transform .18s ease-out; background: #fff; border-radius: 6px; cursor: zoom-in; }
.eg-lightbox .lb-img.zoomed { cursor: grab; }
.eg-lightbox .lb-img.dragging { transition: none; cursor: grabbing; }
.eg-lightbox .lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; }
.eg-lightbox .lb-prev { inset-inline-start: .6rem; }
.eg-lightbox .lb-next { inset-inline-end: .6rem; }
.eg-lightbox .lb-foot { padding: .6rem 1rem calc(.8rem + env(safe-area-inset-bottom, 0px)); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .9rem; }
.eg-lightbox .lb-cap { font-size: .95rem; line-height: 1.5; flex: 1 1 16rem; }
.eg-lightbox .lb-hint { font-size: .75rem; color: rgba(255,255,255,.7); flex-basis: 100%; order: 3; }
@media (prefers-reduced-motion: reduce) { .eg-lightbox .lb-img, .md-pic > .md-img { transition: none; } }
html.a11y-reduce-motion .eg-lightbox .lb-img { transition: none; }

/* small screens: the lesson first, then the Smart Instructor, then the course outline */
.player-outline-link { display: none; }
@media (max-width: 1199px) {
  .player-content { order: 1; }
  .player-chat { order: 2; }
  .player-nav { order: 3; }
  .player-outline-link { display: inline-flex; align-items: center; gap: .35rem; }
}
@media (max-width: 575px) {
  .player-content { padding: 16px 14px; }
  .lesson-body { font-size: 1rem; line-height: 1.75; }
  .lesson-body .md-h-icon { height: 2.1rem; }
  .course-hub { display: flex; overflow-x: auto; padding-bottom: 4px; }
  .course-hub .hub-tile { flex: 0 0 86px; }
  .learn-strip { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .learn-strip button { flex: 0 0 auto; min-height: 40px; }
  .md-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .eg-lightbox .lb-nav { display: none; }
}
