
/* ============================================================
   CAT ACADEMY IMIPAS — css/exam-runner.css
   VERSION 5.1 — STABILITY, RESPONSIVE UI & ACCESSIBILITY

   TUJUAN:
   - Simulator ujian CAT yang nyaman di desktop dan mobile
   - Fullscreen tanpa gangguan navigasi aplikasi
   - Timer dan navigasi soal selalu terlihat
   - Area soal dapat di-scroll secara independen
   - Pilihan jawaban mudah dibaca dan disentuh
   - Mendukung keyboard dan screen reader
   - Mendukung dark mode dan light mode
   - Animasi ringan dan menghormati reduced motion

   KOMPATIBILITAS:
   - exam-runner.js v5.x
   - exam.css
   - variables.css
   - base.css
   - layout.css
   - components.css
   - utilities.css

   LOAD ORDER:
   <link rel="stylesheet" href="css/exam.css">
   <link rel="stylesheet" href="css/exam-runner.css?v=5.1">

   CATATAN:
   - Seluruh class utama v5.0 dipertahankan.
   - Tidak mengubah logika ujian atau penilaian.
   - JS harus menambahkan body.in-exam-mode.
   ============================================================ */


/* ============================================================
   01. LOCAL DESIGN TOKENS
   ============================================================ */

