/**
 * Quiz Redesign — Foundation CSS
 *
 * Design system for the redesigned quiz pages on sewaqa.com.
 * Mockup brand: #815ef5 (matches app.blade.php global brand)
 *
 * Scope: quizzes/show.blade.php + quizzes/results.blade.php + future
 *        quiz-related views.
 *
 * Not used: layouts/app.blade.php (out of scope, surgical port only)
 *
 * Resolves: Group A color drift on quizzes/show (#6366F1/#667eea →
 *           #815ef5) as a side-effect of the redesign.
 *
 * Phase: R.1 — Foundation tokens + base utilities only.
 *        R.2 will add component styles (mobile-first).
 *        R.3 will add result screen components.
 */

/* ============================================================
 * Design tokens
 * ============================================================ */
:root {
  /* Brand (canonical with app.blade.php global) */
  --quiz-brand: #815ef5;
  --quiz-brand-light: #f5f3ff;
  --quiz-brand-dark: #1a1640;
  --quiz-brand-muted: #6b6585;

  /* Surfaces */
  --quiz-bg: #fafaff;
  --quiz-card: #ffffff;
  --quiz-border: #e5e1f7;
  --quiz-border-light: #f0eef9;
  --quiz-divider: #d8d4ea;

  /* Status colors */
  --quiz-success: #00a86b;
  --quiz-success-bg: #ecfdf5;
  --quiz-success-text: #064e3b;

  --quiz-error: #ef4444;
  --quiz-error-bg: #fef2f2;
  --quiz-error-text: #7f1d1d;

  --quiz-warning: #ffd84a;
  --quiz-warning-bg: #fff8e6;
  --quiz-warning-text: #b8860b;

  /* Brand social colors (share buttons) */
  --quiz-whatsapp: #25d366;
  --quiz-facebook: #1877f2;
  --quiz-twitter: #000000;

  /* Spacing scale */
  --quiz-space-xs: 4px;
  --quiz-space-sm: 6px;
  --quiz-space-md: 10px;
  --quiz-space-lg: 14px;
  --quiz-space-xl: 18px;
  --quiz-space-2xl: 24px;

  /* Border radii */
  --quiz-radius-sm: 6px;
  --quiz-radius-md: 8px;
  --quiz-radius-lg: 10px;
  --quiz-radius-xl: 12px;
  --quiz-radius-pill: 99px;

  /* Typography */
  --quiz-font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --quiz-font-xs: 10px;
  --quiz-font-sm: 11px;
  --quiz-font-md: 12px;
  --quiz-font-base: 13px;
  --quiz-font-lg: 15px;
  --quiz-font-xl: 16px;
  --quiz-font-2xl: 18px;
  --quiz-font-3xl: 32px;
  --quiz-font-4xl: 38px;

  /* Font weights */
  --quiz-weight-normal: 400;
  --quiz-weight-medium: 500;
  --quiz-weight-semibold: 600;
  --quiz-weight-bold: 700;

  /* Effects */
  --quiz-shadow-sm: 0 1px 3px rgba(26, 22, 64, 0.06);
  --quiz-shadow-md: 0 4px 12px rgba(26, 22, 64, 0.08);
  --quiz-shadow-lg: 0 10px 28px rgba(26, 22, 64, 0.12);
  --quiz-transition: 150ms ease;
}

/* ============================================================
 * Base container scoping
 * ============================================================ */
.quiz-redesign,
.quiz-redesign * {
  box-sizing: border-box;
}

.quiz-redesign {
  font-family: var(--quiz-font-family);
  color: var(--quiz-brand-dark);
  direction: rtl;
  background: var(--quiz-bg);
}

/* ============================================================
 * Base utilities — reusable across components
 * ============================================================ */
.quiz-card {
  background: var(--quiz-card);
  border: 1px solid var(--quiz-border);
  border-radius: var(--quiz-radius-lg);
  transition: var(--quiz-transition);
}

.quiz-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--quiz-space-xs);
  background: var(--quiz-brand-light);
  color: var(--quiz-brand);
  font-size: var(--quiz-font-xs);
  font-weight: var(--quiz-weight-bold);
  padding: 3px 9px;
  border-radius: var(--quiz-radius-pill);
}

.quiz-pill--success {
  background: var(--quiz-success-bg);
  color: var(--quiz-success);
}

.quiz-pill--error {
  background: var(--quiz-error-bg);
  color: var(--quiz-error);
}

.quiz-pill--warning {
  background: var(--quiz-warning-bg);
  color: var(--quiz-warning-text);
}

/* Letter badge for answer options (أ, ب, ج, د) */
.quiz-letter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--quiz-radius-sm);
  background: var(--quiz-brand-light);
  color: var(--quiz-brand);
  font-size: var(--quiz-font-sm);
  font-weight: var(--quiz-weight-bold);
  flex-shrink: 0;
}

.quiz-letter-badge--active {
  background: var(--quiz-brand);
  color: #ffffff;
}

/* Progress bar */
.quiz-progress-track {
  height: 5px;
  background: #e8e5f5;
  border-radius: var(--quiz-radius-pill);
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: var(--quiz-brand);
  border-radius: var(--quiz-radius-pill);
  transition: width 300ms ease;
}

/* ============================================================
 * Mobile-first responsive scaffolding (R.2 will extend)
 * Container max-width adjusts at breakpoints
 * ============================================================ */
@media (min-width: 768px) {
  /* tablet+ */
}

@media (min-width: 1024px) {
  /* desktop */
}

/* ============================================================
 * Placeholder section — components added per phase
 * ============================================================
 *
 * R.2 (mobile-first question screen) will add:
 *   .quiz-mobile-header (top bar: close, timer, count)
 *   .quiz-mobile-progress (progress bar + stats row)
 *   .quiz-question-image (image container)
 *   .quiz-question-text (label + heading)
 *   .quiz-answer-list (vertical answer options on mobile)
 *   .quiz-answer-option (single answer card)
 *   .quiz-answer-option--selected (selected state)
 *   .quiz-mobile-nav (prev/next at bottom)
 *
 * R.3 (mobile-first result screen) will add:
 *   .quiz-result-hero (score circle + trophy)
 *   .quiz-result-stats (time + rank cards)
 *   .quiz-wrong-review (yellow review card)
 *   .quiz-next-suggestion (next quiz CTA)
 *   .quiz-share-grid (4-button social share)
 *   .quiz-signup-cta (sign-up panel)
 *
 * R.X (desktop-only additions) will add:
 *   .quiz-desktop-layout (3-column grid)
 *   .quiz-navigator-sidebar (1-N question grid)
 *   .quiz-stats-sidebar (correct/wrong/allowed)
 *   .quiz-social-proof-block
 *   .quiz-keyboard-shortcuts-block
 *   .quiz-mode-indicator
 */

/* ============================================================
 * R.2 — Mobile question screen components
 * Mockup reference: temp/sewaqa_quiz_redesign_mobile_mockups.html
 *                   (Screen 2 — Question)
 * Activated when .quiz-redesign--mobile-question wrapper is present.
 * ============================================================ */

.quiz-redesign--mobile-question {
  background: var(--quiz-bg);
  min-height: 100vh;
}

