/* EduBoard — student portal.
   Layout comes from the console design system (styles.css). This file adds the
   portal-only pieces: the course/test cards, the exam
   runner and the response sheet (a faithful port of the source's carbon-copy
   layout, including its "not attempted" 5th-option handling). */

/* ================================================================
   DASHBOARD — stat tiles
   Icon chip + number/label pair, laid out only within the student
   dashboard (.dash-stats scopes it so the plain admin .stat markup in
   app.js, which has no icon child, is untouched).
   ================================================================ */
.dash-stats .stat { display: flex; align-items: center; gap: 12px; }
.dash-stats .stat-ic {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px;
  display: grid; place-items: center; background: var(--indigo-soft); color: var(--indigo);
}
.dash-stats .stat-ic svg { width: 19px; height: 19px; }
.dash-stats .stat.warn .stat-ic { background: var(--amber-bg); color: var(--amber); }
.dash-stats .stat.bad .stat-ic { background: var(--coral-bg); color: var(--coral); }

/* ================================================================
   COURSE / TEST CARDS
   Icon + status badge in the head, title and description in the body,
   and an action footer pinned to the bottom so every card in a row
   ends at the same height.
   ================================================================ */
.cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(292px, 1fr)); gap: 16px; align-items: stretch; animation: ebFadeUp 0.3s ease; }

.ecard {
  display: flex; flex-direction: column;
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px; height: 100%;
  box-shadow: 0 1px 2px rgba(23, 22, 48, 0.04);
  transition: box-shadow 0.16s ease, transform 0.16s ease, border-color 0.16s ease;
}
.ecard:hover { box-shadow: 0 4px 18px rgba(23, 22, 48, 0.09); transform: translateY(-2px); border-color: var(--lilac); }

.ecard-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.ecard-icon {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  background: var(--indigo-soft); color: var(--indigo);
  display: grid; place-items: center;
}
.ecard-icon svg { width: 21px; height: 21px; }
.ecard-badges { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }

.ecard-body { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.ecard-title {
  margin: 0; font-family: var(--display); font-size: 16px; font-weight: 700; line-height: 1.32; letter-spacing: -0.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ecard-desc {
  margin: 0; font-size: 13px; color: var(--muted); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* ---------- Meta chips ----------
   Exam-card facts (question count, duration, schedule) as small pills
   with an icon, rather than a bare mono-font line of dot-separated
   text — reads as structured data at a glance and wraps cleanly on
   narrow screens instead of overflowing a single row. */
.ecard-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
/* Plain-text meta (subject/subscription/store cards, which don't use
   chips) keeps the original compact dot-separated style. */
.ecard-meta > span:not(.ecard-chip) {
  display: inline-flex; align-items: center;
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
}
.ecard-meta > span:not(.ecard-chip) + span:not(.ecard-chip)::before { content: "·"; margin-right: 10px; opacity: 0.6; }
.ecard-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--mist); border: 1px solid var(--line); color: var(--muted);
  font-size: 11.5px; font-weight: 600; line-height: 1; white-space: nowrap;
  padding: 5px 9px 5px 7px; border-radius: 7px;
}
.ecard-chip-ic { display: inline-flex; width: 12px; height: 12px; flex-shrink: 0; opacity: 0.85; }
.ecard-chip-ic svg { width: 100%; height: 100%; }

.ecard-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid #f0f0f7;
}
.ecard-row .btn { flex: 1 1 auto; justify-content: center; }

/* ---------- Status notes inside a card ---------- */
/* Icon + text sit on one flex row at every width. `flex-wrap: nowrap` keeps
   the icon from ever dropping onto its own line, and the text span below
   gets `min-width: 0` — without it a flex child won't shrink below its
   full unwrapped width, so on a wide desktop card the sentence fits and
   looks fine, but on a narrow mobile card it overflows past the icon
   instead of wrapping beside it (looks "not inline"). min-width: 0 lets
   it wrap normally and stay flush against the icon on any screen size. */
