:root{
  --bg:#0b0e14;
  --card:#121826;
  --text:#e6edf3;
  --muted:#a6b3c2;
  --accent:#4aa3ff;
  --good:#1fbf75;
  --bad:#ff5c58;
  --bar:#1e293b;
  --bar-green:#22c55e;
  --bar-red:#ef4444;
  --pill:#243042;
  --border:#243047;
  --table-header-bg:transparent;
}

/* Responsive design with minimum width */
body {
  min-width: 420px;
}

/* Light theme */
[data-theme="light"]{
  --bg:#f8fafc;
  --card:#ffffff;
  --text:#1e293b;
  --muted:#64748b;
  --accent:#2563eb;
  --good:#059669;
  --bad:#dc2626;
  --bar:#e2e8f0;
  --bar-green:#10b981;
  --bar-red:#ef4444;
  --pill:#f1f5f9;
  --border:#e2e8f0;
  --table-header-bg:#f5f5f5;
}

[data-theme="light"] body{
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) no-repeat, var(--bg);
}

[data-theme="light"] .card{
  background: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* Light theme form elements */
[data-theme="light"] .config input,
[data-theme="light"] .config select{
  background: #ffffff;
  border: 1px solid #d1d5db;
  color: #1e293b;
}

[data-theme="light"] .config input:focus,
[data-theme="light"] .config select:focus{
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Light theme pills */
[data-theme="light"] .pill{
  background: #f1f5f9;
  color: #1e293b;
  border-color: #e2e8f0;
}

/* Light theme choices */
[data-theme="light"] .choice{
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .choice:hover{
  background: #f8fafc;
  border-color: #cbd5e1;
}

[data-theme="light"] .choice.correct{
  border-color: rgba(34 197 94);
  background: rgba(16, 185, 129, 0.05);
}

[data-theme="light"] .choice.wrong{
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.05);
}

/* Light theme feedback */
[data-theme="light"] .feedback{
  border-color: #e2e8f0;
}

[data-theme="light"] .feedback.good{
  border-color: rgba(34 197 94);
  color: #065f46;
}

[data-theme="light"] .feedback.bad{
  border-color: rgba(239, 68, 68, 0.5);
  color: #991b1b;
}

/* Light theme details */
[data-theme="light"] .details{
  background: #f8fafc;
  border-color: #e2e8f0;
}

/* Light theme counter */
[data-theme="light"] .counter{
  color: #64748b;
}

/* Light theme Next button */
[data-theme="light"] .btn:not(.primary){
  background: #f1f5f9;
  color: #1e293b;
  border-color: #e2e8f0;
}

/* Light theme review items */
[data-theme="light"] .review-item{
  border-color: #e2e8f0;
}

[data-theme="light"] .review-exp{
  color: #475569;
}

[data-theme="light"] .review-your{
  color: #991b1b;
}

[data-theme="light"] .review-corr{
  color: #065f46;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 800px at 20% -10%, #152033 0%, #0b0e14 50%) no-repeat, var(--bg);
  color:var(--text);
  line-height:1.5;
}

#app{
  max-width:900px;
  margin:0 auto;
  padding:16px;
  position:relative;
  min-height:100vh;
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.theme-toggle{
  position:absolute;
  top:-10px;
  right:16px;
  z-index:10;
}

.theme-toggle-button {
  position: relative;
  width: 3.5rem;
  height: 1.5rem;
  border-radius: 0.8rem;
  border: none;
  cursor: pointer;
  overflow: hidden;
  background: var(--toggle-bg);
  border: 1px solid var(--toggle-border);
  transition: all 0.3s ease;
}

.actions {
  margin-top: 3.75rem;
}

.theme-toggle-button:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.theme-toggle-button:active {
  transform: scale(0.95);
}

/* Icon container */
.theme-toggle-button .icon-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.25rem;
  z-index: 2;
}

/* Sun icon */ 
.sun-icon {
  width: 1rem;
  height: 1rem;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  transform: translateX(0) rotate(0deg);
}

/* Moon icon */
.moon-icon {
  width: 1rem;
  height: 1rem;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateX(0) rotate(0deg);
}

/* Dark theme (default) */
:root {
  --toggle-bg: #4a4a4a;
  --toggle-border: #aeaeae;
}

[data-theme="dark"] .theme-toggle-button {
  --toggle-bg: #4a4a4a;
  --toggle-border: #aeaeae;
}

[data-theme="dark"] .sun-icon {
  opacity: 0;
  transform: translateX(-2rem) rotate(-360deg);
}

[data-theme="dark"] .moon-icon {
  opacity: 1;
  transform: translateX(0) rotate(0deg);
}

/* Light theme */
[data-theme="light"] .theme-toggle-button {
  --toggle-bg: #ffffff;
  --toggle-border: #aeaeae;
}

[data-theme="light"] .sun-icon {
  opacity: 1;
  transform: translateX(0) rotate(0deg);
}

[data-theme="light"] .moon-icon {
  opacity: 0;
  transform: translateX(2rem) rotate(360deg);
}

.card{
  background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.0));
  border:1px solid var(--border);
  border-radius:8px;
  padding:24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.30);
  margin:20px 0;
  position:relative;
}