/* Top bar */
.qr-mobile-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--quiz-card);
  padding: 11px 13px;
  border-bottom: 1px solid var(--quiz-border-light);
}
.qr-mobile-topbar__close {
  font-size: 18px;
  color: var(--quiz-brand-muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}
.qr-mobile-topbar__timer {
  display: flex;
  align-items: center;
  gap: var(--quiz-space-xs);
  font-size: var(--quiz-font-md);
  font-weight: var(--quiz-weight-semibold);
  color: var(--quiz-brand-dark);
}
.qr-mobile-topbar__timer i {
  font-size: 13px;
  color: var(--quiz-brand);
}
.qr-mobile-topbar__count {
  font-size: var(--quiz-font-sm);
  color: var(--quiz-brand-muted);
}

/* Progress bar wrapper (extends .quiz-progress-track from R.1) */
.qr-mobile-progress {
  padding: var(--quiz-space-md) 13px 0;
}

/* Question card area */
.qr-mobile-question-image {
  margin: 12px 13px 10px;
  background: #e8e5f5;
  border-radius: var(--quiz-radius-xl);
  min-height: 95px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.qr-mobile-question-image img {
  max-width: 100%;
  height: auto;
  display: block;
}
.qr-mobile-question-image--placeholder {
  color: var(--quiz-brand);
  opacity: 0.5;
  font-size: 28px;
}

.qr-mobile-question-text {
  padding: 0 13px var(--quiz-space-md);
}
.qr-mobile-question-text__label {
  font-size: var(--quiz-font-xs);
  color: var(--quiz-brand);
  font-weight: var(--quiz-weight-semibold);
  margin-bottom: var(--quiz-space-xs);
}
.qr-mobile-question-text__heading {
  font-size: var(--quiz-font-base);
  font-weight: var(--quiz-weight-semibold);
  margin: 0;
  line-height: 1.5;
  color: var(--quiz-brand-dark);
}

/* Answer options (mobile vertical) */
.qr-mobile-answers {
  padding: 0 13px;
  display: flex;
  flex-direction: column;
  gap: var(--quiz-space-sm);
}

.qr-mobile-answer {
  background: var(--quiz-card);
  border: 1.5px solid var(--quiz-border);
  border-radius: var(--quiz-radius-lg);
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: var(--quiz-space-md);
  cursor: pointer;
  transition: var(--quiz-transition);
}
.qr-mobile-answer:hover {
  border-color: var(--quiz-brand);
}
.qr-mobile-answer__badge {
  width: 18px;
  height: 18px;
  border-radius: var(--quiz-radius-sm);
  background: var(--quiz-brand-light);
  color: var(--quiz-brand);
  font-size: var(--quiz-font-xs);
  font-weight: var(--quiz-weight-semibold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.qr-mobile-answer__text {
  font-size: var(--quiz-font-sm);
  color: var(--quiz-brand-dark);
  flex: 1;
  /* The text from data-answer-title or .answer-label content */
}
.qr-mobile-answer__check {
  font-size: 14px;
  color: var(--quiz-brand);
  margin-right: auto;
  display: none;
}

/* Selected state — when the radio inside is checked */
.qr-mobile-answer.is-selected,
.qr-mobile-answer:has(input:checked) {
  background: var(--quiz-brand-light);
  border-color: var(--quiz-brand);
}
.qr-mobile-answer.is-selected .qr-mobile-answer__badge,
.qr-mobile-answer:has(input:checked) .qr-mobile-answer__badge {
  background: var(--quiz-brand);
  color: #ffffff;
}
.qr-mobile-answer.is-selected .qr-mobile-answer__text,
.qr-mobile-answer:has(input:checked) .qr-mobile-answer__text {
  font-weight: var(--quiz-weight-medium);
}
.qr-mobile-answer.is-selected .qr-mobile-answer__check,
.qr-mobile-answer:has(input:checked) .qr-mobile-answer__check {
  display: block;
}

/* Hide the native radio/checkbox input inside the answer */
.qr-mobile-answer input[type="radio"],
.qr-mobile-answer input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Bottom nav */
.qr-mobile-nav {
  padding: var(--quiz-space-md) 12px 12px;
  display: flex;
  gap: var(--quiz-space-sm);
  align-items: center;
}
.qr-mobile-nav__prev {
  width: 34px;
  height: 34px;
  background: var(--quiz-card);
  border: 1.5px solid var(--quiz-border);
  border-radius: var(--quiz-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}
.qr-mobile-nav__prev i {
  font-size: 16px;
  color: var(--quiz-brand);
}
.qr-mobile-nav__next {
  flex: 1;
  background: var(--quiz-brand);
  color: #ffffff;
  border: none;
  border-radius: var(--quiz-radius-lg);
  padding: var(--quiz-space-md);
  text-align: center;
  font-size: var(--quiz-font-md);
  font-weight: var(--quiz-weight-semibold);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--quiz-space-xs);
  cursor: pointer;
}
.qr-mobile-nav__next i {
  font-size: 13px;
}

/* Tablet/desktop — R.2 mobile styles only target small screens.
 * Desktop layouts will be added in R.4. For now, on desktop we
 * keep the mobile layout (will look narrow but functional). */
@media (min-width: 1024px) {
  /* .qr-mobile-* stays the same for now; R.4 will override */
}

/* ============================================================
 * R.2.9 — Hide old chrome on quiz pages (mobile redesign)
 *
 * Selectors VERIFIED against the actual markup (the original task's
 * guessed names — test-footer, test-summary, progress-squares, etc.
 * — do not exist in this view and were dropped).
 *
 * Two-tier strategy:
 *   - Tier 1 (display:none): pure-visual duplicates
 *   - Tier 2 (1px off-screen): keep functional + jQuery :visible-true
 *     for the form contract / R.6 JS bridges / safety net
 *
 * NOTE: .test-header is intentionally NOT hidden here — the protected
 * safety-net routine ensureTestHeaderVisible() force-shows it via
 * inline !important on a timer, which beats any stylesheet rule.
 * Hiding it needs a JS/Blade change (out of R.2.9 CSS-only scope).
 * ============================================================ */

/* ---- Question page: OUTSIDE-wrapper old chrome (left sidebar) ---- */
/* .progress-panel = old left column: 1-N navigator grid, correct/wrong
   stats ("تقدمك"), challenge bank, star rating, feedback stats.
   .test-header = old top bar (title + share + restart + breadcrumb);
   effective only because ensureTestHeaderVisible() is now guarded to
   no-op on redesign pages (user-approved JS guard, see show.blade.php). */
body.pt-quizpage .progress-panel {
  display: none !important;
}

/* .test-header is force-shown by aggressive legacy inline-<style> rules
   ('#full-page-container .test-header { display:flex !important }',
   specificity 1,1,0). Out-specify it by including the same #id so this
   rule wins (1,2,1). The JS force (ensureTestHeaderVisible) is separately
   guarded to no-op on redesign pages. */
body.pt-quizpage #full-page-container .test-header {
  display: none !important;
}

/* ---- Question page: INSIDE-wrapper duplicates — Tier 1 ---- */
/* Old question heading + image duplicate the new .qr-mobile-question-card.
   .question-video-container is intentionally KEPT visible because the new
   mobile card renders image/placeholder only (not video). */
.quiz-redesign--mobile-question .question-title,
.quiz-redesign--mobile-question .question-image-container {
  display: none !important;
}

/* ---- Question page: INSIDE-wrapper controls — Tier 2 (off-screen) ---- */
/* Keep radios (R.6.1 bridge), .answer-text-backup (safety net), and the
   old prev/next/submit buttons (R.6.2/R.6.6 trigger them via .click()).
   1px box (not display:none) so jQuery :visible stays true. */
.quiz-redesign--mobile-question .answer-option,
.quiz-redesign--mobile-question .quiz-navigation {
  /* clip-based visually-hidden (NOT left:-99999px — that bloats the RTL
     document width and creates a horizontal scrollbar). Stays 1px in place,
     clipped: jQuery :visible stays true, #next-question-btn keeps a non-null
     offsetParent (so R.6.6's last-question check still works), and JS .click()
     / radio .checked still function. NOT display:none (that would null the
     offsetParent on every question and make R.6.6 always submit). */
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: auto !important;
}



/* ============================================================
 * R.M.P.1 — Fix large gaps between answer cards (real iOS Safari)
 *
 * DIAGNOSIS (the originally-guessed cause was wrong):
 * The mobile cards (.qr-mobile-answer) are NOT wrapped in a
 * .qr-mobile-answers element — they render as direct children of the
 * OLD .answer-options flex container, interleaved with the old
 * .answer-option divs (card, option, card, option, ...).
 *
 * .answer-options carries inline `gap: 15px !important`. The Tier-2
 * hide rule tries `position: absolute !important` on .answer-option,
 * but the option's INLINE style carries `position: relative !important`,
 * which (inline !important beats stylesheet !important) wins. So each
 * old option stays IN the flex flow at a pinned 50px height (stylesheet
 * height:1px + overflow:hidden clip, inline min-height:50px floor,
 * box-sizing:border-box). Result: every pair of visible cards is
 * separated by ~80px (15px gap + 50px clipped option + 15px gap).
 *
 * FIX: collapse each clipped option's layout footprint with a negative
 * margin-top (margin-top is NOT set inline — only margin-bottom:0 — so a
 * stylesheet !important applies; selector specificity (0,3,0) beats the
 * hide rule's (0,2,0)). Height is reliably pinned at 50px and gap at
 * 15px, so margin-top:-74px collapses the option's outer box to -24px
 * and yields 15 + (-24) + 15 = ~6px (=var(--quiz-space-sm)) between
 * adjacent cards. position/clip/visibility/opacity are untouched, so the
 * R.6.1 radio bridge, jQuery :visible and the #next-question-btn
 * offsetParent (R.6.6) all still function.
 * ============================================================ */
.quiz-redesign--mobile-question .answer-options > .answer-option {
  margin-top: -74px !important;
}

/* Inset the answer cards so they align with the mobile question card
 * (which uses a 13px side margin). padding is not set inline on
 * .answer-options, so this applies cleanly in mobile mode only. */
.quiz-redesign--mobile-question .answer-options {
  padding: 0 13px !important;
}


/* ============================================================
 * R.M.P.2 — Video question support
 *
 * The mobile card now renders the video itself (.qr-mobile-question-video)
 * so the old desktop .question-video-container is hidden in mobile mode to
 * avoid a duplicate player below the card.
 * ============================================================ */
.qr-mobile-question-video {
  margin: 12px 13px 10px;
  background: #000;
  border-radius: var(--quiz-radius-xl);
  overflow: hidden;
  border: 1px solid var(--quiz-border-light);
}
.qr-mobile-question-video video {
  width: 100%;
  height: auto;
  display: block;
  background: #000;
}
/* YouTube embeds: 16:9 responsive frame */
.qr-mobile-question-video--yt {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
}
.qr-mobile-question-video--yt iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Hide the OLD desktop video container in mobile mode (we render the video
 * inside the mobile card now). Desktop/old design is untouched. */
.quiz-redesign--mobile-question .question-video-container {
  display: none !important;
}


/* ============================================================
 * R.M.P.4 — Text-only question indicator (Option B)
 *
 * For questions with neither image nor video, the mobile card shows a
 * subtle indicator instead of an empty image placeholder. Blade markup
 * was added in the R.M.P.2 four-way media conditional.
 * ============================================================ */
.qr-mobile-question-text-only {
  margin: 12px 13px 10px;
  background: #e8e5f5;               /* same box as image questions, for layout rhythm */
  border-radius: var(--quiz-radius-xl);
  height: 242.594px;                /* match the rendered image box height exactly */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--quiz-space-xs);
  color: var(--quiz-brand);
}
.qr-mobile-question-text-only i {
  font-size: 28px;
  opacity: 0.55;
  flex-shrink: 0;
}
.qr-mobile-question-text-only span {
  font-size: var(--quiz-font-xs);
  font-weight: var(--quiz-weight-medium);
  opacity: 0.85;
}


/* ============================================================
 * R.4 — Desktop 3-column layout (question screen)
 * All visual rules gated >=1024px. New desktop-only elements are
 * hidden <1024px so mobile stays byte-identical.
 * ============================================================ */

/* New desktop sidebars must NEVER render on mobile */
@media (max-width: 1023px) {
  .qr-desktop-grid__sidebar-left,
  .qr-desktop-grid__sidebar-right {
    display: none !important;
  }
}

@media (min-width: 1024px) {
  /* R.4.1 — 3-column grid scaffold */
  .quiz-redesign--mobile-question {
    background: var(--quiz-bg);
    padding: var(--quiz-space-lg) 0;
  }
  .qr-desktop-grid {
    display: grid;
    grid-template-columns: 240px 1fr 280px;
    gap: var(--quiz-space-lg);
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--quiz-space-lg);
    align-items: start;
  }
  .qr-desktop-grid__main {
    background: var(--quiz-card);
    border-radius: var(--quiz-radius-xl);
    border: 1px solid var(--quiz-border-light);
    overflow: hidden;
  }
  .qr-desktop-grid__sidebar-left,
  .qr-desktop-grid__sidebar-right {
    position: sticky;
    top: var(--quiz-space-lg);
    align-self: start;
  }
  .qr-desktop-grid .qr-mobile-topbar {
    border-radius: var(--quiz-radius-xl) var(--quiz-radius-xl) 0 0;
  }
  .qr-desktop-grid .qr-mobile-nav {
    border-top: 1px solid var(--quiz-border-light);
    padding: var(--quiz-space-md) var(--quiz-space-lg);
  }
}

@media (min-width: 1024px) {
  /* R.4.2 — question navigator panel */
  .qr-nav-panel {
    background: var(--quiz-card);
    border-radius: var(--quiz-radius-xl);
    border: 1px solid var(--quiz-border-light);
    padding: var(--quiz-space-lg);
  }
  .qr-nav-panel__title {
    font-size: var(--quiz-font-md);
    font-weight: var(--quiz-weight-semibold);
    color: var(--quiz-brand-dark);
    margin-bottom: var(--quiz-space-md);
    text-align: right;
  }
  .qr-nav-panel__grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--quiz-space-xs);
  }
  .qr-nav-cell {
    aspect-ratio: 1;
    background: var(--quiz-bg);
    border: 1px solid var(--quiz-border);
    border-radius: var(--quiz-radius-sm);
    color: var(--quiz-brand-muted);
    font-size: var(--quiz-font-sm);
    font-weight: var(--quiz-weight-medium);
    cursor: pointer;
    transition: var(--quiz-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
  }
  .qr-nav-cell:hover {
    border-color: var(--quiz-brand);
    color: var(--quiz-brand);
  }
  .qr-nav-cell.is-current {
    background: var(--quiz-brand);
    color: #ffffff;
    border-color: var(--quiz-brand);
  }
}