.locknote, .oknote, .infonote {
  border-radius: 9px; padding: 8px 11px; font-size: 12.5px; line-height: 1.45;
  display: flex; flex-wrap: nowrap; align-items: flex-start; gap: 7px;
}
.statusnote-ic { display: inline-flex; width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; }
.statusnote-ic svg { width: 100%; height: 100%; }
.statusnote-tx { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; }
.locknote { background: var(--amber-bg); border: 1px solid #f0d9ae; color: #8a4708; }
.oknote { background: var(--ok-bg); border: 1px solid #bfe6cc; color: #14672f; }
.infonote { background: var(--indigo-soft); border: 1px solid var(--lilac); color: var(--indigo-deep); }

/* ---------- Percentage bar in results tables ---------- */
.scorebar { height: 6px; background: #e6e6f2; border-radius: 99px; overflow: hidden; margin-top: 6px; max-width: 160px; }
.scorebar > div { height: 100%; background: var(--indigo); border-radius: 99px; }

/* ---------- Leaderboard ---------- */
.tbl tbody tr.me { background: var(--indigo-soft) !important; }
.tbl tbody tr.me td { font-weight: 600; }
.rank-medal { font-family: var(--display); font-weight: 800; }

/* ================================================================
   EXAM RUNNER (full-screen overlay)
   ================================================================ */
.runner { position: fixed; inset: 0; background: var(--mist); z-index: 80; overflow-y: auto; }
/* No title bar: the quiz engine owns the whole screen. No return button
   either — the way out (mid-paper or after submit) is the browser's Back
   gesture, handled by armRunnerBack() in student.js. */
.runner-body { padding: 0; min-height: 100%; }
.runner-msg {
  max-width: 460px; margin: 60px auto; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px; text-align: center;
  animation: ebFadeUp 0.3s ease;
}
.runner-msg h3 { margin: 0 0 8px; font-size: 19px; }
.runner-msg p { color: var(--muted); margin: 0 0 18px; }

/* ================================================================
   BRANDED LOADING STATE
   Shared "boot" screen used any time a test/practice paper is being
   fetched — before the engine has anything to show. Replaces the old
   bare "Loading…" text with a centred spinner + label matching the
   portal's own palette, so the hop from dashboard → runner shell →
   engine feels like one continuous surface instead of a flash of
   plain text between two very different-looking screens.
   ================================================================ */
.runner-boot {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 24px; text-align: center;
  padding-top: calc(24px + env(safe-area-inset-top));
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
.runner-boot-spin {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--indigo);
  animation: ebSpin 0.8s linear infinite;
}
.runner-boot p { margin: 0; color: var(--muted); font-size: 14px; font-weight: 500; }
.runner-boot .runner-boot-title { color: #1a1a2e; font-size: 16px; font-weight: 700; font-family: var(--display); }
@keyframes ebSpin { to { transform: rotate(360deg); } }
@keyframes ebFadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .runner-boot-spin { animation-duration: 2.4s; }
  .runner-msg { animation: none; }
  .cardgrid { animation: none; }
}

/* Content that replaces a loading state (the mounted quiz engine, a
   freshly-rendered pane) fades in rather than popping into place. */
.eb-fade-in { animation: ebFadeUp 0.28s ease; }
@media (prefers-reduced-motion: reduce) { .eb-fade-in { animation: none; } }

/* ---------- Skeleton placeholders for card/list panes ----------
   Shown the instant a view mounts, before its data arrives — a shimmer
   silhouette of the real cards rather than a lone "Loading…" line, so
   test-series, practice and subscription panes never show a blank or
   text-only moment while their exam list is in flight. */
.skel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(292px, 1fr)); gap: 16px; }
.skel-card {
  height: 168px; border-radius: 14px; border: 1px solid var(--line);
  background: linear-gradient(100deg, var(--paper) 40%, var(--mist) 50%, var(--paper) 60%);
  background-size: 250% 100%; animation: ebShimmer 1.4s ease-in-out infinite;
}
@keyframes ebShimmer { from { background-position: 120% 0; } to { background-position: -20% 0; } }
@media (prefers-reduced-motion: reduce) { .skel-card { animation: none; background: var(--mist); } }

/* Compact inline loading row for table/list panes (dashboard, subscriptions)
   where a full skeleton grid would be overkill. */
.pane-loading { display: flex; align-items: center; gap: 10px; padding: 6px 2px; color: var(--muted); font-size: 13.5px; }
.pane-loading .runner-boot-spin { width: 18px; height: 18px; border-width: 2px; }

/* ================================================================
   STANDALONE STUDY-NOTES READER
   Its own tab, its own full viewport. There is no portal chrome and
   no close bar — the reader's own toolbar is the whole interface.

   The height chain matters: the engine's .pdfre-root carries NO
   height of its own, so a shell asked for height:100% resolves
   against an auto-height parent and collapses to nothing. The
   document then never renders and the reader appears to hang. Giving
   the host AND .pdfre-root a resolved height is what makes 100% mean
   the viewport.
   ================================================================ */
html.pdfre-standalone,
body.pdfre-standalone {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;              /* the document scrolls, never the page */
  overscroll-behavior: none;     /* no rubber-banding / pull-to-refresh */
  background: #202124;           /* matches the reader's dark surface */
}
body.pdfre-standalone #app { height: 100%; }

.pdfre-host {
  box-sizing: border-box;
  width: 100%;
  height: 100vh;
  height: 100dvh;                /* tracks mobile browser chrome as it hides */
  /* keep the toolbar and dock clear of notches and home indicators */
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: #202124;
}
/* the missing link — without this the shell has nothing to be 100% OF */
.pdfre-host > .pdfre-root { height: 100%; }
/* full-bleed: no floating card edges when the reader owns the screen */
.pdfre-host .pdfre-shell { border: 0; border-radius: 0; max-height: 100%; height: 100%; }

/* Loading / error placeholder shown before the engine takes over. */
.pdfre-boot {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; color: #e8eaed; font-family: var(--body); text-align: center; padding: 24px;
}
.pdfre-boot h3 { margin: 0; font-family: var(--display); font-size: 18px; font-weight: 700; }
.pdfre-boot p { margin: 0; color: #9aa0a6; font-size: 14px; max-width: 340px; line-height: 1.55; }
.pdfre-boot-spin {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.16); border-top-color: #8ab4f8;
  animation: pdfre-spin 0.8s linear infinite;
}
@keyframes pdfre-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pdfre-boot-spin { animation-duration: 2.4s; } }