.hidden{display:none}

h1{margin:0 0 8px}
.sub{color:var(--muted); margin-top:0}

.config{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin:15px 0;
  width: 70%;
}
.config input,.config select{
  background:#0f1624;
  border:1px solid var(--border);
  color:var(--text);
  border-radius:10px;
  padding:10px 12px;
  outline:none;
}
small{color:var(--muted)}

.btn{
  appearance:none;
  border:none;
  background:#1b2436;
  color:var(--text);
  padding:12px 16px;
  border-radius:8px;
  cursor:pointer;
  transition:transform .02s ease, background .2s ease, opacity .2s ease;
  border:1px solid var(--border);
}
.btn.primary{
  background:linear-gradient(180deg, #DCFCE7, #bcf8d1);
  position:relative;
  overflow:hidden;
}

.btn.primary::before{
  content:'';
  position:absolute;
  top:0;
  left:-100%;
  width:100%;
  height:100%;
  background:linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition:left 0.6s ease;
}

.btn.primary:hover::before{
  left:100%;
}

.btn.primary:hover{
  background:linear-gradient(180deg, #DCFCE7, #bcf8d1);
}
.btn:disabled{opacity:.5; cursor:not-allowed}
.btn:active{transform:translateY(1px)}

.footnote{color:var(--muted); margin-top:14px}

.exam-header{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:16px;
}
.pill{
  background:var(--pill);
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  color:#c9d7ee;
  font-size:.9rem;
}
.counter{
  margin-left:auto;
  font-weight:600;
  color:#cfe4ff;
}

.timer{
  position:relative;
  height:8px;
  background:var(--bar);
  border-radius:999px;
  overflow:hidden;
  border:1px solid var(--border);
  margin-top: 1.5rem;
}
.timer .bar{
  position:absolute;
  top:0; left:0; height:100%;
  width:100%;
  background:var(--bar-green);
  transition: width .25s linear, background-color .25s linear;
}
.timer .time-text{
  position:absolute;
  top:-28px; right:0;
  font-feature-settings:"tnum";
  font-variant-numeric: tabular-nums;
  color:#cbd5e1;
}

.question{
  font-size:1.15rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  margin-left: 0.25rem;
}

.choices{
  display:grid;
  gap:10px;
  margin-bottom:8px;
}
.choice{
  background:#0e1524;
  border:1px solid var(--border);
  border-radius:8px;
  padding:12px;
  cursor:pointer;
  display:flex;
  align-items:flex-start;
  gap:10px;
}
.choice input{margin-top:3px}
.choice-text{
  min-width:0;
  white-space:pre-line;
  overflow-wrap:anywhere;
}
.large-symbols .symbol-text{
  font-size:2rem;
  line-height:1.35;
}
.question.large-symbols .large-symbol-question-line.pattern-line{
  padding-left:1rem;
  display:flex;
  align-items:center;
  flex-wrap:wrap;
}
.choices.large-symbols .choice{
  align-items:center;
}
.choices.large-symbols .choice input{
  margin-top:0;
}
.choice.correct{border-color:rgb(34 197 94)}
.choice.wrong{border-color:rgba(239,68,68,.5)}

.feedback{
  margin-top: 1.5rem;
  margin-bottom: 1.25rem;
  border-top:1px solid var(--border);
  border-bottom:1px solid var(--border);
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.feedback.good{border-color:rgba(34,197,94); color:#b7f0cb}
.feedback.bad{border-color:rgba(239,68,68,.5); color:#ffc9c9}

/* Feedback */
.feedback-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.feedback-icon {
  width: 20px;
  height: 20px;
}

.feedback-title {
  font-size: 1.05rem;
}

.feedback-body {
  margin-left: 1.9rem;
}

.score{
  font-size:1.25rem;
  padding:10px 0 16px;
}

.details{
  margin:8px 0 16px;
  border:1px solid var(--border);
  border-radius:8px;
  padding:10px 14px;
  background:#0e1423;
}

.details summary{
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  user-select: none;
}

/* Hide default arrow/marker */
.details summary::-webkit-details-marker{
  display: none;
}

/* PNG icon */
.summary-icon{
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
}

/* Arrow on the right */
.summary-arrow{
  margin-left: auto;
  transition: transform 0.3s ease;
  font-size: 0.875rem;
  color: var(--muted);
}

/* Summary Filter */
.review-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0 0.5rem;
}

.btn.small {
  padding: 0.45rem 0.75rem;
  font-size: 0.95rem;
}

.filter-count {
  margin-left: auto;
  opacity: 0.75;
  font-size: 0.95rem;
}

/* Rotate arrow when open */
.details[open] .summary-arrow{
  transform: rotate(-180deg);
}

.review-item{
  border-top:1px dashed var(--border);
  padding:8px 0;
  margin-top: 0.5rem;
}

.review-item:first-child{border-top:none}

.review-q {
    font-size: 1rem;
    line-height: 1.25rem;
}

.review-your{color:#ffc9c9}

.review-corr {
  color: rgba(34, 197, 94);
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  align-items: flex-start;
}

.review-exp {
  color: #fff;
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  align-items: flex-start;
}

.review-corr-icon,
.review-exp-icon {
  width: 16px;
  height: auto;
  margin-top: 0.2rem;
}

.counter {
  margin-left: auto;
  font-weight: 600;
  display: flex;
  border-radius: 5px;
  height: 2rem;
  align-items: center;
}
.qIndex {
  padding-left: 0.5rem;
  padding-top: 0.1rem;
  padding-bottom: 0.1rem;
  border: 1px solid #64748b;
  border-right: none;
  border-radius: 5px;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  padding-right: 0.5rem;
  width: 6.25rem;
  text-align: center;
}
.qTimer {
  background: #64748b;
  color: #fff;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  padding-top: 0.1rem;
  padding-bottom: 0.1rem;
  border-top-right-radius: 5px;
  border-bottom-right-radius: 5px;
  width: 6.25rem;
  text-align: center;
  border: 1px solid #64748b;
}
.timer {
  position: relative;
  height: 8px;
  background: var(--bar);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-top: 1.5rem;
}

/* Progress Tracker */
.pt-actions{
  display:flex;
  justify-content:flex-end;
  margin-top: 0.75rem;
}

.pt-table-wrap{
  overflow-x:auto;
  margin-top: 1.5rem;
}

.progress-details {
  background: #fff !important;
  margin-top: 1.5rem !important;
}

/* Default (collapsed) */
.progress-details {
  border: 2px solid gray !important;
}

/* Expanded (focused) */
.progress-details[open] {
  border: 2px solid #ff9900 !important;
}

/* Default (collapsed) title color */
.progress-title {
  text-indent: 0.5rem;
  color: gray;
  transition: color 0.25s ease;
}

/* When expanded */
.progress-details[open] .progress-title {
  color: #ff9900;
  font-size: 1.2rem;
}

.pt-table{
  width:100%;
  border-collapse:collapse;
  margin-top: 0.25rem;
  font-size: 1rem;
}

.pt-table thead th{
  text-align:left;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

.pt-table td{
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.pt-table td.num,
.pt-table th.num{
  text-align:center;
}

.pt-muted{
  color: var(--muted);
  margin-left: 0.5rem;
}

/* --------------------------------------------------------------------------
   CEM / Mettl-style exam mode
   Practice mode intentionally continues to use the original UI above.
   -------------------------------------------------------------------------- */

.exam-only{ display:none; }
.practice-only{ display:flex; }
.pane-heading{ display:none; }

/* Keep the original practice screen flow despite the shared markup. */
#exam-screen:not(.exam-authentic) .test-workspace,
#exam-screen:not(.exam-authentic) .question-pane,
#exam-screen:not(.exam-authentic) .answer-pane,
#exam-screen:not(.exam-authentic) .pane-scroll{ display:block; }
#exam-screen:not(.exam-authentic) .test-footer{
  display:flex;
  justify-content:flex-end;
  margin-top:3.75rem;
}
#exam-screen:not(.exam-authentic) .test-footer-left,
#exam-screen:not(.exam-authentic) .question-counter{ display:none; }
#exam-screen:not(.exam-authentic) .test-footer-right{ display:flex; gap:.75rem; }
#exam-screen:not(.exam-authentic) .next-control{
  appearance:none;
  background:#1b2436;
  color:var(--text);
  padding:12px 16px;
  border-radius:5px;
  cursor:pointer;
  border:1px solid var(--border);
  width:6rem;
}
[data-theme="light"] #exam-screen:not(.exam-authentic) .next-control{
  background:#f1f5f9;
  color:#1e293b;
  border-color:#e2e8f0;
}

body.exam-running{
  min-width:1024px;
  overflow:hidden;
  background:#eef0f3;
}
body.exam-running #app{
  max-width:none;
  width:100%;
  min-height:100vh;
  margin:0;
  padding:0;
  display:block;
}

#exam-screen.exam-authentic{
  display:flex;
  flex-direction:column;
  width:100%;
  height:100vh;
  min-height:650px;
  margin:0;
  padding:0;
  overflow:hidden;
  border:0;
  border-radius:0;
  box-shadow:none;
  background:#fff;
  color:#202124;
  font-family:Arial, Helvetica, sans-serif;
  line-height:1.4;
}
#exam-screen.exam-authentic.hidden{ display:none; }
#exam-screen.exam-authentic .practice-only{ display:none !important; }
#exam-screen.exam-authentic .exam-only{ display:block; }

#exam-screen.exam-authentic .cem-shell{
  flex:0 0 auto;
  background:#fff;
  border-bottom:1px solid #c9cdd3;
}
#exam-screen.exam-authentic .cem-toolbar{
  height:62px;
  display:flex;
  align-items:stretch;
  background:#fff;
  border-bottom:1px solid #d1d4d8;
}
#exam-screen.exam-authentic .test-header-tools{
  width:100%;
  display:flex;
  align-items:stretch;
}
#exam-screen.exam-authentic .test-tool{
  min-width:260px;
  padding:9px 18px;
  border:0;
  border-right:1px solid #d2d5d9;
  border-radius:0;
  background:#fff;
  color:#25282c;
  text-align:left;
  font:inherit;
  cursor:default;
}
#exam-screen.exam-authentic .test-tool .tool-label{
  display:block;
  margin-bottom:2px;
  color:#777c82;
  font-size:10px;
  font-weight:normal;
  letter-spacing:.25px;
}
#exam-screen.exam-authentic .test-tool strong{
  font-size:14px;
  font-weight:600;
}
#exam-screen.exam-authentic .test-timers{
  margin-left:auto;
  display:flex;
  align-items:stretch;
}
#exam-screen.exam-authentic .test-timer-block{
  min-width:158px;
  padding:9px 20px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  border-left:1px solid #d2d5d9;
  text-align:center;
}
#exam-screen.exam-authentic .test-timer-block span{
  color:#696e74;
  font-size:11px;
}
#exam-screen.exam-authentic .test-timer-block strong{
  color:#1c2735;
  font-size:20px;
  font-weight:600;
  font-variant-numeric:tabular-nums;
}
#exam-screen.exam-authentic .finish-test{
  min-width:128px;
  padding:0 20px;
  border:0;
  border-radius:0;
  background:#e45b52;
  color:#fff;
  font-size:14px;
  cursor:pointer;
}
#exam-screen.exam-authentic .finish-test:hover{ background:#d84b43; }