/* ============================================================
 * R.4.3 — Center column polish + desktop typography scaling
 * ============================================================ */
@media (min-width: 1024px) {
  .qr-desktop-grid .qr-mobile-topbar { padding: var(--quiz-space-md) var(--quiz-space-lg); }
  .qr-desktop-grid .qr-mobile-topbar__close { font-size: 22px; }
  .qr-desktop-grid .qr-mobile-topbar__timer { font-size: var(--quiz-font-md); }
  .qr-desktop-grid .qr-mobile-topbar__timer i { font-size: 16px; }
  .qr-desktop-grid .qr-mobile-topbar__count { font-size: var(--quiz-font-base); }
  .qr-desktop-grid .qr-mobile-progress { padding: var(--quiz-space-md) var(--quiz-space-lg) 0; }

  .qr-desktop-grid .qr-mobile-question-text { padding: 0 var(--quiz-space-lg) var(--quiz-space-md); }
  .qr-desktop-grid .qr-mobile-question-text__label { font-size: var(--quiz-font-sm); margin-bottom: var(--quiz-space-sm); }
  .qr-desktop-grid .qr-mobile-question-text__heading { font-size: 1.25rem; line-height: 1.6; }

  /* 2-column answer grid + larger answer text */
  .qr-desktop-grid .qr-mobile-answers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--quiz-space-md);
    padding: 0 var(--quiz-space-lg);
  }
  .qr-desktop-grid .qr-mobile-answer { padding: var(--quiz-space-md) var(--quiz-space-lg); min-height: 56px; }
  .qr-desktop-grid .qr-mobile-answer__badge { width: 26px; height: 26px; font-size: var(--quiz-font-sm); }
  .qr-desktop-grid .qr-mobile-answer__text { font-size: var(--quiz-font-base); line-height: 1.5; }
  .qr-desktop-grid .qr-mobile-answer__check { font-size: 18px; }

  /* Bottom nav with inline keyboard hint */
  .qr-desktop-grid .qr-mobile-nav { padding: var(--quiz-space-lg); align-items: center; }
  .qr-desktop-grid .qr-mobile-nav::before {
    content: 'استخدم الأسهم أو الأرقام 1-4 للاختيار السريع';
    font-size: var(--quiz-font-xs);
    color: var(--quiz-brand-muted);
    margin-inline-end: auto;
    order: -1;
  }
  .qr-desktop-grid .qr-mobile-nav__prev,
  .qr-desktop-grid .qr-mobile-nav__next { flex: 0 0 auto; min-width: 120px; }
  .qr-desktop-grid .qr-mobile-nav__next { padding: var(--quiz-space-md) var(--quiz-space-xl); font-size: var(--quiz-font-base); }

  .qr-desktop-only { display: inline; }
}
@media (max-width: 1023px) {
  .qr-desktop-only { display: none; }
}


/* ============================================================
 * R.4.4 — Left-visual sidebar: quiz info + keyboard help (≥1024px)
 * (navigator = other sidebar from R.4.2; social proof SKIPPED)
 * ============================================================ */
@media (min-width: 1024px) {
  .qr-quiz-info {
    background: var(--quiz-card);
    border-radius: var(--quiz-radius-xl);
    border: 1px solid var(--quiz-border-light);
    padding: var(--quiz-space-lg);
    margin-bottom: var(--quiz-space-md);
  }
  .qr-quiz-info__title {
    font-size: var(--quiz-font-md);
    font-weight: var(--quiz-weight-semibold);
    color: var(--quiz-brand-dark);
    margin-bottom: var(--quiz-space-md);
    line-height: 1.5;
    text-align: right;
  }
  .qr-quiz-info__row {
    display: flex;
    align-items: center;
    gap: var(--quiz-space-sm);
    padding: var(--quiz-space-xs) 0;
    font-size: var(--quiz-font-sm);
    color: var(--quiz-brand-muted);
    text-align: right;
  }
  .qr-quiz-info__row i { color: var(--quiz-brand); font-size: 16px; flex-shrink: 0; }

  .qr-keyboard-help {
    background: var(--quiz-card);
    border-radius: var(--quiz-radius-xl);
    border: 1px solid var(--quiz-border-light);
    padding: var(--quiz-space-lg);
  }
  .qr-keyboard-help__title {
    font-size: var(--quiz-font-md);
    font-weight: var(--quiz-weight-semibold);
    color: var(--quiz-brand-dark);
    margin-bottom: var(--quiz-space-md);
    display: flex;
    align-items: center;
    gap: var(--quiz-space-sm);
    text-align: right;
  }
  .qr-keyboard-help__title i { color: var(--quiz-brand); }
  .qr-keyboard-help__list { list-style: none; padding: 0; margin: 0; }
  .qr-keyboard-help__list li {
    display: flex;
    align-items: center;
    gap: var(--quiz-space-sm);
    padding: var(--quiz-space-sm) 0;
    font-size: var(--quiz-font-sm);
    color: var(--quiz-brand-muted);
    flex-wrap: wrap;
  }
  .qr-keyboard-help kbd {
    background: var(--quiz-bg);
    border: 1px solid var(--quiz-border);
    border-radius: var(--quiz-radius-sm);
    padding: 3px 8px;
    font-size: var(--quiz-font-xs);
    font-family: monospace;
    color: var(--quiz-brand-dark);
    min-width: 28px;
    text-align: center;
    line-height: 1.2;
  }
}


/* ============================================================
 * R.4.P.1 — Mobile answer text readability (14px → 17px)
 * .qr-mobile-answer__text is the answer text span (mobile + desktop).
 * ============================================================ */
.qr-mobile-answer__text { font-size: 17px; line-height: 1.5; }
@media (min-width: 1024px) {
  .qr-desktop-grid .qr-mobile-answer__text { font-size: 17px; line-height: 1.5; }
}

/* ============================================================
 * R.4.P.2 — Gap between answers and nav buttons
 * Diagnosed: the legacy .question-block carries padding-bottom:30px +
 * margin-bottom:40px (70px trailing space from the old scroll layout),
 * leaving a large empty gap before .qr-mobile-nav in the one-question-
 * at-a-time redesign. (NOT .qr-mobile-answers — that wrapper doesn't
 * exist; cards live in legacy .answer-options. NOT .quiz-navigation —
 * already 1px-clipped.) Precise fix: collapse the block's trailing
 * space inside the redesign wrapper; .qr-mobile-nav supplies its own
 * padding. Scoped to the wrapper so other .question-block uses (none
 * today) are unaffected.
 * ============================================================ */
