/* ============================================================
   Oman EM Prep — clean, calm, exam-focused UI
   ============================================================ */

:root {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --primary: #0f766e;
  --primary-strong: #115e59;
  --primary-soft: #ccfbf1;
  --accent: #2563eb;
  --correct: #16a34a;
  --correct-soft: #dcfce7;
  --wrong: #dc2626;
  --wrong-soft: #fee2e2;
  --flag: #d97706;
  --flag-soft: #fef3c7;
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .05);
  --radius: 14px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-ar: 'Noto Naskh Arabic', 'Segoe UI', Tahoma, sans-serif;
}

:root[data-theme="dark"] {
    --bg: #0b1220;
    --surface: #101a2c;
    --surface-2: #16223a;
    --border: #24344f;
    --text: #e2e8f0;
    --text-2: #94a3b8;
    --text-3: #64748b;
    --primary: #2dd4bf;
    --primary-strong: #5eead4;
    --primary-soft: #113b38;
    --accent: #60a5fa;
    --correct: #4ade80;
    --correct-soft: #14321f;
    --wrong: #f87171;
    --wrong-soft: #3b1516;
    --flag: #fbbf24;
    --flag-soft: #3a2c10;
    --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
  }
}
/* JS sets data-theme="dark"/"light" on <html> at boot (system default until user toggles) */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

.ar { font-family: var(--font-ar); direction: rtl; }

/* ---------- boot ---------- */
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: var(--text-2); }
.boot-logo {
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 22px;
}

/* ---------- layout ---------- */
.wrap { max-width: 880px; margin: 0 auto; padding: 24px 20px 80px; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 880px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
}
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.brand-sub { font-size: 11.5px; color: var(--text-3); margin-top: -2px; }

/* ---------- home ---------- */
.hero { padding: 28px 0 8px; }
.hero h1 { font-size: clamp(22px, 4vw, 30px); font-weight: 800; letter-spacing: -0.02em; }
.hero p { color: var(--text-2); margin-top: 6px; max-width: 56ch; }