#exam-screen.exam-authentic > .timer{
  display:none;
  position:absolute;
  top:60px;
  left:0;
  right:0;
  z-index:3;
  height:3px;
  margin:0;
  overflow:hidden;
  border:0;
  border-radius:0;
  background:#dfe3e8;
}
#exam-screen.exam-authentic > .timer .bar{
  background:#4e9f3d;
  transition:width .25s linear;
}

#exam-screen.exam-authentic .question-navigation{
  position:relative;
  min-width:0;
  height:auto;
  flex:1 1 auto;
  align-self:stretch;
  display:flex;
  align-items:center;
  padding:0 0 0 8px;
  background:#fff;
  border-left:1px solid #d2d5d9;
  border-right:1px solid #d2d5d9;
}
#exam-screen.exam-authentic .nav-arrow{
  flex:0 0 34px;
  height:31px;
  transform:translateY(-4px);
  border:1px solid #b9bec5;
  border-radius:0;
  background:#fff;
  color:#333;
  font-size:24px;
  line-height:26px;
  cursor:pointer;
}
#exam-screen.exam-authentic .nav-arrow:disabled{ color:#aaa; background:#eceeef; cursor:not-allowed; }
#exam-screen.exam-authentic .question-palette{
  flex:1;
  height:100%;
  display:flex;
  align-items:center;
  gap:6px;
  padding:0 7px;
  overflow-x:auto;
  scrollbar-width:thin;
}
#exam-screen.exam-authentic .question-palette button{
  flex:0 0 31px;
  height:31px;
  padding:0;
  border:1px solid #b8bdc3;
  border-radius:2px;
  background:#fff;
  color:#3c4043;
  font-size:12px;
  cursor:pointer;
}
#exam-screen.exam-authentic .question-palette button.current{
  border:2px solid #2374b7;
  color:#135f99;
  font-weight:bold;
}
#exam-screen.exam-authentic .question-palette button:disabled{
  border-color:#d2d5d9;
  background:#eceeef;
  color:#a2a6ab;
  cursor:not-allowed;
}
#exam-screen.exam-authentic .question-palette button.answered{
  border-color:#24689e;
  background:#2f7fb8;
  color:#fff;
}
#exam-screen.exam-authentic .question-palette button.review{
  border-color:#da8615;
  background:#ef9e2f;
  color:#fff;
}
#exam-screen.exam-authentic .question-palette button.review.answered{
  background:#ef9e2f;
  border-color:#da8615;
}
#exam-screen.exam-authentic .question-palette button.filtered-out{ display:none; }
#exam-screen.exam-authentic .status-filter{
  align-self:stretch;
  min-width:210px;
  margin-left:8px;
  padding:0 10px;
  border:0;
  border-left:1px solid #d2d5d9;
  border-radius:0;
  background:#e4e6e9;
  color:#34383d;
  font-size:12px;
  cursor:pointer;
}
#exam-screen.exam-authentic .status-filter .filter-icon{ margin-right:7px; font-size:16px; }
#exam-screen.exam-authentic .status-panel{
  position:absolute;
  z-index:20;
  top:61px;
  right:0;
  width:250px;
  padding:8px 0;
  border:1px solid #aeb3ba;
  background:#fff;
  box-shadow:0 3px 8px rgba(0,0,0,.18);
}
#exam-screen.exam-authentic .status-panel button{
  width:100%;
  display:flex;
  justify-content:space-between;
  padding:10px 14px;
  border:0;
  border-radius:0;
  background:#fff;
  color:#30343a;
  text-align:left;
  cursor:pointer;
}
#exam-screen.exam-authentic .status-panel button:hover,
#exam-screen.exam-authentic .status-panel button.active{ background:#e8f1f8; }

