/* pm-ui.css — the redesigned learner pages' shared look.
 * ---------------------------------------------------------------------------
 * Agreed with Daniel on 22 Nov 2026 from the clickable mock-up (the learner
 * redesign: a dark navy header and top panel with rounded bottom corners,
 * white rounded cards on light grey, a green main button, small tinted icon
 * squares drawn in SVG, never emoji). The build spec is
 * C:\plumbmate-lab\learner-redesign\SPEC.md; its "Look" table is the token list
 * below, word for word.
 *
 * ONE FILE, SO THE LEVELS CANNOT DRIFT. Part 1 puts the header, the menu and
 * the Switch course sheet on the Level 2 written course. Parts 2 to 4 restyle
 * the Level 2 home, unit, lesson and revision pages from the same pieces, and
 * Level 1, Level 3 and the short courses take them up after that. A colour or
 * a radius changed here changes on every one of those pages at once.
 *
 * EVERYTHING IS NAMESPACED pm-. These pages already carry hundreds of lines of
 * their own CSS, some of it written as bare element rules (`header {...}`,
 * `a {...}`). Nothing here is a bare element rule, and every class starts pm-,
 * so loading this file cannot restyle a page body that has not been redesigned
 * yet. The header rules are written as header.pm-top so they outrank a page's
 * own bare `header` rule wherever one is still there.
 *
 * THE FONTS are the site's own (Daniel, 22 Nov 2026: keep the current fonts,
 * not Inter): Plus Jakarta Sans for the text (--pm-font) and Outfit for
 * headings (--pm-font-head), as level-2/l2-course.css has them. A page that
 * loads this file also links both from Google Fonts in its <head>; until they
 * arrive, or if they never do, the system font stands in.
 *
 * The behaviour (opening the menu and the sheet, what goes in them, who sees
 * the staff box) is /pm-header.js.
 * ---------------------------------------------------------------------------
 */