:root {
  --exr-accent:
    var(--accent-primary, #70a6ed);

  --exr-bg:
    var(--bg-app, #0a1929);

  --exr-surface:
    var(--bg-surface, #0f2438);

  --exr-surface-alt:
    var(--bg-surface-2, #143152);

  --exr-border:
    var(--border-default, rgba(255,255,255,.12));

  --exr-border-soft:
    var(--border-subtle, rgba(255,255,255,.08));

  --exr-text:
    var(--text-primary, #ffffff);

  --exr-text-secondary:
    var(--text-secondary, #b7c9dc);

  --exr-text-muted:
    var(--text-tertiary, #8ba3b8);

  --exr-success: #10b981;
  --exr-warning: #f59e0b;
  --exr-danger: #ef4444;
  --exr-info: #3b82f6;

  --exr-radius-sm: 8px;
  --exr-radius-md: 12px;
  --exr-radius-lg: 16px;
  --exr-radius-xl: 20px;

  --exr-speed-fast: 150ms;
  --exr-speed-base: 200ms;
  --exr-speed-slow: 280ms;

  --exr-ease:
    cubic-bezier(.2,.8,.2,1);

  --exr-content-width: 860px;

  --exr-safe-top:
    env(safe-area-inset-top, 0px);

  --exr-safe-bottom:
    env(safe-area-inset-bottom, 0px);

  --exr-safe-left:
    env(safe-area-inset-left, 0px);

  --exr-safe-right:
    env(safe-area-inset-right, 0px);
}


/* ============================================================
   02. EXAM MODE — HIDE GLOBAL APPLICATION UI
   ============================================================ */

body.in-exam-mode .app-topbar,
body.in-exam-mode .app-bottom-nav,
body.in-exam-mode .app-sidebar,
body.in-exam-mode .cat-sidebar-backdrop {
  display: none !important;
}

body.in-exam-mode .app-shell,
body.in-exam-mode .app-shell.is-sidebar-collapsed {
  display: block !important;

  grid-template-columns: none !important;
  grid-template-areas: none !important;

  width: 100%;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;

  transition: none !important;
}

body.in-exam-mode .app-body {
  display: flex;
  flex-direction: column;

  width: 100%;
  min-width: 0;
  min-height: 0;
}

body.in-exam-mode .app-main {
  display: flex;

  flex: 1 1 auto;

  width: 100%;
  min-width: 0;
  min-height: 0;

  margin: 0;
  padding: 0 !important;

  overflow: hidden;
}

body.in-exam-mode {
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}


/* ============================================================
   03. ROOT EXAM LAYOUT
   ============================================================ */

.exr-layout,
.exr-layout *,
.exr-layout *::before,
.exr-layout *::after {
  box-sizing: border-box;
}

.exr-layout {
  position: relative;

  display: flex;
  flex-direction: column;

  flex: 1 1 auto;

  width: 100%;
  min-width: 0;
  min-height: 0;

  height: 100vh;
  height: 100dvh;

  overflow: hidden;

  background: var(--exr-bg);
  color: var(--exr-text);

  font-family: inherit;

  isolation: isolate;
}

.exr-layout button,
.exr-layout input {
  font: inherit;
}

.exr-layout button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.exr-layout img,
.exr-layout video,
.exr-layout canvas {
  max-width: 100%;
}

.exr-layout svg {
  flex-shrink: 0;
}


/* ============================================================
   04. ACCESSIBILITY
   ============================================================ */

.exr-layout button:focus-visible,
.exr-layout a:focus-visible,
.exr-layout select:focus-visible,
.exr-layout textarea:focus-visible,
.exr-layout input:focus-visible {
  outline: 2px solid var(--exr-accent);
  outline-offset: 3px;
}

.exr-layout button:disabled {
  cursor: not-allowed;
}

.exr-layout [hidden] {
  display: none !important;
}

.exr-layout :where(
  .exr-topbar,
  .exr-bottom-bar,
  .exr-panel,
  .exr-modal
) {
  color: var(--exr-text);
}


/* ============================================================
   05. EXAM TOPBAR
   ============================================================ */

.exr-topbar {
  position: relative;

  display: flex;
  flex-direction: column;

  flex: 0 0 auto;

  width: 100%;
  min-width: 0;

  background: var(--exr-surface);

  border-bottom:
    1px solid var(--exr-border-soft);

  z-index: 10;
}

.exr-topbar-main {
  display: flex;
  align-items: center;

  gap: 8px;

  width: 100%;
  min-width: 0;

  padding:
    calc(8px + var(--exr-safe-top))
    calc(12px + var(--exr-safe-right))
    8px
    calc(12px + var(--exr-safe-left));
}

.exr-topbar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 8px;

  min-width: 0;

  padding:
    6px
    calc(12px + var(--exr-safe-right))
    8px
    calc(12px + var(--exr-safe-left));

  border-top:
    1px solid var(--exr-border-soft);

  font-size: 11px;
  line-height: 1.4;

  color: var(--exr-text-muted);
}


/* ============================================================
   06. PACKAGE INFORMATION
   ============================================================ */

.exr-package-name {
  flex: 1 1 auto;

  min-width: 0;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  font-size: 11px;
  font-weight: 600;

  color: var(--exr-text-secondary);
}

.exr-package-meta {
  display: inline-flex;
  align-items: center;

  gap: 6px;

  flex: 0 0 auto;

  max-width: 55%;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  font-size: 11px;

  color: var(--exr-text-muted);
}


/* ============================================================
   07. TOPBAR ICON BUTTONS
   ============================================================ */

.exr-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  flex: 0 0 auto;

  width: 40px;
  height: 40px;

  padding: 0;

  border:
    1px solid var(--exr-border);

  border-radius: 10px;

  background: var(--exr-surface-alt);

  color: var(--exr-text-secondary);

  cursor: pointer;

  transition:
    background-color var(--exr-speed-fast) ease,
    border-color var(--exr-speed-fast) ease,
    color var(--exr-speed-fast) ease,
    transform var(--exr-speed-fast) ease;
}

.exr-icon-btn svg {
  width: 20px;
  height: 20px;
}

@media (hover: hover) {
  .exr-icon-btn:hover {
    background:
      var(--bg-hover, rgba(160,193,235,.08));

    color: var(--exr-text);

    border-color: var(--exr-accent);
  }

  .exr-icon-btn.exr-exit-btn:hover {
    background: rgba(239,68,68,.12);
    color: var(--exr-danger);
    border-color: var(--exr-danger);
  }

  .exr-icon-btn.exr-menu-btn:hover {
    background: var(--exr-accent);
    color: #ffffff;
    border-color: var(--exr-accent);
  }
}

.exr-icon-btn:active {
  transform: scale(.96);
}


/* ============================================================
   08. QUESTION COUNTER
   ============================================================ */

.exr-counter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;

  flex: 1 1 auto;

  gap: 4px;

  min-width: 0;
}

.exr-counter-current {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;

  color: var(--exr-text);

  font-variant-numeric: tabular-nums;
}

.exr-counter-total {
  font-size: 12px;
  font-weight: 500;

  color: var(--exr-text-muted);

  white-space: nowrap;

  font-variant-numeric: tabular-nums;
}

.exr-counter-answered {
  display: inline-flex;
  align-items: center;

  margin-left: 4px;
  padding: 3px 8px;

  border-radius: 999px;

  background: rgba(16,185,129,.12);

  color: var(--exr-success);

  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;

  white-space: nowrap;

  font-variant-numeric: tabular-nums;
}


/* ============================================================
   09. EXAM TIMER
   ============================================================ */

.exr-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  flex: 0 0 auto;

  gap: 6px;

  min-height: 38px;

  padding: 6px 10px;

  border:
    1.5px solid var(--exr-border);

  border-radius: 10px;

  background: var(--exr-surface-alt);

  color: var(--exr-text);

  font-family:
    ui-monospace,
    "SFMono-Regular",
    Menlo,
    Consolas,
    monospace;

  font-size: 13px;
  font-weight: 800;

  font-variant-numeric: tabular-nums;

  white-space: nowrap;

  transition:
    background-color var(--exr-speed-base) ease,
    border-color var(--exr-speed-base) ease,
    color var(--exr-speed-base) ease;
}

.exr-timer svg {
  width: 14px;
  height: 14px;

  opacity: .8;
}

.exr-timer.is-warning {
  background: rgba(245,158,11,.12);
  border-color: rgba(245,158,11,.45);
  color: var(--exr-warning);
}

.exr-timer.is-warning svg {
  opacity: 1;
}

.exr-timer.is-critical {
  background: rgba(239,68,68,.15);
  border-color: rgba(239,68,68,.55);
  color: var(--exr-danger);

  animation:
    exr-timer-pulse 1.2s ease-in-out infinite;
}

.exr-timer.is-critical svg {
  opacity: 1;
}

@keyframes exr-timer-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239,68,68,.12);
  }

  50% {
    box-shadow: 0 0 0 4px rgba(239,68,68,.20);
  }
}


/* ============================================================
   10. AUTOSAVE BADGE
   ============================================================ */

