/**
 * Elevate LMS — server-rendered surface styles.
 *
 * FLAT PROFESSIONAL design, matching the React webapp/dashboard (the `--pge-*`
 * token system in src/styles.css): white cards, slate hairline borders, subtle
 * shadows, indigo primary, Outfit/Inter type. (The legacy neumorphic look was
 * replaced per design review — the student LMS now renders as React tabs inside
 * the real dashboard; these styles cover the parent portal and any SSR
 * fallback so every Elevate surface looks like the app.)
 *
 * Scoped under .pge-elevate. The `--pgl-*` set below is Elevate's LOCAL
 * vocabulary: each one aliases a global `--pge-*` token but carries a hard
 * fallback, so this file still renders on surfaces where src/styles.css was
 * never enqueued (the parent portal, any SSR fallback). Enqueued only on LMS
 * surfaces.
 *
 * The local set is prefixed `--pgl-` rather than `--pge-` for a mechanical
 * reason: the globals used to be `--tb-*`, so prefix alone told the two layers
 * apart. Once the testbook namespace was retired and the globals became
 * `--pge-*`, every alias here read `--pge-ui-bg: var(--pge-ui-bg, …)` — a custom
 * property referencing itself, which CSS treats as invalid at computed-value
 * time. The whole scoped palette would have silently evaluated to nothing.
 */