.overall {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin: 20px 0 8px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
}
.stat-num { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.stat-label { font-size: 12.5px; color: var(--text-2); }

.section-heading {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 28px 0 12px;
}
.section-heading h2 { font-size: 17px; font-weight: 700; }
.section-heading span { font-size: 12.5px; color: var(--text-3); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(15,23,42,.10); }

.card-top { display: flex; align-items: center; gap: 12px; }
.card-icon {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  background: var(--primary-soft); display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.card-title { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.card-title-ar { font-family: var(--font-ar); direction: rtl; font-size: 12.5px; color: var(--text-2); text-align: right; }
.card-meta { font-size: 12.5px; color: var(--text-2); }

.mastery { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.mastery-fill { height: 100%; border-radius: 99px; background: var(--primary); transition: width .4s ease; }

.card-actions { display: flex; gap: 8px; margin-top: 4px; }

/* ---------- buttons ---------- */
.btn {
  appearance: none; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-family: inherit; font-size: 13.5px; font-weight: 600;
  padding: 9px 14px; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: background .12s ease, border-color .12s ease, transform .08s ease;
  text-decoration: none;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-block { width: 100%; }
.btn-danger-soft { background: var(--wrong-soft); border-color: transparent; color: var(--wrong); }
.btn-danger-soft:hover { background: var(--wrong-soft); filter: brightness(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- quiz ---------- */
.quiz-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0 10px; flex-wrap: wrap;
}
.quiz-mode-badge {
  font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--primary); background: var(--primary-soft);
  padding: 4px 10px; border-radius: 99px;
}
.quiz-mode-badge.exam { color: var(--flag); background: var(--flag-soft); }
.quiz-counter { font-size: 13px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.quiz-timer {
  font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13.5px;
  color: var(--text-2); background: var(--surface-2);
  padding: 5px 12px; border-radius: 99px;
}
.quiz-timer.danger { color: var(--wrong); background: var(--wrong-soft); }

.progress-track { height: 5px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-bottom: 18px; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 99px; transition: width .25s ease; }

.q-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.q-text { font-size: 16.5px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 18px; white-space: pre-wrap; }
.q-vignette { font-size: 15px; color: var(--text-2); white-space: pre-wrap; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px dashed var(--border); }

.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex; align-items: flex-start; gap: 12px;
  border: 1.5px solid var(--border); border-radius: 12px;
  padding: 13px 15px; cursor: pointer; background: var(--surface);
  transition: border-color .12s ease, background .12s ease;
  font-size: 15px; text-align: left; width: 100%; font-family: inherit; color: var(--text);
  line-height: 1.5;
}
.option:hover:not(:disabled) { border-color: var(--primary); }
.option:disabled { cursor: default; }
.option-key {
  flex: none; width: 26px; height: 26px; border-radius: 8px;
  background: var(--surface-2); color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; margin-top: 1px;
}
.option.selected { border-color: var(--primary); background: color-mix(in srgb, var(--primary-soft) 40%, var(--surface)); }
.option.selected .option-key { background: var(--primary); color: #fff; }
.option.correct { border-color: var(--correct); background: var(--correct-soft); }
.option.correct .option-key { background: var(--correct); color: #fff; }
.option.wrong { border-color: var(--wrong); background: var(--wrong-soft); }
.option.wrong .option-key { background: var(--wrong); color: #fff; }

/* feedback */
.feedback {
  margin-top: 18px; border-radius: 12px; padding: 18px;
  border: 1px solid var(--border); background: var(--surface-2);
  animation: rise .25s ease;
}
.feedback.correct { border-color: color-mix(in srgb, var(--correct) 40%, var(--border)); background: var(--correct-soft); }
.feedback.wrong { border-color: color-mix(in srgb, var(--wrong) 40%, var(--border)); background: var(--wrong-soft); }
.feedback-head { font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.feedback.correct .feedback-head { color: var(--correct); }
.feedback.wrong .feedback-head { color: var(--wrong); }
.feedback-body { font-size: 14.5px; color: var(--text); white-space: pre-wrap; }
.feedback-ref { margin-top: 12px; font-size: 12.5px; color: var(--text-2); font-style: italic; }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* quiz footer */
.quiz-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 18px; flex-wrap: wrap;
}
.quiz-footer-right { display: flex; gap: 8px; margin-inline-start: auto; }
.hint { font-size: 12px; color: var(--text-3); margin-top: 14px; text-align: center; }
kbd {
  font-family: inherit; font-size: 11px; background: var(--surface-2);
  border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 6px; color: var(--text-2);
}

/* flag button states */
.btn.flagged { background: var(--flag-soft); border-color: transparent; color: var(--flag); }

/* ---------- results ---------- */
.result-hero {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
  text-align: center; margin-top: 20px;
}
.score-ring {
  --pct: 0; width: 132px; height: 132px; border-radius: 50%;
  margin: 0 auto 16px;
  background: conic-gradient(var(--score-color, var(--primary)) calc(var(--pct) * 1%), var(--surface-2) 0);
  display: flex; align-items: center; justify-content: center;
}
.score-ring-inner {
  width: 104px; height: 104px; border-radius: 50%; background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.score-num { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.score-label { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.result-msg { font-size: 15px; color: var(--text-2); max-width: 46ch; margin: 0 auto; }

.review-list { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.review-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 13px 16px; cursor: pointer;
  transition: border-color .12s ease;
}
.review-row:hover { border-color: var(--primary); }
.review-status { flex: none; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; }
.review-status.ok { background: var(--correct-soft); color: var(--correct); }
.review-status.no { background: var(--wrong-soft); color: var(--wrong); }
.review-text { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.review-num { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; flex: none; }

/* review detail */
.review-detail { margin-top: 14px; }

/* ---------- misc ---------- */
.empty {
  text-align: center; padding: 48px 20px; color: var(--text-2);
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
}
.empty-icon { font-size: 34px; margin-bottom: 10px; }

.error-overlay {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.error-box {
  max-width: 520px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
}
.error-box h2 { font-size: 18px; margin-bottom: 10px; }
.error-box p { font-size: 14.5px; color: var(--text-2); margin-bottom: 10px; }
.error-box code {
  display: block; background: var(--surface-2); border: 1px solid var(--border);
  padding: 10px 14px; border-radius: 8px; font-size: 13px; margin: 8px 0; direction: ltr;
  overflow-x: auto;
}

.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 600; color: var(--text-2);
  background: none; border: none; cursor: pointer; font-family: inherit;
  padding: 4px 0;
}
.back-link:hover { color: var(--primary); }

@media (max-width: 560px) {
  .wrap { padding: 16px 14px 64px; }
  .q-card { padding: 18px 16px; }
  .card-actions { flex-direction: column; }
  .btn { width: 100%; }
  .card-actions .btn { width: 100%; }
  .quiz-footer { flex-direction: column-reverse; }
  .quiz-footer .btn, .quiz-footer-right { width: 100%; }
  .quiz-footer-right .btn { width: 100%; flex: 1; }
}

/* ---------- theme toggle ---------- */
.theme-btn { flex: none; width: 38px; height: 38px; padding: 0; border-radius: 10px; font-size: 16px; }

/* ---------- readiness hero ---------- */
.readiness {
  display: flex; align-items: center; gap: 26px; margin: 20px 0 14px; flex-wrap: wrap;
}
.readiness .score-ring { margin: 0; flex: none; }
.readiness-text { flex: 1; min-width: 240px; }
.readiness-title { font-family: var(--font-ar); font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.readiness-text p { font-size: 14.5px; color: var(--text-2); }
.readiness-text b { color: var(--text); }
.legend { font-size: 12.5px; color: var(--text-3); }
.readiness .score-ring { --pct: 0; width: 110px; height: 110px; }
.readiness .score-ring-inner { width: 88px; height: 88px; }
.readiness .score-num { font-size: 24px; }

/* ---------- resume card ---------- */
.resume-card { border-color: var(--primary); border-width: 1.5px; margin-bottom: 6px; }

/* ---------- weak areas ---------- */
.weak-acc { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.weak-acc.low { color: var(--wrong); }
.weak-acc.mid { color: var(--flag); }

/* ---------- tab navigation ---------- */
.tabbar {
  max-width: 880px; margin: 10px auto 0; padding: 0 20px;
  display: flex; gap: 8px;
}
.tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface);
  text-decoration: none; color: var(--text-2);
  transition: background .12s ease, color .12s ease;
}
.tab:hover { background: var(--surface-2); }
.tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.tab.active { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.tab-icon { font-size: 15px; }
.tab-text { display: flex; align-items: baseline; gap: 6px; }
.tab-label { font-weight: 700; font-size: 13.5px; }
.tab-ar { font-family: var(--font-ar); font-size: 11.5px; opacity: .75; }

@media (max-width: 720px) {
  .tabbar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    margin: 0; padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    gap: 4px;
  }
  .tab { flex-direction: column; gap: 2px; padding: 6px 4px; border: none; background: none; border-radius: 10px; }
  .tab.active { background: var(--primary-soft); }
  .tab-icon { font-size: 18px; }
  .tab-text { flex-direction: column; align-items: center; gap: 0; }
  .tab-label { font-size: 11px; }
  .tab-ar { display: none; }
  .wrap { padding-bottom: 120px; }
  .queue-card { flex-wrap: wrap; }
  .queue-body { flex: 1 1 calc(100% - 46px); }
  .queue-card .btn { flex: 1 1 100%; }
  .rc-stats { gap: 16px; }
}

/* ---------- home: compact readiness ---------- */
.readiness-compact {
  display: flex; align-items: center; gap: 18px; margin: 14px 0 14px; flex-wrap: wrap;
}
.score-ring.sm { --pct: 0; width: 64px; height: 64px; flex: none; }
.score-ring.sm .score-ring-inner { width: 52px; height: 52px; }
.score-ring.sm b { font-size: 14px; font-weight: 800; }
.rc-stats { display: flex; gap: 22px; flex-wrap: wrap; flex: 1; }
.rc-stats > div { min-width: 64px; }
.rc-stats b { display: block; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.rc-stats b i { font-style: normal; font-size: 12px; color: var(--text-3); font-weight: 600; }
.rc-stats span { font-size: 11.5px; color: var(--text-2); }

/* ---------- today's queue ---------- */
.queue-card { flex-direction: row; align-items: center; gap: 14px; }
.queue-rank {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
}
.queue-body { flex: 1; min-width: 0; }
.queue-title { font-weight: 700; font-size: 14.5px; }
.queue-sub { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }

/* ---------- OEEM strip on home ---------- */
.oeem-strip { flex-direction: row; align-items: center; gap: 14px; }
.oeem-strip .oeem-logo { width: 42px; height: 42px; font-size: 12px; }
.oeem-strip-title { font-weight: 700; font-size: 14.5px; }
.oeem-chevron { font-size: 26px; color: var(--text-3); line-height: 1; }

/* ---------- practice cards as links ---------- */
.sec-card { text-decoration: none; color: inherit; }
.sec-card:hover .card-title { color: var(--primary); }

/* ---------- section page ---------- */
.sec-hero { display: flex; gap: 16px; align-items: flex-start; margin: 12px 0 16px; }
.sec-hero h1 { font-size: 22px; letter-spacing: -0.02em; }
.sec-hero-ar { font-family: var(--font-ar); color: var(--text-2); font-size: 14px; margin-bottom: 2px; }
.card-icon.big { width: 60px; height: 60px; font-size: 30px; border-radius: 16px; }
.sec-cta { margin-bottom: 6px; padding: 13px; font-size: 15px; }
.cp-list { display: flex; flex-direction: column; gap: 10px; }
.cp-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 13px 16px;
}
.cp-row.locked { border-style: dashed; opacity: .75; }
.cp-state {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  background: var(--correct-soft); color: var(--correct);
}
.cp-row.locked .cp-state { background: var(--surface-2); color: var(--text-3); }
.cp-body { flex: 1; min-width: 0; }
.cp-name { font-weight: 700; font-size: 14px; }
.cp-meta { font-size: 12.5px; color: var(--text-2); margin-top: 1px; }

/* ---------- exam ladder rows ---------- */
.ms-list { display: flex; flex-direction: column; gap: 10px; }
.ms-row { flex-direction: row; align-items: center; gap: 14px; }
.ms-row.locked { border-style: dashed; opacity: .8; }
.ms-num {
  flex: none; width: 36px; height: 36px; border-radius: 11px;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px;
}
.ms-row.locked .ms-num { background: var(--surface-2); color: var(--text-3); }
.ms-row.sim .ms-num { background: linear-gradient(135deg, #0f766e 0%, #0b3d3a 100%); color: #fff; }
.ms-row.sim.locked .ms-num { background: var(--surface-2); color: var(--text-3); }
.ms-row .btn { flex: none; min-width: 86px; }

/* ---------- recommended path strip ---------- */
.path-strip {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.path-chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 99px; padding: 6px 13px;
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
  text-decoration: none; white-space: nowrap;
}
.path-chip b { color: var(--text-3); font-size: 11px; }
.path-chip.touched { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.path-chip.touched b { color: var(--primary); }

/* ---------- auth screens ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { width: min(420px, 100%); text-align: center; padding: 30px 26px; }
.auth-logo { width: 52px; height: 52px; font-size: 18px; margin: 0 auto 12px; }
.auth-card h1 { font-size: 22px; letter-spacing: -0.02em; }
.auth-sub { font-size: 13.5px; color: var(--text-2); margin: 4px 0 18px; }
.auth-label { display: block; text-align: right; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 12px; }
.auth-label input {
  width: 100%; margin-top: 5px; padding: 10px 12px;
  border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 14.5px;
}
.auth-label input:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: transparent; }
.auth-card .btn { margin-top: 6px; }
.auth-err {
  background: var(--wrong-soft); color: var(--wrong);
  font-size: 13.5px; font-weight: 600; border-radius: 10px;
  padding: 10px 14px; margin-bottom: 14px;
}
.auth-ok {
  background: var(--correct-soft); color: var(--correct);
  font-size: 13.5px; font-weight: 600; border-radius: 10px;
  padding: 10px 14px; margin-bottom: 14px;
}
.auth-note { font-size: 13.5px; color: var(--text-2); margin-bottom: 16px; }
.user-chip { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }

/* ---------- self-grade (answerless questions) ---------- */
.self-grade { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.self-grade-q { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 10px; color: var(--text-2); }
.self-grade-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- OEEM simulation card ---------- */
.oeem-card { background: linear-gradient(135deg, #0f766e 0%, #0b3d3a 100%); border: none; }
.oeem-head { display: flex; align-items: center; gap: 14px; }
.oeem-logo {
  flex: none; width: 46px; height: 46px; border-radius: 12px;
  background: rgba(255, 255, 255, .16); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; letter-spacing: .04em;
}
.oeem-title { font-weight: 800; font-size: 16.5px; color: #fff; letter-spacing: -0.01em; }
.oeem-sub { font-family: var(--font-ar); font-size: 12.5px; color: rgba(255, 255, 255, .75); }
.oeem-badge {
  flex: none; font-size: 12px; font-weight: 700;
  background: rgba(255, 255, 255, .16); color: #fff;
  padding: 4px 12px; border-radius: 99px; white-space: nowrap;
}
.oeem-facts { font-size: 13px; color: rgba(255, 255, 255, .85); margin: 12px 0 14px; }
.oeem-cta { background: #fff; color: #0f766e; border: none; font-weight: 800; }
.oeem-cta:hover { background: #ecfdf5; }
.oeem-progress { background: rgba(255, 255, 255, .2); }
.oeem-progress .mastery-fill { background: #fff; }
.oeem-progress-label { font-size: 12.5px; color: rgba(255, 255, 255, .85); margin-top: 6px; }
.oeem-card.locked { background: var(--surface); border: 1px dashed var(--border); }
.oeem-card.locked .oeem-title { color: var(--text); }
.oeem-card.locked .oeem-sub { color: var(--text-2); }
.oeem-card.locked .oeem-facts { color: var(--text-2); }
.oeem-card.locked .oeem-logo { background: var(--surface-2); color: var(--text-2); }
.oeem-card.locked .oeem-badge { background: var(--surface-2); color: var(--text-2); }
.oeem-card.locked .oeem-progress { background: var(--surface-2); }
.oeem-card.locked .oeem-progress .mastery-fill { background: var(--primary); }
.oeem-card.locked .oeem-progress-label { color: var(--text-2); }

/* ---------- exam pacing strip ---------- */
.pace-wrap { margin: 0 0 16px; }
.pace-bar { position: relative; height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.pace-fill { height: 100%; background: var(--flag); opacity: .5; transition: width 1s linear; }
.pace-marker {
  position: absolute; top: -2px; bottom: -2px; width: 3px;
  background: var(--text); border-radius: 2px; transition: left .3s ease;
}
.pace-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 5px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.pace-status { font-weight: 700; }
.pace-status.ok, .pace-status.ahead { color: var(--correct); }
.pace-status.behind { color: var(--wrong); }

/* ---------- question navigator grid ---------- */
.grid-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(2, 8, 14, .55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.grid-overlay[hidden] { display: none; }
.grid-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 18px; width: min(560px, 100%);
  max-height: 86vh; display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--shadow);
}
.grid-panel-head { display: flex; align-items: center; justify-content: space-between; font-size: 15px; }
.qgrid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; overflow-y: auto; }
.qcell {
  aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2);
  font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.qcell.done { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.qcell.mark { background: var(--flag-soft); color: var(--flag); border-color: transparent; }
.qcell.done.mark { background: linear-gradient(135deg, var(--primary-soft) 50%, var(--flag-soft) 50%); }
.qcell.cur { outline: 2.5px solid var(--primary); outline-offset: 1px; color: var(--text); }
.grid-panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
@media (max-width: 480px) { .qgrid { grid-template-columns: repeat(8, 1fr); } }

/* ---------- briefing ---------- */
.briefing { text-align: center; padding: 32px 26px; }
.briefing h1 { font-size: 24px; letter-spacing: -0.02em; margin: 14px 0 2px; }
.briefing-ar { font-family: var(--font-ar); color: var(--text-2); }
.briefing-src { font-size: 12.5px; color: var(--text-3); margin: 4px 0 18px; }
.oeem-logo.big { width: 64px; height: 64px; font-size: 18px; margin: 0 auto; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 18px 0; }
.fact { background: var(--surface-2); border-radius: 12px; padding: 12px 8px; }
.fact b { display: block; font-size: 20px; }
.fact span { font-size: 12px; color: var(--text-2); }
.rules { text-align: left; margin: 0 0 18px; padding-left: 20px; color: var(--text-2); font-size: 14px; display: grid; gap: 6px; }
.briefing .btn { margin-top: 8px; }

/* ---------- domain breakdown ---------- */
.domain-table { display: flex; flex-direction: column; gap: 8px; }
.domain-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 14px;
}
.domain-name { flex: 1; font-size: 13.5px; font-weight: 600; }
.domain-weak { font-size: 11px; font-weight: 700; color: var(--wrong); background: var(--wrong-soft); padding: 2px 8px; border-radius: 99px; }
.domain-score { font-weight: 800; font-size: 13.5px; width: 48px; text-align: center; border-radius: 8px; padding: 2px 0; }
.domain-score.ok { background: var(--correct-soft); color: var(--correct); }
.domain-score.mid { background: var(--flag-soft); color: var(--flag); }
.domain-score.low { background: var(--wrong-soft); color: var(--wrong); }
.domain-meta { font-size: 12px; color: var(--text-3); width: 44px; text-align: right; }

/* ---------- session history ---------- */
.hist-list { display: flex; flex-direction: column; gap: 8px; }
.hist-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px;
}
.hist-score {
  flex: none; width: 52px; text-align: center;
  font-weight: 800; font-size: 13.5px; font-variant-numeric: tabular-nums;
  padding: 3px 0; border-radius: 8px;
}
.hist-score.ok { background: var(--correct-soft); color: var(--correct); }
.hist-score.no { background: var(--wrong-soft); color: var(--wrong); }
.hist-title { font-size: 13.5px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-meta { font-size: 12px; color: var(--text-3); flex: none; }

@media (max-width: 560px) {
  .hist-row { flex-wrap: wrap; row-gap: 4px; }
  .hist-meta { width: 100%; text-align: right; }
}
