/* The CBT exam: start modal, exam hall (a GATE replica), palette, calculator, submit, scorecard, review. */

#calc-modal { z-index: 2500; }
.modal-head .cbt-modal-head-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.modal-head .cbt-modal-head-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

/* ------------------------------------------------------------------ scorecard */
.modal-scorecard { width: min(520px, 100%); }
.scorecard-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 20px; background: linear-gradient(135deg, var(--surface-2), var(--brand-soft));
  border: 1px solid var(--border); border-radius: 12px;
}
.score-main { display: flex; flex-direction: column; gap: 2px; }
.score-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3); }
.score-val { font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--brand); line-height: 1.1; }
.score-max { font-size: 13px; color: var(--text-2); font-weight: 500; }
.score-accuracy { display: flex; flex-direction: column; align-items: flex-end; }
.acc-val { font-size: 28px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.acc-label { font-size: 12px; font-weight: 600; color: var(--text-3); }
.score-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 4px; }
.score-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.score-stat .s-label { font-size: 12px; font-weight: 600; color: var(--text-3); }
.score-stat .s-num { font-size: 20px; font-weight: 750; color: var(--text); font-variant-numeric: tabular-nums; }
.score-stat .s-pts { font-size: 12px; font-weight: 600; color: var(--text-2); }
.score-stat.good .s-pts { color: var(--good); }
.score-stat.bad .s-pts { color: var(--bad); }