.exr-save-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  flex: 0 0 auto;

  gap: 5px;

  min-height: 24px;

  padding: 4px 9px;

  border-radius: 999px;

  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;

  white-space: nowrap;

  transition:
    background-color var(--exr-speed-base) ease,
    color var(--exr-speed-base) ease;
}

.exr-save-badge svg {
  width: 12px;
  height: 12px;

  flex-shrink: 0;
}

.exr-save-badge.is-saved {
  background: rgba(16,185,129,.14);
  color: var(--exr-success);
}

.exr-save-badge.is-saving {
  background: rgba(245,158,11,.14);
  color: var(--exr-warning);
}

.exr-save-badge.is-error {
  background: rgba(239,68,68,.14);
  color: var(--exr-danger);
}

.exr-save-badge.is-saving svg {
  animation: exr-save-spin 1s linear infinite;
}

@keyframes exr-save-spin {
  to {
    transform: rotate(360deg);
  }
}


/* ============================================================
   11. PROGRESS STRIP
   ============================================================ */

.exr-progress {
  position: relative;

  flex: 0 0 auto;

  width: 100%;
  height: 4px;

  overflow: hidden;

  background:
    var(--bg-muted, rgba(255,255,255,.06));
}

.exr-progress-fill {
  width: 0;
  height: 100%;

  background:
    linear-gradient(
      90deg,
      #3884e6 0%,
      #70a6ed 50%,
      #a0c1eb 100%
    );

  transition:
    width 350ms ease-out;
}


/* ============================================================
   12. SCROLLABLE EXAM BODY
   ============================================================ */

.exr-body {
  flex: 1 1 auto;

  min-width: 0;
  min-height: 0;

  width: 100%;

  overflow-y: auto;
  overflow-x: hidden;

  background: var(--exr-bg);

  overscroll-behavior-y: contain;

  -webkit-overflow-scrolling: touch;

  scrollbar-width: thin;

  scrollbar-color:
    var(--exr-border)
    transparent;
}

.exr-body::-webkit-scrollbar {
  width: 6px;
}

.exr-body::-webkit-scrollbar-thumb {
  background: var(--exr-border);
  border-radius: 999px;
}

.exr-content {
  width: 100%;
  max-width: var(--exr-content-width);

  min-width: 0;

  margin: 0 auto;

  padding: 20px 16px 28px;
}

.exr-content > * {
  min-width: 0;
}


/* ============================================================
   13. LOADING SCREEN
   ============================================================ */

.exr-loading {
  position: fixed;
  inset: 0;

  z-index: 100;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 16px;

  padding:
    calc(24px + var(--exr-safe-top))
    calc(24px + var(--exr-safe-right))
    calc(24px + var(--exr-safe-bottom))
    calc(24px + var(--exr-safe-left));

  background: var(--exr-bg);

  text-align: center;

  overflow-y: auto;
}

.exr-loading-icon {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 64px;
  height: 64px;

  flex-shrink: 0;

  margin-bottom: 4px;

  border-radius: 20px;

  background:
    var(--accent-subtle, rgba(112,166,237,.10));
}

.exr-loading-icon svg {
  width: 32px;
  height: 32px;

  color: var(--exr-accent);
}

.exr-loading-title {
  margin: 0;

  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;

  color: var(--exr-text);
}

.exr-loading-text {
  max-width: 300px;

  margin: 0;

  font-size: 13px;
  line-height: 1.6;

  color: var(--exr-text-muted);
}

.exr-loading-progress {
  width: 100%;
  max-width: 280px;

  height: 6px;

  margin-top: 4px;

  overflow: hidden;

  border-radius: 999px;

  background:
    var(--bg-muted, rgba(255,255,255,.06));
}

.exr-loading-fill {
  width: 0;
  height: 100%;

  border-radius: inherit;

  background:
    linear-gradient(
      90deg,
      #3884e6,
      #a0c1eb
    );

  transition: width 300ms ease-out;
}

.exr-loading-pct {
  font-family: ui-monospace, monospace;

  font-size: 11px;

  font-variant-numeric: tabular-nums;

  color: var(--exr-text-muted);
}


/* ============================================================
   14. BOTTOM NAVIGATION BAR
   ============================================================ */

.exr-bottom-bar {
  position: relative;

  display: flex;
  flex-direction: column;

  flex: 0 0 auto;

  gap: 8px;

  width: 100%;
  min-width: 0;

  padding:
    10px
    calc(12px + var(--exr-safe-right))
    calc(10px + var(--exr-safe-bottom))
    calc(12px + var(--exr-safe-left));

  background: var(--exr-surface);

  border-top:
    1px solid var(--exr-border-soft);

  box-shadow:
    0 -3px 16px rgba(0,0,0,.08);

  z-index: 10;
}

.exr-nav-strip {
  display: flex;
  align-items: center;

  gap: 6px;

  width: 100%;
  min-width: 0;
}


/* ============================================================
   15. NAVIGATION ARROWS
   ============================================================ */

.exr-nav-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  flex: 0 0 auto;

  width: 40px;
  height: 40px;

  padding: 0;

  border:
    1px solid var(--exr-border);

  border-radius: 10px;

  background: var(--exr-surface-alt);

  color: var(--exr-text);

  cursor: pointer;

  transition:
    background-color var(--exr-speed-fast) ease,
    border-color var(--exr-speed-fast) ease,
    color var(--exr-speed-fast) ease,
    transform var(--exr-speed-fast) ease;
}