:root {
  /* navy: header, top panel */
  --pm-navy: #0f2942;
  --pm-navy-2: #18406a;
  --pm-panel: linear-gradient(180deg, #0f2942 0%, #18406a 100%);
  --pm-panel-radius: 28px;
  /* ground and cards */
  --pm-bg: #f1f5f9;
  --pm-card: #fff;
  --pm-line: #e2e8f0;
  --pm-card-radius: 18px;
  --pm-card-shadow: 0 1px 3px rgba(15, 23, 42, .05);
  /* the main button */
  --pm-green: #047857;
  --pm-green-hover: #065f46;
  /* links and accent */
  --pm-blue: #2563eb;
  --pm-blue-text: #1d4ed8;
  /* text: secondary is never lighter than this on the grey ground */
  --pm-text: #0f172a;
  --pm-text-2: #475569;
  /* amber: homework, next step */
  --pm-amber-fill: #fef3c7;
  --pm-amber-fill-2: #fffbeb;
  --pm-amber-text: #92400e;
  --pm-amber-line: #fcd34d;
  /* unit colours, in unit order (bars), with a darker shade for text */
  --pm-unit-1: #2563eb; --pm-unit-1-text: #1d4ed8;
  --pm-unit-2: #059669; --pm-unit-2-text: #047857;
  --pm-unit-3: #d97706; --pm-unit-3-text: #b45309;
  --pm-unit-4: #7c3aed; --pm-unit-4-text: #6d28d9;
  --pm-unit-5: #0284c7; --pm-unit-5-text: #0369a1;
  --pm-unit-6: #e11d48; --pm-unit-6-text: #be123c;
  --pm-unit-7: #0d9488; --pm-unit-7-text: #0f766e;
  --pm-unit-8: #4f46e5; --pm-unit-8-text: #4338ca;
  --pm-unit-9: #ea580c; --pm-unit-9-text: #c2410c;
  /* touch targets */
  --pm-touch: 44px;
  --pm-font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --pm-font-head: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ── Cards and buttons ─────────────────────────────────────────────────── */
.pm-card {
  background: var(--pm-card); border: 1px solid var(--pm-line);
  border-radius: var(--pm-card-radius); box-shadow: var(--pm-card-shadow);
}
.pm-btn-main {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 52px; padding: 0 18px; border: 0; border-radius: 14px; box-sizing: border-box;
  background: var(--pm-green); color: #fff; font: 800 15px/1.2 var(--pm-font);
  text-decoration: none; cursor: pointer; box-shadow: 0 2px 8px rgba(4, 120, 87, .28);
}
.pm-btn-main:hover { background: var(--pm-green-hover); color: #fff; }
.pm-btn-outline {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 16px; border-radius: 12px; box-sizing: border-box;
  background: #fff; border: 1.5px solid #cbd5e1; color: var(--pm-text);
  font: 700 14px/1.2 var(--pm-font); text-decoration: none; cursor: pointer;
}
.pm-btn-outline:hover { background: #f8fafc; color: var(--pm-text); }

/* ── Icon squares: 40px, radius 12 (34px in a list row) ───────────────── */
.pm-ic {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
.pm-ic svg { display: block; }
.pm-t-blue   { background: #dbeafe; color: #1d4ed8; }
.pm-t-green  { background: #d1fae5; color: #047857; }
.pm-t-amber  { background: #fef3c7; color: #b45309; }
.pm-t-violet { background: #ede9fe; color: #6d28d9; }
.pm-t-indigo { background: #e0e7ff; color: #4338ca; }
.pm-t-sky    { background: #e0f2fe; color: #0369a1; }
.pm-t-rose   { background: #ffe4e6; color: #be123c; }
.pm-t-slate  { background: #f1f5f9; color: #334155; }

/* ── The header ────────────────────────────────────────────────────────────
 * Logo (home) or a back link on the left, the course button in the middle,
 * the menu button on the right. Sticky, 60px, the same on a phone and a PC;
 * on a wide screen its contents line up with a centred column. */
/* The floating "Aa" reading-settings tab (pm-access.js): not on a page with
   this header, whose menu has "Reading and display" instead (Daniel, 22 Nov
   2026). pm-header.js also marks the page html.pm-has-top for browsers
   without :has. */
html:not(.sr-class) body:has(header.pm-top) #pmA-tab { display: none !important; }

header.pm-top {
  /* 100, as the old top bars were: the pages' own pop-outs (the unit page's
     Key facts, flashcards and key terms, z-index 500) and dialogs must still
     cover the header */
  position: sticky; top: 0; z-index: 100;
  display: block; height: auto; min-height: 0; margin: 0; padding: 0; border: 0;
  background: var(--pm-navy); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .06);
  font-family: var(--pm-font); -webkit-font-smoothing: antialiased;
}
.pm-top-in {
  max-width: 1200px; margin: 0 auto; box-sizing: border-box;
  height: 60px; padding: 0 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
@media (min-width: 768px) { .pm-top-in { padding: 0 24px; } }
.pm-top a, .pm-top button { font-family: var(--pm-font); -webkit-tap-highlight-color: transparent; }
.pm-top a:focus-visible, .pm-top button:focus-visible,
.pm-menu a:focus-visible, .pm-menu button:focus-visible,
.pm-sheet a:focus-visible, .pm-sheet button:focus-visible {
  outline: 3px solid #7dd3fc; outline-offset: 2px;
}
.pm-menu a:focus-visible, .pm-menu button:focus-visible,
.pm-sheet a:focus-visible, .pm-sheet button:focus-visible { outline-color: var(--pm-blue-text); }

.pm-top-brand {
  display: flex; align-items: center; gap: 9px; min-height: var(--pm-touch);
  color: #fff; font-weight: 800; font-size: 16px; letter-spacing: -.01em;
  text-decoration: none; flex-shrink: 0; font-family: var(--pm-font-head);
}
.pm-top-brand:hover, .pm-top-brand:visited { color: #fff; text-decoration: none; }
.pm-top-logo {
  width: 36px; height: 36px; box-sizing: border-box; border-radius: 11px;
  background: rgba(56, 189, 248, .16); border: 1px solid rgba(125, 211, 252, .35);
  display: flex; align-items: center; justify-content: center; color: #7dd3fc;
}
.pm-top-back {
  display: flex; align-items: center; gap: 4px; height: var(--pm-touch); padding: 0 10px 0 4px;
  border-radius: 12px; color: #bae6fd; font-weight: 700; font-size: 14px;
  text-decoration: none; flex-shrink: 0; white-space: nowrap;
}
.pm-top-back:hover, .pm-top-back:visited { color: #fff; text-decoration: none; }
.pm-top-back:hover { background: rgba(255, 255, 255, .08); }
.pm-top-course {
  display: flex; align-items: center; gap: 6px; min-width: 0; height: 40px; padding: 0 14px;
  border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2);
  color: #e0f2fe; font-size: 13px; font-weight: 700; cursor: pointer; margin: 0;
}
.pm-top-course:hover { color: #fff; background: rgba(255, 255, 255, .16); }
.pm-top-course > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-top-course svg { flex-shrink: 0; }
.pm-top-ibtn {
  width: var(--pm-touch); height: var(--pm-touch); flex-shrink: 0; border-radius: 12px; border: 0; margin: 0; padding: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  color: #e2e8f0; background: rgba(255, 255, 255, .08);
}
.pm-top-ibtn:hover { color: #fff; background: rgba(255, 255, 255, .16); }
/* A narrow phone keeps the logo and drops the word beside it, so the
   course button never squeezes the menu button off the edge. */
@media (max-width: 359px) { .pm-top-name { display: none; } .pm-top-course { padding: 0 11px; } }

/* ── The slim header: a page where a learner is ANSWERING ────────────────
 * <header class="pm-top pm-top-slim">: back, a short title with how far they
 * are ("6 of 20 answered") under it, a progress line, and Reading and display
 * (Aa). No menu and no course button: nothing to wander into mid-paper. The
 * behaviour is pm-header.js (PM_SLIM). */
.pm-top-slim .pm-top-in { max-width: 820px; gap: 6px; padding-left: 6px; padding-right: 8px; }
.pm-top-slim .pm-top-back { max-width: 34%; min-width: var(--pm-touch); }
.pm-top-slim .pm-top-back svg { flex-shrink: 0; }
.pm-top-slim .pm-top-back > span { overflow: hidden; text-overflow: ellipsis; }
.pm-slim-mid { flex: 1 1 auto; min-width: 0; text-align: center; line-height: 1.25; }
.pm-slim-t { display: block; font: 800 15px/1.25 var(--pm-font-head); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-slim-n { display: block; min-height: 16px; font-size: 12.5px; font-weight: 700; color: #bae6fd; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-slim-bar { height: 4px; background: rgba(255, 255, 255, .14); }
.pm-slim-bar > i { display: block; height: 100%; width: 0; background: #34d399; transition: width .25s ease; }
.pm-top-slim .pm-top-ibtn { font: 800 16px/1 var(--pm-font); letter-spacing: -.02em; }
@media (max-width: 359px) { .pm-top-slim .pm-top-back > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } .pm-top-slim .pm-top-back { padding: 0 4px; justify-content: center; } }
@media (prefers-reduced-motion: reduce) { .pm-slim-bar > i { transition: none; } }
/* the question it asks before a paper is left half done */
.pm-sheet .pm-ask-p { margin: 8px 0 16px; font-size: 15px; line-height: 1.5; color: #334155; }
.pm-sheet .pm-ask-go { display: flex; flex-direction: column; gap: 10px; }
.pm-sheet .pm-ask-go .pm-btn-main { justify-content: center; width: 100%; }
.pm-sheet .pm-ask-go .pm-btn-outline { width: 100%; min-height: 48px; }

/* ── The menu: a panel over the page, from the right ─────────────────────
 * Full width on a phone, 420px on a wider screen, with the page dimmed
 * behind it. */
.pm-scrim {
  position: fixed; inset: 0; z-index: 10000; background: rgba(15, 23, 42, .55);
  opacity: 0; transition: opacity .18s ease;
}
.pm-scrim.pm-on { opacity: 1; }
.pm-menu {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 10001;
  width: 100%; max-width: 420px; box-sizing: border-box;
  background: var(--pm-bg); color: var(--pm-text); font-family: var(--pm-font);
  -webkit-font-smoothing: antialiased; font-size: 15px; line-height: 1.4;
  overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(100%); transition: transform .2s ease;
  box-shadow: -12px 0 40px rgba(2, 6, 23, .25);
}
.pm-menu.pm-on { transform: none; }
@media (prefers-reduced-motion: reduce) { .pm-menu, .pm-sheet, .pm-scrim { transition: none; } }
.pm-menu-top {
  position: sticky; top: 0; z-index: 1; height: 60px; box-sizing: border-box; padding: 0 12px;
  background: var(--pm-navy); color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.pm-menu-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.pm-menu .pm-card { overflow: hidden; }
.pm-menu-who { padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.pm-menu-av {
  width: 46px; height: 46px; flex-shrink: 0; border-radius: 999px; background: var(--pm-navy); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px;
}
.pm-menu-who b { display: block; font-size: 16px; font-weight: 800; overflow-wrap: anywhere; }
.pm-menu-who small { display: block; font-size: 13px; color: var(--pm-text-2); overflow-wrap: anywhere; }
.pm-secH {
  font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: #334155; padding: 14px 16px 6px; margin: 0;
}
.pm-item {
  display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box;
  min-height: 54px; padding: 0 16px; margin: 0; border: 0; border-top: 1px solid #f1f5f9;
  background: none; color: var(--pm-text); font: 700 15px/1.3 var(--pm-font);
  text-align: left; text-decoration: none; cursor: pointer;
}
.pm-item:hover, .pm-item:visited { color: var(--pm-text); text-decoration: none; }
/* display:flex above would otherwise beat the browser's own rule for hidden */
.pm-item[hidden], .pm-opt[hidden], .pm-crs[hidden] { display: none; }
.pm-item:hover { background: #f8fafc; }
.pm-item .pm-ic { width: 34px; height: 34px; border-radius: 10px; }
.pm-item-end { margin-left: auto; color: #64748b; display: flex; align-items: center; gap: 8px; }
.pm-item-feedback, .pm-item-feedback:visited, .pm-item-feedback:hover { color: var(--pm-blue-text); }
.pm-item-feedback { background: #f8fbff; }
.pm-item-out, .pm-item-out:visited, .pm-item-out:hover { color: #be123c; }
.pm-count {
  font-size: 12px; font-weight: 800; color: var(--pm-amber-text); background: var(--pm-amber-fill);
  border-radius: 999px; padding: 3px 9px;
}
.pm-menu-staff { border: 1.5px dashed #94a3b8; background: #f8fafc; }
.pm-menu-staff .pm-item:hover { background: #f1f5f9; }

/* "Your course" rows in the menu, and the rows in the Switch course sheet */
.pm-crs {
  display: flex; align-items: center; gap: 12px; box-sizing: border-box; width: auto;
  padding: 12px 14px; margin: 0 12px 8px; border-radius: 14px; border: 1.5px solid var(--pm-line);
  background: #fff; color: var(--pm-text); font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.pm-crs:hover, .pm-crs:visited { color: var(--pm-text); text-decoration: none; }
.pm-crs:hover { border-color: #93c5fd; }
.pm-crs b { display: block; font-size: 14px; font-weight: 800; }
.pm-crs small { display: block; font-size: 12px; color: var(--pm-text-2); margin-top: 1px; }
.pm-crs.pm-cur { border-color: var(--pm-blue); background: #eff6ff; }
.pm-badge {
  margin-left: auto; flex-shrink: 0; font-size: 12px; font-weight: 800;
  padding: 4px 10px; border-radius: 999px; color: var(--pm-blue-text);
}
.pm-cur .pm-badge { background: var(--pm-blue); color: #fff; }

/* ── The bottom sheet (Switch course) ────────────────────────────────────
 * Slides up from the bottom. On a phone it is the width of the screen; on a
 * wider one it is a 520px panel at the bottom, centred. */
.pm-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10001;
  width: 100%; max-width: 520px; max-height: 92vh; margin: 0 auto; box-sizing: border-box;
  background: var(--pm-bg); color: var(--pm-text); font-family: var(--pm-font);
  -webkit-font-smoothing: antialiased; font-size: 15px; line-height: 1.4;
  border-radius: 26px 26px 0 0; padding: 10px 16px calc(28px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 40px rgba(2, 6, 23, .3);
  overflow-y: auto; overscroll-behavior: contain;
  transform: translateY(100%); transition: transform .22s ease;
}
.pm-sheet.pm-on { transform: none; }
.pm-sheet-grip { width: 44px; height: 5px; border-radius: 999px; background: #cbd5e1; margin: 0 auto 14px; }
.pm-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pm-sheet-head h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.01em; color: var(--pm-text); font-family: var(--pm-font-head); }
.pm-sheet-x {
  width: var(--pm-touch); height: var(--pm-touch); flex-shrink: 0; border: 0; border-radius: 999px;
  background: var(--pm-line); color: #334155; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.pm-sheet-x:hover { background: #cbd5e1; }
.pm-sheet-sub { font-size: 13px; color: var(--pm-text-2); margin-top: 2px; }
.pm-sheet .pm-secH { padding: 0; margin: 18px 0 8px; }
.pm-opts { display: flex; flex-direction: column; gap: 8px; }
.pm-opt {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px; box-sizing: border-box; width: 100%;
  border: 1.5px solid var(--pm-line); border-radius: 16px; background: #fff; color: var(--pm-text);
  font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.pm-opt:hover, .pm-opt:visited { color: var(--pm-text); text-decoration: none; }
.pm-opt:hover { border-color: #93c5fd; }
.pm-opt b { display: block; font-size: 15px; font-weight: 800; }
.pm-opt small { display: block; font-size: 12px; color: var(--pm-text-2); margin-top: 2px; }
.pm-opt.pm-cur { border: 2px solid var(--pm-blue); background: #eff6ff; }
.pm-opt.pm-soon { background: #f8fafc; cursor: default; }
.pm-opt.pm-soon:hover { border-color: var(--pm-line); }
.pm-soon .pm-badge { background: var(--pm-line); color: #334155; }
.pm-num {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px;
}
.pm-cur .pm-num { background: var(--pm-blue) !important; color: #fff !important; }
.pm-shorts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pm-short {
  display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 12px; box-sizing: border-box;
  border: 1.5px solid var(--pm-line); border-radius: 14px; background: #fff;
  font-size: 14px; font-weight: 700; color: var(--pm-text); text-decoration: none; line-height: 1.25;
}
.pm-short:hover, .pm-short:visited { color: var(--pm-text); text-decoration: none; }
.pm-short:hover { border-color: #93c5fd; }
.pm-short i { width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0; }
.pm-short.pm-cur { border: 2px solid var(--pm-blue); background: #eff6ff; }
.pm-short-all, .pm-short-all:visited { border-color: transparent; background: none; color: var(--pm-blue-text); font-weight: 800; }
.pm-sheet-note {
  margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--pm-line);
  font-size: 13px; color: #334155; line-height: 1.5;
}

/* ── Where a lesson stands: grey, orange or green ─────────────────────── */
/* /pm-lesson-status.js draws the dot; this is its size, and the key to it. */
.pm-dot { display: block; flex-shrink: 0; }
.pm-dotkey { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; font-size: 12px; font-weight: 700; color: var(--pm-text-2); }
.pm-dotkey > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.pm-dotkey .pm-dot { width: 16px; height: 16px; }

/* While the menu or the sheet is open the page behind does not scroll. */
html.pm-locked, html.pm-locked body { overflow: hidden; }

/* ── The pop-outs over a redesigned page ─────────────────────────────────
 * Key facts, flashcards, key terms, the glossary, a section's quiz and the
 * mock exam: Level 2's .cs-overlay (level-2/l2-popout.js) and Level 1's
 * .cs-overlay and .gx-overlay. Their own styles are the courses' stylesheets',
 * which other courses share; these are only for a page with the new header. On
 * a phone each is a sheet that comes up from the bottom, like Switch course. */
/* Not on the tutor dashboard (header.pm-top-tutor, tutor redesign Part 1): its
   own pop-ups keep their look until their part restyles them. */
body:has(header.pm-top:not(.pm-top-tutor)) :is(.cs-overlay, .gx-overlay) { background: rgba(15, 23, 42, .55); backdrop-filter: none; -webkit-backdrop-filter: none; }
body:has(header.pm-top:not(.pm-top-tutor)) :is(.cs-modal, .gx-modal) { border-radius: 24px; background: #fff; font-family: var(--pm-font); box-shadow: 0 24px 60px rgba(2, 6, 23, .3); }
body:has(header.pm-top:not(.pm-top-tutor)) :is(.cs-header, .gx-header) { align-items: center; gap: 12px; padding: 14px 14px 14px 18px; border-bottom: 1px solid var(--pm-line); }
body:has(header.pm-top:not(.pm-top-tutor)) :is(.cs-header-icon, .gx-header-icon) { width: 40px; height: 40px; border-radius: 12px; background: #dbeafe; color: var(--pm-blue-text); font-size: 20px; }
body:has(header.pm-top:not(.pm-top-tutor)) :is(.cs-header-text, .gx-header-text) { min-width: 0; }
body:has(header.pm-top:not(.pm-top-tutor)) :is(.cs-header-eyebrow, .gx-eyebrow) { font: 800 12px/1.35 var(--pm-font); letter-spacing: .05em; color: var(--pm-text-2); margin: 0 0 2px; }
body:has(header.pm-top:not(.pm-top-tutor)) :is(.cs-header-title, .gx-title) { font: 800 18px/1.25 var(--pm-font-head); color: var(--pm-text); }
body:has(header.pm-top:not(.pm-top-tutor)) :is(.cs-close, .gx-close) { width: var(--pm-touch); height: var(--pm-touch); border-radius: 999px; background: var(--pm-line); color: #334155; font-size: 17px; }
body:has(header.pm-top:not(.pm-top-tutor)) :is(.cs-close, .gx-close):hover { background: #cbd5e1; }
body:has(header.pm-top:not(.pm-top-tutor)) :is(.cs-body, .gx-body) { padding: 16px 18px 20px; overscroll-behavior: contain; }
body:has(header.pm-top:not(.pm-top-tutor)) :is(.cs-footer, .gx-footer) { background: #f8fafc; border-top: 1px solid var(--pm-line); padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); }
body:has(header.pm-top:not(.pm-top-tutor)) .cs-footer { font: 600 13px/1.4 var(--pm-font); color: var(--pm-text-2); border-radius: 0; }
body:has(header.pm-top:not(.pm-top-tutor)) .cs-fact-list { gap: 10px; }
body:has(header.pm-top:not(.pm-top-tutor)) .cs-fact { font-size: 16px; line-height: 1.55; color: #334155; background: #f8fafc; border: 1px solid var(--pm-line); border-radius: 14px; padding: 12px 14px; }
body:has(header.pm-top:not(.pm-top-tutor)) .cs-fact > span:last-child { min-width: 0; overflow-wrap: break-word; }
body:has(header.pm-top:not(.pm-top-tutor)) .cs-fact strong { color: var(--pm-text); }
body:has(header.pm-top:not(.pm-top-tutor)) .cs-fact-bullet { width: 22px; height: 22px; background: var(--pm-green); margin-top: 1px; }
body:has(header.pm-top:not(.pm-top-tutor)) .gx-btn { min-height: 48px; border-radius: 14px; background: var(--pm-green); color: #fff; font: 800 15px/1.2 var(--pm-font); }
body:has(header.pm-top:not(.pm-top-tutor)) .gx-btn:hover { background: var(--pm-green-hover); }
body:has(header.pm-top:not(.pm-top-tutor)) .gx-btn.ghost { background: #fff; color: var(--pm-text); border: 1.5px solid #cbd5e1; }
body:has(header.pm-top:not(.pm-top-tutor)) .gx-btn.ghost:hover { background: #f8fafc; }
body:has(header.pm-top:not(.pm-top-tutor)) .gx-footer { flex-wrap: wrap; gap: 8px; }
/* a flashcard: white to ask, navy to answer */
body:has(header.pm-top:not(.pm-top-tutor)) :is(.fc-face, .l2-fc-side) { border-radius: 22px; box-shadow: 0 4px 18px rgba(15, 23, 42, .1); }
body:has(header.pm-top:not(.pm-top-tutor)) :is(.fc-front, .l2-fc-front) { background: #fff; border: 1.5px solid var(--pm-line); color: var(--pm-text); }
body:has(header.pm-top:not(.pm-top-tutor)) :is(.fc-back, .l2-fc-rear) { background: var(--pm-panel); border: 0; color: #fff; }
body:has(header.pm-top:not(.pm-top-tutor)) :is(.fc-front p, .l2-fc-front .l2-fc-face) { font: 800 clamp(19px, 5.2vw, 24px)/1.3 var(--pm-font-head); color: var(--pm-text); overflow-wrap: break-word; max-width: 100%; }
body:has(header.pm-top:not(.pm-top-tutor)) :is(.fc-back p, .l2-fc-rear .l2-fc-face) { font: 600 clamp(17px, 4.6vw, 20px)/1.5 var(--pm-font); color: #fff; overflow-wrap: break-word; max-width: 100%; }
body:has(header.pm-top:not(.pm-top-tutor)) :is(.fc-hint, .l2-fc-hint) { font: 600 13px/1.4 var(--pm-font); font-style: normal; padding: 0 12px; }
body:has(header.pm-top:not(.pm-top-tutor)) :is(.fc-front .fc-hint, .l2-fc-front .l2-fc-hint) { color: var(--pm-text-2); }
body:has(header.pm-top:not(.pm-top-tutor)) :is(.fc-back .fc-hint, .l2-fc-rear .l2-fc-hint) { color: #bae6fd; }
body:has(header.pm-top:not(.pm-top-tutor)) .l2-fc-card { padding: 0; }
body:has(header.pm-top:not(.pm-top-tutor)) :is(.fc-card, .l2-fc-card):focus-visible { outline: 3px solid var(--pm-blue-text); outline-offset: 4px; border-radius: 22px; }
body:has(header.pm-top:not(.pm-top-tutor)) :is(.l2-fc-btn, .l2-kt-step) { min-height: 48px; padding: 0 16px; border-radius: 14px; border: 1.5px solid #cbd5e1; background: #fff; color: var(--pm-text); font: 800 15px/1.2 var(--pm-font); }
body:has(header.pm-top:not(.pm-top-tutor)) :is(.l2-fc-btn, .l2-kt-step):hover { background: #f8fafc; filter: none; }
body:has(header.pm-top:not(.pm-top-tutor)) :is(.l2-fc-btn, .l2-kt-step)[data-step="1"] { background: var(--pm-green); border-color: transparent; color: #fff; }
body:has(header.pm-top:not(.pm-top-tutor)) :is(.l2-fc-btn, .l2-kt-step)[data-step="1"]:hover { background: var(--pm-green-hover); }
body:has(header.pm-top:not(.pm-top-tutor)) .fc-count { text-align: center; margin: 12px 0 0; }
body:has(header.pm-top:not(.pm-top-tutor)) :is(.fc-count, .l2-fc-count) { font: 700 14px/1.3 var(--pm-font); color: var(--pm-text-2); }
/* key terms, and Level 1's glossary */
body:has(header.pm-top:not(.pm-top-tutor)) .l2-kt-sense p { font-size: 16px; line-height: 1.6; color: var(--pm-text); }
body:has(header.pm-top:not(.pm-top-tutor)) .l2-kt-sense-ctx { font-size: 12px; color: var(--pm-text-2); }
body:has(header.pm-top:not(.pm-top-tutor)) :is(.l2-kt-item, .gl-term) { border-color: var(--pm-line); }
body:has(header.pm-top:not(.pm-top-tutor)) .gl-term-name { font: 700 17px/1.3 var(--pm-font-head); color: var(--pm-text); }
body:has(header.pm-top:not(.pm-top-tutor)) .gl-term-def { font-size: 15px; line-height: 1.55; color: #334155; }
body:has(header.pm-top:not(.pm-top-tutor)) .gl-search { min-height: 52px; border: 1.5px solid #cbd5e1; border-radius: 16px; padding: 0 16px; font: 500 16px var(--pm-font); }
body:has(header.pm-top:not(.pm-top-tutor)) .gl-search:focus { outline: 3px solid var(--pm-blue-text); outline-offset: 1px; border-color: var(--pm-blue-text); }
body:has(header.pm-top:not(.pm-top-tutor)) .gl-chips { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 3px 3px 8px; gap: 8px; }
body:has(header.pm-top:not(.pm-top-tutor)) .gl-chip { flex: 0 0 auto; white-space: nowrap; min-height: var(--pm-touch); padding: 0 16px; border: 1.5px solid #cbd5e1; border-radius: 99px; font: 700 14px/1 var(--pm-font); color: var(--pm-text); }
body:has(header.pm-top:not(.pm-top-tutor)) .gl-chip.active { background: var(--pm-navy); border-color: var(--pm-navy); color: #fff; }
body:has(header.pm-top:not(.pm-top-tutor)) .gl-term-lessons .lt { font: 700 12px/1.3 var(--pm-font); color: var(--pm-blue-text); background: #dbeafe; border-radius: 99px; padding: 3px 9px; }
@media (max-width: 640px) {
  body:has(header.pm-top:not(.pm-top-tutor)) :is(.cs-overlay, .gx-overlay) { padding: 0; align-items: flex-end; }
  body:has(header.pm-top:not(.pm-top-tutor)) :is(.cs-modal, .gx-modal) { max-width: 100%; max-height: 92vh; border-radius: 26px 26px 0 0; }
  body:has(header.pm-top:not(.pm-top-tutor)) :is(.fc-face, .l2-fc-side) { min-height: 270px; }
  body:has(header.pm-top:not(.pm-top-tutor)) .gx-footer .gx-btn { flex: 1 1 auto; padding: 0 12px; }
}

@media print { header.pm-top, .pm-menu, .pm-sheet, .pm-scrim { display: none !important; } }

/* Short-answer feedback that leads straight to a retry. */
.pm-sa-retry {
  margin-top: 12px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid #cbd5e1; background: #f8fafc; color: #1e293b;
  overflow-wrap: anywhere;
}
.pm-sa-retry strong { color: #0f172a; }
.pm-sa-retry p { margin: 6px 0 10px; }
.pm-sa-retry-button {
  min-height: 44px; padding: 8px 13px; border-radius: 9px; border: 1px solid #1d4ed8;
  color: #1e40af; background: #fff; font: inherit; font-weight: 700; cursor: pointer;
}
.pm-sa-retry-button:disabled { cursor: wait; opacity: .68; }
.pm-sa-retry-form label { display: block; margin-bottom: 8px; }
.pm-sa-retry-form textarea {
  display: block; box-sizing: border-box; width: 100%; margin-top: 5px; padding: 10px;
  border: 1px solid #64748b; border-radius: 9px; background: #fff; color: #0f172a;
  font: inherit; font-size: max(1em, 16px); resize: vertical;
}
.pm-sa-retry-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pm-sa-retry-status { font-weight: 700; }