/* Authentic Exam Summary Submit Modal */
.modal-exam-submit {
  width: min(850px, calc(100vw - 32px));
  max-height: min(90vh, 90dvh);
  display: flex;
  flex-direction: column;
}
.exam-submit-lead {
  font-size: 14px;
  color: var(--text-2);
  margin: 0 0 16px;
  line-height: 1.5;
}
.exam-summary-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.exam-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: center;
}
.exam-summary-table th {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.exam-summary-table th:first-child,
.exam-summary-table td:first-child {
  text-align: left;
  min-width: 220px;
}
.exam-summary-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.exam-summary-table tbody tr:last-child td {
  border-bottom: none;
}
.exam-summary-table tbody tr:hover td {
  background: var(--surface-2);
}
.leg-badge.inline {
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
  width: 11px;
  height: 11px;
}
.sum-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.sum-count.cnt-total { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.sum-count.cnt-ans { background: var(--good-soft); color: var(--good); }
.sum-count.cnt-not-ans { background: var(--bad-soft); color: var(--bad); }
.sum-count.cnt-review { background: rgba(124, 58, 237, .12); color: #7c3aed; }
.sum-count.cnt-ans-review { background: rgba(124, 58, 237, .12); color: #7c3aed; }
.sum-count.cnt-not-vis { background: var(--surface-2); color: var(--text-3); }

.exam-submit-warning {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: rgba(217, 119, 6, .08);
  border: 1px solid rgba(217, 119, 6, .35);
}
.exam-submit-warning-title,
.exam-submit-warning > strong:first-child {
  font-size: 13px;
  font-weight: 700;
  color: #b45309;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}
.exam-submit-warning p {
  font-size: 13px;
  color: var(--text-2);
  margin: 0;
  line-height: 1.55;
}
.exam-submit-warning p strong {
  display: inline !important;
  font-weight: 700;
  color: var(--text);
}

/* Calculator Modal */
.modal-calc { width: min(440px, 100%); }
.calc-head { padding: 10px 14px; }
.calc-head-title { display: flex; align-items: center; gap: 8px; }
.calc-head-title h3 { font-size: 15px; margin: 0; }
.calc-head-actions { display: flex; align-items: center; gap: 8px; }
.calc-badge {
  display: inline-block;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  background: var(--brand-soft);
  color: var(--brand);
}
.calc-badge-mem {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}
.calc-body { padding: 12px; }
.calc-screen {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  text-align: right;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.calc-history {
  min-height: 18px;
  font-size: 12px;
  color: var(--text-3);
  overflow-x: auto;
  white-space: nowrap;
}
.calc-display {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  overflow-x: auto;
  white-space: nowrap;
  line-height: 1.2;
}
.calc-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}
.calc-btn {
  height: 38px;
  padding: 0;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.1s ease;
  user-select: none;
}
.calc-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.calc-btn:active { transform: scale(0.96); }
.calc-fn { font-size: 12px; color: var(--text-2); background: var(--surface-2); }
.calc-mem { font-size: 11px; font-weight: 700; color: #d97706; background: rgba(245, 158, 11, 0.08); }
.calc-op { font-size: 15px; font-weight: 700; color: var(--brand); background: var(--brand-soft); }
.calc-act { font-size: 12px; font-weight: 700; color: #ef4444; background: rgba(239, 68, 68, 0.08); }
.calc-eq { grid-column: span 2; font-size: 18px; font-weight: 700; color: #fff; background: var(--brand); border-color: var(--brand); }
.calc-eq:hover { filter: brightness(1.1); }
.calc-num { font-size: 15px; font-weight: 600; }
.calc-foot { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; }
.calc-hint { font-size: 11px; }

@media (max-width: 480px) {
  .calc-grid { gap: 4px; }
  .calc-btn { height: 35px; font-size: 12px; }
  .calc-display { font-size: 20px; }
}

/* =========================================================================
   DEDICATED CBT EXAM HALL UI
   ========================================================================= */
html.exam-mode {
  overflow: hidden !important;
}
html.exam-mode .sidebar,
html.exam-mode .topbar,
html.exam-mode .tabbar,
html.exam-mode .mobile-foot,
html.exam-mode #qe-tracker,
html.exam-mode .qe-tracker {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
html.exam-mode .toast {
  position: fixed !important;
  top: 56px !important;
  bottom: auto !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 10000 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
html.exam-mode .shell {
  display: block !important;
  grid-template-columns: 1fr !important;
  height: 100vh !important;
  height: 100dvh !important;
}
html.exam-mode .main {
  margin: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  padding: 0 !important;
}
html.exam-mode .content {
  padding: 0 !important;
  margin: 0 !important;
  max-width: 100% !important;
  height: 100% !important;
}
html.exam-mode #view-exam {
  display: flex !important;
  height: 100% !important;
}

.exam-hall-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  overflow: hidden;
}

/* ==================================================================
   AUTHENTIC TCS iON GATE CBT EXAM HALL UI (IIT Guwahati / IIT Madras)
   ================================================================== */
.cbt-exam-hall {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1e293b;
}

/* 1. TCS iON Top Bar */
.cbt-topbar {
  height: 56px;
  background: #232f3e; /* Authentic digialm dark navy */
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  border-bottom: 2px solid #1a232f;
}
.cbt-title-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cbt-exam-main-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 750;
  letter-spacing: .02em;
  color: #ffffff;
}
.cbt-exam-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 2px 7px;
  border-radius: 4px;
  background: #0284c7;
  color: #fff;
  flex-shrink: 0;
}
.cbt-info-circle {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #3b82f6;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.cbt-exam-sub-title {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}
.cbt-topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.cbt-top-links {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cbt-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}
.cbt-link-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: #fff;
}
.cbt-quit-btn {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}
.cbt-quit-btn:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}
.cbt-candidate-block {
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  padding-left: 16px;
}
.cbt-cand-avatar {
  width: 38px;
  height: 38px;
  border-radius: 4px;
  background: #334155;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: grid;
  place-items: center;
}
.cbt-cand-meta {
  display: flex;
  flex-direction: column;
}
.cbt-cand-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.cbt-timer-line {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 12.5px;
}
.cbt-timer-lbl {
  color: #94a3b8;
  font-weight: 600;
  font-size: 11px;
}
.cbt-timer-val {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 800;
  font-size: 14px;
  color: #38bdf8;
  letter-spacing: .5px;
  transition: color .3s ease;
}
.cbt-timer-line.warn .cbt-timer-val {
  color: #f59e0b;
}
.cbt-timer-line.warn .cbt-timer-lbl {
  color: #fcd34d;
}
.cbt-timer-line.urgent .cbt-timer-val {
  color: #ef4444;
  animation: cbt-timer-pulse 1s infinite;
}
.cbt-timer-line.urgent .cbt-timer-lbl {
  color: #fca5a5;
}
@keyframes cbt-timer-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(1.06); }
}

/* 2. Sections Bar */
.cbt-sections-bar {
  background: #e2e8f0;
  border-bottom: 1px solid #cbd5e1;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 20px;
  min-height: 38px;
  flex-shrink: 0;
}
.cbt-paper-title-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}
.cbt-sections-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cbt-sec-heading {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  margin-right: 4px;
}
.cbt-section-tab-list {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cbt-sec-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #cbd5e1;
  border: 1px solid #94a3b8;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all .12s ease;
}
.cbt-sec-tab:hover {
  background: #e2e8f0;
}
.cbt-sec-tab.active {
  background: #ffffff;
  color: #0284c7;
  font-weight: 800;
  border-color: #cbd5e1;
  border-top: 3px solid #0284c7;
  margin-bottom: -1px;
  padding-bottom: 7px;
}
.cbt-tab-info {
  display: inline-grid;
  place-items: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #0284c7;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  margin-left: 2px;
}

/* 3. Main Split */
.cbt-main-split {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
  background: #fff;
}

/* Question Workspace (Left) */
.cbt-question-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-y: auto;
  background: #fff;
}
.cbt-q-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
  color: #334155;
  flex-shrink: 0;
}
.cbt-q-type-box strong, .cbt-q-marks-box strong {
  color: #0f172a;
}
.cbt-meta-sep {
  margin: 0 8px;
  color: #94a3b8;
}
.cbt-q-num-row {
  padding: 10px 24px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.cbt-q-num-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}