.exr-nav-arrow svg {
  width: 18px;
  height: 18px;
}

.exr-nav-arrow:disabled {
  opacity: .4;
  cursor: not-allowed;
}

@media (hover: hover) {
  .exr-nav-arrow:not(:disabled):hover {
    background: var(--exr-accent);
    border-color: var(--exr-accent);
    color: #ffffff;
  }
}

.exr-nav-arrow:not(:disabled):active {
  transform: scale(.95);
}


/* ============================================================
   16. HORIZONTAL QUESTION NAVIGATION
   ============================================================ */

.exr-nav-scroll {
  display: flex;
  align-items: center;

  flex: 1 1 auto;

  gap: 5px;

  min-width: 0;

  padding: 3px 2px;

  overflow-x: auto;
  overflow-y: hidden;

  scrollbar-width: none;
  -ms-overflow-style: none;

  overscroll-behavior-x: contain;

  scroll-behavior: smooth;

  scroll-padding-inline: 8px;

  -webkit-overflow-scrolling: touch;
}

.exr-nav-scroll::-webkit-scrollbar {
  display: none;
}

.exr-nav-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  position: relative;

  flex: 0 0 auto;

  width: 36px;
  height: 36px;

  padding: 0;

  border:
    1.5px solid var(--exr-border);

  border-radius: 9px;

  background: var(--exr-surface-alt);

  color: var(--exr-text-secondary);

  font-size: 11px;
  font-weight: 700;

  font-variant-numeric: tabular-nums;

  cursor: pointer;

  transition:
    background-color var(--exr-speed-fast) ease,
    border-color var(--exr-speed-fast) ease,
    color var(--exr-speed-fast) ease,
    box-shadow var(--exr-speed-fast) ease,
    transform var(--exr-speed-fast) ease;
}

.exr-nav-cell:active {
  transform: scale(.95);
}

.exr-nav-cell.is-answered {
  background: rgba(16,185,129,.14);
  border-color: var(--exr-success);
  color: var(--exr-success);
}

.exr-nav-cell.is-flagged {
  background: rgba(245,158,11,.14);
  border-color: var(--exr-warning);
  color: var(--exr-warning);
}

.exr-nav-cell.is-flagged.is-answered {
  background: rgba(245,158,11,.20);
  border-color: var(--exr-warning);
}

.exr-nav-cell.is-active {
  border-color: var(--exr-accent);

  box-shadow:
    0 0 0 2px var(--exr-accent);

  color: var(--exr-text);

  font-weight: 800;
}

.exr-nav-cell.is-active.is-answered,
.exr-nav-cell.is-active.is-flagged {
  border-color: var(--exr-accent);
}


/* ============================================================
   17. END EXAM BUTTON
   ============================================================ */

.exr-end-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 8px;

  width: 100%;
  min-height: 44px;

  padding: 11px 20px;

  border: 0;
  border-radius: 12px;

  background:
    linear-gradient(
      135deg,
      #dc2626 0%,
      #ef4444 100%
    );

  color: #ffffff;

  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;

  cursor: pointer;

  box-shadow:
    0 4px 14px rgba(239,68,68,.22);

  transition:
    box-shadow var(--exr-speed-base) ease,
    transform var(--exr-speed-base) ease,
    opacity var(--exr-speed-base) ease;
}

.exr-end-btn svg {
  width: 16px;
  height: 16px;
}

@media (hover: hover) {
  .exr-end-btn:not(:disabled):hover {
    transform: translateY(-1px);

    box-shadow:
      0 6px 20px rgba(239,68,68,.35);
  }
}

.exr-end-btn:not(:disabled):active {
  transform: translateY(0);
}

.exr-end-btn:disabled {
  opacity: .55;
  box-shadow: none;
}


/* ============================================================
   18. QUESTION CARD
   ============================================================ */

.exr-question {
  width: 100%;
  min-width: 0;

  padding: 22px;

  border:
    1px solid var(--exr-border-soft);

  border-radius: var(--exr-radius-lg);

  background: var(--exr-surface);

  box-shadow:
    0 2px 12px rgba(0,0,0,.05);
}


/* ============================================================
   19. QUESTION HEADER
   ============================================================ */

.exr-qhead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;

  gap: 12px;

  padding-bottom: 14px;
  margin-bottom: 18px;

  border-bottom:
    1px solid var(--exr-border-soft);
}

.exr-qnum {
  display: inline-flex;
  align-items: baseline;

  gap: 5px;

  font-size: 12px;

  color: var(--exr-text-muted);
}

.exr-qnum strong {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;

  color: var(--exr-accent);

  font-variant-numeric: tabular-nums;
}


/* ============================================================
   20. QUESTION TAGS
   ============================================================ */

.exr-qtags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;

  gap: 6px;

  min-width: 0;
}

.exr-qtag {
  display: inline-flex;
  align-items: center;

  max-width: 100%;

  padding: 4px 10px;

  border-radius: 999px;

  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;

  letter-spacing: .02em;

  text-transform: uppercase;

  overflow-wrap: anywhere;
}

.exr-qtag.cat {
  background: rgba(112,166,237,.12);
  color: var(--exr-accent);
}

.exr-qtag.topic {
  background: rgba(59,130,246,.12);
  color: var(--exr-info);
}