/* Tablet — roomy enough for the full toolbar, so only the dock needs
   lifting clear of the bottom edge. */
@media (min-width: 641px) and (max-width: 1024px) {
  .pdfre-host .pdfre-dock { bottom: 18px; }
}

/* Phone — the engine already compacts its controls below 640px. Here we
   only make sure the dock clears the home indicator and that the title
   never pushes the buttons off the bar. */
@media (max-width: 640px) {
  .pdfre-host .pdfre-dock { bottom: calc(12px + env(safe-area-inset-bottom)); }
  .pdfre-host .pdfre-title {
    max-width: 52vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
}

/* ================================================================
   RESPONSE SHEET (carbon copy) — ported from the source add-on.
   Opens as its own page so Print / Save-as-PDF produces a clean
   multi-page document.
   ================================================================ */
.rsheet-page { max-width: 900px; margin: 0 auto; padding: 26px 20px 60px; }

.rsheet-head {
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 20px; margin-bottom: 12px; text-align: center;
  box-shadow: 0 1px 2px rgba(23,22,48,.04), 0 6px 20px rgba(23,22,48,.05);
}
.rsheet-head h2 { margin: 0; font-size: 1.3rem; line-height: 1.3; letter-spacing: -0.01em; word-break: break-word; }
.rsheet-head .meta { font-size: 0.85rem; margin-top: 4px; color: var(--muted); font-weight: 600; }
.rsheet-note {
  color: var(--muted); font-size: 0.85rem; line-height: 1.55; background: #f8f8fc;
  border: 1px dashed var(--line); border-radius: 10px; padding: 10px 14px; margin: 12px 0 16px;
  text-align: center;
}

/* ---- result / rank stat tiles — nested INSIDE the single header block,
   separated from the title/meta by a hairline divider rather than its own
   card, so the whole header (title, candidate meta, score) reads as one
   unit instead of stacked separate boxes. ---- */
.aq-rs-board {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px;
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); break-inside: avoid;
}
.aq-rs-board > div {
  background: #f8f8fc; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 8px; text-align: center; min-width: 0;
}
.aq-rs-board .n { font-family: var(--display); font-size: 1.3rem; font-weight: 800; color: var(--indigo); line-height: 1.15; font-variant-numeric: tabular-nums; }
.aq-rs-board .n small { font-size: 0.75rem; color: #9aa0b4; font-weight: 700; }
.aq-rs-board .l { font-size: 0.64rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; margin-top: 5px; }

/* ---- question cards ---- */
.aq-cc-sheet { display: flex; flex-direction: column; gap: 14px; }
.aq-cc-item {
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(23,22,48,.04), 0 6px 20px rgba(23,22,48,.05);
}
.aq-cc-q { font-weight: 600; line-height: 1.55; color: #1e1d3a; margin-bottom: 12px; font-size: 0.98rem; }
.aq-cc-q img { max-width: 100%; height: auto; border-radius: 8px; }

/* ---- per-question header — a thin row holding just the question NUMBER
   and (when this particular question has a second saved language, see
   aimcqBuildCarbon's `langs`/`content`) the language switch, pinned to the
   right — same placement as the exam runner's own per-question EN/HI
   buttons. The question text itself lives in `.aq-cc-q` below, OUTSIDE this
   row, so it always gets the full card width, same as the runner's
   `.aq-q-body`. A question with no second language just shows the number
   with nothing beside it. ---- */
.aq-cc-qhead { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.aq-cc-langsw { display: inline-flex; gap: 4px; margin-left: auto; }
.aq-cc-lang-btn {
  border: 1px solid var(--line); background: var(--paper); color: var(--muted);
  font-weight: 700; font-size: 0.78rem; padding: 5px 14px; border-radius: 999px;
  cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.aq-cc-lang-btn:hover { border-color: var(--aq-primary, #007bff); color: var(--aq-primary, #007bff); }
.aq-cc-lang-btn.active { background: var(--aq-primary, #007bff); border-color: var(--aq-primary, #007bff); color: #fff; }
@media print { .aq-cc-langsw { display: none; } }
.aq-cc-n {
  display: inline-block; background: var(--indigo-soft); color: var(--indigo);
  font-weight: 800; font-size: 0.78rem; padding: 3px 11px; border-radius: 999px;
  margin-right: 8px; vertical-align: middle; letter-spacing: 0.02em; white-space: nowrap;
}

/* ---- options: mirrored 1:1 from the exam runner ----------------------------
   The engine's own rules are all scoped under #aimcq-root-scope, so they can't
   reach this page. Rather than approximate them, the runner's design tokens and
   option metrics are reproduced verbatim below — same 2px border, same 8px
   radius, same 0.9rem/1rem padding, same 28px circular letter badge, same state
   colours, same image and KaTeX handling. An option therefore looks and lays
   out identically whether a candidate is sitting the exam or reading it back.
   -------------------------------------------------------------------------- */
.aq-cc-sheet {
  --aq-primary: #007bff;
  --aq-secondary: #6c757d;
  --aq-secondary-dark: #5a6268;
  --aq-success: #28a745;
  --aq-success-light: #e9f7eb;
  --aq-danger: #dc3545;
  --aq-danger-light: #fdeaec;
  --aq-light: #f8f9fa;
  --aq-white: #fff;
  --aq-border: #dee2e6;
  --aq-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* .aq-options ul */
.aq-cc-opts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.65rem; }
.aq-cc-opts li { list-style: none !important; }

/* .aq-options label */
.aq-cc-opt {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 0.9rem 1rem;
  border: 2px solid var(--aq-border); border-radius: 8px;
  background: var(--aq-white); position: relative;
  font-family: var(--aq-font);
}

/* .aq-opt-wrap */
.aq-cc-opt-wrap { display: flex; align-items: center; width: 100%; }

/* .aq-opt-lbl */
.aq-cc-key {
  display: inline-flex; justify-content: center; align-items: center;
  width: 28px; height: 28px; flex-shrink: 0;
  background: var(--aq-light); color: var(--aq-secondary-dark);
  border-radius: 50%; margin-right: 10px;
  font-weight: bold; font-size: 0.9rem;
  border: 1px solid var(--aq-border);
  font-family: var(--aq-font);
}

/* .aq-opt-text */
.aq-cc-otext { flex: 1; min-width: 0; font-family: var(--aq-font); font-size: 1rem; line-height: 1.5; }
.aq-cc-otext-body { font-size: 1rem; }
.aq-cc-otext p { margin: 0; font-family: var(--aq-font); font-size: 1rem; }

/* .aq-opt-img — identical rule to the runner's */
.aq-cc-opt-img { max-width: 100%; height: auto; border-radius: 6px; margin-bottom: 0.25rem; display: block; flex-shrink: 0; }

/* ---- option states, mapped to the runner's ---- */
/* label.selected */
.aq-cc-opt.marked { border-color: var(--aq-primary); background: #f0f7ff; }
.aq-cc-opt.marked .aq-cc-key { background: var(--aq-primary); color: #fff; border-color: var(--aq-primary); }
/* label.correct */
.aq-cc-opt.right { border-color: var(--aq-success) !important; background: var(--aq-success-light) !important; }
.aq-cc-opt.right .aq-cc-key { background: var(--aq-success) !important; color: #fff !important; border-color: var(--aq-success) !important; }
/* label.incorrect */
.aq-cc-opt.wrong { border-color: var(--aq-danger) !important; background: var(--aq-danger-light) !important; }
.aq-cc-opt.wrong .aq-cc-key { background: var(--aq-danger) !important; color: #fff !important; border-color: var(--aq-danger) !important; }
/* label.missed — the correct answer the candidate didn't pick */
.aq-cc-opt.missed { border: 2px dashed var(--aq-success) !important; }
/* label.na-marked — 5th "not attempted" option chosen deliberately: never red */
.aq-cc-opt.skipped { border-color: #94a3b8 !important; background: #f1f5f9 !important; }
.aq-cc-opt.skipped .aq-cc-key { background: #64748b !important; color: #fff !important; border-color: #64748b !important; }

/* ---- colour-key legend, shown once above the sheet since the options
   themselves carry colour only (no trailing text badge) — swatches share
   the exact colours used by .aq-cc-opt's own state classes above. ---- */
.aq-cc-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
  padding: 10px 14px; margin-bottom: 14px; border-radius: 10px;
  background: var(--aq-light, #f8f9fa); border: 1px solid var(--aq-border, #dee2e6);
  font-size: 0.82rem; color: var(--aq-secondary-dark, #495057);
}
.aq-cc-legend-lbl { font-weight: 700; color: inherit; }
.aq-cc-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.aq-cc-legend-swatch {
  display: inline-block; width: 13px; height: 13px; border-radius: 4px;
  border: 2px solid var(--aq-border, #dee2e6); background: var(--aq-white, #fff); flex-shrink: 0;
}
.aq-cc-legend-swatch.marked { border-color: var(--aq-primary, #007bff); background: #f0f7ff; }
.aq-cc-legend-swatch.right { border-color: var(--aq-success, #28a745); background: var(--aq-success-light, #e9f7eb); }
.aq-cc-legend-swatch.wrong { border-color: var(--aq-danger, #dc3545); background: var(--aq-danger-light, #fdeaec); }
.aq-cc-legend-swatch.missed { border: 2px dashed var(--aq-success, #28a745); background: var(--aq-success-light, #e9f7eb); }
.aq-cc-legend-swatch.skipped { border-color: #94a3b8; background: #f1f5f9; }

/* ---- KaTeX — identical rule to the runner's, so display maths scrolls here
   exactly as it does in the exam instead of re-wrapping differently ---- */
.aq-cc-sheet .katex-display { overflow-x: auto; overflow-y: hidden; padding-bottom: 8px; white-space: nowrap; }

/* ---- status chips (still used by the pre-deadline carbon copy, which has
   no right/wrong state yet — only "marked"/"you skipped") ---- */
.aq-cc-tick {
  align-self: center; margin-left: auto; padding-left: 10px; white-space: nowrap; font-weight: 700; font-size: 0.66rem;
  text-transform: uppercase; letter-spacing: 0.05em; padding: 3px 9px; border-radius: 999px;
  background: var(--indigo-soft); color: var(--indigo);
}
.aq-cc-tick.ok { background: #dcfce7; color: #15803d; }
.aq-cc-tick.bad { background: #fee2e2; color: #b91c1c; }
.aq-cc-tick.skip { background: #e2e8f0; color: #475569; }
.aq-cc-na {
  display: inline-block; margin-top: 10px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--amber); background: #fef3c7; border: 1px solid #fde68a;
  padding: 3px 10px; border-radius: 999px;
}

/* ---- explanation ---- */
.aq-cc-expl {
  margin-top: 14px; padding: 14px 16px; background: #f0f9ff; border-left: 4px solid #0ea5e9;
  border-radius: 10px; font-size: 0.9rem; color: #33344f; line-height: 1.65;
}
.aq-cc-expl > strong:first-child {
  display: block; color: #0369a1; font-weight: 800; text-transform: uppercase;
  font-size: 0.7rem; letter-spacing: 0.07em; margin-bottom: 5px;
}
.aq-cc-expl img { max-width: 100%; height: auto; border-radius: 6px; }

/* ---- rich content inside statements, options and explanations ---- */
.aq-cc-q p, .aq-cc-expl p { margin: 0 0 0.6em; }
.aq-cc-q p:last-child, .aq-cc-expl p:last-child { margin-bottom: 0; }
/* <p> tags are stripped from option text before render, so nothing here needs
   paragraph margins — this only guards against markup arriving another way. */
.aq-cc-otext p { margin: 0; }
.aq-cc-q ul, .aq-cc-expl ul, .aq-cc-otext ul { list-style: disc !important; padding-left: 1.35rem !important; margin: .5rem 0 .75rem !important; }
.aq-cc-q ol, .aq-cc-expl ol, .aq-cc-otext ol { list-style: decimal !important; padding-left: 1.35rem !important; margin: .5rem 0 .75rem !important; }
.aq-cc-q li, .aq-cc-expl li, .aq-cc-otext li { display: list-item !important; list-style: inherit !important; padding-left: .25rem !important; margin: 0 0 .35em !important; font-weight: 400; line-height: 1.6; }
.aq-cc-q li:last-child, .aq-cc-expl li:last-child { margin-bottom: 0 !important; }

/* ---- tables (match-the-column etc.) ---- */
.aq-cc-q table, .aq-cc-expl table, .aq-cc-otext table {
  display: table !important; width: 100% !important; max-width: 100% !important; min-width: 0 !important;
  height: auto !important; table-layout: fixed !important; border-collapse: collapse !important;
  border-spacing: 0 !important; border: 1px solid #e2e3ee !important; margin: .6rem 0 .9rem !important;
  padding: 0 !important; font-size: .9rem !important; line-height: 1.55 !important;
  background: #fff !important; color: #33344f !important; float: none !important;
}
.aq-cc-q col, .aq-cc-expl col, .aq-cc-otext col { width: auto !important; }
.aq-cc-q th, .aq-cc-q td, .aq-cc-expl th, .aq-cc-expl td, .aq-cc-otext th, .aq-cc-otext td {
  border: 1px solid #e2e3ee !important; padding: 9px 12px !important; text-align: left !important;
  vertical-align: top !important; font-size: .9rem !important; font-weight: 400 !important;
  line-height: 1.55 !important; color: #33344f !important; background: transparent !important;
  width: auto !important; height: auto !important; min-width: 0 !important; max-width: none !important;
  white-space: normal !important; word-break: break-word !important; overflow-wrap: break-word !important;
}
.aq-cc-q th, .aq-cc-expl th, .aq-cc-otext th { background: #f8f8fc !important; font-weight: 700 !important; color: #1e1d3a !important; vertical-align: middle !important; }
.aq-cc-q tbody tr:nth-child(even) td, .aq-cc-expl tbody tr:nth-child(even) td { background: #fafbfd !important; }
.aq-cc-q thead, .aq-cc-q tbody, .aq-cc-q tfoot, .aq-cc-q tr,
.aq-cc-expl thead, .aq-cc-expl tbody, .aq-cc-expl tfoot, .aq-cc-expl tr,
.aq-cc-otext thead, .aq-cc-otext tbody, .aq-cc-otext tfoot, .aq-cc-otext tr {
  background: transparent !important; height: auto !important; padding: 0 !important; margin: 0 !important; border: none !important;
}
@media (max-width: 600px) {
  .aq-cc-q table, .aq-cc-expl table, .aq-cc-otext table { display: block !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch !important; }
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 640px) {
  .cardgrid { grid-template-columns: 1fr; }
  /* Continue Learning stays a peek-ahead horizontal carousel on mobile
     instead of a tall stack — each card gets most of the width so the
     next one visibly peeks in, signalling there's more to swipe to. */
  .cardgrid.cardgrid-carousel {
    display: flex; grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; gap: 12px; margin: 0 -16px; padding: 2px 16px 10px;
  }
  .cardgrid.cardgrid-carousel::-webkit-scrollbar { display: none; }
  .cardgrid.cardgrid-carousel .ecard { flex: 0 0 82%; scroll-snap-align: start; }
  /* Stat tiles: keep the 2x2 icon-tile grid even down to narrow phones —
     dash-stats overrides the base .stats single-column collapse below. */
  .dash-stats { grid-template-columns: 1fr 1fr !important; }
  .dash-stats .stat-ic { width: 34px; height: 34px; }
  .dash-stats .stat-ic svg { width: 17px; height: 17px; }
  /* Recent Activity rows: bold title leads, then the score/% badge sit on
     one line, the attempt date below in a dim footnote line, and the
     practice button runs full-width beneath — reads as an app list row
     instead of repeating generic label/value pairs down the card. */
  .activity-wrap { background: transparent; border: none; box-shadow: none; }
  .activity-tbl.tbl tbody tr { padding: 12px 14px; }
  .activity-tbl.tbl td { padding: 3px 0; border-bottom: none; }
  .activity-tbl.tbl td.activity-title {
    display: block; text-align: left; font-weight: 700; font-size: 14px;
    color: var(--ink); padding-top: 2px; margin-bottom: 4px;
  }
  .activity-tbl.tbl td.activity-title::before { content: none; }
  .activity-tbl.tbl td[data-label="Score"], .activity-tbl.tbl td[data-label="%"] { display: inline-flex; width: auto; padding-bottom: 6px; }
  .activity-tbl.tbl td[data-label="Score"]::before, .activity-tbl.tbl td[data-label="%"]::before { content: none; }
  .activity-tbl.tbl td[data-label="Last attempt"] {
    display: block; text-align: left; font-size: 11.5px; padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f7; margin-bottom: 10px;
  }
  .activity-tbl.tbl td[data-label="Last attempt"]::before { content: none; }
  .activity-tbl.tbl td.activity-action { display: block; text-align: left; padding-top: 0; }
  .activity-tbl.tbl td.activity-action::before { content: none; }
  .activity-tbl.tbl td.activity-action .btn { width: 100%; }
  .runner-body { padding: 0; }
  .scorebar { max-width: none; width: 120px; margin-left: auto; }
  .rsheet-page { padding: 16px 12px 50px; }
  .rsheet-head { padding: 14px 16px; }
  .rsheet-head h2 { font-size: 1.12rem; }
  .aq-rs-board { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 14px; padding-top: 14px; }
  .aq-rs-board > div { padding: 10px 6px; }
  .aq-rs-board .n { font-size: 1.1rem; }
  .aq-cc-item { padding: 15px 14px; }
  .aq-cc-opt { flex-wrap: wrap; }
  .aq-cc-tick { margin-left: 36px; }
}

/* ================================================================
   PRINT — the response sheet is the only thing that should print.
   Flex containers fragment badly across pages, so switch them to
   block flow and keep each question card whole.
   ================================================================ */
/* ---------- WhatsApp help & support floating button ---------- */
.wa-help-btn {
  position: fixed; right: 22px; bottom: 22px; z-index: 55;
  width: 54px; height: 54px; border-radius: 50%;
  background: #25D366; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
}
.wa-help-btn:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 8px 24px rgba(37, 211, 102, 0.55); }
.wa-help-btn:active { transform: scale(0.96); }
@media (max-width: 640px) {
  .wa-help-btn { right: 16px; bottom: 16px; width: 50px; height: 50px; }
  .wa-help-btn svg { width: 25px; height: 25px; }
}
@media print { .wa-help-btn { display: none !important; } }

@media print {
  .noprint, .sidebar, .menu-btn { display: none !important; }
  .runner { position: static; overflow: visible; }
  html, body { height: auto !important; overflow: visible !important; background: #fff !important; }
  .frame { display: block !important; }
  .main { padding: 0 !important; max-width: none !important; }
  .rsheet-page { max-width: none; padding: 0; }
  #response-print * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .aq-cc-sheet { display: block !important; }
  .aq-cc-item { margin-bottom: 14px; }
  .aq-cc-opts { display: block !important; }
  .aq-cc-opt { margin-bottom: 8px; }
  .aq-cc-opt:last-child { margin-bottom: 0; }
  .aq-cc-item, .aq-rs-board { break-inside: avoid; page-break-inside: avoid; box-shadow: none !important; }
  .aq-cc-opt-img, .aq-cc-q img, .aq-cc-expl img { max-width: 100% !important; break-inside: avoid; }
  .katex, .katex-display { break-inside: avoid; }
  .rsheet-head { box-shadow: none !important; }
}

/* ================================================================
   THEMING — the manager's palette flows in through CSS variables set
   by applyTheme() (student.js). Fallbacks equal the stock EduBoard look,
   so a centre that never customised anything is unchanged.
   ================================================================ */
.sidebar { background: linear-gradient(178deg, var(--indigo-deep), var(--sb-mid, #2c2691) 60%, var(--indigo)); }
.btn { border-radius: var(--btn-radius, 9px); }
.side-site { display: block; margin-top: 10px; color: #d9d7f2; font-size: 12.5px; text-decoration: none; opacity: .9; }
.side-site:hover { opacity: 1; text-decoration: underline; }

/* ================================================================
   SIGN-IN / REGISTER — split LMS layout
   Brand panel (logo, name, tagline, hero image) beside the form.
   Collapses to a single column on tablets and phones.
   ================================================================ */
.auth-split { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--paper); }
.auth-brand {
  position: relative; color: #fff; background-color: var(--indigo-deep); background-size: cover; background-position: center;
  background-image: linear-gradient(160deg, var(--indigo-deep), var(--sb-mid, #2c2691) 55%, var(--indigo));
  display: flex;
}
.auth-brand::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(500px 320px at 90% 0%, rgba(255,255,255,.16), transparent 70%), radial-gradient(380px 280px at 0% 100%, rgba(255,255,255,.1), transparent 70%); }
.auth-brand-in { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 36px 48px 56px; width: 100%; }
.auth-site { color: #fff; opacity: .85; text-decoration: none; font-size: 14px; font-weight: 600; align-self: flex-start; }
.auth-site:hover { opacity: 1; text-decoration: underline; }
.auth-brand-main { max-width: 460px; }
.auth-brand-logo { width: 64px; height: 64px; border-radius: 16px; background: #fff; display: grid; place-items: center; margin-bottom: 22px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.auth-brand-logo img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.auth-brand-logo span { font: 800 22px var(--display); color: var(--indigo); }
.auth-brand h2 { font-family: var(--display); font-size: clamp(26px, 3vw, 36px); line-height: 1.15; margin: 0 0 12px; color: #fff; }
.auth-brand p { margin: 0 0 22px; font-size: 16px; opacity: .92; line-height: 1.6; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-weight: 600; font-size: 14.5px; }
.auth-points li { display: flex; align-items: center; gap: 10px; }
.auth-points li::before { content: "✓"; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.2); font-size: 12px; flex-shrink: 0; }
.auth-form-wrap { display: grid; place-items: center; padding: 32px 22px; background: var(--mist); }
.auth-card { box-shadow: var(--shadow); }
.auth-mobile-mark { display: none; }

@media (max-width: 900px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-form-wrap { min-height: 100vh; }
  .auth-mobile-mark { display: block; }
}