.pge-elevate {
	--pgl-bg: var(--pge-ui-bg, #f8fafc);
	--pgl-surface: var(--pge-ui-surface, #ffffff);
	--pgl-border: var(--pge-ui-border, #e2e8f0);
	--pgl-border-hover: var(--pge-ui-border-hover, #cbd5e1);
	--pgl-primary: var(--pge-ui-primary, #2563eb);
	--pgl-primary-light: var(--pge-ui-primary-light, #eff4ff);
	--pgl-ink: var(--pge-ui-text-main, #0f172a);
	--pgl-ink-soft: var(--pge-ui-text-secondary, #334155);
	--pgl-ink-muted: var(--pge-ui-text-muted, #64748b);
	--pgl-success: #15803d; --pgl-success-bg: var(--pge-ui-success-light, #f0fdf4);
	--pgl-warning: #b45309; --pgl-warning-bg: var(--pge-ui-warning-light, #fffbeb);
	--pgl-danger: #b91c1c; --pgl-danger-bg: var(--pge-ui-danger-light, #fef2f2);
	--pgl-shadow: var(--pge-ui-shadow-sm, 0 1px 2px rgb(0 0 0 / .05));
	/* Both read the GLOBAL ladder one step up, which is what the pre-rename
	   code did (--tb-radius-lg / --tb-radius-xl). Pointing --pgl-radius at the
	   local --pgl-radius-lg instead would quietly shift every small corner in
	   Elevate up to the large radius. */
	--pgl-radius: var(--pge-ui-radius-lg, 12px);
	--pgl-radius-lg: var(--pge-ui-radius-xl, 16px);
	--pgl-display: 'Outfit', var(--pge-ui-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
	--pgl-sans: var(--pge-ui-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);

	background: var(--pgl-bg); color: var(--pgl-ink);
	font-family: var(--pgl-sans); -webkit-font-smoothing: antialiased;
	padding: 24px; border-radius: var(--pgl-radius-lg);
}
.pge-elevate * { box-sizing: border-box; }
.pge-elevate h1, .pge-elevate h2, .pge-elevate h3, .pge-elevate h4 { font-family: var(--pgl-display); margin: 0; color: var(--pgl-ink); }
.pge-elevate .pge-mono { font-variant-numeric: tabular-nums; }
.pge-elevate .pge-muted { color: var(--pgl-ink-muted); }

.pge-elevate .pge-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.pge-elevate .pge-grid { display: grid; gap: 16px; }
.pge-elevate .pge-g2 { grid-template-columns: repeat(2, 1fr); }
.pge-elevate .pge-g3 { grid-template-columns: repeat(3, 1fr); }
.pge-elevate .pge-g4 { grid-template-columns: repeat(4, 1fr); }

/* Card / panel — flat white with hairline border */
.pge-elevate .pge-panel { background: var(--pgl-surface); border: 1px solid var(--pgl-border); border-radius: var(--pgl-radius-lg); box-shadow: var(--pgl-shadow); padding: 24px; }

.pge-elevate .pge-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.pge-elevate .pge-head h1 { font-size: clamp(20px, 3vw, 26px); font-weight: 700; }
.pge-elevate .pge-head .pge-sub { color: var(--pgl-ink-muted); font-size: 14px; margin-top: 6px; }

/* Buttons — flat, matching .pge-btn */
.pge-elevate .pge-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--pgl-border); cursor: pointer; font: 600 14px/1 var(--pgl-sans); padding: 10px 18px; border-radius: var(--pge-ui-radius-pill, 999px); color: var(--pgl-ink-soft); background: var(--pgl-surface); transition: all .15s ease; text-decoration: none; }
.pge-elevate .pge-btn:hover { border-color: var(--pgl-border-hover); background: var(--pg-surface-hover, #f8fafc); }
.pge-elevate .pge-btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--pgl-primary-light); }
.pge-elevate .pge-btn-primary { color: #fff; background: var(--pgl-primary); border-color: var(--pgl-primary); }
.pge-elevate .pge-btn-primary:hover { filter: brightness(.95); background: var(--pgl-primary); }
.pge-elevate .pge-btn-coral { color: #fff; background: #cc3d12; border-color: #cc3d12; } /* was #ff5e3a — 3.04:1 under white */
.pge-elevate .pge-btn-ghost { background: transparent; border-color: transparent; color: var(--pgl-ink-muted); }
.pge-elevate .pge-btn-ghost:hover { background: var(--pg-surface-sunk, #f1f5f9); }
.pge-elevate .pge-btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Badges — soft tinted pills */
.pge-elevate .pge-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font: 600 12px/1.4 var(--pgl-sans); background: var(--pg-surface-sunk, #f1f5f9); color: var(--pgl-ink-soft); }
.pge-elevate .pge-badge.g { background: var(--pgl-success-bg); color: var(--pgl-success); }
.pge-elevate .pge-badge.w { background: var(--pgl-warning-bg); color: var(--pgl-warning); }
.pge-elevate .pge-badge.b { background: var(--pgl-danger-bg); color: var(--pgl-danger); }
.pge-elevate .pge-badge.i { background: var(--pgl-primary-light); color: var(--pgl-primary); }
.pge-elevate .pge-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.pge-elevate .pge-dot.g { background: #22c55e; } .pge-elevate .pge-dot.w { background: #f59e0b; } .pge-elevate .pge-dot.b { background: #ef4444; }

/* Stat tiles — flat metric cards */
.pge-elevate .pge-stat { background: var(--pgl-bg); border: 1px solid var(--pgl-border); border-radius: var(--pgl-radius); padding: 18px; text-align: center; }
.pge-elevate .pge-stat b { display: block; font: 700 26px/1 var(--pgl-display); color: var(--pgl-ink); font-variant-numeric: tabular-nums; }
.pge-elevate .pge-stat.coral b { color: #ea580c; } .pge-elevate .pge-stat.mint b { color: var(--pgl-success, #16a34a); }
.pge-elevate .pge-stat span { font: 500 12px/1.3 var(--pgl-sans); color: var(--pgl-ink-muted); display: block; margin-top: 6px; }

/* Progress */
.pge-elevate .pge-ring { width: 96px; height: 96px; border-radius: 50%; background: conic-gradient(var(--pgl-primary) calc(var(--p, 0) * 1%), var(--pgl-border) 0); display: grid; place-items: center; position: relative; }
.pge-elevate .pge-ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--pgl-surface); }
.pge-elevate .pge-ring b { position: relative; font: 700 18px/1 var(--pgl-display); color: var(--pgl-primary); }
.pge-elevate .pge-bar { height: 8px; border-radius: 999px; background: var(--pgl-border); overflow: hidden; }
.pge-elevate .pge-bar i { display: block; height: 100%; border-radius: 999px; background: var(--pgl-primary); }

/* Course / list cards */
.pge-elevate .pge-ecard { background: var(--pgl-surface); border: 1px solid var(--pgl-border); border-radius: var(--pgl-radius); padding: 16px; display: flex; gap: 14px; align-items: center; transition: all .15s ease; cursor: pointer; text-decoration: none; color: inherit; }
.pge-elevate .pge-ecard:hover { border-color: var(--pgl-border-hover); box-shadow: var(--pgl-shadow); }
.pge-elevate .pge-ecard:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--pgl-primary-light); }
.pge-elevate .pge-ecard .pge-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--pgl-primary-light); display: grid; place-items: center; font-size: 20px; flex: none; }
.pge-elevate .pge-ecard h4 { font-size: 15px; font-weight: 600; }
.pge-elevate .pge-ecard .pge-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* Table */
.pge-elevate .pge-tbl { background: var(--pgl-surface); border: 1px solid var(--pgl-border); border-radius: var(--pgl-radius); overflow: hidden; width: 100%; border-collapse: collapse; }
.pge-elevate .pge-tbl th { text-align: left; font: 600 11px/1 var(--pgl-sans); text-transform: uppercase; letter-spacing: .05em; color: var(--pgl-ink-muted); padding: 12px 16px; background: var(--pgl-bg); }
.pge-elevate .pge-tbl td { padding: 12px 16px; font: 500 13px/1.4 var(--pgl-sans); border-top: 1px solid var(--pgl-border); }

/* XP chip */
.pge-elevate .pge-xp { display: flex; align-items: center; gap: 14px; }
.pge-elevate .pge-xp .pge-lvl { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--pgl-primary); color: #fff; font: 700 16px/1 var(--pgl-display); flex: none; }

/* Empty state */
.pge-elevate .pge-empty { text-align: center; padding: 40px 24px; }
.pge-elevate .pge-empty .pge-art { width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 18px; background: var(--pgl-primary-light); display: grid; place-items: center; font-size: 30px; }
.pge-elevate .pge-empty h4 { font-size: 17px; font-weight: 700; } .pge-elevate .pge-empty p { color: var(--pgl-ink-muted); font-size: 14px; margin: 6px 0 16px; }

/* Toast */
.pge-elevate-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: #0f172a; color: #fff; padding: 12px 20px; border-radius: 10px; font: 600 13px/1 var(--pgl-sans, sans-serif); box-shadow: 0 8px 24px rgb(0 0 0 / .22); z-index: 99999; opacity: 0; transition: opacity .2s; }
.pge-elevate-toast.show { opacity: 1; }

@media (prefers-reduced-motion: reduce) { .pge-elevate * { transition: none !important; } }
@media (max-width: 820px) { .pge-elevate .pge-g3, .pge-elevate .pge-g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .pge-elevate .pge-g2, .pge-elevate .pge-g3, .pge-elevate .pge-g4 { grid-template-columns: 1fr; } }

/* ── Pillar portal pages (Evaluate · Elevate · Excel) ─────────────────────
   Design: 21st.dev sketch d3f8a1bf **Take 1 (GLM 5.2)** — light heroes with
   pillar chips + oversized ink display type, amber assigned banner, blue
   buttons with hover lift/glow, gradient progress fills, priority chips.
   UI/UX Pro Max rules kept (no emoji icons, AA contrast, visible focus,
   reduced-motion respected via the global rule above). */

/* Hero — light, huge Outfit ink headline (GLM take) */
.pge-elevate .pge-hero { background: transparent; border-radius: 0; color: var(--pgl-ink); padding: 34px 0 26px; display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 8px; }
.pge-elevate .pge-hero h1 { font: 800 clamp(32px, 4.6vw, 46px)/1.06 var(--pgl-display); letter-spacing: -.025em; margin: 0 0 14px; color: var(--pgl-ink); max-width: 16ch; }
.pge-elevate .pge-hero p { margin: 0 0 20px; font: 500 15.5px/1.6 var(--pgl-sans); color: var(--pgl-ink-soft); max-width: 56ch; }
.pge-elevate .pge-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.pge-elevate .pge-pillar-chip { display: inline-flex; align-items: center; gap: 6px; font: 600 11px/1 var(--pgl-sans); letter-spacing: .02em; border-radius: 999px; padding: 5px 11px; background: var(--pgl-primary-light); color: var(--pgl-primary); }
.pge-elevate .pge-pillar-chip::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--pgl-primary); }
.pge-elevate .pge-pillar-chip.amber { background: #fef3c7; color: #92400e; }
.pge-elevate .pge-pillar-chip.amber::before { background: #f59e0b; }
.pge-elevate .pge-pillar-chip.green { background: #dcfce7; color: #166534; }
.pge-elevate .pge-pillar-chip.green::before { background: #16a34a; }
.pge-elevate .pge-hero-cta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pge-elevate .pge-hero-cta .pge-microcopy { font: 500 13px/1 var(--pgl-sans); color: var(--pgl-ink-muted); }
.pge-elevate .pge-btn-hero { background: var(--pgl-primary); color: #fff; border-color: transparent; font-weight: 700; padding: 13px 22px; border-radius: var(--pge-ui-radius-pill, 999px); transition: all .18s ease; }
.pge-elevate .pge-btn-hero:hover { background: #1d4ed8; box-shadow: 0 8px 20px -6px rgb(37 99 235 / .5); transform: translateY(-1px); }
.pge-elevate .pge-btn-hero svg { margin-left: 2px; }
.pge-elevate .pge-btn-hero-ghost { background: var(--pgl-surface); color: var(--pgl-primary); border: 1px solid #bfdbfe; font-weight: 600; padding: 12px 20px; border-radius: var(--pge-ui-radius-pill, 999px); transition: all .18s ease; }
.pge-elevate .pge-btn-hero-ghost:hover { background: var(--pgl-primary-light); border-color: var(--pgl-primary); }

/* Journey stepper (Diagnose → Study → Excel) */
.pge-elevate .pge-journey { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 22px; padding: 0; list-style: none; counter-reset: pge-step; }
.pge-elevate .pge-journey li { background: var(--pgl-surface); border: 1px solid var(--pgl-border); border-radius: var(--pgl-radius); padding: 14px 16px; display: flex; gap: 12px; align-items: center; position: relative; }
.pge-elevate .pge-journey li .pge-step-n { counter-increment: pge-step; width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center; background: var(--pgl-border); color: var(--pgl-ink-muted); font: 700 13px/1 var(--pgl-display); flex: none; }
.pge-elevate .pge-journey li .pge-step-n::before { content: counter(pge-step); }
.pge-elevate .pge-journey li b { display: block; font: 700 13.5px/1.2 var(--pgl-sans); color: var(--pgl-ink); }
.pge-elevate .pge-journey li span { font: 500 11.5px/1.35 var(--pgl-sans); color: var(--pgl-ink-muted); }
.pge-elevate .pge-journey li.is-active { border-color: var(--pgl-primary); box-shadow: 0 0 0 3px var(--pgl-primary-light); }
.pge-elevate .pge-journey li.is-active .pge-step-n { background: var(--pgl-primary); color: #fff; }
.pge-elevate .pge-journey li.is-done .pge-step-n { background: #dcfce7; color: #16a34a; }
.pge-elevate .pge-journey li.is-done .pge-step-n::before { content: "✓"; }

/* Section head */
.pge-elevate .pge-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 0 12px; }
.pge-elevate .pge-sec-head h2 { font: 700 18px/1.2 var(--pgl-display); color: var(--pgl-ink); margin: 0; }
.pge-elevate .pge-sec-head a { font: 600 13px/1 var(--pgl-sans); color: var(--pgl-primary); text-decoration: none; }
.pge-elevate .pge-sec-head a:hover { text-decoration: underline; }

/* Assigned-diagnostic / notice banner — amber (GLM take) with a blue variant */
.pge-elevate .pge-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; background: rgb(255 251 235 / .7); border: 1px solid #fde68a; border-radius: var(--pgl-radius); padding: 14px 18px; margin-bottom: 20px; }
.pge-elevate .pge-notice .pge-ic { width: 38px; height: 38px; border-radius: 10px; background: #fef3c7; color: #b45309; display: grid; place-items: center; flex: none; }
.pge-elevate .pge-notice b { font: 700 14px/1.3 var(--pgl-sans); color: var(--pgl-ink); display: block; }
.pge-elevate .pge-notice span { font: 500 12.5px/1.45 var(--pgl-sans); color: var(--pgl-ink-soft); }
.pge-elevate .pge-notice.blue { background: #eff6ff; border-color: #bfdbfe; }
.pge-elevate .pge-notice.blue .pge-ic { background: var(--pgl-primary); color: #fff; }

/* Priority chips (GLM focus areas) */
.pge-elevate .pge-prio { font: 600 11px/1 var(--pgl-sans); border-radius: 999px; padding: 4px 10px; }
.pge-elevate .pge-prio.high { background: #fee2e2; color: #b91c1c; }
.pge-elevate .pge-prio.med { background: #fef3c7; color: #92400e; }
.pge-elevate .pge-prio.low { background: var(--pg-surface-sunk, #f1f5f9); color: var(--pgl-ink-soft); }

/* Cross-pillar upsell band */
.pge-elevate .pge-upsell { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; background: #0f172a; color: #fff; border-radius: calc(var(--pgl-radius) + 4px); padding: 24px 26px; margin-top: 30px; }
.pge-elevate .pge-upsell b { font: 700 17px/1.3 var(--pgl-display); display: block; color: #fff; }
.pge-elevate .pge-upsell span { font: 500 13.5px/1.5 var(--pgl-sans); color: rgb(255 255 255 / .72); }
.pge-elevate .pge-upsell .pge-btn { background: #fff; color: #0f172a; border-color: transparent; font-weight: 700; }
.pge-elevate .pge-upsell .pge-btn:hover { background: #e2e8f0; }

/* Weekly class usage meter — green gradient fill (GLM take) */
.pge-elevate .pge-meter { background: var(--pgl-surface); border: 1px solid var(--pgl-border); border-radius: var(--pgl-radius); padding: 16px 18px; }
.pge-elevate .pge-meter .pge-meter-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; gap: 10px; flex-wrap: wrap; }
.pge-elevate .pge-meter b { font: 700 14px/1 var(--pgl-sans); color: var(--pgl-ink); }
.pge-elevate .pge-meter span { font: 600 12px/1 var(--pgl-sans); color: var(--pgl-ink-muted); }
.pge-elevate .pge-meter .pge-bar i { background: linear-gradient(90deg, #22c55e, #16a34a); transition: width .6s ease; }
.pge-elevate .pge-meter.is-full .pge-bar i { background: linear-gradient(90deg, #f59e0b, #ea580c); }

/* Gradient progress fill everywhere else (GLM take) */
.pge-elevate .pge-bar i { background: linear-gradient(90deg, #3b82f6, #2563eb); transition: width .6s ease; }

/* Countdown chip on session rows */
.pge-elevate .pge-count { font: 700 11px/1 var(--pgl-sans); border-radius: 999px; padding: 5px 10px; background: var(--pgl-primary-light); color: var(--pgl-primary); white-space: nowrap; }

/* Session / tutor rows */
.pge-elevate .pge-session { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; background: var(--pgl-surface); border: 1px solid var(--pgl-border); border-radius: var(--pgl-radius); padding: 14px 18px; }
.pge-elevate .pge-session time { font: 700 13px/1.35 var(--pgl-sans); color: var(--pgl-ink); display: block; }
.pge-elevate .pge-session .pge-when { min-width: 150px; }
.pge-elevate .pge-avatar { width: 42px; height: 42px; border-radius: 999px; background: var(--pgl-primary-light); color: var(--pgl-primary); display: grid; place-items: center; font: 700 15px/1 var(--pgl-display); flex: none; }
.pge-elevate .pge-chiprow { display: flex; gap: 6px; flex-wrap: wrap; }
.pge-elevate .pge-chip { font: 600 11px/1 var(--pgl-sans); color: var(--pgl-ink-soft); background: var(--pgl-bg); border: 1px solid var(--pgl-border); border-radius: 999px; padding: 5px 10px; }

/* Report card */
.pge-elevate .pge-report { background: var(--pgl-surface); border: 1px solid var(--pgl-border); border-radius: var(--pgl-radius); padding: 18px; }
.pge-elevate .pge-report h4 { font: 700 14px/1.3 var(--pgl-sans); margin: 0 0 10px; color: var(--pgl-ink); }
.pge-elevate .pge-report dl { margin: 0; display: grid; gap: 8px; }
.pge-elevate .pge-report dt { font: 700 10.5px/1 var(--pgl-sans); text-transform: uppercase; letter-spacing: .08em; color: var(--pgl-ink-muted); }
.pge-elevate .pge-report dd { margin: 2px 0 0; font: 500 13px/1.5 var(--pgl-sans); color: var(--pgl-ink-soft); }

/* Locked pillar state */
.pge-elevate .pge-locked { text-align: center; background: var(--pgl-surface); border: 1px solid var(--pgl-border); border-radius: calc(var(--pgl-radius) + 4px); padding: 48px 28px; }
.pge-elevate .pge-locked .pge-lock-art { width: 76px; height: 76px; margin: 0 auto 16px; border-radius: 20px; background: var(--pgl-primary-light); color: var(--pgl-primary); display: grid; place-items: center; }
.pge-elevate .pge-locked h2 { font: 800 24px/1.2 var(--pgl-display); margin: 0 0 8px; color: var(--pgl-ink); }
.pge-elevate .pge-locked p { font: 500 14.5px/1.6 var(--pgl-sans); color: var(--pgl-ink-muted); max-width: 54ch; margin: 0 auto 18px; }
.pge-elevate .pge-locked .pge-price { font: 800 34px/1 var(--pgl-display); color: var(--pgl-ink); margin: 14px 0 2px; }
.pge-elevate .pge-locked .pge-price small { font: 600 14px/1 var(--pgl-sans); color: var(--pgl-ink-muted); }
.pge-elevate .pge-locked ul { list-style: none; margin: 18px auto; padding: 0; display: inline-grid; gap: 8px; text-align: left; }
.pge-elevate .pge-locked ul li { display: flex; gap: 9px; align-items: center; font: 500 13.5px/1.4 var(--pgl-sans); color: var(--pgl-ink-soft); }
.pge-elevate .pge-locked ul li svg { color: #16a34a; flex: none; }

@media (max-width: 720px) { .pge-elevate .pge-journey { grid-template-columns: 1fr; } .pge-elevate .pge-hero { padding: 26px 20px; } }

/* ── Flashcards (SRS) ──────────────────────────────────────────────────── */
.pge-elevate .pge-fc-wrap { max-width: 640px; margin: 0 auto; }
.pge-elevate .pge-fc-exit-link { display: inline-flex; align-items: center; gap: 6px; font: 600 13px/1 var(--pgl-sans); color: var(--pgl-ink-muted); text-decoration: none; margin-bottom: 14px; }
.pge-elevate .pge-fc-exit-link:hover { color: var(--pgl-primary); }
.pge-elevate .pge-fc-exit-link svg { transform: rotate(180deg); }
.pge-elevate .pge-fc-toolbar .pge-fc-exit { color: var(--pgl-ink-muted); }
.pge-elevate .pge-fc-toolbar .pge-fc-exit:hover { color: #b91c1c; background: #fef2f2; }

.pge-elevate .pge-fc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pge-elevate .pge-fc-count { font: 600 12px/1 var(--pgl-sans); font-variant-numeric: tabular-nums; }

/* Session progress — was previously invisible beyond the small "3 / 10" count. */
.pge-elevate .pge-fc-progress { height: 6px; border-radius: 999px; background: var(--pgl-border); overflow: hidden; margin-bottom: 18px; }
.pge-elevate .pge-fc-progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--pgl-primary), #60a5fa); transition: width .35s ease; }

/* Real 3D flip: .pge-fc is the perspective stage, .pge-fc-inner is the plane
   that rotates, and both faces sit absolutely stacked inside it with
   backface-visibility hidden — a genuine card flip instead of the previous
   instant content swap with only a border-color change. */
.pge-elevate .pge-fc { position: relative; min-height: 260px; perspective: 1400px; }
.pge-elevate .pge-fc-inner {
    position: relative; width: 100%; height: 100%; min-height: 260px;
    transform-style: preserve-3d; transition: transform .5s cubic-bezier(.4,.2,.2,1);
    cursor: pointer;
}
.pge-elevate .pge-fc.is-flipped .pge-fc-inner { transform: rotateY(180deg); }
.pge-elevate .pge-fc:focus-visible .pge-fc-inner { outline: 0; box-shadow: 0 0 0 3px var(--pgl-primary-light); border-radius: calc(var(--pgl-radius) + 4px); }
.pge-elevate .pge-fc-face {
    position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
    background: var(--pgl-surface); border: 1px solid var(--pgl-border); border-radius: calc(var(--pgl-radius) + 4px);
    box-shadow: var(--pgl-shadow); overflow: hidden;
    display: flex; align-items: center;
}
.pge-elevate .pge-fc:hover .pge-fc-face { box-shadow: 0 10px 28px -10px rgb(15 23 42 / .2); }
.pge-elevate .pge-fc-front { background: linear-gradient(155deg, var(--pgl-surface) 0%, var(--pgl-primary-light) 140%); }
.pge-elevate .pge-fc-back { transform: rotateY(180deg); border-color: var(--pgl-primary); }
.pge-elevate .pge-fc-scroll { max-height: 100%; overflow-y: auto; padding: 24px 26px; width: 100%; font: 500 15.5px/1.55 var(--pgl-sans); color: var(--pgl-ink); text-align: left; }
.pge-elevate .pge-fc-label { font: 700 10.5px/1 var(--pgl-sans); text-transform: uppercase; letter-spacing: .1em; color: var(--pgl-ink-muted); margin-bottom: 10px; }
.pge-elevate .pge-fc-answer { font: 700 19px/1.4 var(--pgl-display); color: var(--pgl-primary); }
.pge-elevate .pge-fc-expl { margin-top: 12px; font: 500 13.5px/1.6 var(--pgl-sans); color: var(--pgl-ink-soft); border-top: 1px solid var(--pgl-border); padding-top: 10px; text-align: left; }
/* Question/answer/explanation prose commonly embeds images and short inline
   LaTeX (via Simple MathJax). MathJax renders $$..$$ as block, centered,
   own-line "display" math by default — fine for a real equation block, but
   AI-generated cards often wrap short inline quantities in $$..$$, which
   otherwise shatters a sentence into a tall stack of centered lines instead
   of flowing as a paragraph. Force it inline here so cards stay compact. */
.pge-elevate .pge-fc-face mjx-container[display="true"] { display: inline-block !important; margin: 0 .15em !important; }
.pge-elevate .pge-fc-face img { display: block; max-width: 100%; height: auto; margin: 10px auto; border-radius: 8px; }
.pge-elevate .pge-fc-face p { margin: 0 0 8px; }
.pge-elevate .pge-fc-face p:last-child { margin-bottom: 0; }
.pge-elevate .pge-fc-actions { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.pge-elevate .pge-fc-hint { font: 500 12px/1 var(--pgl-sans); }
.pge-elevate .pge-fc-again { color: #b91c1c; border-color: #fecaca; }
.pge-elevate .pge-fc-again:hover { background: #fee2e2; border-color: #fca5a5; }
.pge-elevate .pge-fc-hard { color: #92400e; border-color: #fde68a; }
.pge-elevate .pge-fc-hard:hover { background: #fef3c7; border-color: #fcd34d; }
.pge-elevate .pge-fc-good { color: #fff; background: var(--pgl-primary); border-color: var(--pgl-primary); }
.pge-elevate .pge-fc-good:hover { background: #1d4ed8; }
.pge-elevate .pge-fc-easy { color: #166534; border-color: #bbf7d0; }
.pge-elevate .pge-fc-easy:hover { background: #dcfce7; border-color: #86efac; }
.pge-elevate .pge-fc-actions .pge-btn { transition: transform .12s ease, filter .12s ease, background .12s ease, border-color .12s ease; }
.pge-elevate .pge-fc-actions .pge-btn:active { transform: scale(.96); }

/* Loading spinner — the placeholder used to be static text with nothing to
   signal the page was actually doing something. */
.pge-elevate .pge-fc-spinner { width: 30px; height: 30px; margin: 0 auto 14px; border-radius: 50%; border: 3px solid var(--pgl-border); border-top-color: var(--pgl-primary); animation: pge-fc-spin .8s linear infinite; }
@keyframes pge-fc-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .pge-elevate .pge-fc-inner { transition: none; }
    .pge-elevate .pge-fc-spinner { animation: none; border-top-color: var(--pgl-border); }
}

/* ── Flashcards: motivational toasts ───────────────────────────────────────
   The host is appended to <body> (a transformed ancestor — the flip plane —
   would demote position:fixed to absolute) and carries .pge-elevate purely
   for the --pgl-* tokens and their dark twins, so the double selector here
   both scopes the styles and out-specifies .pge-elevate's own surface
   styling (background/padding/radius), which a floating rail must not have.
   pointer-events:none end to end — a toast may never block a click. */
.pge-elevate.pge-fc-toast-host {
    position: fixed; top: 20px; right: 20px; z-index: 99990;
    display: grid; gap: 8px; justify-items: end;
    background: transparent; padding: 0; border-radius: 0;
    pointer-events: none; max-width: min(340px, calc(100vw - 32px));
}
body.admin-bar .pge-elevate.pge-fc-toast-host { top: 52px; }
.pge-elevate .pge-fc-toast {
    display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 10px;
    background: var(--pgl-surface); border: 1px solid var(--pgl-border);
    border-radius: 999px; box-shadow: 0 8px 24px -8px rgb(15 23 42 / .25);
    font: 600 13px/1.35 var(--pgl-sans); color: var(--pgl-ink);
    opacity: 0; transform: translateY(-8px);
    transition: opacity .3s ease, transform .3s ease;
}
.pge-elevate .pge-fc-toast.is-in { opacity: 1; transform: translateY(0); }
.pge-elevate .pge-fc-toast.is-out { opacity: 0; transform: translateY(-8px); }
.pge-elevate .pge-fc-toast-ic {
    flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
    display: grid; place-items: center; font-size: 13px;
    background: var(--pgl-primary-light);
}
@media (prefers-reduced-motion: reduce) {
    .pge-elevate .pge-fc-toast { transition: none; opacity: 1; transform: none; }
}

/* ── Flashcards: session summary ─────────────────────────────────────────── */
.pge-elevate .pge-fc-summary .pge-fc-sum-grid {
    display: grid; grid-template-columns: repeat(4, minmax(64px, 96px));
    gap: 10px; justify-content: center; margin: 16px 0 4px;
}
.pge-elevate .pge-fc-sum-stat {
    display: grid; gap: 2px; padding: 10px 8px; border-radius: 12px;
    border: 1px solid var(--pgl-border); text-align: center;
}
.pge-elevate .pge-fc-sum-stat b { font: 700 18px/1.2 var(--pgl-display); font-variant-numeric: tabular-nums; }
.pge-elevate .pge-fc-sum-stat span { font: 600 11px/1 var(--pgl-sans); text-transform: uppercase; letter-spacing: .06em; }
.pge-elevate .pge-fc-sum-stat.is-again { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.pge-elevate .pge-fc-sum-stat.is-hard  { color: #92400e; background: #fffbeb; border-color: #fde68a; }
.pge-elevate .pge-fc-sum-stat.is-good  { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.pge-elevate .pge-fc-sum-stat.is-easy  { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }
.pge-elevate .pge-fc-summary .pge-fc-sum-mastery { max-width: 320px; margin: 12px auto 4px; }
.pge-elevate .pge-fc-sum-mastery-label { font: 600 12px/1 var(--pgl-sans); color: var(--pgl-ink-muted); margin-bottom: 6px; }
.pge-elevate .pge-fc-summary .pge-fc-progress { margin-bottom: 0; }
.pge-elevate .pge-fc-summary .pge-fc-actions { margin-top: 18px; }
@media (max-width: 480px) {
    .pge-elevate .pge-fc-summary .pge-fc-sum-grid { grid-template-columns: repeat(2, minmax(64px, 1fr)); }
}

/* ── Cheat sheets list ─────────────────────────────────────────────────── */
.pge-elevate .pge-cs-row { display: flex; align-items: center; gap: 14px; background: var(--pgl-surface); border: 1px solid var(--pgl-border); border-radius: var(--pgl-radius); padding: 14px 18px; flex-wrap: wrap; }
.pge-elevate .pge-cs-row b { font: 700 14px/1.3 var(--pgl-sans); color: var(--pgl-ink); flex: 1; min-width: 160px; }
.pge-elevate .pge-cs-row .pge-btn[disabled] { pointer-events: none; }

/* ── Teacher session rows (report form) ────────────────────────────────── */
.pge-elevate .pge-tr-form { display: grid; gap: 10px; margin-top: 12px; border-top: 1px solid var(--pgl-border); padding-top: 14px; width: 100%; }
.pge-elevate .pge-tr-form label { font: 700 11px/1 var(--pgl-sans); text-transform: uppercase; letter-spacing: .07em; color: var(--pgl-ink-muted); display: grid; gap: 5px; }
.pge-elevate .pge-tr-form textarea, .pge-elevate .pge-tr-form select { font: 500 13.5px/1.5 var(--pgl-sans); color: var(--pgl-ink); border: 1px solid var(--pgl-border); border-radius: 8px; padding: 9px 12px; background: var(--pgl-surface); width: 100%; }
.pge-elevate .pge-tr-form textarea:focus-visible, .pge-elevate .pge-tr-form select:focus-visible { outline: 0; border-color: var(--pgl-primary); box-shadow: 0 0 0 3px var(--pgl-primary-light); }

/* ── Announcement board ────────────────────────────────────────────────────
   Deliberately NOT scoped under .pge-elevate: the board renders on the course
   template (.pge-course) and inside the dashboard shortcode alike, and a
   notice that silently loses its styling on one of them is worse than none. */
.pge-anns { display: grid; gap: 10px; max-width: 1160px; margin: 0 auto; padding: 16px 24px 0; }
.pge-ann { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: #eff6ff; border: 1px solid #bfdbfe; color: var(--pg-ink, #0f172a); }
.pge-ann--site { background: #fffbeb; border-color: #fde68a; }
.pge-ann__icon { flex: 0 0 auto; color: #2563eb; margin-top: 2px; }
.pge-ann--site .pge-ann__icon { color: #b45309; }
.pge-ann__body { flex: 1; min-width: 0; }
.pge-ann__meta { margin: 0 0 2px; font-size: 12px; color: var(--pg-ink-muted, #64748b); }
.pge-ann__tag { display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 999px; background: rgba(15, 23, 42, .07); font-weight: 700; font-size: 11px; color: var(--pg-ink-2, #334155); }
.pge-ann__title { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.35; }
.pge-ann__text { font-size: 13.5px; line-height: 1.6; color: var(--pg-ink-2, #334155); }
.pge-ann__text > :first-child { margin-top: 4px; }
.pge-ann__text > :last-child { margin-bottom: 0; }
.pge-ann__dismiss { flex: 0 0 auto; appearance: none; cursor: pointer; align-self: center; border: 1px solid var(--pg-line-strong, #cbd5e1); background: var(--pg-surface, #fff); border-radius: 8px; padding: 6px 12px; font: 600 12.5px/1 inherit; color: var(--pg-ink-2, #334155); }
.pge-ann__dismiss:hover { border-color: #94a3b8; }
.pge-ann__dismiss[disabled] { opacity: .55; cursor: default; }
@media (max-width: 640px) { .pge-anns { padding: 12px 16px 0; } .pge-ann { flex-wrap: wrap; } }

/* ── Dark theme (Acorn Next) ──────────────────────────────────────────
   Activated by html[data-pge-admin-theme="dark"][data-pge-dark-scope] (the shared toggle,
   persisted in localStorage as pge_admin_theme; the app shell boots the
   attribute pre-paint). Everything below re-points the scoped tokens, so
   every portal surface inherits — status colours lighten for contrast on
   dark tints, accents stay untouched. */
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate {
	--pgl-bg: #131720;
	--pgl-surface: #1c2230;
	--pgl-border: #2a3345;
	--pgl-border-hover: #3a4763;
	--pgl-primary-light: rgba(37, 99, 235, 0.20);
	--pgl-ink: #eef2f9;
	--pgl-ink-soft: #c6cfdd;
	--pgl-ink-muted: #93a0b5;
	--pgl-success: #4ade80; --pgl-success-bg: #122a1d;
	--pgl-warning: #fbbf24; --pgl-warning-bg: #33270f;
	--pgl-danger: #f87171;  --pgl-danger-bg: #331717;
	--pgl-shadow: 0 1px 2px rgb(0 0 0 / .35);
}
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-btn:hover { background: #232c3d; }

/* --pgl-primary is TEXT in most call sites (chips, links, ring figure,
   flashcard answer, countdown) — the deep blue vanishes on dark surfaces, so
   it lifts here; every pair below sits ≥6:1 on its dark ground. Controls that
   FILL with it under a white label are pinned back to --pge-ui-primary (which
   stays deep in dark — white on the lifted accent is ~2.2:1). */
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate {
	--pgl-primary: #8ab0ff;
}
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-btn-primary,
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-btn-primary:hover,
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-btn-hero,
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-fc-good,
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-fc-good:hover,
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-xp .pge-lvl,
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-notice.blue .pge-ic,
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-journey li.is-active .pge-step-n {
	background: var(--pge-ui-primary, #1b3beb);
	border-color: var(--pge-ui-primary, #1b3beb);
}

/* Tinted bands and chips whose light washes would glow on a dark page. All
   ink-on-wash pairs verified ≥6:1. */
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-btn-ghost:hover { background: #232c3d; }
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-badge { background: #232c3d; }
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-btn-hero-ghost { border-color: #2e3d66; }
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-pillar-chip.amber { background: #2a2110; color: #fbbf24; }
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-pillar-chip.green { background: #14261b; color: #34d399; }
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-journey li.is-done .pge-step-n { background: #14261b; color: #34d399; }
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-notice { background: #2a2110; border-color: #574117; }
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-notice .pge-ic { background: #3a2d12; color: #fbbf24; }
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-notice.blue { background: #1b2440; border-color: #2e3d66; }
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-prio.high { background: #2b1717; color: #f87171; }
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-prio.med { background: #2a2110; color: #fbbf24; }
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-prio.low { background: #232c3d; }
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-upsell { background: #232c3d; }
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-stat.coral b { color: #fb923c; }
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-fc-toolbar .pge-fc-exit:hover { color: #f87171; background: #2b1717; }
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-fc-again { color: #f87171; border-color: #5f2a2a; }
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-fc-again:hover { background: #2b1717; border-color: #7a3535; }
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-fc-hard { color: #fbbf24; border-color: #574117; }
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-fc-hard:hover { background: #2a2110; border-color: #6b5220; }
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-fc-easy { color: #4ade80; border-color: #245536; }
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-fc-easy:hover { background: #14261b; border-color: #2f6b45; }

/* The announcement board renders OUTSIDE .pge-elevate (course template and
   dashboard alike), so its dark twins are gated on the html attributes only. */
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-ann { background: #1b2440; border-color: #2e3d66; }
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-ann--site { background: #2a2110; border-color: #574117; }
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-ann__icon { color: #8ab0ff; }
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-ann--site .pge-ann__icon { color: #fbbf24; }
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-ann__tag { background: rgba(238, 242, 249, .1); }

/* Flashcards toasts + summary tiles: surfaces/tokens flip on their own (the
   toast host carries .pge-elevate), so only the hard-coded tints need dark
   twins — same palette as the grade buttons above, all pairs ≥6:1. */
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-fc-toast { box-shadow: 0 8px 24px -8px rgb(0 0 0 / .6); }
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-fc-sum-stat.is-again { color: #f87171; background: #2b1717; border-color: #5f2a2a; }
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-fc-sum-stat.is-hard  { color: #fbbf24; background: #2a2110; border-color: #574117; }
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-fc-sum-stat.is-good  { color: #8ab0ff; background: #1b2440; border-color: #2e3d66; }
html[data-pge-admin-theme="dark"][data-pge-dark-scope] .pge-elevate .pge-fc-sum-stat.is-easy  { color: #4ade80; background: #14261b; border-color: #245536; }
