/* «📝 التحضير للاختبار» — بطاقة الصفحة الرئيسية + نافذة الإعداد/الاختبار/النتيجة (تُحمَّل في index فقط) */
.uo-exam { grid-column: 1 / -1; }
.uo-exam h3 { margin-bottom: 6px; }
.uo-exam > p { margin-bottom: 12px; }
.uo-exam .uo-meta { gap: 12px; flex-wrap: wrap; }
.exam-last { font-weight: 600; color: var(--ink-soft); }

.ex-ov { position: fixed; inset: 0; z-index: 1100; background: rgba(40, 36, 24, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.ex-box { position: relative; background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; width: 100%; max-width: 760px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; padding: 18px 22px 22px; font-size: 17px; }
.ex-box:focus { outline: none; }
.ex-head, .ex-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ex-title { font-size: 22px; margin: 0; }
.ex-x { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper-2); color: var(--ink); font-size: 16px; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .ex-x:hover { border-color: var(--mustard); } }
.ex-top .ex-count { font-weight: 700; flex: 1 1 auto; }
.ex-timer { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 20px; padding: 2px 12px; border-radius: 999px; background: var(--mustard-wash); border: 1px solid var(--mustard); }
.ex-timer.is-warn { background: rgba(179, 83, 46, .14); border-color: #b3532e; color: #b3532e; }
.ex-set { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 12px; padding: 8px 14px 12px; }
.ex-set legend { font-weight: 700; padding: 0 6px; font-size: 15px; }
.ex-units, .ex-choices { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.ex-units { flex-direction: column; gap: 4px; }
.ex-choice { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; font-size: 16px; }
.ex-choice input { width: 20px; height: 20px; accent-color: var(--mustard-deep); }
.ex-err { min-height: 22px; color: #b3532e; font-size: 14.5px; margin-bottom: 6px; }
.ex-note { margin: 0 0 10px; font-size: 14px; color: var(--ink-soft); }
#examStart.is-locked { font-family: inherit; font-size: 14px; letter-spacing: 0; background: transparent; color: var(--ink-soft); border: 1px dashed var(--line); white-space: normal; text-align: start; }
.ex-msg { margin: 8px 0; color: var(--ink-soft); }
.ex-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.ex-btn { min-height: 44px; padding: 8px 20px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper-2); color: var(--ink); font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .ex-btn:hover:not(:disabled) { border-color: var(--mustard); } }
.ex-btn:disabled { opacity: .45; cursor: default; }
.ex-btn-main { background: var(--mustard); border-color: var(--mustard-deep); color: #181818; }
@media (hover: hover) and (pointer: fine) { .ex-btn-main:hover:not(:disabled) { background: var(--mustard-deep); } }
.ex-box button:focus-visible, .ex-box a:focus-visible, .ex-box input:focus-visible { outline: 3px solid var(--mustard-deep); outline-offset: 2px; }

.ex-stem { font-size: 19px; line-height: 1.9; margin: 6px 0 14px; overflow-wrap: anywhere; }
.ex-stem .inline-code, .ex-t .inline-code, .ex-rv-v .inline-code { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; overflow-wrap: anywhere; }
.ex-box pre.quiz-code { margin: 10px 0; max-width: 100%; white-space: pre; overflow-x: auto; overflow-wrap: normal; font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; font-size: 15px; }
.ex-opts { display: flex; flex-direction: column; gap: 10px; }
.ex-opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 10px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); font: inherit; font-size: 17px; text-align: start; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .ex-opt:hover { border-color: var(--mustard); } }
.ex-opt.is-sel { border-color: var(--mustard-deep); background: var(--mustard-wash); }
.ex-l { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.ex-opt.is-sel .ex-l { background: var(--mustard); border-color: var(--mustard-deep); color: #181818; }
.ex-t { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; line-height: 1.6; }
.ex-dots { display: flex; gap: 6px; overflow-x: auto; padding: 14px 2px 6px; margin-top: 6px; }
.ex-dot { flex: none; min-width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper-2); color: var(--ink-soft); font: inherit; font-size: 13px; cursor: pointer; }
.ex-dot.is-done { background: var(--mustard-wash); border-color: var(--mustard); color: var(--ink); }
.ex-dot.is-cur { border: 2px solid var(--ink); font-weight: 700; }
.ex-confirm { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--mustard-deep); background: var(--mustard-wash); }
.ex-confirm-t { flex: 1 1 100%; font-weight: 600; }

.ex-score { font-size: 32px; font-weight: 700; margin: 4px 0; }
.ex-score:focus { outline: none; }
.ex-time { color: var(--ink-soft); margin-bottom: 8px; }
.ex-h3 { font-size: 18px; margin: 18px 0 8px; }
.ex-bar { display: grid; grid-template-columns: 90px 1fr auto; align-items: center; gap: 10px; margin: 6px 0; font-size: 15px; }
.ex-bar-track { height: 12px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); overflow: hidden; display: block; }
.ex-bar-fill { display: block; height: 100%; background: var(--mustard); border-radius: 999px; }
.ex-review { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.ex-rv { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--paper-2); }
.ex-rv-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 700; }
.ex-rv-link { color: var(--mustard-deep); font-weight: 700; }
.ex-rv .ex-stem { font-size: 17px; margin: 6px 0 8px; }
.ex-rv-row { display: flex; flex-wrap: wrap; gap: 4px; font-size: 16px; margin: 4px 0; }
.ex-rv-row.is-bad b { color: #b3532e; }
.ex-rv-row.is-good b { color: var(--ok); }
.ex-rv-why { font-size: 15px; color: var(--ink-soft); line-height: 1.8; margin: 2px 0 6px; padding-inline-start: 22px; }

@media (max-width: 480px) {
  .ex-ov { padding: 0; }
  .ex-box { max-height: 100vh; max-height: 100dvh; height: 100%; border-radius: 0; padding: 12px 14px 18px; font-size: 16px;
    /* مناطق آمنة: الصندوق بملء الشاشة على الجوال فلا يختبئ تحت النتوء أو شريط الصفحة الرئيسية */
    padding: calc(12px + env(safe-area-inset-top, 0px)) calc(14px + env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) calc(14px + env(safe-area-inset-left, 0px)); }
  .ex-stem { font-size: 17px; }
  .ex-opt { font-size: 16px; }
  .ex-bar { grid-template-columns: 70px 1fr auto; }
  .ex-score { font-size: 28px; }
}

html[data-theme="dark"] .ex-ov { background: rgba(0, 0, 0, .65); }
html[data-theme="dark"] .ex-timer.is-warn, html[data-theme="dark"] .ex-err, html[data-theme="dark"] .ex-rv-row.is-bad b { color: #e0a080; }
html[data-theme="dark"] .ex-timer.is-warn { border-color: #e0a080; background: rgba(224, 160, 128, .12); }
html[data-theme="dark"] .ex-btn-main, html[data-theme="dark"] .ex-opt.is-sel .ex-l { color: #181818; }
html[data-theme="dark"] .ex-opt { background: #23231c; }
html[data-theme="dark"] .ex-opt.is-sel { background: var(--mustard-wash); }
html[data-theme="dark"] .ex-rv { background: #1c1c17; }
