/* ==========================================================================
   SIMULASI CAT CPNS 2027 — CAT BKN EXAM INTERFACE
   File: css/exam.css
   ========================================================================== */

/* ==========================================================================
   EXAM BODY & VIEWPORT STATE
   ========================================================================== */
body.in-exam {
  overflow-y: auto;
  min-height: 100vh;
  background: var(--bg-subtle);
}

[data-theme="dark"] body.in-exam {
  background: var(--bg-page);
}

body.in-exam .main-container {
  max-width: 1400px;
  margin: 12px auto 28px;
  padding: 0 16px;
  width: 100%;
}

body.in-exam #screenExam {
  display: block;
}

/* ==========================================================================
   CAT EXAM STATS & DIGITAL TIMER (HEADER INTEGRATION)
   ========================================================================== */
.cat-header-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 0.8rem;
}

.cat-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
}

.cat-stat-label {
  font-size: 0.68rem;
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 600;
}

.cat-stat-val {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

.cat-stat-val.c-ans { color: #38bdf8; }
.cat-stat-val.c-doubt { color: #fbbf24; }
.cat-stat-val.c-empty { color: #ffffff; }

.cat-stat-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.15);
}

.timer-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  color: #ffffff;
}

.timer-wrapper.urgent {
  background: rgba(220, 38, 38, 0.2);
  border-color: #ef4444;
  color: #fca5a5;
  animation: timerUrgentPulse 1.5s infinite;
}

@keyframes timerUrgentPulse {
  0%, 100% { border-color: #ef4444; }
  50% { border-color: #fca5a5; }
}

.timer-wrapper.study-mode {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.timer-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timer-num {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

.timer-sub {
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #94a3b8;
  margin-top: 3px;
  text-transform: uppercase;
}

.timer-sep {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
  opacity: 0.6;
}

/* ==========================================================================
   RESPONSIVE EXAM GRID LAYOUT (ZERO HORIZONTAL OVERFLOW)
   ========================================================================== */
#screenExam {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* Desktop default: 2-column layout (Question panel + 310px sticky sidebar) */
.exam-grid,
#screenExam .exam-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 16px;
  align-items: start;
  width: 100%;
  max-width: 100%;
}

#screenExam #examSidebarCol {
  width: 310px;
  min-width: 0;
  max-width: 100%;
  position: sticky;
  top: 72px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Mobile & Tablet (<980px): Fluid single-column stacked layout */
@media (max-width: 980px) {
  .exam-grid,
  #screenExam .exam-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
  }

  #screenExam #qMainPanel {
    width: 100%;
    min-width: 0;
    order: 1;
  }

  #screenExam #examSidebarCol {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    position: static;
    top: auto;
    order: 2;
  }
}

/* ==========================================================================
   MAIN QUESTION PANEL
   ========================================================================== */
#screenExam #qMainPanel {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-height: 560px;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.q-topbar {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.q-meta-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.q-counter {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  padding-right: 12px;
  border-right: 1.5px solid var(--border-color);
}

.q-tag {
  background: var(--bkn-navy);
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
}

.q-subtopic {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Question Content & Scroll Area */
.q-content-scroll {
  padding: 20px 22px;
  flex: 1;
  overflow-y: auto;
  word-break: break-word;
}

.q-stem {
  font-size: calc(1.02rem * var(--exam-font-scale, 1));
  line-height: 1.7;
  color: var(--text-primary);
  font-weight: 500;
  margin: 0 0 18px 0;
  word-break: break-word;
}

.q-stem p {
  margin-bottom: 10px;
}

.fig-svg-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 16px 0 18px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.q-stem svg,
.fig-svg-wrap svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 12px auto;
}

.q-stem table {
  width: 100%;
  max-width: 600px;
  margin: 14px auto;
  border-collapse: collapse;
}

.q-stem th,
.q-stem td {
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  text-align: center;
  font-size: 0.95rem;
}

.q-stem th {
  background: var(--bg-subtle);
  font-weight: 600;
}

.q-stem pre,
.explain-card pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-family: var(--font-code);
  font-size: 0.85rem;
  line-height: 1.45;
  margin: 10px 0;
}

.q-stem code,
.explain-card code {
  font-family: var(--font-code);
  background: var(--bg-subtle);
  color: var(--text-primary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
  font-weight: 600;
}

.q-stem pre code,
.explain-card pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

/* ==========================================================================
   OPTIONS GROUP & RADIO BUTTONS
   ========================================================================== */
.options-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.option-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.55;
  box-sizing: border-box;
}

[data-theme="dark"] .option-btn {
  background: #111827;
  border-color: #334155;
  color: #f8fafc;
}