#exam-screen.exam-authentic .question-context{
  height:34px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:0 18px;
  border-bottom:1px solid #d4d7db;
  background:#fff;
  color:#6a6e73;
  font-size:12px;
}

#exam-screen.exam-authentic .test-workspace{
  min-height:0;
  flex:1 1 auto;
  display:grid;
  grid-template-columns:minmax(0, 1fr) minmax(0, 1fr);
  background:#fff;
}
#exam-screen.exam-authentic .question-pane,
#exam-screen.exam-authentic .answer-pane{
  position:relative;
  min-width:0;
  min-height:0;
  display:flex;
  flex-direction:column;
}
#exam-screen.exam-authentic .question-pane{ border-right:1px solid #bfc4ca; }
#exam-screen.exam-authentic .pane-arrow{
  position:absolute;
  z-index:6;
  top:50%;
  width:34px;
  height:64px;
  margin-top:-32px;
  padding:0;
  border:1px solid #aeb4ba;
  border-radius:0;
  background:#f3f4f5;
  color:#3f454b;
  font-size:30px;
  line-height:60px;
  cursor:pointer;
}
#exam-screen.exam-authentic .pane-arrow:hover{ background:#e4e7e9; }
#exam-screen.exam-authentic .pane-arrow:disabled{ color:#b1b5b9; background:#f0f1f2; cursor:not-allowed; }
#exam-screen.exam-authentic .pane-arrow-left{ left:0; border-left:0; }
#exam-screen.exam-authentic .pane-arrow-right{ right:0; border-right:0; }
#exam-screen.exam-authentic .question-pane .pane-scroll{ padding-left:54px; }
#exam-screen.exam-authentic .answer-pane .pane-scroll{ padding-right:54px; }
#exam-screen.exam-authentic .pane-heading{
  height:36px;
  flex:0 0 36px;
  display:flex;
  align-items:center;
  padding:0 18px;
  border-bottom:1px solid #d0d4d9;
  background:#f4f4f4;
  color:#3f4348;
  font-size:13px;
  font-weight:bold;
}
#exam-screen.exam-authentic .pane-scroll{
  min-height:0;
  flex:1 1 auto;
  padding:22px 26px;
  overflow:auto;
}
#exam-screen.exam-authentic .question{
  margin:0;
  color:#202124;
  font-size:15px;
  line-height:1.65;
}
#exam-screen.exam-authentic .passage{
  margin:0 0 24px;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
}
#exam-screen.exam-authentic .passage-label{
  margin-bottom:10px;
  padding:0 0 7px;
  border-bottom:1px solid #d7dadd;
  color:#333;
  font-size:12px;
}
#exam-screen.exam-authentic .passage-text{
  color:#202124;
  font-size:14px;
  line-height:1.7;
}
#exam-screen.exam-authentic .passage-counter{ display:none; }
#exam-screen.exam-authentic .choices{
  display:block;
  margin:0;
}
#exam-screen.exam-authentic .choice{
  min-height:45px;
  margin:0 0 12px;
  padding:11px 13px;
  display:flex;
  align-items:flex-start;
  gap:10px;
  border:1px solid #c9cdd2;
  border-radius:0;
  background:#fff;
  color:#24272b;
  font-size:14px;
  cursor:pointer;
}
#exam-screen.exam-authentic .choice:hover{ border-color:#7d8792; background:#fafafa; }
#exam-screen.exam-authentic .choice:has(input:checked){ border-color:#4384b7; background:#edf5fb; }
#exam-screen.exam-authentic .choice input{
  width:15px;
  height:15px;
  margin:2px 0 0;
  accent-color:#2d78ad;
}
#exam-screen.exam-authentic .choice-letter{
  flex:0 0 26px;
  color:#30343a;
  font-weight:normal;
}
#exam-screen.exam-authentic .choices.large-symbols .choice{
  align-items:center;
}
#exam-screen.exam-authentic .choices.large-symbols .choice input{
  margin-top:0;
}