.cbt-q-content {
  padding: 24px 28px;
  font-size: 16px;
  line-height: 1.65;
  color: #1e293b;
  flex-shrink: 0;
}
.cbt-q-options {
  padding: 0 28px 28px;
  flex: 1;
}

/* Bottom Actions Toolbar */
.cbt-exam-footer {
  margin-top: auto;
  position: sticky;
  bottom: 0;
  background: #f1f5f9;
  border-top: 1px solid #cbd5e1;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 10;
  flex-shrink: 0;
}
.cbt-foot-left, .cbt-foot-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cbt-btn-action {
  padding: 7px 16px;
  background: #ffffff;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  transition: all .12s ease;
}
.cbt-btn-action:hover {
  background: #e2e8f0;
  border-color: #64748b;
}
.cbt-btn-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.cbt-btn-save {
  padding: 7px 22px;
  background: #0284c7;
  border: 1px solid #0369a1;
  border-radius: 4px;
  font-size: 13.5px;
  font-weight: 800;
  color: #ffffff;
  cursor: pointer;
  transition: all .12s ease;
}
.cbt-btn-save:hover {
  background: #0369a1;
}

/* 4. Right Palette Panel */
.cbt-collapse-btn {
  position: absolute;
  top: 50%;
  left: -16px;
  transform: translateY(-50%);
  width: 16px;
  height: 48px;
  background: #cbd5e1;
  border: 1px solid #94a3b8;
  border-right: none;
  border-radius: 4px 0 0 4px;
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 20;
}
.cbt-collapse-btn:hover {
  background: #94a3b8;
  color: #fff;
}

/* Legend Box */
.cbt-palette-legend {
  padding: 12px 14px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.cbt-leg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}
.cbt-leg-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #334155;
}
.cbt-leg-full {
  grid-column: span 2;
}