.quiz-redesign--mobile-question .question-block {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

/* ============================================================
 * R.4.P.3 — Visited question indicator (navigator, ≥1024px)
 * Light purple tint on cells the user has passed (idx < current).
 * Distinct from bold .is-current. Does NOT mean "answered" (R.5).
 * ============================================================ */
@media (min-width: 1024px) {
  .qr-nav-cell.is-visited {
    background: var(--quiz-brand-light);
    color: var(--quiz-brand);
    border-color: var(--quiz-brand-light);
  }
  .qr-nav-cell.is-current,
  .qr-nav-cell.is-visited.is-current {
    background: var(--quiz-brand);
    color: #ffffff;
    border-color: var(--quiz-brand);
  }
}


/* ============================================================
 * R.4.P.bonus — Desktop 2-column answers: DEFERRED (not feasible via CSS)
 * The legacy .answer-option carries inline `display:flex !important` (and
 * .answer-options' display is likewise locked), so stylesheet
 * `display:grid`/`display:none` overrides lose to inline !important (same
 * trap as R.M.P.1). 2-col-of-just-cards needs a markup change (wrap the
 * .qr-mobile-answer cards in their own container, excluding the clipped
 * legacy options). Left single-column for now.
 * ============================================================ */


/* ============================================================
 * R.4.P2.2 — ~35px gap ABOVE the nav button row.
 * Corrects an earlier attempt that set padding-top on the BUTTONS
 * (.qr-mobile-nav__prev/__next) — that made them tall/asymmetric and
 * the prev button look disconnected from next (P2.1). Putting the
 * padding on the .qr-mobile-nav CONTAINER adds the gap while the
 * buttons keep their normal size + flex arrangement. Precise target,
 * no broad !important. (Pairs with R.4.P.2's .question-block collapse.)
 * ============================================================ */
.quiz-redesign--mobile-question .qr-mobile-nav {
  padding-top: 35px;
}


/* ============================================================
 * R.4.Polish.2 — Force Tajawal across the quiz redesign.
 * The legacy style-rtl.css sets font-family:dubai directly on (nearly)
 * every element (NOT !important), which defeats inheritance from the
 * .quiz-redesign wrapper. Re-assert the quiz font on descendants.
 * :not(.ti) protects Tabler icon glyphs (which also win via their own
 * !important). No !important here, so .ti and higher-specificity rules
 * are unaffected.
 * ============================================================ */
.quiz-redesign *:not(.ti) {
  font-family: var(--quiz-font-family);
}


/* ============================================================
 * R.5 — REVIEW ANSWERS PAGE (standalone /review)
 * Rebuilt 2026-06-18 to match temp/sewaqa_review_answers_page_design.html
 * pixel-for-pixel (exact hex/padding/radius/borders from the mockup).
 * Mobile-first base (mockup is ~375px wide); centered on desktop.
 * ============================================================ */
.qr-review { padding: 16px 0; }
.qr-review__panel { background: #f5f3ff; padding: 14px; border-radius: 12px; max-width: 960px; margin: 0 auto; }
/* R.9 follow-up — responsive ladder for desktop parity with intro/result.
   Cards are structured content (question + options + short explanation),
   not prose, so they read fine wider. */
@media (min-width: 1280px) { .qr-review__panel { max-width: 1140px; } }
@media (min-width: 1536px) { .qr-review__panel { max-width: 1280px; } }
/* Future-proof: cap long explanation prose (right-pinned in RTL) so essay-length
   content from the content team stays readable; no visual change at 1-3 sentences. */
.qr-rv-explain__body { max-width: 720px; margin-inline-end: auto; }

/* Breadcrumb */
.qr-rv-crumb { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #6b6585; margin-bottom: 12px; flex-wrap: wrap; }
.qr-rv-crumb a { color: #6b6585; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.qr-rv-crumb a:hover { color: #815ef5; }
.qr-rv-crumb .ti { font-size: 13px; }
.qr-rv-crumb__sep { color: #d8d4ea; }
.qr-rv-crumb__current { color: #1a1640; font-weight: 600; }

/* Hero — grid 1fr auto: text on the start side, 2 compact stats on the end */
.qr-rv-hero { background: #815ef5; border-radius: 14px; padding: 18px 20px; color: #fff; margin-bottom: 12px; display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
.qr-rv-hero__badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.15); padding: 4px 10px; border-radius: 99px; margin-bottom: 6px; font-size: 11px; font-weight: 500; }
.qr-rv-hero__badge .ti { font-size: 12px; }
.qr-rv-hero__title { font-size: 16px; font-weight: 700; margin: 0 0 3px; }
.qr-rv-hero__sub { font-size: 12px; opacity: .9; }
.qr-rv-hero__stats { display: flex; gap: 8px; }
.qr-rv-stat { background: rgba(255,255,255,0.15); padding: 8px 12px; border-radius: 9px; text-align: center; min-width: 70px; }
.qr-rv-stat__label { font-size: 10px; opacity: .85; }
.qr-rv-stat__num { font-size: 18px; font-weight: 700; }

/* Filter bar */
.qr-rv-filter { background: #fff; border: 1px solid #e5e1f7; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qr-rv-filter__label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #1a1640; flex-shrink: 0; }
.qr-rv-filter__label .ti { font-size: 14px; color: #815ef5; }
.qr-rv-chip { appearance: none; background: #fff; border: 1px solid #e5e1f7; color: #6b6585; padding: 5px 11px; border-radius: 99px; font-size: 11px; font-weight: 500; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.qr-rv-chip .ti { font-size: 12px; }
.qr-rv-chip__count { background: rgba(129,94,245,0.12); color: #815ef5; padding: 0 6px; border-radius: 99px; font-size: 10px; font-weight: 600; }
.qr-rv-chip--wrong .ti { color: #ef4444; }
.qr-rv-chip--wrong .qr-rv-chip__count { background: #fef2f2; color: #ef4444; }
.qr-rv-chip--correct .ti { color: #00a86b; }
.qr-rv-chip--correct .qr-rv-chip__count { background: #ecfdf5; color: #00a86b; }
.qr-rv-chip--saved .ti { color: #815ef5; }
.qr-rv-chip--saved .qr-rv-chip__count { background: #f5f3ff; color: #815ef5; }
.qr-rv-chip.is-active { background: #815ef5; border-color: #815ef5; color: #fff; }
.qr-rv-chip.is-active .ti { color: #fff; }
.qr-rv-chip.is-active .qr-rv-chip__count { background: rgba(255,255,255,0.25); color: #fff; }
.qr-rv-filter__search { margin-right: auto; color: #6b6585; display: inline-flex; align-items: center; flex-shrink: 0; }
.qr-rv-filter__search .ti { font-size: 14px; }

.qr-rv-empty { text-align: center; color: #6b6585; padding: 28px 14px; font-size: 12px; }

/* Question card */
.qr-rv-card { background: #fff; border: 1px solid #e5e1f7; border-radius: 12px; overflow: hidden; margin-bottom: 10px; }
.qr-rv-card--wrong { border: 1.5px solid #ef4444; }
.qr-rv-card__head { padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qr-rv-card--correct .qr-rv-card__head { background: #ecfdf5; border-bottom: 1px solid #d1f0e0; }
.qr-rv-card--wrong .qr-rv-card__head { background: #fef2f2; border-bottom: 1px solid #fecaca; }
.qr-rv-card__head-l { display: flex; align-items: center; gap: 8px; }
.qr-rv-badge { color: #fff; font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.qr-rv-card--correct .qr-rv-badge { background: #00a86b; }
.qr-rv-card--wrong .qr-rv-badge { background: #ef4444; }
.qr-rv-status { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; }
.qr-rv-status .ti { font-size: 14px; }
.qr-rv-card--correct .qr-rv-status { color: #00a86b; }
.qr-rv-card--wrong .qr-rv-status { color: #ef4444; }
.qr-rv-cat { font-size: 10px; opacity: .7; text-align: left; }
.qr-rv-card--correct .qr-rv-cat { color: #064e3b; }
.qr-rv-card--wrong .qr-rv-cat { color: #7f1d1d; }
.qr-rv-card__body { padding: 14px; }
.qr-rv-q { font-size: 14px; font-weight: 600; margin: 0 0 12px; color: #1a1640; line-height: 1.6; }
.qr-rv-qmedia { display: grid; grid-template-columns: auto 1fr; gap: 14px; margin-bottom: 14px; }
.qr-rv-qmedia__img { width: 110px; height: 80px; background: #fafaff; border: 1px solid #e5e1f7; border-radius: 10px; display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.qr-rv-qmedia__img img { width: 100%; height: 100%; object-fit: cover; }
.qr-rv-qmedia .qr-rv-q { margin: 0; align-self: center; }

/* Answer options */
.qr-rv-opt { border-radius: 10px; padding: 9px 12px; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; }
.qr-rv-opt:last-child { margin-bottom: 0; }
.qr-rv-opt__circle { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 11px; font-weight: 700; }
.qr-rv-opt__circle .ti { font-size: 14px; color: #fff; }
.qr-rv-opt__text { font-size: 12px; flex: 1; }
.qr-rv-opt__img { display: block; max-width: 120px; margin-top: 6px; border-radius: 6px; }
.qr-rv-opt__badges { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.qr-rv-obadge { color: #fff; font-size: 9px; padding: 2px 7px; border-radius: 99px; font-weight: 600; white-space: nowrap; }
.qr-rv-opt--neutral { background: #fafaff; border: 1px solid #e5e1f7; }
.qr-rv-opt--neutral .qr-rv-opt__circle { background: #f5f3ff; color: #815ef5; }
.qr-rv-opt--neutral .qr-rv-opt__text { color: #6b6585; }
.qr-rv-opt--correct { background: #ecfdf5; border: 1.5px solid #00a86b; }
.qr-rv-opt--correct .qr-rv-opt__circle { background: #00a86b; }
.qr-rv-opt--correct .qr-rv-opt__text { color: #064e3b; font-weight: 500; }
.qr-rv-opt--wrong { background: #fef2f2; border: 1.5px solid #ef4444; }
.qr-rv-opt--wrong .qr-rv-opt__circle { background: #ef4444; }
.qr-rv-opt--wrong .qr-rv-opt__circle .ti { font-size: 13px; }
.qr-rv-opt--wrong .qr-rv-opt__text { color: #7f1d1d; font-weight: 500; text-decoration: line-through; opacity: .85; }
.qr-rv-obadge--picked { background: #00a86b; }
.qr-rv-obadge--right { background: #064e3b; }
.qr-rv-obadge--wrong { background: #ef4444; }

/* Explanation box (purple right-accent) */
.qr-rv-explain { margin-top: 12px; background: #f5f3ff; border-right: 3px solid #815ef5; border-radius: 0 8px 8px 0; padding: 11px 13px; }
.qr-rv-explain__head { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.qr-rv-explain__head .ti { font-size: 14px; color: #815ef5; }
.qr-rv-explain__head span { font-size: 11px; font-weight: 600; color: #1a1640; }
.qr-rv-explain__body { font-size: 11.5px; color: #6b6585; line-height: 1.7; }
.qr-rv-explain__body--empty { font-style: italic; }
.qr-rv-ref { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(129,94,245,0.15); }
.qr-rv-ref .ti { font-size: 12px; color: #815ef5; }
.qr-rv-ref__label { font-size: 10px; color: #815ef5; font-weight: 600; }
.qr-rv-ref__text { font-size: 10px; color: #6b6585; }

/* Per-question actions (wrong cards, logged-in) */
.qr-rv-actions { margin-top: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qr-rv-act { appearance: none; background: #fff; border: 1px solid #e5e1f7; padding: 7px 11px; border-radius: 8px; font-size: 11px; font-weight: 500; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.qr-rv-act .ti { font-size: 13px; }
.qr-rv-act--bookmark { color: #815ef5; }
.qr-rv-act--bookmark.is-active { background: #f5f3ff; border-color: #815ef5; }
.qr-rv-act--report { color: #6b6585; }
.qr-rv-act--report:hover { border-color: #ef4444; color: #ef4444; }

/* Pagination */
.qr-rv-pager { background: #fff; border: 1px solid #e5e1f7; border-radius: 12px; padding: 12px; display: flex; align-items: center; gap: 8px; }
.qr-rv-pager__btn { appearance: none; padding: 9px 14px; border-radius: 9px; font-size: 11px; font-weight: 500; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; background: #fff; border: 1.5px solid #e5e1f7; color: #6b6585; }
.qr-rv-pager__btn .ti { font-size: 14px; }
.qr-rv-pager__btn--next { background: #815ef5; border: 1.5px solid #815ef5; color: #fff; font-weight: 600; }
.qr-rv-pager__btn:disabled { opacity: .45; cursor: default; }
.qr-rv-pager__mid { flex: 1; display: flex; justify-content: center; align-items: center; gap: 5px; font-size: 11px; color: #6b6585; }
.qr-rv-pager__range { background: #815ef5; color: #fff; padding: 4px 10px; border-radius: 99px; font-weight: 600; unicode-bidi: plaintext; }

/* Bottom retry CTA */
.qr-rv-retry { margin-top: 12px; background: #815ef5; border-radius: 12px; padding: 14px 16px; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qr-rv-retry__l { display: flex; align-items: center; gap: 11px; }
.qr-rv-retry__icon { width: 38px; height: 38px; background: #ffd84a; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qr-rv-retry__icon .ti { font-size: 20px; color: #6b4f00; }
.qr-rv-retry__title { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.qr-rv-retry__sub { font-size: 11px; opacity: .9; }
.qr-rv-retry__btn { background: #ffd84a; color: #6b4f00; padding: 9px 16px; border-radius: 8px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; text-decoration: none; flex-shrink: 0; }
.qr-rv-retry__btn .ti { font-size: 14px; }

/* Report modal (styled to the mockup palette; no modal in the mockups) */
.qr-rv-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 16px; }
.qr-rv-modal[hidden] { display: none; }
.qr-rv-modal__backdrop { position: absolute; inset: 0; background: rgba(26,22,64,.55); }
.qr-rv-modal__panel { position: relative; background: #fff; border-radius: 14px; width: 100%; max-width: 420px; padding: 20px; box-shadow: 0 20px 60px rgba(26,22,64,.3); }
.qr-rv-modal__x { position: absolute; top: 12px; left: 12px; background: none; border: none; cursor: pointer; color: #6b6585; font-size: 18px; }
.qr-rv-modal__title { font-size: 15px; font-weight: 700; color: #1a1640; margin: 0 0 6px; display: flex; align-items: center; gap: 7px; }
.qr-rv-modal__title .ti { color: #ef4444; }
.qr-rv-modal__hint { font-size: 11px; color: #6b6585; margin: 0 0 10px; line-height: 1.6; }
.qr-rv-modal__textarea { width: 100%; border: 1px solid #e5e1f7; border-radius: 9px; padding: 10px 12px; font-family: inherit; font-size: 12px; resize: vertical; color: #1a1640; }
.qr-rv-modal__textarea:focus { outline: none; border-color: #815ef5; }
.qr-rv-modal__error { color: #ef4444; font-size: 11px; margin-top: 6px; }
.qr-rv-modal__actions { display: flex; gap: 8px; justify-content: flex-start; margin-top: 14px; }
.qr-rv-modal__cancel { appearance: none; background: #fff; border: 1px solid #e5e1f7; color: #6b6585; border-radius: 8px; padding: 9px 16px; font-size: 12px; font-weight: 500; cursor: pointer; }
.qr-rv-modal__submit { appearance: none; background: #815ef5; border: none; color: #fff; border-radius: 8px; padding: 9px 18px; font-size: 12px; font-weight: 700; cursor: pointer; }
.qr-rv-modal__submit:disabled { opacity: .6; cursor: default; }

/* Toast */
.qr-rv-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(12px); background: #1a1640; color: #fff; padding: 11px 20px; border-radius: 99px; font-size: 12px; font-weight: 600; z-index: 10000; opacity: 0; transition: opacity .25s, transform .25s; box-shadow: 0 8px 24px rgba(26,22,64,.35); max-width: 90vw; text-align: center; }
.qr-rv-toast[hidden] { display: none; }
.qr-rv-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Mobile (<=420px): stack hero, scroll chips horizontally */
@media (max-width: 420px) {
  .qr-rv-hero { grid-template-columns: 1fr; }
  .qr-rv-hero__stats { justify-content: flex-start; }
  .qr-rv-filter { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .qr-rv-qmedia { grid-template-columns: 1fr; }
  .qr-rv-qmedia__img { width: 100%; height: 140px; }
}

/* Print */
@media print {
  .qr-review__panel { background: #fff; }
  .qr-rv-filter, .qr-rv-actions, .qr-rv-pager, .qr-rv-retry, .qr-rv-modal, .qr-rv-toast, .qr-rv-filter__search { display: none !important; }
  .qr-rv-hero { background: #fff !important; color: #000 !important; border: 1px solid #000; }
  .qr-rv-card { display: block !important; break-inside: avoid; }
  .qr-rv-card, .qr-rv-card--wrong { border: 1px solid #999 !important; }
}

/* R.5 — force RTL text alignment (legacy global sets text-align:left). */
.qr-review .qr-rv-q,
.qr-review .qr-rv-opt__text,
.qr-review .qr-rv-explain__body,
.qr-review .qr-rv-explain__head span,
.qr-review .qr-rv-hero__title,
.qr-review .qr-rv-hero__sub,
.qr-review .qr-rv-status,
.qr-review .qr-rv-ref__text { text-align: right; }
.qr-review .qr-rv-hero > div:first-child { text-align: right; }


 * R.7 (Phase 2C) — RESULT SCREEN (pass/fail) — results.blade.php
 * Pixel-faithful to temp/sewaqa_quiz_failed_result_purple.html + the
 * derived PASS variant. New .qr-rs-* namespace (old qr-result-* removed).
 * Mobile-first; hero side-stat stacks <768, 2-col body ≥1024.
 * ============================================================ */
.qr-rs { padding: 16px 0; }
.qr-rs__panel { background: #f5f3ff; padding: 14px; border-radius: 12px; max-width: 960px; margin: 0 auto; }

/* Hero */
.qr-rs-hero { background: #815ef5; border-radius: 14px; padding: 22px 24px; color: #fff; position: relative; overflow: hidden; margin-bottom: 12px; }
.qr-rs-hero__top { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.qr-rs-hero__icon { width: 76px; height: 76px; background: #9277f7; border: 1.5px solid #a78bf9; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qr-rs-hero__icon .ti { font-size: 38px; color: #ffd84a; }
.qr-rs-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 11px; font-weight: 500; margin-bottom: 8px; }
.qr-rs-badge .ti { font-size: 12px; }
.qr-rs-badge--pass { background: rgba(0,168,107,0.18); border: 1px solid rgba(0,168,107,0.45); color: #ecfdf5; }
.qr-rs-badge--fail { background: rgba(255,216,74,0.20); border: 1px solid rgba(255,216,74,0.45); color: #ffd84a; }
.qr-rs-hero__score-row { display: flex; align-items: baseline; gap: 14px; margin-bottom: 4px; flex-wrap: wrap; }
.qr-rs-hero__score { font-size: 44px; font-weight: 700; line-height: 1; }
.qr-rs-hero__pct { font-size: 22px; opacity: .85; }
.qr-rs-hero__breakdown { font-size: 13px; opacity: .9; }
.qr-rs-hero__msg { font-size: 12px; opacity: .85; line-height: 1.5; }
.qr-rs-hero__side { grid-column: 1 / -1; text-align: center; border-top: 1px solid rgba(255,255,255,0.18); margin-top: 14px; padding-top: 12px; }
.qr-rs-hero__side-label { font-size: 10px; opacity: .8; margin-bottom: 4px; }
.qr-rs-hero__side-value { font-size: 22px; font-weight: 700; color: #ffd84a; line-height: 1.1; }
.qr-rs-hero__side-sub { font-size: 10px; opacity: .8; margin-top: 4px; }
.qr-rs-hero__bar { margin-top: 18px; }
.qr-rs-hero__bar-track { position: relative; height: 6px; background: rgba(255,255,255,0.20); border-radius: 99px; overflow: hidden; }
.qr-rs-hero__bar-fill { position: absolute; top: 0; right: 0; height: 100%; border-radius: 99px; }
.qr-rs-hero--fail .qr-rs-hero__bar-fill { background: #ef4444; }
.qr-rs-hero--pass .qr-rs-hero__bar-fill { background: #00a86b; }
.qr-rs-hero__bar-marker { position: absolute; top: -3px; width: 2px; height: 12px; background: #ffd84a; border-radius: 1px; }
.qr-rs-hero__bar-labels { display: flex; justify-content: space-between; margin-top: 5px; font-size: 9.5px; opacity: .7; }
.qr-rs-hero__bar-pass { color: #ffd84a; opacity: 1; font-weight: 500; }

/* Review / challenge CTA */
.qr-rs-cta { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; margin-bottom: 12px; text-decoration: none; }
.qr-rs-cta--review { background: #fff8e6; border: 1.5px solid #ffd84a; }
.qr-rs-cta--challenge { background: #f5f3ff; border: 1.5px solid #815ef5; }
.qr-rs-cta__icon { width: 44px; height: 44px; background: #ffd84a; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qr-rs-cta__icon .ti { font-size: 22px; color: #6b4f00; }
.qr-rs-cta__icon--purple { background: #ede8ff; }
.qr-rs-cta__icon--purple .ti { color: #815ef5; }
.qr-rs-cta__body { flex: 1; min-width: 0; }
.qr-rs-cta__title { font-size: 13px; font-weight: 600; color: #1a1640; margin-bottom: 2px; }
.qr-rs-cta__sub { font-size: 11px; color: #6b6585; line-height: 1.5; }
.qr-rs-cta__btn { background: #815ef5; color: #fff; padding: 9px 16px; border-radius: 8px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; white-space: nowrap; }
.qr-rs-cta__btn .ti { font-size: 14px; }

/* Stats */
.qr-rs-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.qr-rs-stat { background: #fff; border: 1px solid #e5e1f7; border-radius: 10px; padding: 10px 12px; }
.qr-rs-stat__head { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; font-size: 10px; color: #6b6585; font-weight: 500; }
.qr-rs-stat__head .ti { font-size: 13px; color: #815ef5; }
.qr-rs-stat__num { font-size: 17px; font-weight: 700; color: #1a1640; }
.qr-rs-stat--correct { background: #ecfdf5; border-color: #b6f0d8; }
.qr-rs-stat--correct .qr-rs-stat__head, .qr-rs-stat--correct .qr-rs-stat__head .ti { color: #00a86b; }
.qr-rs-stat--correct .qr-rs-stat__num { color: #00a86b; }
.qr-rs-stat--wrong { background: #fef2f2; border-color: #fecaca; }
.qr-rs-stat--wrong .qr-rs-stat__head, .qr-rs-stat--wrong .qr-rs-stat__head .ti { color: #ef4444; }
.qr-rs-stat--wrong .qr-rs-stat__num { color: #ef4444; }

/* 2-col body */
.qr-rs-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.qr-rs-col { display: flex; flex-direction: column; gap: 12px; }

/* Cards */
.qr-rs-card { background: #fff; border: 1px solid #e5e1f7; border-radius: 12px; overflow: hidden; }
.qr-rs-card__head { padding: 11px 14px; border-bottom: 1px solid #e5e1f7; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qr-rs-card__head--bare { border-bottom: none; padding-bottom: 0; }
.qr-rs-card__head-title { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: #1a1640; }
.qr-rs-card__head-title .ti { font-size: 15px; color: #815ef5; }
.qr-rs-card__badge { background: #815ef5; color: #fff; font-size: 9px; padding: 2px 7px; border-radius: 10px; font-weight: 600; white-space: nowrap; }
.qr-rs-card__link { font-size: 10px; color: #815ef5; font-weight: 500; text-decoration: none; }
.qr-rs-card--pad { padding-bottom: 14px; }

/* Next-step */
.qr-rs-next { display: flex; align-items: center; gap: 12px; padding: 14px; text-decoration: none; }
.qr-rs-next__icon { width: 48px; height: 48px; background: #f5f3ff; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qr-rs-next__icon .ti { font-size: 24px; color: #815ef5; }
.qr-rs-next__info { flex: 1; min-width: 0; }
.qr-rs-next__title { font-size: 13px; font-weight: 600; color: #1a1640; margin-bottom: 3px; }
.qr-rs-next__meta { display: flex; align-items: center; gap: 10px; font-size: 10px; color: #6b6585; }
.qr-rs-next__meta span { display: inline-flex; align-items: center; gap: 4px; }
.qr-rs-next__chevron { font-size: 20px; color: #815ef5; flex-shrink: 0; }

/* Other-quizzes list */
.qr-rs-list { padding: 6px; }
.qr-rs-list__item { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 8px; text-decoration: none; }
.qr-rs-list__item:hover { background: #f5f3ff; }
.qr-rs-list__icon { width: 34px; height: 34px; background: #f5f3ff; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qr-rs-list__icon .ti { font-size: 17px; color: #815ef5; }
.qr-rs-list__info { flex: 1; min-width: 0; }
.qr-rs-list__title { font-size: 12px; font-weight: 500; color: #1a1640; margin-bottom: 1px; }
.qr-rs-list__meta { font-size: 10px; color: #6b6585; }
.qr-rs-list__chevron { font-size: 16px; color: #b4b0c8; flex-shrink: 0; }

/* Share */
.qr-rs-share { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0 14px; }
.qr-rs-share__btn { appearance: none; border: none; cursor: pointer; padding: 9px; border-radius: 8px; text-align: center; color: #fff; display: flex; align-items: center; justify-content: center; }
.qr-rs-share__btn .ti { font-size: 18px; }
.qr-rs-share__btn--wa { background: #25d366; }
.qr-rs-share__btn--fb { background: #1877f2; }
.qr-rs-share__btn--x { background: #000; }
.qr-rs-share__btn--copy { background: #fff; border: 1.5px solid #e5e1f7; color: #815ef5; }

/* Signup (guests) */
.qr-rs-signup { background: #815ef5; border-radius: 12px; padding: 18px; color: #fff; position: relative; overflow: hidden; }
.qr-rs-signup__deco { position: absolute; top: -20px; left: -20px; width: 80px; height: 80px; background: #9277f7; border-radius: 50%; opacity: .5; }
.qr-rs-signup__inner { position: relative; }
.qr-rs-signup__icon { width: 38px; height: 38px; background: #ffd84a; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 11px; }
.qr-rs-signup__icon .ti { font-size: 20px; color: #6b4f00; }
.qr-rs-signup__title { font-size: 14px; font-weight: 700; margin-bottom: 5px; }
.qr-rs-signup__desc { font-size: 11px; opacity: .9; line-height: 1.6; margin-bottom: 14px; }
.qr-rs-signup__benefits { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 6px; }
.qr-rs-signup__benefits li { display: flex; align-items: center; gap: 7px; font-size: 11px; opacity: .95; }
.qr-rs-signup__check { width: 16px; height: 16px; border-radius: 50%; background: rgba(255,216,74,0.30); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qr-rs-signup__check .ti { font-size: 10px; color: #ffd84a; }
.qr-rs-signup__cta { background: #ffd84a; color: #6b4f00; padding: 11px; border-radius: 9px; text-align: center; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.qr-rs-signup__cta .ti { font-size: 14px; }

/* Logged-in stats */
.qr-rs-userstats { background: #815ef5; border-radius: 12px; padding: 18px; color: #fff; }
.qr-rs-userstats__title { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; margin-bottom: 12px; }
.qr-rs-userstats__title .ti { font-size: 16px; color: #ffd84a; }
.qr-rs-userstats__row { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,0.12); }
.qr-rs-userstats__row:last-child { border-bottom: none; }
.qr-rs-userstats__label { font-size: 12px; opacity: .9; }
.qr-rs-userstats__value { font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.qr-rs-userstats__value--best { color: #ffd84a; }

/* Tips (fail only) */
.qr-rs-tips { background: #fff; border: 1px solid #e5e1f7; border-radius: 12px; padding: 14px; }
.qr-rs-tips__title { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: #1a1640; margin-bottom: 11px; }
.qr-rs-tips__title .ti { font-size: 15px; color: #f59e0b; }
.qr-rs-tips__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.qr-rs-tips__list li { display: flex; align-items: flex-start; gap: 8px; font-size: 11px; color: #6b6585; line-height: 1.6; }
.qr-rs-tips__num { width: 18px; height: 18px; border-radius: 50%; background: #f5f3ff; color: #815ef5; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }

/* Bottom actions */
.qr-rs-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.qr-rs-action { padding: 10px; border-radius: 9px; text-align: center; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 5px; text-decoration: none; }
.qr-rs-action .ti { font-size: 14px; }
.qr-rs-action--retry { background: #fff; border: 1.5px solid #815ef5; color: #815ef5; }
.qr-rs-action--all { background: #fff; border: 1px solid #e5e1f7; color: #6b6585; }

/* Force RTL text alignment (legacy global sets text-align:left). */
.qr-rs .qr-rs-hero__msg, .qr-rs .qr-rs-hero__breakdown,
.qr-rs .qr-rs-cta__title, .qr-rs .qr-rs-cta__sub,
.qr-rs .qr-rs-next__title, .qr-rs .qr-rs-next__meta,
.qr-rs .qr-rs-list__title, .qr-rs .qr-rs-list__meta,
.qr-rs .qr-rs-signup__title, .qr-rs .qr-rs-signup__desc, .qr-rs .qr-rs-signup__benefits li,
.qr-rs .qr-rs-userstats__label,
.qr-rs .qr-rs-tips__list li { text-align: right; }

/* Tablet+ */
@media (min-width: 768px) {
  .qr-rs-hero__top { grid-template-columns: auto 1fr auto; }
  .qr-rs-hero__side { grid-column: auto; border-top: none; margin-top: 0; padding-top: 0; min-width: 90px; }
  .qr-rs-stats { grid-template-columns: repeat(4, 1fr); }
}
/* Desktop 2-col */
@media (min-width: 1024px) {
  .qr-rs-grid { grid-template-columns: 1.4fr 1fr; align-items: start; }
}


/* ============================================================
 * R.8 (Phase 2D) — RATING WIDGET (post-result, results.blade.php)
 * Stars gold when filled, gray when empty. RTL fill (right→left).
 * ============================================================ */
.qr-rate { margin-top: 12px; background: #fff; border: 1px solid #e5e1f7; border-radius: 12px; padding: 14px; }
.qr-rate[hidden] { display: none; }
.qr-rate__ask { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.qr-rate__block { display: flex; align-items: center; gap: 10px; }
.qr-rate__label { font-size: 12px; font-weight: 600; color: #1a1640; text-align: right; }
.qr-rate__stars { display: inline-flex; gap: 4px; }
.qr-rate__star { appearance: none; background: none; border: none; cursor: pointer; padding: 2px; line-height: 1; }
.qr-rate__star .ti { font-size: 28px; color: #d8d4ea; transition: color .15s ease; }
.qr-rate__star.is-on .ti { color: #ffd84a; }
.qr-rate__pills { display: inline-flex; gap: 8px; }
.qr-rate__pill { appearance: none; cursor: pointer; background: #fff; border: 1px solid #e5e1f7; color: #6b6585; border-radius: 99px; padding: 6px 14px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; transition: background .15s, border-color .15s, color .15s; }
.qr-rate__pill .ti { font-size: 15px; }
.qr-rate__pill.is-on { background: #815ef5; border-color: #815ef5; color: #fff; }
.qr-rate__thanks { display: flex; align-items: center; gap: 8px; color: #00a86b; font-size: 13px; font-weight: 600; }
.qr-rate__thanks .ti { font-size: 20px; }
.qr-rate__thanks-text { text-align: right; }
.qr-rate__thanks--compact { color: #6b6585; font-size: 12px; }
.qr-rate__thanks--compact .ti { color: #00a86b; font-size: 16px; }
@media (min-width: 1024px) {
  .qr-rate__star .ti { font-size: 32px; }
}


/* ============================================================
 * R.9 — Responsive content ladder for intro + result wrappers.
 * Component-scoped (only .qr-intro__container + .qr-rs__panel);
 * review stays 760px (single-column reading). No global change.
 * ============================================================ */
/* Base (declared BEFORE the media queries so they override at larger widths).
   Re-added here after the original lived in the removed R.6 block. */
.qr-intro__container { max-width: 960px; margin: 0 auto; }
@media (min-width: 1280px) {
  .qr-intro__container, .qr-rs__panel { max-width: 1140px; }
}
@media (min-width: 1536px) {
  .qr-intro__container, .qr-rs__panel { max-width: 1280px; }
}


/* === R.10: INTRO SCREEN UNIFIED CARD (replaces R.6) ===
 * Layout: one .qr-card (hero + stats + action) then outcomes/tips grid,
 * sources strip, FAQ accordion. Faithful to temp/sewaqa-intro-page-v3.html.
 *
 * JS hook mapping (preserved from Phase 2B QuizState — no JS change):
 *   #intro-screen [data-quiz-id/total/has-content/country] · #active-screen
 *   .qr-intro-mode[data-mode] (also .qr-mode) · selection class .is-selected
 *   #quiz-start-btn (also .qr-start) · #quiz-resume-banner/-btn/restart-btn
 *   .qr-intro-resume__q · #qr-hero-desc (read-more)
 * Width: R.9 ladder via .qr-intro__container (960/1140/1280).
 * ====================================================== */

/* Screen toggle (beats legacy .test-page-wrapper{display:block!important}) */
#active-screen[hidden], #intro-screen[hidden] { display: none !important; }

.qr-intro { background: var(--quiz-bg); padding: 16px 14px 50px; direction: rtl; }
@media (min-width: 1280px) { .qr-intro { padding: 22px 18px 60px; } }

/* Breadcrumb */
.qr-breadcrumb { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: #9590ad; margin-bottom: 12px; flex-wrap: wrap; }
.qr-breadcrumb a { color: #9590ad; text-decoration: none; transition: color .15s; }
.qr-breadcrumb a:hover { color: var(--quiz-brand); }
.qr-breadcrumb__sep { color: #d8d4ea; font-size: 10px; }
.qr-breadcrumb__current { color: var(--quiz-brand-dark); font-weight: 600; }

/* Resume banner */
.qr-resume-banner { background: #fff8e6; border: 1px solid #f7e497; border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qr-resume-banner[hidden] { display: none; }
.qr-resume-banner i.lead { font-size: 18px; color: #6b4f00; flex-shrink: 0; }
.qr-resume-banner__text { flex: 1; min-width: 180px; font-size: 12.5px; color: var(--quiz-brand-dark); }
.qr-resume-banner__text strong { color: #6b4f00; font-weight: 700; }
.qr-resume-banner__actions { display: flex; gap: 6px; }
.qr-btn--mini { padding: 6px 12px; border-radius: 7px; font-size: 12px; font-weight: 600; border: none; cursor: pointer; font-family: inherit; }
.qr-btn--mini.primary { background: var(--quiz-brand); color: #fff; }
.qr-btn--mini.link { background: transparent; color: var(--quiz-brand-muted); }

/* Unified card */
.qr-card { background: #fff; border: 1px solid var(--quiz-border); border-radius: 18px; overflow: hidden; box-shadow: 0 4px 16px -2px rgba(26,22,64,.06); margin-bottom: 14px; }
.qr-card__hero { position: relative; padding: 20px; background: linear-gradient(135deg, #fff 0%, #faf9ff 100%); border-bottom: 1px solid #ece9f7; display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 768px) { .qr-card__hero { grid-template-columns: 1fr 220px; gap: 22px; padding: 24px 26px; } }
@media (min-width: 1024px) { .qr-card__hero { grid-template-columns: 1fr 260px; padding: 26px 30px; } }
.qr-card__hero-main { display: flex; flex-direction: column; min-width: 0; }
.qr-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.qr-card__badges { display: flex; gap: 6px; flex-wrap: wrap; }
.qr-badge { display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 1px solid var(--quiz-border); color: var(--quiz-brand-dark); padding: 4px 10px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.qr-badge i { font-size: 12px; color: var(--quiz-brand); }
.qr-badge--country { background: var(--quiz-brand-light); border-color: #d4caf9; color: var(--quiz-brand); }
.qr-updated { display: inline-flex; align-items: center; gap: 4px; color: var(--quiz-success); font-size: 11px; font-weight: 600; }
.qr-updated i { font-size: 13px; }
.qr-card__title { font-size: 19px; font-weight: 800; color: var(--quiz-brand-dark); line-height: 1.4; margin-bottom: 10px; letter-spacing: -.01em; }
@media (min-width: 768px) { .qr-card__title { font-size: 21px; } }
@media (min-width: 1024px) { .qr-card__title { font-size: 24px; line-height: 1.35; } }
.qr-card__desc { font-size: 13px; color: var(--quiz-brand-muted); line-height: 1.75; margin-bottom: 12px; }
.qr-card__desc p { margin: 0; }
.qr-card__desc strong { color: var(--quiz-brand-dark); font-weight: 700; }
.qr-card__desc-toggle { display: inline-flex; align-items: center; gap: 3px; background: none; border: none; color: var(--quiz-brand); font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer; padding: 0; margin-inline-start: 4px; }
.qr-card__desc-toggle i { font-size: 13px; transition: transform .2s; }
.qr-card__desc ul, .qr-card__desc ol { margin: 6px 0; padding-inline-start: 20px; }
.qr-card__desc li { margin-bottom: 4px; }
.qr-card__desc h3 { font-size: 14px; font-weight: 700; color: var(--quiz-brand-dark); margin: 10px 0 4px; }
.qr-card__desc blockquote { border-inline-start: 3px solid var(--quiz-brand); padding: 2px 10px; margin: 6px 0; color: var(--quiz-brand-dark); }
.qr-card__desc a { color: var(--quiz-brand); text-decoration: underline; }
.qr-card__desc-full { display: none; margin-top: 8px; }
.qr-card__desc-full p { margin-bottom: 8px; }
.qr-card__desc-full p:last-child { margin-bottom: 0; }
.qr-card__desc.is-expanded .qr-card__desc-full { display: block; }
.qr-card__desc.is-expanded .qr-card__desc-toggle i { transform: rotate(180deg); }
.qr-card__hero-footer { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 12px; border-top: 1px solid #ece9f7; flex-wrap: wrap; }
.qr-rating { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--quiz-brand-muted); }
.qr-rating .stars { display: flex; gap: 1px; }
.qr-rating .stars i { font-size: 13px; color: var(--quiz-warning); }
.qr-rating strong { color: var(--quiz-brand-dark); font-weight: 700; margin-inline-start: 3px; }
.qr-footer-sep { width: 1px; height: 12px; background: var(--quiz-border); }
.qr-trust { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--quiz-success); font-weight: 600; }
.qr-trust i { font-size: 13px; }
.qr-card__image { position: relative; width: 100%; aspect-ratio: 4/3; border-radius: 14px; overflow: hidden; background: linear-gradient(135deg, var(--quiz-brand) 0%, #9277f7 60%, #b8a4ff 100%); display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 22px -6px rgba(129,94,245,.35); }
@media (max-width: 767px) { .qr-card__image { aspect-ratio: 16/9; max-height: 140px; } }
.qr-card__image::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.22), transparent 50%), radial-gradient(circle at 70% 80%, rgba(255,255,255,.08), transparent 50%); }
.qr-card__image-icon { position: relative; z-index: 2; width: 72px; height: 72px; background: rgba(255,255,255,.20); border: 2px solid rgba(255,255,255,.32); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.qr-card__image-icon i { font-size: 36px; color: #fff; }

/* Stats strip */
.qr-card__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: #ece9f7; border-bottom: 1px solid #ece9f7; }
@media (min-width: 640px) { .qr-card__stats { grid-template-columns: repeat(4, 1fr); } }
.qr-stat { background: #fff; padding: 14px 12px; display: flex; align-items: center; gap: 10px; }
.qr-stat__icon { width: 34px; height: 34px; background: var(--quiz-brand-light); border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qr-stat__icon i { font-size: 17px; color: var(--quiz-brand); }
.qr-stat__body { min-width: 0; }
.qr-stat__value { font-size: 16px; font-weight: 800; color: var(--quiz-brand-dark); line-height: 1.1; }
.qr-stat__label { font-size: 10.5px; color: var(--quiz-brand-muted); margin-top: 2px; font-weight: 500; }
.qr-stat--difficulty .qr-stat__icon { background: #fffbeb; }
.qr-stat--difficulty .qr-stat__icon i { color: #f59e0b; }

/* Action: mode + CTA */
.qr-card__action { padding: 18px 20px 20px; background: #fff; }
@media (min-width: 768px) { .qr-card__action { padding: 20px 26px 22px; } }
@media (min-width: 1024px) { .qr-card__action { padding: 22px 30px 24px; } }
.qr-card__action-label { font-size: 12.5px; font-weight: 700; color: var(--quiz-brand-dark); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.qr-card__action-label i { font-size: 14px; color: var(--quiz-brand); }
.qr-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.qr-mode { position: relative; border: 2px solid var(--quiz-border); background: var(--quiz-bg); border-radius: 11px; padding: 12px; cursor: pointer; transition: all .15s; }
.qr-mode:hover { border-color: #d4caf9; }
.qr-mode.is-selected { border-color: var(--quiz-brand); background: var(--quiz-brand-light); }
.qr-mode__check { position: absolute; top: 8px; left: 8px; width: 18px; height: 18px; background: var(--quiz-brand); border-radius: 50%; display: none; align-items: center; justify-content: center; }
.qr-mode__check i { font-size: 12px; color: #fff; }
.qr-mode.is-selected .qr-mode__check { display: flex; }
.qr-mode__head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.qr-mode__icon { width: 28px; height: 28px; background: #fff; border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qr-mode.is-selected .qr-mode__icon { background: var(--quiz-brand); }
.qr-mode__icon i { font-size: 15px; color: var(--quiz-brand); }
.qr-mode.is-selected .qr-mode__icon i { color: #fff; }
.qr-mode__title { font-size: 13px; font-weight: 700; color: var(--quiz-brand-dark); }
.qr-mode__desc { font-size: 11px; color: var(--quiz-brand-muted); line-height: 1.5; }
.qr-start { width: 100%; background: var(--quiz-brand); color: #fff; border: none; padding: 14px; border-radius: 11px; font-size: 15px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; font-family: inherit; transition: all .2s; box-shadow: 0 12px 28px -6px rgba(129,94,245,.20); }
.qr-start:hover { background: #6f4be0; transform: translateY(-1px); }
.qr-start i { font-size: 18px; }

/* Content grid (outcomes + tips) */
.qr-content-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 14px; }
@media (min-width: 768px) { .qr-content-grid { grid-template-columns: 1fr 1fr; gap: 12px; } }
.qr-content-card { background: #fff; border: 1px solid var(--quiz-border); border-radius: 14px; padding: 18px 20px; }
.qr-content-card__header { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.qr-content-card__icon { width: 30px; height: 30px; background: var(--quiz-brand-light); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qr-content-card__icon i { font-size: 15px; color: var(--quiz-brand); }
.qr-content-card__title { font-size: 14px; font-weight: 700; color: var(--quiz-brand-dark); }
.qr-outcomes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.qr-outcomes li { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--quiz-brand-dark); line-height: 1.6; }
.qr-outcomes i { flex-shrink: 0; width: 18px; height: 18px; background: var(--quiz-success-bg); color: var(--quiz-success); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; margin-top: 2px; }
.qr-tips { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; counter-reset: tip; }
.qr-tips li { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; color: var(--quiz-brand-dark); line-height: 1.6; counter-increment: tip; }
.qr-tips li::before { content: counter(tip); flex-shrink: 0; width: 20px; height: 20px; background: var(--quiz-brand); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700; margin-top: 2px; }

/* Sources strip */
.qr-sources { background: var(--quiz-bg); border: 1px solid #ece9f7; border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; display: flex; align-items: flex-start; gap: 10px; }
.qr-sources i.lead { font-size: 17px; color: var(--quiz-brand); flex-shrink: 0; margin-top: 1px; }
.qr-sources__label { font-size: 10.5px; color: var(--quiz-brand-muted); font-weight: 600; margin-bottom: 3px; text-transform: uppercase; letter-spacing: .04em; text-align: right; }
.qr-sources__text { font-size: 12px; color: var(--quiz-brand-dark); line-height: 1.65; }

/* FAQ */
.qr-faq { background: #fff; border: 1px solid var(--quiz-border); border-radius: 14px; padding: 20px; }
.qr-faq__header { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.qr-faq__icon { width: 30px; height: 30px; background: var(--quiz-brand-light); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.qr-faq__icon i { font-size: 15px; color: var(--quiz-brand); }
.qr-faq__title { font-size: 15px; font-weight: 700; color: var(--quiz-brand-dark); }
.qr-faq-list { display: flex; flex-direction: column; gap: 7px; }
.qr-faq-item { border: 1px solid #ece9f7; border-radius: 10px; overflow: hidden; transition: all .15s; }
.qr-faq-item[open] { border-color: #d4caf9; background: #faf9ff; }
.qr-faq-item__question { list-style: none; padding: 11px 13px; font-size: 12.5px; font-weight: 600; color: var(--quiz-brand-dark); cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qr-faq-item__question::-webkit-details-marker { display: none; }
.qr-faq-item__qicon { flex-shrink: 0; width: 20px; height: 20px; background: var(--quiz-brand-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: transform .2s, background .2s; }
.qr-faq-item__qicon i { font-size: 12px; color: var(--quiz-brand); }
.qr-faq-item[open] .qr-faq-item__qicon { transform: rotate(45deg); background: var(--quiz-brand); }
.qr-faq-item[open] .qr-faq-item__qicon i { color: #fff; }
.qr-faq-item__answer { padding: 0 13px 12px; font-size: 12px; color: var(--quiz-brand-muted); line-height: 1.7; }

/* Force RTL text alignment (legacy global sets text-align:left) */
.qr-intro .qr-card__title, .qr-intro .qr-card__desc, .qr-intro .qr-stat__value, .qr-intro .qr-stat__label,
.qr-intro .qr-mode__title, .qr-intro .qr-mode__desc, .qr-intro .qr-outcomes li, .qr-intro .qr-tips li,
.qr-intro .qr-content-card__title, .qr-intro .qr-faq-item__question, .qr-intro .qr-faq-item__answer,
.qr-intro .qr-sources__text, .qr-intro .qr-resume-banner__text, .qr-intro .qr-faq__title { text-align: right; }

/* Below 380px: stack mode cards (iPhone SE 1st gen, older Androids) */
@media (max-width: 380px) {
  .qr-modes { grid-template-columns: 1fr; }
}

/* R.10 (Phase D) — real hero image covers the gradient container when present */
.qr-card__image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