#exam-screen.exam-authentic .test-footer{
  flex:0 0 58px;
  min-height:58px;
  margin:0;
  padding:0 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-top:1px solid #bfc4ca;
  background:#f1f2f4;
}
#exam-screen.exam-authentic .test-footer-left,
#exam-screen.exam-authentic .test-footer-right{ display:flex; align-items:center; gap:9px; }
#exam-screen.exam-authentic .exam-control{
  min-width:100px;
  height:34px;
  padding:0 14px;
  border:1px solid #9ca2aa;
  border-radius:2px;
  background:#fff;
  color:#30343a;
  font-size:13px;
  cursor:pointer;
}
#exam-screen.exam-authentic .exam-control:hover{ background:#e8eaed; }
#exam-screen.exam-authentic .exam-control:disabled{ color:#a4a8ad; background:#e5e7e9; cursor:not-allowed; }
#exam-screen.exam-authentic .revisit-control.marked{
  border-color:#d47c08;
  background:#ef9e2f;
  color:#fff;
}
#exam-screen.exam-authentic #clearResponseBtn{ border:0; background:transparent; text-decoration:underline; }
#exam-screen.exam-authentic #submitBtn{ display:none; }
#exam-screen.exam-authentic .next-control{ border-color:#286d9f; background:#317daf; color:#fff; }
#exam-screen.exam-authentic .next-control:hover{ background:#286d9f; }
#exam-screen.exam-authentic .question-counter{ margin-right:8px; color:#686d73; font-size:12px; }