.exr-qtag.diff-easy {
  background: rgba(16,185,129,.12);
  color: var(--exr-success);
}

.exr-qtag.diff-medium {
  background: rgba(245,158,11,.12);
  color: var(--exr-warning);
}

.exr-qtag.diff-hard {
  background: rgba(239,68,68,.12);
  color: var(--exr-danger);
}


/* ============================================================
   21. QUESTION TEXT
   ============================================================ */

.exr-qtext {
  margin: 0 0 22px;

  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;

  color: var(--exr-text);

  white-space: pre-wrap;

  overflow-wrap: anywhere;
  word-break: normal;
}

.exr-qtext img {
  display: block;

  max-width: 100%;
  height: auto;

  margin: 12px auto;

  border-radius: 10px;
}

.exr-qtext table {
  display: block;

  max-width: 100%;

  overflow-x: auto;
}

.exr-qtext pre {
  max-width: 100%;
  overflow-x: auto;
}


/* ============================================================
   22. ANSWER OPTIONS CONTAINER
   ============================================================ */

.exr-options {
  display: flex;
  flex-direction: column;

  gap: 10px;

  margin: 0 0 18px;
  padding: 0;

  list-style: none;
}

.exr-options li {
  min-width: 0;

  margin: 0;
  padding: 0;
}


/* ============================================================
   23. ANSWER OPTION
   ============================================================ */

.exr-option {
  position: relative;

  display: flex;
  align-items: flex-start;

  gap: 12px;

  width: 100%;
  min-width: 0;
  min-height: 58px;

  padding: 14px 16px;

  border:
    1.5px solid var(--exr-border-soft);

  border-radius: 12px;

  background: var(--exr-surface-alt);

  cursor: pointer;

  -webkit-tap-highlight-color: transparent;

  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

@media (hover: hover) {
  .exr-option:hover {
    border-color: var(--exr-accent);

    background:
      var(--bg-hover, rgba(160,193,235,.08));
  }
}

.exr-option:active {
  transform: scale(.997);
}


/* ============================================================
   24. ACCESSIBLE RADIO INPUT
   ============================================================ */

.exr-option input[type="radio"] {
  position: absolute;

  width: 1px;
  height: 1px;

  margin: 0;
  padding: 0;

  opacity: 0;

  overflow: hidden;

  pointer-events: none;
}

.exr-option:focus-within {
  outline: 2px solid var(--exr-accent);
  outline-offset: 3px;
}

.exr-option:has(
  input[type="radio"]:focus-visible
) {
  outline: 3px solid var(--exr-accent);
  outline-offset: 3px;
}

.exr-option:has(
  input[type="radio"]:disabled
) {
  opacity: .55;
  cursor: not-allowed;
}


/* ============================================================
   25. ANSWER OPTION MARKER
   ============================================================ */

.exr-option-marker {
  display: flex;
  align-items: center;
  justify-content: center;

  flex: 0 0 auto;

  width: 32px;
  height: 32px;

  border:
    1.5px solid var(--exr-border);

  border-radius: 9px;

  background: var(--exr-surface);

  color: var(--exr-text-secondary);

  font-size: 13px;
  font-weight: 800;

  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}


/* ============================================================
   26. ANSWER OPTION TEXT
   ============================================================ */

.exr-option-text {
  flex: 1 1 auto;

  min-width: 0;

  padding-top: 4px;

  font-size: 14.5px;
  line-height: 1.65;

  color: var(--exr-text-secondary);

  overflow-wrap: anywhere;
  word-break: normal;
}


/* ============================================================
   27. SELECTED ANSWER
   ============================================================ */

.exr-option.is-selected,
.exr-option:has(
  input[type="radio"]:checked
) {
  border-color: var(--exr-accent);

  background: rgba(112,166,237,.08);

  box-shadow:
    0 0 0 2px rgba(112,166,237,.15);
}

.exr-option.is-selected .exr-option-marker,
.exr-option:has(
  input[type="radio"]:checked
) .exr-option-marker {
  background: var(--exr-accent);
  border-color: var(--exr-accent);

  color: #06141c;
}

.exr-option.is-selected .exr-option-text,
.exr-option:has(
  input[type="radio"]:checked
) .exr-option-text {
  color: var(--exr-text);
  font-weight: 600;
}

/*
 * Indikator centang tanpa SVG data URI.
 * Lebih stabil di browser mobile.
 */

.exr-option.is-selected::after,
.exr-option:has(
  input[type="radio"]:checked
)::after {
  content: "";

  position: absolute;

  top: 50%;
  right: 16px;

  width: 8px;
  height: 14px;

  border-right: 3px solid var(--exr-accent);
  border-bottom: 3px solid var(--exr-accent);

  transform:
    translateY(-65%) rotate(45deg);
}

.exr-option.is-selected,
.exr-option:has(
  input[type="radio"]:checked
) {
  padding-right: 40px;
}


/* ============================================================
   28. QUESTION ACTIONS
   ============================================================ */

.exr-qactions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;

  gap: 8px;

  padding-top: 14px;

  border-top:
    1px solid var(--exr-border-soft);
}

.exr-qactions > button {
  max-width: 100%;
}


/* ============================================================
   29. PANEL OVERLAY
   ============================================================ */