.option-btn:not(.is-review):hover {
  border-color: var(--bkn-blue);
  background: #f0f9ff;
  color: var(--text-primary);
}

[data-theme="dark"] .option-btn:not(.is-review):hover {
  border-color: #38bdf8;
  background: #0c3556;
  color: #ffffff;
}

.option-btn.is-review {
  cursor: default;
  color: var(--text-primary);
}

.q-stem ul.md-list,
.explain-body ul.md-list {
  margin: 8px 0 12px 20px;
  padding-left: 4px;
}

.q-stem ul.md-list li,
.explain-body ul.md-list li {
  margin-bottom: 5px;
}

.option-btn.selected {
  border-color: var(--bkn-blue);
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 600;
}

[data-theme="dark"] .option-btn.selected {
  border-color: #38bdf8;
  background: #0c4a6e;
  color: #e0f2fe;
}

.option-btn.correct {
  border-color: var(--color-answered);
  background: var(--color-answered-light);
  color: #14532d;
}

[data-theme="dark"] .option-btn.correct {
  color: #dcfce7;
}

.option-btn.correct .opt-letter {
  background: var(--color-answered);
  color: #ffffff;
  border-color: var(--color-answered);
}

.option-btn.wrong {
  border-color: var(--color-empty);
  background: var(--color-empty-light);
  color: #7f1d1d;
}

[data-theme="dark"] .option-btn.wrong {
  color: #fee2e2;
}

.option-btn.wrong .opt-letter {
  background: var(--color-empty);
  color: #ffffff;
  border-color: var(--color-empty);
}

.opt-letter {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid #94a3b8;
  background: #ffffff;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all var(--transition-fast);
}

[data-theme="dark"] .opt-letter {
  background: #1e293b;
  border-color: #64748b;
  color: #f8fafc;
}

.option-btn.selected .opt-letter {
  border-color: var(--bkn-blue);
  background: var(--bkn-blue);
  color: #ffffff;
}

.opt-text {
  flex: 1;
  font-size: calc(0.95rem * var(--exam-font-scale, 1));
  line-height: 1.55;
  color: inherit;
}

.opt-text p {
  margin: 0;
}

.opt-text strong,
.opt-text b {
  font-weight: 500;
}

.opt-score {
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  align-self: center;
  margin-left: 8px;
  flex-shrink: 0;
}

/* ==========================================================================
   QUESTION TOOLBAR (BOTTOM BAR)
   ========================================================================== */
.q-toolbar {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
  padding: 10px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
  flex-wrap: wrap;
}

.toolbar-left,
.toolbar-center,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-nav {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1.5px solid var(--border-color);
}

.btn-nav:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--bkn-blue);
  color: var(--bkn-blue);
}

[data-theme="dark"] .btn-nav {
  background: #1e293b;
  color: #f8fafc;
  border-color: #475569;
}

[data-theme="dark"] .btn-nav:hover:not(:disabled) {
  background: #0c4a6e;
  border-color: #38bdf8;
  color: #ffffff;
}

.btn-doubt-toggle {
  background: var(--cat-yellow);
  color: #000000;
  font-weight: 700;
  border: 1px solid #d99b00;
  padding: 7px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-doubt-toggle.active {
  background: #b45309;
  color: #ffffff;
  border-color: #78350f;
}

/* ==========================================================================
   EXPLANATION & SHORTCUT HACK CARD
   ========================================================================== */
.explain-card {
  margin-top: 20px;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
}

.explain-header {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  margin-bottom: 6px;
}

.explain-body {
  font-size: 0.9rem;
  line-height: 1.55;
  margin-bottom: 12px;
}

.hack-card {
  background: var(--bg-surface);
  border-left: 3px solid var(--color-doubt);
  padding: 12px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 10px;
}

.hack-card-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-doubt);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

/* ==========================================================================
   WEBCAM PROCTORING WIDGET (SIDEBAR)
   ========================================================================== */
.proctor-box {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.proctor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.proctor-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--text-primary);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.proctor-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--color-answered);
  background: var(--color-answered-light);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

.proctor-badge.off {
  color: var(--text-muted);
  background: var(--bg-subtle);
}

.proctor-badge.warn {
  color: var(--color-doubt);
  background: var(--color-doubt-light);
}

.proctor-badge.danger {
  color: var(--color-empty);
  background: var(--color-empty-light);
}

.proctor-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-answered);
  animation: livePulse 1.4s infinite;
}

.proctor-badge.off .proctor-dot {
  background: #94a3b8;
  animation: none;
}

.proctor-badge.warn .proctor-dot {
  background: var(--color-doubt);
  box-shadow: none;
}

.proctor-badge.danger .proctor-dot {
  background: var(--color-empty);
  box-shadow: none;
}