#exam-screen.exam-authentic .exam-break-page{
  min-height:0;
  flex:1 1 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:40px;
  background:#fff;
  color:#282c31;
}
#exam-screen.exam-authentic .exam-break-page.hidden{ display:none; }
#exam-screen.exam-authentic .exam-break-content{
  width:620px;
  padding:34px 40px;
  border:1px solid #c3c7cc;
  border-radius:0;
  background:#fff;
  text-align:center;
}
#exam-screen.exam-authentic .exam-break-content h2{
  margin:0 0 16px;
  font-size:22px;
  font-weight:normal;
}
#exam-screen.exam-authentic .exam-break-content p{
  margin:12px 0;
  color:#5d6268;
  font-size:13px;
}
#exam-screen.exam-authentic .exam-break-clock{
  margin:22px 0;
  font-size:42px;
  font-weight:600;
  font-variant-numeric:tabular-nums;
}
#exam-screen.exam-authentic.break-active .exam-question-meta,
#exam-screen.exam-authentic.break-active .test-workspace,
#exam-screen.exam-authentic.break-active .test-footer{ display:none; }
#exam-screen.exam-authentic.break-active .question-navigation{ visibility:hidden; }

#exam-screen.exam-authentic .cem-overlay{
  position:absolute;
  z-index:50;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:30px;
  background:rgba(29,33,38,.58);
}
#exam-screen.exam-authentic .cem-overlay.hidden{ display:none; }
#exam-screen.exam-authentic .cem-summary-card{
  width:min(720px, 85vw);
  max-height:86vh;
  overflow:auto;
  padding:0 24px 22px;
  border:1px solid #858b92;
  border-radius:0;
  background:#fff;
  color:#272b30;
  box-shadow:0 6px 22px rgba(0,0,0,.3);
}
#exam-screen.exam-authentic .cem-summary-head{
  height:55px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid #d2d5d8;
}
#exam-screen.exam-authentic .cem-summary-head h2{ margin:0; font-size:20px; font-weight:normal; }
#exam-screen.exam-authentic .cem-summary-head button{
  border:0;
  background:transparent;
  color:#555;
  font-size:25px;
  cursor:pointer;
}
#exam-screen.exam-authentic .cem-summary-card > p{ margin:18px 0; color:#5d6268; font-size:13px; }
#exam-screen.exam-authentic .cem-summary-counts{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  border:1px solid #d0d4d8;
}
#exam-screen.exam-authentic .cem-summary-counts div{
  padding:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  border-right:1px solid #d0d4d8;
}
#exam-screen.exam-authentic .cem-summary-counts div:last-child{ border-right:0; }
#exam-screen.exam-authentic .cem-summary-counts strong{ font-size:20px; }
#exam-screen.exam-authentic .cem-summary-counts span{ color:#666b70; font-size:12px; }
#exam-screen.exam-authentic .cem-summary-grid{
  max-height:230px;
  margin:18px 0;
  padding:12px;
  display:grid;
  grid-template-columns:repeat(15, 1fr);
  gap:6px;
  overflow:auto;
  border:1px solid #d0d4d8;
}
#exam-screen.exam-authentic .cem-summary-grid button{
  aspect-ratio:1;
  padding:0;
  border:1px solid #b8bdc3;
  border-radius:2px;
  background:#fff;
  color:#333;
  font-size:11px;
  cursor:pointer;
}
#exam-screen.exam-authentic .cem-summary-grid button.answered{ background:#2f7fb8; border-color:#24689e; color:#fff; }
#exam-screen.exam-authentic .cem-summary-grid button.review{ background:#ef9e2f; border-color:#da8615; color:#fff; }
#exam-screen.exam-authentic .cem-summary-grid button:disabled{
  border-color:#d2d5d9;
  background:#eceeef;
  color:#a2a6ab;
  cursor:not-allowed;
}
#exam-screen.exam-authentic .cem-summary-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
}
#exam-screen.exam-authentic .cem-action{
  min-width:120px;
  height:36px;
  padding:0 16px;
  border:1px solid #969ca3;
  border-radius:2px;
  background:#fff;
  color:#30343a;
  cursor:pointer;
}
#exam-screen.exam-authentic .cem-submit{ border-color:#c4433d; background:#df554e; color:#fff; }