.exr-panel-overlay {
  position: fixed;
  inset: 0;

  z-index: 199;

  background: rgba(0,0,0,.66);

  backdrop-filter: none;
  -webkit-backdrop-filter: none;

  opacity: 0;

  visibility: hidden;
  pointer-events: none;

  transition:
    opacity var(--exr-speed-base) ease,
    visibility var(--exr-speed-base) ease;
}

.exr-panel-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}


/* ============================================================
   30. QUESTION NAVIGATION PANEL
   ============================================================ */

.exr-panel {
  position: fixed;

  top: 0;
  right: 0;
  bottom: 0;

  z-index: 200;

  width: 340px;
  max-width: min(92vw, 340px);

  height: 100vh;
  height: 100dvh;

  padding:
    calc(20px + var(--exr-safe-top))
    calc(20px + var(--exr-safe-right))
    calc(20px + var(--exr-safe-bottom))
    20px;

  overflow-y: auto;
  overflow-x: hidden;

  background: var(--exr-surface);

  border-left:
    1px solid var(--exr-border-soft);

  box-shadow:
    -12px 0 40px rgba(0,0,0,.30);

  overscroll-behavior-y: contain;

  -webkit-overflow-scrolling: touch;

  transform: translateX(100%);

  visibility: hidden;
  pointer-events: none;

  transition:
    transform var(--exr-speed-slow) var(--exr-ease),
    visibility var(--exr-speed-slow) ease;
}

.exr-panel.is-open {
  transform: translateX(0);

  visibility: visible;
  pointer-events: auto;
}


/* ============================================================
   31. PANEL HEADER
   ============================================================ */

.exr-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 12px;

  margin-bottom: 16px;
  padding-bottom: 12px;

  border-bottom:
    1px solid var(--exr-border-soft);
}

.exr-panel-title {
  margin: 0;

  font-size: 15px;
  font-weight: 800;

  color: var(--exr-text);
}

.exr-panel-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  flex: 0 0 auto;

  width: 40px;
  height: 40px;

  padding: 0;

  border:
    1px solid var(--exr-border);

  border-radius: 10px;

  background:
    var(--bg-muted, rgba(255,255,255,.06));

  color: var(--exr-text-secondary);

  cursor: pointer;

  transition:
    background-color var(--exr-speed-fast) ease,
    color var(--exr-speed-fast) ease,
    border-color var(--exr-speed-fast) ease;
}

@media (hover: hover) {
  .exr-panel-close:hover {
    background: var(--exr-danger);
    color: #ffffff;
    border-color: var(--exr-danger);
  }
}


/* ============================================================
   32. PANEL QUESTION GRID
   ============================================================ */

.exr-panel-grid {
  display: grid;

  grid-template-columns:
    repeat(5, minmax(0, 1fr));

  gap: 8px;

  margin-bottom: 16px;
}

.exr-panel-cell {
  display: flex;
  align-items: center;
  justify-content: center;

  position: relative;

  min-width: 0;
  min-height: 44px;

  aspect-ratio: 1;

  padding: 0;

  border:
    1.5px solid var(--exr-border);

  border-radius: 9px;

  background:
    var(--bg-muted, var(--exr-surface-alt));

  color: var(--exr-text-secondary);

  font-size: 13px;
  font-weight: 700;

  font-variant-numeric: tabular-nums;

  cursor: pointer;

  transition:
    background-color var(--exr-speed-fast) ease,
    border-color var(--exr-speed-fast) ease,
    color var(--exr-speed-fast) ease,
    box-shadow var(--exr-speed-fast) ease;
}

.exr-panel-cell.is-answered {
  background: rgba(16,185,129,.14);
  border-color: var(--exr-success);
  color: var(--exr-success);
}

.exr-panel-cell.is-flagged {
  background: rgba(245,158,11,.14);
  border-color: var(--exr-warning);
  color: var(--exr-warning);
}

.exr-panel-cell.is-flagged.is-answered {
  background: rgba(245,158,11,.20);
  border-color: var(--exr-warning);
}

.exr-panel-cell.is-active {
  border-color: var(--exr-accent);

  box-shadow:
    0 0 0 2px var(--exr-accent);

  color: var(--exr-text);

  font-weight: 800;
}


/* ============================================================
   33. PANEL LEGEND
   ============================================================ */

.exr-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;

  gap: 12px;

  padding: 12px 0;
  margin-bottom: 12px;

  border-top:
    1px solid var(--exr-border-soft);

  border-bottom:
    1px solid var(--exr-border-soft);
}

.exr-legend-item {
  display: inline-flex;
  align-items: center;

  gap: 6px;

  font-size: 11px;
  line-height: 1.4;

  color: var(--exr-text-muted);
}

.exr-legend-swatch {
  display: inline-block;

  flex-shrink: 0;

  width: 12px;
  height: 12px;

  border: 1.5px solid;
  border-radius: 3px;
}

.exr-legend-swatch.a {
  background: rgba(16,185,129,.15);
  border-color: var(--exr-success);
}

.exr-legend-swatch.f {
  background: rgba(245,158,11,.15);
  border-color: var(--exr-warning);
}

.exr-legend-swatch.e {
  background:
    var(--bg-muted, var(--exr-surface-alt));

  border-color: var(--exr-border);
}


/* ============================================================
   34. MODAL BACKDROP
   ============================================================ */