/* Authentic TCS iON Polygon Shapes */
.cbt-shape {
  width: 26px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  user-select: none;
}
.shape-answered {
  background: #27ae60;
  clip-path: polygon(0% 0%, 100% 0%, 100% 70%, 50% 100%, 0% 70%);
}
.shape-not-answered {
  background: #e74c3c;
  clip-path: polygon(50% 0%, 100% 30%, 100% 100%, 0% 100%, 0% 30%);
}
.shape-not-visited {
  background: #e2e8f0;
  color: #1e293b;
  border: 1px solid #94a3b8;
  border-radius: 3px;
}
.shape-review {
  background: #8e44ad;
  border-radius: 50%;
}
.shape-ans-review {
  background: #8e44ad;
  border-radius: 50%;
  position: relative;
}
.shape-ans-review::after {
  content: "";
  position: absolute;
  right: 0px;
  bottom: 0px;
  width: 8px;
  height: 8px;
  background: #2ecc71;
  border: 1px solid #ffffff;
  border-radius: 1px;
}

.cbt-pal-sec-bar {
  background: #0284c7;
  color: #ffffff;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  flex-shrink: 0;
}
.cbt-choose-q-bar {
  padding: 6px 12px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  flex-shrink: 0;
}
.cbt-palette-grid-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}
.cbt-palette-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px 8px;
  justify-items: center;
}
.cbt-pal-btn {
  width: 44px;
  height: 36px;
  cursor: pointer;
  border: none;
  font-size: 13px;
  font-weight: 800;
  transition: transform .1s ease, filter .1s ease;
  user-select: none;
}
.cbt-pal-btn:hover {
  filter: brightness(0.92);
  transform: scale(1.06);
}
.cbt-pal-btn.active {
  box-shadow: 0 0 0 2.5px #0284c7, 0 0 0 4px rgba(2, 132, 199, 0.3) !important;
}

/* Palette Bottom Controls */
.cbt-palette-foot {
  padding: 12px;
  background: #f1f5f9;
  border-top: 1px solid #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.cbt-foot-btn {
  padding: 6px 8px;
  background: #ffffff;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
}
.cbt-foot-btn:hover {
  background: #e2e8f0;
}
.cbt-btn-submit {
  width: 100%;
  padding: 9px;
  background: #0284c7;
  color: #ffffff;
  border: 1px solid #0369a1;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background .12s ease;
}
.cbt-btn-submit:hover {
  background: #0369a1;
}

/* Instructions Modal Header */
.cbt-inst-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: #232f3e;
  color: #fff;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.cbt-inst-header-left {
  flex: 1;
  min-width: 0;
}
.cbt-inst-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}
.cbt-inst-close {
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-left: 4px;
}
.cbt-inst-close:hover {
  color: #fff;
  background: #dc2626;
  border-color: #dc2626;
}
.cbt-inst-main-title {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
}
.cbt-inst-sub-title {
  font-size: 11.5px;
  color: #94a3b8;
}
.cbt-inst-page-title {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
}
.cbt-inst-sec-title {
  font-size: 14px;
  font-weight: 700;
  color: #0284c7;
  margin-bottom: 8px;
}
.cbt-inst-lead {
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 14px;
}
.cbt-inst-symbols-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}
.cbt-inst-sym-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #334155;
}
.sym-icon {
  width: 28px;
  height: 26px;
  font-size: 12px;
}
.cbt-marks-table-wrap {
  margin: 14px 0;
  overflow-x: auto;
}
.cbt-marks-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: center;
}
.cbt-marks-table th, .cbt-marks-table td {
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
}
.cbt-marks-table th {
  background: #f1f5f9;
  font-weight: 750;
  color: #1e293b;
}
.cbt-inst-note {
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  margin: 10px 0 16px;
}
.cbt-inst-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #f1f5f9;
  border-top: 1px solid #cbd5e1;
}
.cbt-inst-foot-left, .cbt-inst-foot-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Authentic GATE CBT Instructions & Declaration Modal */
.modal-test-start {
  width: min(800px, 95vw);
  max-height: 90vh;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
}
.cbt-modal-head-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cbt-exam-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--brand);
  color: #fff;
  text-transform: uppercase;
}
.cbt-instructions-body {
  overflow-y: auto;
  padding: 20px 24px;
  max-height: 68vh;
}