@media (max-height:720px){
  #exam-screen.exam-authentic .cem-toolbar{ height:55px; }
  #exam-screen.exam-authentic > .timer{ top:53px; }
  #exam-screen.exam-authentic .question-navigation{ height:43px; }
  #exam-screen.exam-authentic .test-footer{ flex-basis:52px; min-height:52px; }
}

@media (max-width:1200px){
  #exam-screen.exam-authentic .test-tool{ min-width:220px; }
  #exam-screen.exam-authentic .status-filter{ min-width:48px; width:48px; }
  #exam-screen.exam-authentic .status-filter .filter-label{ display:none; }
  #exam-screen.exam-authentic .test-timer-block{ min-width:138px; padding-left:12px; padding-right:12px; }
  #exam-screen.exam-authentic .finish-test{ min-width:112px; padding:0 12px; }
}

/* Break screen styles */
.break-message{
  text-align: left;
  color: var(--muted);
  margin-bottom: 2rem;
  margin-top: -1rem;
  font-size: 1.1rem;
}

.break-timer{
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.break-timer-circle{
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 8px 32px rgba(74, 163, 255, 0.3);
}

.break-timer-circle::before{
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  background: linear-gradient(45deg, var(--accent), #2563eb, var(--accent));
  z-index: -1;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.break-timer-text{
  color: #444;
  font-size: 2.5rem;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
}

.break-actions{
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

/* Light theme break screen */
[data-theme="light"] .break-timer-circle{
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.2);
}

[data-theme="light"] .break-timer-circle::before{
  background: linear-gradient(45deg, #2563eb, #1d4ed8, #2563eb);
}

/* Doc Abby Image Styling */
#start-screen {
  position: relative;
}

.doc-abby-container {
  position: absolute;
  bottom: 0rem;
  right: -1rem;
  width: 22%;
  height: auto;
  pointer-events: none;
}

.doc-abby-container img {
  width: 100%;
  height: auto;
  display: block;
}

/* Show image regardless of theme */
.doc-abby {
  display: block;
}

/* Passage Display */
.passage {
  margin-top: 2rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--bar);
  border-radius: 8px;
}

.passage-label {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-BOTTOM: 1px solid var(--border);
}

.passage-text {
  color: var(--text);
  line-height: 1.8;
  font-size: 1rem;
  margin-bottom: 1rem;
  white-space: pre-wrap;
}

.passage-counter {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

/* Light theme passage */
[data-theme="light"] .passage {
  background: #f8fafc;
  border-left-color: #2563eb;
}

[data-theme="light"] .passage-label {
  color: #2563eb;
}

/* Resume Prompt Styles */
.resume-prompt {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--card);
  border: 2px solid var(--accent);
  border-radius: 12px;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.resume-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: var(--text);
}

.resume-info {
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: var(--bar);
  border-radius: 8px;
}

.resume-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.resume-actions .btn {
  flex: 1;
  min-width: 120px;
}

/* Light theme resume prompt */
[data-theme="light"] .resume-prompt {
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.15);
}

[data-theme="light"] .resume-info {
  background: #f8fafc;
}

/* Accordion */
/* spacing so first item isn't glued to title */
#reviewList { 
  margin-top: 1rem; 
}

/* remove dashed separators; keep clean solid divider */
.review-item {
  border-top: 1px solid var(--border);
  padding: 8px 0;
  margin-top: 0.5rem;
}

.review-item:first-child {
  border-top: none;
}

/* accordion header */
.review-head {
  width: 100%;
  background: transparent;
  border: none;
  padding: 0.75rem 0;
  cursor: pointer;
  display: block;
  color: inherit;
  text-align: left;
}

/* collapsed vs open body */
.review-body {
  display: none;
  padding-bottom: 0.75rem;
}
.review-item.open .review-body {
  display: block;
  padding-left: 0.3rem;
  padding-right: 0.4rem;
}

/* subtle focus-card for open item */
.review-item.open {
    border: 2px solid #f99f1c;
    background: #fff;
    border-radius: 8px;
    padding-left: 0.75rem;
    padding-right: 0.5rem;
}