.exr-modal-backdrop {
  position: fixed;
  inset: 0;

  z-index: 500;

  display: flex;
  align-items: center;
  justify-content: center;

  padding:
    calc(16px + var(--exr-safe-top))
    calc(16px + var(--exr-safe-right))
    calc(16px + var(--exr-safe-bottom))
    calc(16px + var(--exr-safe-left));

  background: rgba(0,0,0,.72);

  overflow-y: auto;

  overscroll-behavior: contain;

  animation:
    exr-fade-in 200ms ease both;
}

@keyframes exr-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}


/* ============================================================
   35. MODAL CONTAINER
   ============================================================ */

.exr-modal {
  width: 100%;
  max-width: 420px;

  max-height: 100%;

  margin: auto;

  padding: 24px;

  overflow-y: auto;
  overscroll-behavior: contain;

  border:
    1px solid var(--exr-border);

  border-radius: 20px;

  background: var(--exr-surface);

  color: var(--exr-text);

  box-shadow:
    0 20px 50px rgba(0,0,0,.35);

  animation:
    exr-modal-in
    250ms
    var(--exr-ease)
    both;
}

@keyframes exr-modal-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


/* ============================================================
   36. MODAL ICON
   ============================================================ */

.exr-modal-icon {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 64px;
  height: 64px;

  margin: 0 auto 16px;

  border-radius: 50%;

  background: rgba(245,158,11,.15);

  color: var(--exr-warning);
}

.exr-modal-icon.danger {
  background: rgba(239,68,68,.15);
  color: var(--exr-danger);
}

.exr-modal-icon svg {
  width: 32px;
  height: 32px;
}


/* ============================================================
   37. MODAL TEXT
   ============================================================ */

.exr-modal-title {
  margin: 0 0 8px;

  font-size: 18px;
  font-weight: 800;
  line-height: 1.4;

  text-align: center;

  color: var(--exr-text);
}

.exr-modal-text {
  margin: 0 0 18px;

  font-size: 13px;
  line-height: 1.65;

  text-align: center;

  color: var(--exr-text-muted);
}


/* ============================================================
   38. MODAL SUMMARY
   ============================================================ */

.exr-modal-summary {
  display: flex;
  flex-direction: column;

  gap: 10px;

  margin-bottom: 18px;
  padding: 14px 16px;

  border-radius: 12px;

  background: var(--exr-surface-alt);
}

.exr-modal-summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;

  gap: 12px;

  min-width: 0;

  font-size: 13px;
  line-height: 1.5;
}

.exr-modal-summary-label {
  min-width: 0;

  color: var(--exr-text-secondary);
}

.exr-modal-summary-value {
  flex-shrink: 0;

  font-weight: 800;

  color: var(--exr-text);

  font-variant-numeric: tabular-nums;
}

.exr-modal-summary-value.warn {
  color: var(--exr-warning);
}

.exr-modal-summary-value.danger {
  color: var(--exr-danger);
}


/* ============================================================
   39. MODAL ACTIONS
   ============================================================ */

.exr-modal-actions {
  display: flex;
  align-items: stretch;

  gap: 10px;
}

.exr-modal-actions .btn {
  flex: 1 1 0;

  min-width: 0;
  min-height: 44px;
}


/* ============================================================
   40. TABLET RESPONSIVENESS
   ============================================================ */

@media (max-width: 768px) {

  .exr-content {
    padding: 16px 14px 24px;
  }

  .exr-question {
    padding: 18px;
  }

  .exr-qtext {
    font-size: 15.5px;
  }

}


/* ============================================================
   41. MOBILE RESPONSIVENESS
   ============================================================ */

@media (max-width: 480px) {

  .exr-topbar-main {
    gap: 6px;

    padding:
      calc(8px + var(--exr-safe-top))
      calc(10px + var(--exr-safe-right))
      8px
      calc(10px + var(--exr-safe-left));
  }

  .exr-topbar-meta {
    gap: 6px;

    padding:
      5px
      calc(10px + var(--exr-safe-right))
      7px
      calc(10px + var(--exr-safe-left));

    font-size: 10px;
  }

  .exr-icon-btn {
    width: 36px;
    height: 36px;
  }

  .exr-icon-btn svg {
    width: 18px;
    height: 18px;
  }

  .exr-counter {
    gap: 3px;
  }

  .exr-counter-current {
    font-size: 16px;
  }

  .exr-counter-total {
    font-size: 11px;
  }

  .exr-counter-answered {
    margin-left: 2px;

    padding: 2px 6px;

    font-size: 9px;
  }

  .exr-timer {
    min-height: 36px;

    gap: 4px;

    padding: 5px 8px;

    font-size: 12px;
  }

  .exr-timer svg {
    width: 12px;
    height: 12px;
  }

  .exr-save-badge {
    padding: 3px 7px;
    font-size: 9px;
  }

  .exr-package-name,
  .exr-package-meta {
    font-size: 10px;
  }

  .exr-content {
    padding: 12px 10px 20px;
  }

  .exr-question {
    padding: 16px;

    border-radius: 14px;
  }

  .exr-qhead {
    gap: 10px;

    margin-bottom: 14px;
    padding-bottom: 12px;
  }

  .exr-qnum strong {
    font-size: 21px;
  }

  .exr-qtag {
    font-size: 9px;
    padding: 3px 8px;
  }

  .exr-qtext {
    margin-bottom: 18px;

    font-size: 15px;
    line-height: 1.7;
  }

  .exr-options {
    gap: 9px;
  }

  .exr-option {
    gap: 10px;

    min-height: 56px;

    padding: 12px;
  }

  .exr-option-marker {
    width: 30px;
    height: 30px;

    font-size: 12px;
  }

  .exr-option-text {
    padding-top: 3px;

    font-size: 14px;
    line-height: 1.6;
  }

  .exr-bottom-bar {
    gap: 7px;

    padding:
      8px
      calc(10px + var(--exr-safe-right))
      calc(8px + var(--exr-safe-bottom))
      calc(10px + var(--exr-safe-left));
  }

  .exr-nav-cell {
    width: 34px;
    height: 34px;

    font-size: 10px;
  }

  .exr-nav-arrow {
    width: 36px;
    height: 36px;
  }

  .exr-end-btn {
    min-height: 42px;

    padding: 10px 14px;

    font-size: 13px;
  }

  .exr-modal {
    padding: 20px;

    border-radius: 16px;
  }

}