.cbt-inst-list {
  padding-left: 20px;
  margin: 0 0 16px;
}
.cbt-inst-list li {
  margin-bottom: 8px;
}

.cbt-declaration-card {
  margin-top: 24px;
  padding: 16px 18px;
  background: var(--brand-soft);
  border: 1.5px solid var(--brand);
  border-radius: var(--radius-sm);
}
.cbt-declaration-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.cbt-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  cursor: pointer;
  accent-color: var(--brand);
  flex-shrink: 0;
}
.cbt-declaration-text strong {
  font-size: 13.5px;
  color: var(--text);
  display: block;
  margin-bottom: 4px;
}
.cbt-declaration-text p {
  font-size: 12.5px;
  color: var(--text-2);
  margin: 0;
  line-height: 1.5;
}

/* Exam Main Split */
.exam-main-split {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* Left Question Workspace */
.exam-question-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  padding: 24px 36px 0;
  background: var(--bg);
}

.exam-q-num {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.exam-mobile-pal-btn {
  display: none;
}

.exam-q-content {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 24px;
}

/* Options area */
.exam-q-options {
  margin-bottom: 30px;
}
.exam-opt-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.exam-opt-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: all .12s ease;
  user-select: none;
}
.exam-opt-item:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.exam-opt-item.sel {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.exam-opt-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  flex-shrink: 0;
  transition: all .12s ease;
}
.exam-opt-item.multi .exam-opt-circle {
  border-radius: 6px;
}
.exam-opt-item.sel .exam-opt-circle {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.exam-opt-text {
  flex: 1;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  padding-top: 2px;
}

/* Review verdicts & badges */
.exam-opt-item.review-correct {
  border-color: var(--good) !important;
  background: color-mix(in srgb, var(--good) 6%, var(--surface)) !important;
}
.exam-opt-item.review-wrong {
  border-color: var(--bad) !important;
  background: color-mix(in srgb, var(--bad) 6%, var(--surface)) !important;
}
.exam-opt-badge {
  font-size: 11px;
  font-weight: 750;
  padding: 3px 8px;
  border-radius: 4px;
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.exam-opt-badge.badge-correct-sel {
  background: var(--good);
  color: #fff;
}
.exam-opt-badge.badge-wrong-sel {
  background: var(--bad);
  color: #fff;
}
.exam-opt-badge.badge-correct-key {
  background: var(--good-soft);
  color: var(--good);
  border: 1px solid var(--good);
}

/* NAT virtual keypad in exam mode */
.exam-nat-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 320px;
}
.exam-nat-input-row {
  display: flex;
  gap: 8px;
}
.exam-nat-input {
  height: 46px;
  padding: 0 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  outline: none;
  width: 100%;
}
.exam-nat-input:focus {
  border-color: var(--brand);
}
.exam-keypad-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.keypad-btn {
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all .1s ease;
  user-select: none;
}
.keypad-btn:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}
.keypad-btn:active {
  transform: scale(0.96);
}
.keypad-act {
  background: var(--surface-2);
  font-size: 12px;
  color: var(--text-2);
}

/* =========================================================================
   Authentic CBT Exam Review Mode Styles
   ========================================================================= */
.cbt-review-panel {
  margin-top: 24px;
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Evaluation Summary Bar */
.cbt-eval-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}

.eval-stat-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.eval-lbl {
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-3);
}

.eval-val-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-size: 13px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 6px;
  letter-spacing: .02em;
}

.eval-val-badge.good {
  background: var(--good);
  color: #fff;
}

.eval-val-badge.bad {
  background: var(--bad);
  color: #fff;
}

.eval-val-badge.muted {
  background: var(--border-strong);
  color: var(--text-2);
}

.eval-val-code {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 750;
  color: var(--text);
  padding: 2px 0;
}