@keyframes livePulse {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 5px rgba(22, 163, 74, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

.proctor-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 165px;
  min-height: 140px;
  background: #0f172a;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.proctor-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.proctor-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.75rem;
  gap: 6px;
  padding: 10px;
  text-align: center;
}

.proctor-caption {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.proctor-warn-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.proctor-warn-banner.warn {
  background: #fffbeb;
  border: 1.5px solid #f59e0b;
  color: #b45309;
  animation: warnAmberPulse 2s infinite;
}

[data-theme="dark"] .proctor-warn-banner.warn {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
}

@keyframes warnAmberPulse {
  0%, 100% { border-color: #f59e0b; }
  50% { border-color: #fcd34d; }
}

.proctor-warn-banner.danger {
  background: #fef2f2;
  border: 1.5px solid #ef4444;
  color: #991b1b;
  animation: warnRedBlink 1.6s infinite;
}

[data-theme="dark"] .proctor-warn-banner.danger {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}

@keyframes warnRedBlink {
  0%, 100% { border-color: #ef4444; }
  50% { border-color: #fca5a5; }
}

.proctor-target-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.target-reticle {
  width: 52%;
  height: 70%;
  border: 1.5px dashed rgba(34, 197, 94, 0.6);
  border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.proctor-target-overlay.warn .target-reticle {
  border-color: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.proctor-target-overlay.danger .target-reticle {
  border-color: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* ==========================================================================
   LEMBAR JAWABAN & 110-NUMBER NAVIGATION (SIDEBAR)
   ========================================================================== */
.nav-soal-card {
  margin: 0;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.nav-panel-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.legend-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 6px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-sq {
  width: 13px;
  height: 13px;
  border-radius: 2px;
  box-sizing: border-box;
}

.legend-sq.sq-ans {
  background: var(--bkn-blue);
  border: 1.5px solid var(--bkn-blue);
}

.legend-sq.sq-doubt {
  background: #fff7ed;
  border: 1.5px solid #ea580c;
}

[data-theme="dark"] .legend-sq.sq-doubt {
  background: rgba(234, 88, 12, 0.2);
  border-color: #f97316;
}

.legend-sq.sq-empty {
  background: #ffffff;
  border: 1px solid #1e293b;
}

[data-theme="dark"] .legend-sq.sq-empty {
  background: #111827;
  border-color: #94a3b8;
}

.grid-numbers {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 2px;
  margin-bottom: 10px;
}

.num-tile {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-sizing: border-box;
  background: #ffffff;
  border: 1px solid #1e293b;
  color: #0f172a;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

[data-theme="dark"] .num-tile {
  background: #111827;
  border-color: #64748b;
  color: #f1f5f9;
}

.num-tile:hover {
  border-color: var(--bkn-blue);
  color: var(--bkn-blue);
}

.num-tile.ans {
  background: var(--bkn-blue) !important;
  border: 1px solid var(--bkn-blue) !important;
  color: #ffffff !important;
}

[data-theme="dark"] .num-tile.ans {
  background: var(--bkn-blue) !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
}

.num-tile.dbt {
  background: #fff7ed !important;
  border: 1.5px solid #ea580c !important;
  color: #c2410c !important;
}

[data-theme="dark"] .num-tile.dbt {
  background: rgba(234, 88, 12, 0.2) !important;
  border-color: #f97316 !important;
  color: #fdba74 !important;
}

.num-tile.curr {
  outline: none !important;
  border: 2px solid var(--bkn-blue) !important;
  color: var(--bkn-blue) !important;
  background: #ffffff;
  z-index: 2;
}

[data-theme="dark"] .num-tile.curr {
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
  background: #111827;
}

.num-tile.ans.curr {
  background: var(--bkn-blue) !important;
  border: 2px solid var(--bkn-blue) !important;
  color: #ffffff !important;
}

.num-tile.dbt.curr {
  background: #fff7ed !important;
  border: 2px solid #ea580c !important;
  color: #c2410c !important;
}

.btn-finish-sidebar {
  width: 100%;
  padding: 9px 12px;
  font-size: 0.88rem;
  font-weight: 700;
  background: var(--cat-red);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-finish-sidebar:hover {
  background: #b91c1c;
}

/* ==========================================================================
   MOBILE EXAM OPTIMIZATIONS (<640px)
   ========================================================================== */
@media (max-width: 640px) {
  body.in-exam .main-container {
    padding: 0 8px 36px;
    margin: 8px auto 20px;
  }

  .q-content-scroll {
    padding: 14px 12px;
  }

  .q-topbar {
    padding: 10px 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .q-toolbar {
    padding: 10px 12px;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }

  .toolbar-left,
  .toolbar-center,
  .toolbar-right {
    width: 100%;
    display: flex;
  }

  .toolbar-left .btn,
  .toolbar-center .btn,
  .toolbar-right .btn {
    flex: 1;
    text-align: center;
    justify-content: center;
  }

  .grid-numbers {
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    max-height: 260px;
  }

  .timer-wrapper {
    padding: 3px 8px;
    gap: 5px;
  }

  .timer-num {
    font-size: 0.95rem;
  }

  .timer-sub {
    font-size: 0.5rem;
  }

  .cat-header-stats {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }

  body.in-exam .site-header .header-inner {
    padding: 6px 10px;
    gap: 6px;
    min-height: 0;
  }

  body.in-exam .brand-text-wrap,
  body.in-exam #btnHdrUserWidget {
    display: none !important;
  }

  body.in-exam .brand-logo-icon {
    width: 30px;
    height: 30px;
    font-size: 0.72rem;
  }

  body.in-exam .cat-header-stats {
    padding: 4px 8px;
    gap: 6px;
  }

  body.in-exam .cat-stat-label {
    font-size: 0.58rem;
  }

  body.in-exam .cat-stat-val {
    font-size: 0.82rem;
  }
}

/* ==========================================================================
   M4 BKN CAT UX ENHANCEMENTS (FONT SCALER, SHORTCUTS, SUBTEST PILLS, MOBILE GRID)
   ========================================================================== */
.font-scaler {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.btn-font-scale {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 4px 8px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  border-right: 1px solid var(--border-color);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.btn-font-scale:last-child {
  border-right: none;
}

.btn-font-scale:hover:not(:disabled),
.btn-font-scale.is-active {
  background: var(--primary-light);
  color: var(--bkn-blue);
}

.btn-font-scale:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.exam-shortcut-hint {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 6px 18px;
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.exam-shortcut-hint kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--border-color);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-family: var(--font-code);
  font-size: 0.7rem;
  font-weight: 700;
}

.subtest-jump-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.subtest-pill {
  flex: 1;
  min-width: 72px;
  padding: 5px 6px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.subtest-pill.active {
  background: var(--bkn-navy);
  border-color: var(--bkn-navy);
  color: #ffffff;
}

[data-theme="dark"] .subtest-pill.active {
  background: var(--bkn-blue);
  border-color: var(--bkn-blue);
}

.num-tile {
  position: relative;
}

.num-tile .num-ans {
  position: absolute;
  bottom: 2px;
  right: 3px;
  font-size: 0.56rem;
  font-weight: 800;
  line-height: 1;
  opacity: 0.9;
}

.btn-grid-toggle {
  display: none;
  margin-bottom: 8px;
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

@media (max-width: 980px) {
  .btn-grid-toggle {
    display: block;
  }
  .nav-soal-card.grid-collapsed #numGrid {
    display: none;
  }
}

@media (max-width: 640px) {
  .exam-shortcut-hint {
    display: none;
  }
}

/* ==========================================================================
   EXAM ANTI-COPY, ANTI-SELECTION & CONTEXT PROTECTION
   ========================================================================== */
body.exam-copy-locked,
body.exam-copy-locked #screenExam,
body.exam-copy-locked #screenExam *,
body.exam-copy-locked .top-header,
body.exam-copy-locked .top-header *,
body.exam-copy-locked .modal-overlay,
body.exam-copy-locked .modal-overlay * {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}

body.exam-copy-locked input,
body.exam-copy-locked textarea,
body.exam-copy-locked select {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  user-select: text !important;
}

body.exam-copy-locked .q-stem svg,
body.exam-copy-locked .fig-svg-wrap svg,
body.exam-copy-locked .q-stem img,
body.exam-copy-locked .opt-text svg,
body.exam-copy-locked .opt-text img {
  -webkit-user-drag: none;
  pointer-events: none;
}

.proctor-security-toast {
  position: fixed;
  top: 74px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(92vw, 520px);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.95);
  color: #f8fafc;
  border: 1px solid rgba(248, 113, 113, 0.55);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.3);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.4;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

.proctor-security-toast.hidden {
  display: none;
}

/* ==========================================================================
   ANTI-SCREENSHOT PRIVACY SHIELD
   ========================================================================== */
body.exam-screenshot-shield #screenExam,
body.exam-screenshot-shield .top-header {
  filter: blur(26px) brightness(0.25) !important;
  opacity: 0.08 !important;
  pointer-events: none !important;
  transition: none !important;
}

.proctor-privacy-shield {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(2, 6, 23, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  -webkit-user-select: none;
  user-select: none;
}

.proctor-privacy-shield.hidden {
  display: none;
}

.proctor-shield-card {
  max-width: 460px;
  width: 100%;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(248, 113, 113, 0.45);
  border-radius: var(--radius-lg, 12px);
  padding: 28px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