/* ============================================================
   42. EXTRA SMALL MOBILE
   ============================================================ */

@media (max-width: 360px) {

  .exr-topbar-main {
    gap: 4px;
  }

  .exr-icon-btn {
    width: 34px;
    height: 34px;
  }

  .exr-counter-current {
    font-size: 15px;
  }

  .exr-counter-total {
    font-size: 10px;
  }

  .exr-counter-answered {
    font-size: 9px;
  }

  .exr-timer {
    padding: 5px 6px;
    font-size: 11px;
  }

  .exr-save-badge {
    padding: 3px 5px;
    font-size: 9px;
  }

  .exr-content {
    padding: 10px 8px 18px;
  }

  .exr-question {
    padding: 14px;
  }

  .exr-option {
    padding: 11px 10px;
  }

  .exr-option-text {
    font-size: 13.5px;
  }

  .exr-panel {
    max-width: 94vw;

    padding-left: 14px;
    padding-right: 14px;
  }

  .exr-panel-grid {
    gap: 6px;
  }

}


/* ============================================================
   43. LANDSCAPE / SHORT SCREENS
   ============================================================ */

@media (max-height: 500px) and (orientation: landscape) {

  .exr-topbar-main {
    padding-top:
      calc(5px + var(--exr-safe-top));

    padding-bottom: 5px;
  }

  .exr-topbar-meta {
    padding-top: 3px;
    padding-bottom: 4px;
  }

  .exr-bottom-bar {
    gap: 5px;

    padding-top: 5px;

    padding-bottom:
      calc(5px + var(--exr-safe-bottom));
  }

  .exr-nav-cell {
    width: 32px;
    height: 32px;
  }

  .exr-nav-arrow {
    width: 34px;
    height: 34px;
  }

  .exr-end-btn {
    min-height: 36px;

    padding: 7px 12px;
  }

  .exr-question {
    padding: 14px;
  }

  .exr-content {
    padding-top: 10px;
    padding-bottom: 14px;
  }

  .exr-modal {
    padding: 16px;
  }

  .exr-modal-icon {
    width: 44px;
    height: 44px;

    margin-bottom: 10px;
  }

  .exr-modal-icon svg {
    width: 24px;
    height: 24px;
  }

}


/* ============================================================
   44. TOUCH DEVICES
   ============================================================ */

@media (pointer: coarse) {

  .exr-option {
    min-height: 56px;
  }

  .exr-panel-cell {
    min-height: 44px;
  }

  .exr-panel-close {
    min-width: 44px;
    min-height: 44px;
  }

  .exr-end-btn {
    min-height: 44px;
  }

}


/* ============================================================
   45. REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

  .exr-layout *,
  .exr-layout *::before,
  .exr-layout *::after {
    scroll-behavior: auto !important;

    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;

    transition-duration: .01ms !important;
  }

  .exr-panel,
  .exr-panel-overlay,
  .exr-modal,
  .exr-modal-backdrop,
  .exr-loading {
    animation: none !important;
    transition: none !important;
  }

}


/* ============================================================
   46. PRINT SAFETY
   ============================================================ */

@media print {

  body.in-exam-mode {
    overflow: visible !important;
  }

  .exr-layout {
    display: block;

    width: 100%;
    height: auto;

    min-height: 0;

    overflow: visible;

    background: #ffffff;
    color: #000000;
  }

  .exr-topbar,
  .exr-bottom-bar,
  .exr-panel,
  .exr-panel-overlay,
  .exr-modal-backdrop,
  .exr-loading {
    display: none !important;
  }

  .exr-body {
    display: block;

    height: auto;

    overflow: visible !important;

    background: #ffffff;
  }

  .exr-content {
    max-width: none;

    padding: 0;
  }

  .exr-question {
    border: 1px solid #cccccc;

    background: #ffffff;

    box-shadow: none;

    break-inside: avoid;
  }

  .exr-qtext,
  .exr-option-text {
    color: #000000 !important;
  }

  .exr-option {
    background: #ffffff;

    border-color: #cccccc;

    break-inside: avoid;
  }

}


/* ============================================================
   END OF FILE
   CAT ACADEMY IMIPAS
   exam-runner.css v5.1
   ============================================================ */