.eval-val-code.key-good {
  color: var(--good);
}

.eval-sub {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
}

/* Derivation Card */
.cbt-derivation-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.derivation-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.derivation-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 750;
  color: var(--text);
}

.derivation-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.derivation-meta .badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
}

.derivation-body {
  padding: 20px 22px;
  font-size: 15.5px;
  line-height: 1.68;
  color: var(--text);
}

.derivation-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}

/* NAT Review Evaluation Bar */
.cbt-nat-eval-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13.5px;
  margin-top: 8px;
}

.cbt-nat-eval-box.good {
  border-color: var(--good);
  background: color-mix(in srgb, var(--good) 6%, var(--surface));
}

.cbt-nat-eval-box.bad {
  border-color: var(--bad);
  background: color-mix(in srgb, var(--bad) 6%, var(--surface));
}

.nat-eval-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nat-eval-lbl {
  color: var(--text-3);
  font-weight: 600;
}

.nat-eval-sep {
  color: var(--border-strong);
}

/* Review Mode Palette Legend & Filter Bar */
.cbt-leg-review-grid {
  grid-template-columns: repeat(3, 1fr) !important;
}

.cbt-pal-filter-bar {
  display: flex;
  gap: 6px;
  padding: 8px 14px 4px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  overflow-x: auto;
}

.pal-filter-btn {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  white-space: nowrap;
  transition: all .1s ease;
}

.pal-filter-btn:hover {
  background: var(--surface);
  color: var(--text);
}

.pal-filter-btn.active {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.pal-filter-btn.incorrect-tab.active {
  background: var(--bad-soft);
  color: var(--bad);
  border-color: var(--bad);
}

.cbt-pal-btn.review-unattempted {
  background: var(--surface-2) !important;
  color: var(--text-3) !important;
  border: 1.5px dashed var(--border-strong) !important;
}

.cbt-pal-btn.dimmed {
  opacity: 0.22;
  filter: grayscale(1);
}

.btn-review-next-mistake {
  background: var(--bad-soft) !important;
  color: var(--bad) !important;
  border-color: var(--bad) !important;
  font-weight: 750 !important;
}
.btn-review-next-mistake:hover {
  background: var(--bad) !important;
  color: #fff !important;
}

/* Right Question Palette Pane */
.exam-palette-pane {
  width: 320px;
  flex-shrink: 0;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 18px;
  gap: 16px;
}

.palette-close-btn {
  display: none;
}

.leg-badge {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}
.badge-answered { background: var(--good); }
.badge-not-answered { background: #dc2626; }
.badge-not-visited { background: var(--surface-2); border: 1.5px solid var(--border-strong); }
.badge-review { background: #7c3aed; }
.badge-ans-review {
  background: #7c3aed;
  position: relative;
}
.badge-ans-review::after {
  content: "";
  position: absolute;
  right: 1px; bottom: 1px;
  width: 5px; height: 5px;
  background: #34d399;
  border-radius: 50%;
}

/* Responsive Exam Layout for Tablets & Mobile */
@media (max-width: 900px) {
  #btn-exam-fullscreen {
    display: none !important;
  }
  .exam-palette-pane {
    position: fixed;
    top: 56px;
    right: 0;
    bottom: 0;
    width: 280px;
    z-index: 30;
    box-shadow: -4px 0 16px rgba(0, 0, 0, .15);
    transform: translateX(100%);
    transition: transform .2s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .exam-palette-pane.open {
    transform: translateX(0);
  }
  .palette-close-btn {
    display: inline-grid;
  }
  .exam-mobile-pal-btn {
    display: inline-flex;
    align-items: center;
  }
  .exam-question-workspace {
    padding: 18px 18px 0;
  }
}

@media (max-width: 640px) {
  .cbt-inst-header {
    padding: 10px 14px;
  }
  .cbt-inst-header-right .cbt-cand-name {
    display: none;
  }
  .cbt-quit-btn span:last-child {
    display: none;
  }
}