/* meta line smaller + calmer */
.review-meta {
  opacity: 0.7;
  font-size: 0.8rem;
}


.pmodal.hidden { display: none; }

.pmodal{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;

  /* KEY: consistent safe padding from edges */
  padding: 18px;
}

.pmodal-backdrop{
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0009;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,.38);
    backdrop-filter: blur(2px);
}

.pmodal-card{
  z-index: 9999;
  width: min(760px, calc(100% - 24px));
  max-height: 90vh;
  overflow:auto;
  background: var(--card);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 0 24px #0003
}

.pmodal-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #44444412;
}

.pmodal-foot{
  display:flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.pm-summary{
  display:grid;
  gap: 12px;
  margin-top: 12px;
}

/* mobile */
@media (max-width: 480px){
  .pm-summary{ grid-template-columns: 1fr; }
}

/* tablet */
@media (min-width: 481px) and (max-width: 900px){
  .pm-summary{ grid-template-columns: repeat(2, 1fr); }
}

/* desktop */
@media (min-width: 901px){
  .pm-summary{ grid-template-columns: repeat(4, 1fr); }
}

.pm-kpi {
    /* background: linear-gradient(180deg, #ffffff, #fafafa); */
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 5px;
    padding: 10px 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,.02);
}

.pm-kpi .label {
    font-size: 1rem;
    color: #3d3e49;
    opacity: .75;
}

.pm-kpi .focuslabel {
    font-size: 0.9rem;
    color: #3d3e49;
    opacity: .75;
}

.pm-kpi .value {
    font-weight: bold;
    font-size: 1rem;
    margin-top: 2px;
    color: #3d3e49;
    opacity: .9;
}

.pm-kpi .best {
    font-weight: bold;
    font-size: 1.25rem;
    margin-top: 2px;
    color: #1e1e1f;
}

.pm-kpi .focus {
    font-weight: bold;
    font-size: 1.25rem;
    margin-top: 2px;
    color: #1e1e1f;
}

@media (max-width: 480px){
  .pm-summary{ grid-template-columns: 1fr; }
  .pmodal-foot{ flex-direction: column-reverse; }
}

.pt-table{
  width:100%;
  border-collapse:collapse;
  margin-top: 0.25rem;
  font-size: 1rem;
}

.pt-table thead th{
  text-align:left;
  padding: 0.55rem 0.6rem;
}

.pt-table td{
  padding: 0.55rem 0.6rem;
  border-top: 1px solid #3d3e4908;
  vertical-align: top;
}

.pt-table td.num,
.pt-table th.num{
  text-align:center;
}

.pt-muted{
  color: var(--muted);
  margin-left: 0.5rem;
}

.pt-row-good { background: rgba(34, 197, 94, 0.01); }  /* subtle green */
.pt-row-mid  { background: rgba(234, 179, 8, 0.02); }  /* subtle yellow */
.pt-row-bad  { background: rgba(239, 68, 68, 0.02); }  /* subtle red */

.pt-table tbody tr:hover { filter: brightness(0.99); }

.btn.small{
  border-radius: 5px !important;
}

.trend { font-size: 0.9em; margin-left: .35rem; font-weight: 700; }
.trend.up { color: #16A34A; }
.trend.down { color: #DC2626; }
.trend.flat { color: #6B7280; }

.kpi-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.trend-wrapper {
  font-size: 0.9rem;
  font-weight: 700;
}

.trend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}

.trend-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.trend.up { color: #16A34A; }
.trend.down { color: #DC2626; }
.trend.flat { color: #6B7280; }

.trend-val {
  font-size: 0.85rem;
}

/* Toggle Mode */
.mode-pill {
    position: relative;
    display: inline-flex;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 5px;
    overflow: hidden;
    background: rgba(255,255,255,.06);
    width: 15.4rem;
    border: 2px solid #21283b;
}

.mode-btn {
    position: relative;
    z-index: 2;
    flex: 1;
    border: 0;
    background: transparent;
    padding: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: rgba(0,0,0,0.1);
    transition: color .25s ease;
}

.mode-btn.active {
  color: #fff;
}

/* THE SLIDER */
.mode-slider {
    position: absolute;
    height: calc(100%);
    width: 50%;
    background: #17e160;
    transition: transform .35s cubic-bezier(.4,0,.2,1);
    will-change: transform;
}

/* Welcome-screen colors mirror the authentic exam status palette. */
#start-screen .start-title-nmat{
  color:#2f7fb8;
}

#start-screen .start-title-mock{
  color:#ef9e2f;
}

#start-screen .mode-slider{
  background:#ef9e2f;
}

#start-screen .mode-slider.exam-selected{
  background:#2f7fb8;
}

#start-screen #startBtn.btn.primary,
#start-screen #startBtn.btn.primary:hover{
  border-color:#24689e;
  background:#2f7fb8;
  color:#fff;
}
