:root {
  --sidebar-collapsed: 80px;
  --sidebar-expanded: 235px;
  --sidebar-bg: #24245e;
  --page-light: #f3f3f3;
  --page-dark: #000;
  --card-light: #fff;
  --card-dark: #1f1f1f;
  --text: #060606;
  --muted: #69708a;
  --orange: #f5a000;
  --radius: 10px;
  --shadow-card: 0 3px 12px rgba(0,0,0,.24);
  --font-main: Montserrat, Avenir, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: var(--font-main); }
body { background: var(--page-light); color: var(--text); overflow-x: hidden; }
body.theme-dark { background: var(--page-dark); color: #fff; }
button, input, textarea, select { font-family: var(--font-main); }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.announcer { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Reference shell */
#codeScreen { min-height: 100vh; }
#app { min-height: 100vh; }
#page-wrapper {
  min-height: 100vh;
  position: relative;
  background: var(--page-light);
  transition: background .2s ease;
  overflow-x: hidden;
}
body.theme-dark #page-wrapper { background: var(--page-dark); color: #fff; }

#side-menu {
  width: var(--sidebar-collapsed);
  float: left;
  height: 100vh;
  min-height: 100vh;
  padding: 5vh 0;
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  border-top-right-radius: 15px;
  border-bottom-right-radius: 15px;
  transition: width .2s ease;
  z-index: 100;
  color: #fff;
  background-color: var(--sidebar-bg);
  overflow: hidden;
}
#side-menu:hover,
body.side-menu-expanded #side-menu,
body.menu-open #side-menu { width: var(--sidebar-expanded); }

#side-menu-logo-container,
#side-menu-profile-container,
#side-menu-options-container {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
#side-menu-logo-container { min-height: 90px; }
#side-menu-logo-container a { display: grid; place-items: center; width: 100%; }
#side-menu-logo { width: 72px; max-height: 58px; object-fit: contain; display: block; filter: none; }
#side-menu:hover #side-menu-logo,
body.side-menu-expanded #side-menu #side-menu-logo,
body.menu-open #side-menu #side-menu-logo { width: 96px; }

#side-menu-profile-container { flex-direction: column; gap: 10px; min-height: 118px; }
#side-menu-profile-img-container { width: 58px; height: 58px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; }
#side-menu-profile-img { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; display: block; }
#studentNameLabel { display: block; font-size: 0; opacity: 0; height: 0; color: #fff; line-height: 1; white-space: nowrap; transition: opacity .15s ease; }
#side-menu:hover #studentNameLabel,
body.side-menu-expanded #studentNameLabel,
body.menu-open #studentNameLabel { font-size: 15px; opacity: 1; height: auto; }

#side-menu-options-container { flex-direction: column; align-items: stretch; gap: 18px; padding: 0; min-height: 230px; }
.menu-option {
  height: 28px;
  width: var(--sidebar-collapsed);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  color: #fff;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: color .15s ease, opacity .15s ease, width .2s ease, padding .2s ease;
}
.menu-option i { width: 32px; min-width: 32px; text-align: center; font-size: 22px; line-height: 1; color: #fff; }
.menu-option .option-description { width: 0; opacity: 0; overflow: hidden; white-space: nowrap; color: #fff; transition: opacity .15s ease, width .2s ease; }
#side-menu:hover .menu-option,
body.side-menu-expanded .menu-option,
body.menu-open .menu-option { width: var(--sidebar-expanded); justify-content: flex-start; padding-left: 28px; gap: 12px; }
#side-menu:hover .option-description,
body.side-menu-expanded .option-description,
body.menu-open .option-description { width: auto; opacity: 1; }
.menu-option:hover, .menu-option.active { color: #77ff7a; }
.menu-option:hover i, .menu-option.active i, .menu-option:hover .option-description, .menu-option.active .option-description { color: #77ff7a; }

#top-menu { display: none; }
#screen-shading { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.35); }

#wrapper {
  min-height: 100vh;
  margin-left: var(--sidebar-collapsed);
  padding: 48px 20px 40px;
  transition: margin-left .2s ease, width .2s ease;
}
body.side-menu-expanded #wrapper,
body.menu-open #wrapper { margin-left: var(--sidebar-expanded); }

#top-center-bar {
  position: fixed;
  top: 14px;
  left: var(--sidebar-collapsed);
  right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: left .2s ease;
}
body.side-menu-expanded #top-center-bar,
body.menu-open #top-center-bar { left: var(--sidebar-expanded); }
#brasilia-clock,
#examClock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 30px;
  padding: 0 14px;
  border: 1px solid var(--orange);
  border-radius: 7px;
  background: #fffdf7;
  color: #9a5200;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
#brasilia-clock i, #examClock i { color: var(--orange); }
body.theme-dark #brasilia-clock,
body.theme-dark #examClock { background: #fff; color: #9a5200; }

#top-right-bar { position: fixed; top: 12px; right: 18px; z-index: 70; width: 62px; height: 40px; display: flex; align-items: center; justify-content: center; }
.toggle { width: 62px; height: 40px; display: block; position: relative; cursor: pointer; }
.toggle__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle__fill {
  position: absolute;
  inset: 0;
  border: 0;
  border-radius: 0;
  background: transparent url('/assets/img/theme-light.png') center / contain no-repeat;
  box-shadow: none;
  transition: none;
  image-rendering: auto;
}
.toggle__fill::after { display: none; }
.toggle__icon { display: none !important; }
.toggle__input:checked + .toggle__fill { background-image: url('/assets/img/theme-dark.png'); background-color: transparent; }

#welcome-screen {
  min-height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 24px;
}
#welcome-screen h2 { margin: 0 0 22px; font-size: 24px; font-weight: 500; letter-spacing: .01em; color: #000; }
#welcome-screen .welcome-description { margin: 0; max-width: 560px; font-size: 15px; line-height: 1.35; color: #000; }
body.theme-dark #welcome-screen h2,
body.theme-dark #welcome-screen .welcome-description { color: #fff; }
body.showing-panel #welcome-screen { display: none !important; }

.aluno-content-panel { width: 100%; }
.aluno-panel-title { margin: -28px 0 18px; }
.aluno-panel-title h1 { margin: 0; font-size: 18px; font-weight: 500; color: #000; display: flex; gap: 6px; align-items: center; }
.aluno-panel-title p { margin: 8px 0 0; color: #596176; font-size: 13px; }
body.theme-dark .aluno-panel-title h1,
body.theme-dark .aluno-panel-title p { color: #fff; }

.pf-test-card-list {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 28px;
  align-items: start;
}
.pf-test-card {
  width: 100%;
  min-height: 230px;
  border: 0;
  border-radius: var(--radius);
  background: var(--card-light);
  box-shadow: var(--shadow-card);
  padding: 20px 20px 18px;
  color: #000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
body.theme-dark .pf-test-card { background: var(--card-dark); color: #fff; box-shadow: none; }
.pf-test-card-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
}
.pf-test-title-block { min-width: 0; }
.pf-test-title-block h2,
.pf-test-title-block h3,
.pf-test-title-block h4 { margin: 0 0 10px; font-size: 13px; line-height: 1.18; font-weight: 700; color: inherit; letter-spacing: .01em; }
.pf-test-title-block h3,
.pf-test-title-block h4 { display: none; }
.pf-test-type { font-size: 13px; font-weight: 500; white-space: nowrap; color: inherit; }
.pf-test-bottom { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 20px; align-items: center; margin-top: 18px; }
.pf-test-dates { min-width: 0; }
.pf-test-dates p { margin: 0 0 13px; font-size: 13px; line-height: 1.2; color: inherit; }
.pf-test-dates strong { font-weight: 700; display: block; margin-bottom: 2px; }
.pf-test-dates span { font-weight: 400; }
.pf-test-dates small { display: block; margin-top: 4px; color: #69708a; font-size: 11px; font-weight: 500; }
body.theme-dark .pf-test-dates small { color: #6f789a; }
.start-evaluation-btn {
  min-width: 96px;
  height: 36px;
  border-radius: 20px;
  border: 1px solid #6e6e7d;
  background: transparent;
  color: #6d63a4;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  padding: 0 16px;
  white-space: nowrap;
}
.start-evaluation-btn:hover { background: rgba(36,36,94,.08); }
body.theme-dark .start-evaluation-btn { color: #cfd4eb; border-color: #777; }
body.theme-dark .start-evaluation-btn:hover { background: rgba(255,255,255,.08); }
.pf-test-location { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(0,0,0,.12); color: #68718b; font-size: 13px; line-height: 1.3; }
body.theme-dark .pf-test-location { border-top-color: rgba(255,255,255,.45); color: #6f789a; }
.empty-state { width: 100%; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-card); padding: 24px; color: #69708a; }
body.theme-dark .empty-state { background: var(--card-dark); color: #fff; }

/* Modal and loading */
.modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: rgba(0,0,0,.42); padding: 20px; }
.modal-card { width: min(520px, 100%); background: #fff; border-radius: 12px; box-shadow: 0 18px 60px rgba(0,0,0,.32); overflow: hidden; }
body.theme-dark .modal-card { background: #1f1f1f; color: #fff; }
.modal-head { padding: 20px 22px 0; }
.modal-head h2 { margin: 0; font-size: 20px; }
.modal-body { padding: 16px 22px; }
.modal-body p { margin: 0 0 12px; line-height: 1.45; }
.modal-body input { width: 100%; height: 46px; border: 1px solid #d6dae5; border-radius: 8px; padding: 0 14px; font-size: 15px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 0 22px 22px; }
.login-alert { margin-top: 12px; color: #b42318; font-weight: 600; }
.btn { min-height: 38px; border: 1px solid #c7cbd7; border-radius: 8px; background: #fff; color: #24245e; padding: 0 16px; font-weight: 700; cursor: pointer; }
.btn-primary { background: #24245e; color: #fff; border-color: #24245e; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
body.theme-dark .btn { background: #1f1f1f; color: #fff; border-color: #555; }
body.theme-dark .btn-primary { background: #fff; color: #24245e; border-color: #fff; }
.app-loading { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; background: rgba(0,0,0,.2); }
.loading-ring { width: 42px; height: 42px; border: 4px solid rgba(255,255,255,.55); border-top-color: #24245e; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Exam mode */
.exam-session { min-height: 100vh; background: #f3f3f3; color: #000; }
body.theme-dark .exam-session { background: #000; color: #fff; }
.exam-topbar { height: 74px; display: flex; align-items: center; justify-content: space-between; padding: 0 36px; background: #f3f3f3; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
body.theme-dark .exam-topbar { background: #111; }
.exam-menu-button { width: 42px; height: 42px; border: 0; background: transparent; color: #49608e; font-size: 25px; cursor: pointer; }
.exam-logo-wrap img { height: 48px; max-width: 140px; object-fit: contain; }
.exam-profile img { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; }
#examClockBar { position: fixed; top: 80px; left: 0; right: 0; display: flex; justify-content: center; z-index: 40; pointer-events: none; }
.exam-theme-gear { position: fixed; top: 87px; right: 36px; z-index: 45; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.25); color: #24245e; font-size: 20px; cursor: pointer; }
.exam-stage { display: grid; grid-template-columns: 260px minmax(0,1fr); gap: 30px; padding: 130px 30px 120px; max-width: 1280px; margin: 0 auto; }
.exam-question-drawer { background: #fff; border-radius: 12px; box-shadow: var(--shadow-card); padding: 18px; height: max-content; position: sticky; top: 120px; }
body.theme-dark .exam-question-drawer { background: #1f1f1f; }
.drawer-title { font-weight: 700; margin-bottom: 14px; }
.qstatus { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.qbox { height: 34px; border: 1px solid #ccd1df; background: #fff; border-radius: 7px; cursor: pointer; }
.qbox.current { background: #24245e; color: #fff; border-color: #24245e; }
.qbox.done { border-color: #16803a; }
.timer-box { margin: 18px 0; color: #69708a; line-height: 1.4; }
.student-question-card { background: #fff; border-radius: 16px; box-shadow: var(--shadow-card); padding: 34px 42px; max-width: 920px; margin: 0 auto; position: relative; }
body.theme-dark .student-question-card { background: #1f1f1f; color: #fff; }
.question-card-header { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 24px; align-items: start; margin-bottom: 26px; }
.question-card-header h1 { margin: 0; font-size: 24px; line-height: 1.24; font-weight: 600; color: inherit; }
.question-score { font-size: 28px; white-space: nowrap; color: inherit; }
.question-list-pill { width: 42px; height: 42px; border: 0; border-radius: 50%; background: #c05252; color: #fff; font-size: 22px; display: grid; place-items: center; margin-bottom: 20px; }
.question-statement-block h2, .essay-answer-card h2 { font-size: 22px; font-weight: 500; margin: 0 0 10px; }
.statement { font-size: 22px; line-height: 1.45; color: inherit; }
.question-options { margin-top: 24px; }
.choice { width: 100%; display: grid; grid-template-columns: 58px 1fr; gap: 18px; align-items: center; min-height: 82px; padding: 18px 0; border: 0; border-top: 1px solid #d7d7d7; background: transparent; text-align: left; cursor: pointer; color: inherit; }
.choice .letter { width: 48px; height: 48px; border-radius: 50%; border: 2px solid #24245e; color: #24245e; display: grid; place-items: center; font-size: 22px; }
body.theme-dark .choice .letter { border-color: #fff; color: #fff; }
.choice .option-text { font-size: 21px; line-height: 1.35; }
.choice.selected { background: rgba(182,182,245,.55); }
.choice.correct-choice { background: rgba(95,180,120,.18); }
.choice.wrong-choice { background: rgba(200,80,80,.15); }
.feedback-box { margin-top: 18px; padding: 14px 16px; border-radius: 10px; background: #eef6ff; color: #1f3d64; }
.essay-answer-card textarea { width: 100%; min-height: 190px; border: 1px solid #d6dae5; border-radius: 10px; padding: 14px; resize: vertical; font-size: 16px; }
.exam-bottom-actions { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.95); box-shadow: 0 -3px 14px rgba(0,0,0,.1); z-index: 45; }
body.theme-dark .exam-bottom-actions { background: rgba(25,25,25,.95); }
.exam-bottom-inner { max-width: 1280px; margin: 0 auto; min-height: 76px; padding: 14px 30px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.save-status { color: #596176; font-size: 13px; }
.buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.result-screen { min-height: 100vh; background: #f3f3f3; padding: 40px; }
.result-card { max-width: 980px; margin: 0 auto; background: #fff; border-radius: 14px; box-shadow: var(--shadow-card); padding: 28px; }
.status-row { display: grid; grid-template-columns: 220px 1fr; padding: 9px 0; border-bottom: 1px solid #e5e7ef; }
.review-question-card { margin-top: 18px; border: 1px solid #e2e5ef; border-radius: 12px; padding: 18px; }
.review-choice { display: grid; grid-template-columns: 42px 1fr; gap: 14px; align-items: start; margin: 10px 0; }
.review-choice span { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 2px solid #24245e; }

@media (max-width: 1180px) { .pf-test-card-list { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  :root { --sidebar-expanded: 220px; }
  #side-menu { transform: translateX(-100%); width: var(--sidebar-expanded); height: 100vh; min-height: 100vh; border-radius: 0 15px 15px 0; }
  body.menu-open #side-menu { transform: translateX(0); width: var(--sidebar-expanded); }
  #wrapper, body.side-menu-expanded #wrapper, body.menu-open #wrapper { margin-left: 0; padding-top: 96px; }
  #top-menu { position: fixed; top: 0; left: 0; right: 0; height: 74px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; background: #f3f3f3; z-index: 70; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
  body.theme-dark #top-menu { background: #111; }
  #top-menu-btn-container { border: 0; background: transparent; color: #49608e; font-size: 24px; }
  .top-menu-logo { height: 44px; max-width: 120px; object-fit: contain; }
  #top-menu-profile-img { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; }
  #top-center-bar, body.side-menu-expanded #top-center-bar, body.menu-open #top-center-bar { top: 82px; left: 0; right: 0; }
  #top-right-bar { top: 84px; right: 18px; }
  .pf-test-card-list { grid-template-columns: 1fr; }
  .exam-stage { grid-template-columns: 1fr; padding: 126px 14px 120px; }
  .exam-question-drawer { position: fixed; top: 74px; left: 0; bottom: 0; width: 280px; transform: translateX(-105%); transition: transform .2s ease; z-index: 55; border-radius: 0 12px 12px 0; }
  .exam-question-drawer.open { transform: translateX(0); }
  .student-question-card { padding: 28px 22px; }
  .question-card-header { grid-template-columns: 1fr; }
  .question-card-header h1 { font-size: 22px; }
  .question-score { font-size: 24px; }
}
@media (max-width: 560px) {
  #brasilia-clock, #examClock { font-size: 10px; padding: 0 8px; max-width: calc(100vw - 90px); overflow: hidden; text-overflow: ellipsis; }
  .aluno-panel-title { margin-top: -18px; }
  .pf-test-card { padding: 18px; }
  .pf-test-card-main, .pf-test-bottom { grid-template-columns: 1fr; }
  .pf-test-type { justify-self: start; }
  .start-evaluation-btn { justify-self: start; }
  .statement, .choice .option-text { font-size: 18px; }
  .choice { grid-template-columns: 50px 1fr; gap: 12px; }
  .choice .letter { width: 42px; height: 42px; }
  .exam-bottom-inner { align-items: stretch; flex-direction: column; }
}


/* v16 focused refinements */
html, body, #codeScreen, #app, #page-wrapper { min-height: 100vh; }
#side-menu {
  height: 100vh !important;
  min-height: 100vh !important;
  padding-top: 5vh !important;
  padding-bottom: 5vh !important;
}
#side-menu-logo-container { min-height: 86px; }
#side-menu-profile-container { min-height: 116px; }
#side-menu-options-container { min-height: 245px; gap: 20px; }
.menu-option i.fa { font-size: 22px !important; }
#side-menu-logo { width: 72px !important; max-width: 72px; }
#side-menu:hover #side-menu-logo,
body.side-menu-expanded #side-menu #side-menu-logo,
body.menu-open #side-menu #side-menu-logo { width: 96px !important; max-width: 96px; }
#top-right-bar, #theme-switch-container, .toggle { filter: none !important; }
.pf-test-card-list { grid-template-columns: repeat(3, minmax(280px, 1fr)); }
@media (max-width: 1180px) { .pf-test-card-list { grid-template-columns: 1fr !important; } }
@media (max-width: 900px) {
  #side-menu { height: 100vh !important; min-height: 100vh !important; padding-top: 5vh !important; padding-bottom: 5vh !important; }
  #top-right-bar { top: 84px; right: 18px; }
}

/* Future exams: informative cards only */
.future-card-grid .pf-future-card {
  display: block !important;
  padding: 22px 24px !important;
  min-height: 212px;
}
.future-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.future-card-header h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 800;
}
.future-card-header span {
  white-space: nowrap;
  color: #667085;
  font-size: 13px;
  font-weight: 500;
}
.future-card-body {
  display: grid;
  gap: 8px;
  color: #000;
  font-size: 13px;
  line-height: 1.25;
}
.future-card-body p { margin: 0; }
.future-card-body strong { font-weight: 500; }
.future-card-location {
  margin-top: 22px;
  padding-top: 15px;
  border-top: 1px solid #ececec;
  color: #667085;
  font-size: 13px;
  line-height: 1.4;
}
body.theme-dark .future-card-body { color: #fff; }
body.theme-dark .future-card-header span,
body.theme-dark .future-card-location { color: #818aa3; }
body.theme-dark .future-card-location { border-top-color: #333; }

#futureExams.pf-test-card-list {
  align-items: stretch;
}

@media (min-width: 1181px) {
  #futureExams.pf-test-card-list { grid-template-columns: repeat(3, minmax(310px, 1fr)) !important; }
}
@media (max-width: 1180px) {
  #futureExams.pf-test-card-list { grid-template-columns: 1fr !important; }
}

/* v21 exam session refactor: Prova Fácil-like question experience */
body.exam-mode { background: #f3f3f3; overflow-x: hidden; }
body.theme-dark.exam-mode { background: #000; }
.exam-session {
  min-height: 100vh;
  background: #f3f3f3;
  color: #101010;
  font-family: Montserrat, Avenir, Helvetica, Arial, sans-serif;
}
body.theme-dark .exam-session { background: #000; color: #fff; }
.exam-topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: 78px;
  padding: 0 clamp(18px, 4vw, 58px);
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  align-items: center;
  background: #f3f3f3;
  box-shadow: 0 3px 16px rgba(0, 0, 0, .12);
  z-index: 80;
}
body.theme-dark .exam-topbar { background: #111820; }
.exam-menu-button {
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #416596;
  font-size: 28px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.exam-menu-button:hover { background: rgba(65, 101, 150, .1); }
.exam-logo-wrap { display: grid; place-items: center; min-width: 0; }
.exam-logo-wrap img {
  height: 52px;
  width: auto;
  max-width: min(180px, 48vw);
  object-fit: contain;
}
.exam-profile { display: flex; justify-content: flex-end; }
.exam-profile img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
#examClockBar {
  position: fixed;
  top: 90px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 50;
  pointer-events: none;
}
.exam-theme-gear {
  position: fixed;
  top: 96px;
  right: clamp(18px, 4vw, 50px);
  z-index: 65;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,.22);
  color: #24245e;
  font-size: 24px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.exam-theme-gear::before {
  content: '';
  position: absolute;
  z-index: -1;
  right: -24px;
  top: 8px;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(0,0,0,.12);
}
body.theme-dark .exam-theme-gear { background: #fff; color: #24245e; }
body.theme-dark .exam-theme-gear::before { background: rgba(255,255,255,.18); }
.exam-stage {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 136px 24px 124px;
}
.exam-paper-area {
  width: 100%;
  display: flex;
  justify-content: center;
}
#questionArea { width: 100%; display: flex; justify-content: center; }
.exam-question-drawer {
  position: fixed;
  z-index: 90;
  top: 78px;
  left: 0;
  bottom: 0;
  width: 300px;
  border-radius: 0 16px 16px 0;
  background: #fff;
  box-shadow: 0 8px 30px rgba(0,0,0,.22);
  padding: 22px;
  transform: translateX(-105%);
  transition: transform .22s ease;
  overflow-y: auto;
}
.exam-question-drawer.open { transform: translateX(0); }
body.theme-dark .exam-question-drawer { background: #1f1f1f; color: #fff; }
.drawer-title { font-size: 18px; margin-bottom: 18px; }
.qstatus { grid-template-columns: repeat(4, 1fr); gap: 10px; }
.qbox {
  height: 42px;
  border-radius: 10px;
  font-weight: 700;
  color: #24245e;
}
.qbox.current { background: #24245e; color: #fff; }
.qbox.done:not(.current) { border-color: #16803a; color: #16803a; background: #f4fff7; }
.timer-box { font-size: 13px; }
.student-question-card {
  width: min(860px, 100%);
  margin: 18px auto 0;
  background: #fff;
  color: #171717;
  border-radius: 18px;
  box-shadow: 0 4px 18px rgba(0,0,0,.22);
  padding: clamp(30px, 4.8vw, 52px) clamp(26px, 5vw, 58px) clamp(34px, 5vw, 56px);
  position: relative;
}
body.theme-dark .student-question-card { background: #1f1f1f; color: #fff; box-shadow: 0 4px 18px rgba(0,0,0,.45); }
.question-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 22px;
  margin-bottom: 34px;
}
.question-card-header h1 {
  margin: 0;
  color: inherit;
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: 1.18;
  font-weight: 500;
  letter-spacing: .01em;
}
.question-score {
  color: inherit;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.15;
  font-weight: 500;
  white-space: nowrap;
  text-align: right;
}
.question-list-pill {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: #c34d4e;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 24px;
  margin: -18px 0 28px;
  box-shadow: none;
  cursor: pointer;
}
.question-list-pill:hover { background: #b44546; }
.question-statement-block h2,
.essay-answer-card h2 {
  color: inherit;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.2;
  font-weight: 500;
  margin: 0 0 8px;
}
.statement {
  color: inherit;
  font-size: clamp(20px, 2.65vw, 28px);
  line-height: 1.34;
  font-weight: 400;
  letter-spacing: .01em;
  overflow-wrap: break-word;
}
.question-options { margin-top: 30px; }
.choice {
  width: 100%;
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 88px;
  padding: 22px 0;
  border: 0;
  border-top: 1px solid #d5d5d5;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, padding .15s ease;
}
.choice:last-child { border-bottom: 1px solid #d5d5d5; }
.choice:hover { background: rgba(36,36,94,.035); }
.choice .letter {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid #24245e;
  color: #24245e;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 500;
  background: transparent;
}
.choice .option-text {
  color: inherit;
  font-size: clamp(19px, 2.4vw, 25px);
  line-height: 1.34;
  overflow-wrap: break-word;
}
.choice.selected,
.review-choice.correct {
  background: #b8b2f4;
}
.choice.selected {
  padding-left: 22px;
  padding-right: 22px;
  border-top-color: transparent;
}
.choice.selected + .choice { border-top-color: transparent; }
.choice.selected .letter,
.review-choice.correct span {
  background: #24245e;
  border-color: #24245e;
  color: #fff;
}
.choice.correct-choice { background: rgba(97, 186, 124, .22); }
.choice.correct-choice .letter { background: #16803a; border-color: #16803a; color: #fff; }
.choice.wrong-choice { background: rgba(203, 75, 75, .18); }
.choice.wrong-choice .letter { background: #b42318; border-color: #b42318; color: #fff; }
.choice.disabled-choice { cursor: default; }
body.theme-dark .choice { border-top-color: #4a4a4a; }
body.theme-dark .choice:last-child { border-bottom-color: #4a4a4a; }
body.theme-dark .choice .letter { border-color: #fff; color: #fff; }
body.theme-dark .choice.selected .letter { border-color: #24245e; }
.feedback-box {
  margin-top: 24px;
  padding: 16px 18px;
  border-radius: 12px;
  font-size: 15px;
  display: grid;
  gap: 6px;
  background: #f2f6ff;
  color: #213964;
}
.feedback-box.ok-feedback { background: #edf9f1; color: #14542b; }
.feedback-box.wrong-feedback { background: #fff0f0; color: #8d1d16; }
.essay-answer-card { margin-top: 30px; }
.essay-answer-card textarea {
  width: 100%;
  min-height: 240px;
  border: 1px solid #d1d5e2;
  border-radius: 14px;
  padding: 18px;
  font-size: 20px;
  line-height: 1.45;
  color: #171717;
  background: #fff;
}
.save-note { margin-top: 10px; color: #667085; font-size: 13px; }
.exam-bottom-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  background: rgba(255,255,255,.94);
  box-shadow: 0 -4px 18px rgba(0,0,0,.12);
  backdrop-filter: blur(6px);
}
body.theme-dark .exam-bottom-actions { background: rgba(20,20,20,.94); }
.exam-bottom-inner {
  width: min(1100px, 100%);
  min-height: 78px;
  padding: 14px 22px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.save-status { font-size: 13px; color: #667085; line-height: 1.4; }
body.theme-dark .save-status { color: #c7c7c7; }
.buttons { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.btn {
  min-height: 40px;
  border-radius: 9px;
  font-size: 13px;
}
.result-screen {
  min-height: 100vh;
  background: #f3f3f3;
  padding: clamp(22px, 4vw, 46px);
  font-family: Montserrat, Avenir, Helvetica, Arial, sans-serif;
}
body.theme-dark .result-screen { background: #000; color: #fff; }
.result-card {
  width: min(860px, 100%);
  margin: 0 auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 4px 18px rgba(0,0,0,.22);
  padding: clamp(24px, 4vw, 44px);
}
body.theme-dark .result-card { background: #1f1f1f; }
.result-card h1 { font-weight: 500; }
.review-question-card {
  margin-top: 28px;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,.14);
  padding: clamp(22px, 4vw, 36px);
}
body.theme-dark .review-question-card { background: #232323; box-shadow: none; }
.review-question-card h3 {
  margin: 0 0 22px;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 500;
  line-height: 1.2;
}
.review-statement { font-size: clamp(19px, 2.4vw, 24px); line-height: 1.36; }
.review-answer-title { margin: 28px 0 12px; font-size: clamp(20px, 2.6vw, 28px); font-weight: 500; }
.review-choice {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  margin: 0 0 18px;
  padding: 22px;
  border-radius: 0;
  color: #171717;
}
body.theme-dark .review-choice { color: #fff; }
.review-choice span {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid #24245e;
  color: #24245e;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 500;
}
.review-choice p { margin: 0; font-size: clamp(19px, 2.4vw, 25px); line-height: 1.34; }
.review-choice.marked { background: transparent; }
.review-choice.marked span { background: transparent; color: #24245e; }
body.theme-dark .review-choice.marked span { color: #fff; border-color: #fff; }
.status-row { grid-template-columns: 180px 1fr; }
@media (min-width: 1180px) {
  .exam-topbar { height: 68px; }
  #examClockBar { top: 84px; }
  .exam-theme-gear { top: 90px; }
  .exam-stage { padding-top: 122px; }
  .exam-menu-button { color: #49608e; }
}
@media (max-width: 760px) {
  .exam-topbar {
    height: 74px;
    grid-template-columns: 56px 1fr 56px;
    padding: 0 22px;
  }
  .exam-menu-button { width: 44px; height: 44px; font-size: 25px; }
  .exam-logo-wrap img { height: 44px; max-width: 136px; }
  .exam-profile img { width: 54px; height: 54px; }
  #examClockBar { display: none; }
  .exam-theme-gear { top: 92px; right: 28px; width: 40px; height: 40px; }
  .exam-stage { padding: 118px 14px 138px; }
  .student-question-card {
    width: 100%;
    border-radius: 16px;
    margin-top: 0;
    padding: 32px 24px 34px;
  }
  .question-card-header { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; margin-bottom: 28px; }
  .question-card-header h1 { font-size: 28px; line-height: 1.2; }
  .question-score { font-size: 26px; line-height: 1.2; }
  .question-list-pill { width: 42px; height: 42px; font-size: 22px; margin: -12px 0 24px; }
  .question-statement-block h2, .essay-answer-card h2 { font-size: 26px; }
  .statement { font-size: 24px; line-height: 1.35; }
  .choice {
    grid-template-columns: 56px minmax(0,1fr);
    gap: 14px;
    min-height: 86px;
    padding: 20px 0;
  }
  .choice.selected { padding: 20px 14px; }
  .choice .letter { width: 50px; height: 50px; font-size: 22px; }
  .choice .option-text { font-size: 23px; line-height: 1.32; }
  .exam-bottom-inner { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 14px; }
  .buttons { justify-content: stretch; display: grid; grid-template-columns: 1fr 1fr; }
  .buttons .btn { width: 100%; padding-left: 8px; padding-right: 8px; }
  .exam-question-drawer { top: 74px; width: min(312px, 88vw); }
  .review-choice { grid-template-columns: 56px 1fr; gap: 14px; padding: 18px; }
  .review-choice span { width: 50px; height: 50px; }
  .status-row { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 440px) {
  .exam-stage { padding-left: 10px; padding-right: 10px; }
  .student-question-card { padding: 30px 20px 32px; }
  .question-card-header { grid-template-columns: 1fr; }
  .question-score { text-align: left; }
  .statement { font-size: 22px; }
  .choice .option-text { font-size: 21px; }
}

/* =========================================================
   v22 complete test page rebuild: one-question layout + fixed right panel
   ========================================================= */
body.exam-mode,
body.exam-mode .exam-session {
  background: #f3f3f3 !important;
  color: #141414 !important;
  overflow-x: hidden !important;
}
body.theme-dark.exam-mode,
body.theme-dark.exam-mode .exam-session {
  background: #000 !important;
  color: #f7f7f7 !important;
}
.exam-session {
  min-height: 100vh !important;
  font-family: Montserrat, Avenir, Helvetica, Arial, sans-serif !important;
}
.exam-topbar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 78px !important;
  display: grid !important;
  grid-template-columns: 72px minmax(0, 1fr) 72px !important;
  align-items: center !important;
  padding: 0 clamp(22px, 4vw, 58px) !important;
  background: #f3f3f3 !important;
  box-shadow: 0 3px 16px rgba(0, 0, 0, .12) !important;
  z-index: 90 !important;
}
body.theme-dark .exam-topbar { background: #111820 !important; }
.exam-menu-button {
  width: 50px !important;
  height: 50px !important;
  display: grid !important;
  place-items: center !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
  color: #416596 !important;
  font-size: 28px !important;
  cursor: pointer !important;
}
.exam-menu-button:hover { background: rgba(65,101,150,.1) !important; }
.exam-logo-wrap { display: flex !important; justify-content: center !important; align-items: center !important; min-width: 0 !important; }
.exam-logo-wrap img {
  height: 48px !important;
  width: auto !important;
  max-width: 156px !important;
  object-fit: contain !important;
  display: block !important;
}
.exam-profile { display: flex !important; justify-content: flex-end !important; align-items: center !important; }
.exam-profile img {
  width: 58px !important;
  height: 58px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  background: #dde2e6 !important;
}
#examClockBar {
  position: fixed !important;
  top: 88px !important;
  left: 0 !important;
  right: 348px !important;
  display: flex !important;
  justify-content: center !important;
  z-index: 55 !important;
  pointer-events: none !important;
}
.exam-theme-gear {
  position: fixed !important;
  top: 94px !important;
  right: 344px !important;
  z-index: 95 !important;
  width: 40px !important;
  height: 40px !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: #fff !important;
  color: #24245e !important;
  display: grid !important;
  place-items: center !important;
  font-size: 22px !important;
  box-shadow: 0 3px 12px rgba(0,0,0,.22) !important;
  cursor: pointer !important;
}
.exam-theme-gear::before {
  content: "" !important;
  position: absolute !important;
  right: -24px !important;
  width: 48px !important;
  height: 26px !important;
  background: rgba(0,0,0,.10) !important;
  border-radius: 999px !important;
  z-index: -1 !important;
}
body.theme-dark .exam-theme-gear { background: #fff !important; color: #24245e !important; }
body.theme-dark .exam-theme-gear::before { background: rgba(255,255,255,.18) !important; }
.exam-stage {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 320px !important;
  gap: clamp(22px, 2.6vw, 42px) !important;
  align-items: start !important;
  width: 100% !important;
  max-width: 1360px !important;
  margin: 0 auto !important;
  padding: 138px clamp(18px, 2.8vw, 42px) 72px !important;
}
.exam-paper-area {
  width: 100% !important;
  display: flex !important;
  justify-content: center !important;
  min-width: 0 !important;
}
#questionArea {
  width: 100% !important;
  display: flex !important;
  justify-content: center !important;
}
.student-question-card {
  width: min(900px, 100%) !important;
  margin: 0 auto !important;
  padding: clamp(32px, 4vw, 48px) clamp(34px, 5vw, 58px) clamp(34px, 4.6vw, 54px) !important;
  border-radius: 18px !important;
  border: 1px solid rgba(0,0,0,.06) !important;
  background: #fff !important;
  color: #171717 !important;
  box-shadow: 0 4px 18px rgba(0,0,0,.18) !important;
  position: relative !important;
  overflow: visible !important;
}
body.theme-dark .student-question-card {
  background: #1f1f1f !important;
  color: #f8f8f8 !important;
  border-color: #2f2f2f !important;
  box-shadow: 0 5px 22px rgba(0,0,0,.55) !important;
}
.question-card-header {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: start !important;
  gap: 24px !important;
  margin: 0 0 34px !important;
}
.question-card-header h1 {
  margin: 0 !important;
  font-size: clamp(24px, 2.5vw, 31px) !important;
  line-height: 1.22 !important;
  font-weight: 500 !important;
  letter-spacing: .01em !important;
  color: inherit !important;
}
.question-score {
  display: grid !important;
  justify-items: end !important;
  gap: 2px !important;
  min-width: 90px !important;
  color: inherit !important;
  text-align: right !important;
  white-space: nowrap !important;
  line-height: 1.05 !important;
}
.question-score span,
.question-score small {
  font-size: 11px !important;
  color: #6b7280 !important;
  font-weight: 600 !important;
}
body.theme-dark .question-score span,
body.theme-dark .question-score small { color: #cbd5e1 !important; }
.question-score strong {
  font-size: 24px !important;
  font-weight: 600 !important;
  color: inherit !important;
}
.question-list-pill {
  display: none !important;
  width: 46px !important;
  height: 46px !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: #c34d4e !important;
  color: #fff !important;
  place-items: center !important;
  font-size: 24px !important;
  margin: -14px 0 26px !important;
  cursor: pointer !important;
}
.question-statement-block h2,
.essay-answer-card h2 {
  margin: 0 0 8px !important;
  font-size: clamp(22px, 2.35vw, 28px) !important;
  line-height: 1.2 !important;
  font-weight: 500 !important;
  color: inherit !important;
}
.statement {
  font-size: clamp(20px, 2.12vw, 25px) !important;
  line-height: 1.44 !important;
  font-weight: 400 !important;
  letter-spacing: .005em !important;
  color: inherit !important;
  overflow-wrap: break-word !important;
}
.question-options {
  display: grid !important;
  margin-top: 34px !important;
}
.choice {
  appearance: none !important;
  width: 100% !important;
  min-height: 96px !important;
  display: grid !important;
  grid-template-columns: 58px minmax(0, 1fr) !important;
  gap: 20px !important;
  align-items: center !important;
  padding: 22px 0 !important;
  border: 0 !important;
  border-top: 1px solid #cfcfcf !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: inherit !important;
  text-align: left !important;
  cursor: pointer !important;
  transition: background .16s ease, padding .16s ease !important;
}
.choice:last-child { border-bottom: 1px solid #cfcfcf !important; }
body.theme-dark .choice { border-top-color: #4a4a4a !important; }
body.theme-dark .choice:last-child { border-bottom-color: #4a4a4a !important; }
.choice:hover { background: rgba(36,36,94,.035) !important; }
.choice .letter {
  width: 54px !important;
  height: 54px !important;
  border-radius: 50% !important;
  display: grid !important;
  place-items: center !important;
  border: 2px solid #24245e !important;
  color: #24245e !important;
  background: transparent !important;
  font-size: 22px !important;
  font-weight: 500 !important;
}
body.theme-dark .choice .letter { border-color: #fff !important; color: #fff !important; }
.choice .option-text {
  font-size: clamp(19px, 2.0vw, 23px) !important;
  line-height: 1.36 !important;
  overflow-wrap: break-word !important;
}
.choice.selected {
  background: #b8b2f4 !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
  border-top-color: transparent !important;
}
.choice.selected + .choice { border-top-color: transparent !important; }
.choice.selected .letter {
  background: #24245e !important;
  border-color: #24245e !important;
  color: #fff !important;
}
.choice.correct-choice { background: rgba(97,186,124,.22) !important; }
.choice.correct-choice .letter { background: #16803a !important; border-color: #16803a !important; color: #fff !important; }
.choice.wrong-choice { background: rgba(203,75,75,.18) !important; }
.choice.wrong-choice .letter { background: #b42318 !important; border-color: #b42318 !important; color: #fff !important; }
.choice.disabled-choice { cursor: default !important; }
.essay-answer-card { margin-top: 30px !important; }
.essay-answer-card textarea {
  width: 100% !important;
  min-height: 260px !important;
  border: 1px solid #d1d5e2 !important;
  border-radius: 14px !important;
  padding: 18px !important;
  font-size: 20px !important;
  line-height: 1.45 !important;
  color: #171717 !important;
  background: #fff !important;
  resize: vertical !important;
}
body.theme-dark .essay-answer-card textarea { background: #111827 !important; color: #fff !important; border-color: #39445a !important; }
.feedback-box {
  margin-top: 22px !important;
  padding: 16px 18px !important;
  border-radius: 12px !important;
  display: grid !important;
  gap: 6px !important;
  font-size: 15px !important;
}
.exam-question-drawer {
  position: sticky !important;
  top: 104px !important;
  align-self: start !important;
  width: 320px !important;
  max-height: calc(100vh - 124px) !important;
  overflow-y: auto !important;
  transform: none !important;
  border-radius: 18px !important;
  background: #fff !important;
  color: #151515 !important;
  border: 1px solid rgba(0,0,0,.06) !important;
  box-shadow: 0 4px 18px rgba(0,0,0,.16) !important;
  padding: 18px !important;
  z-index: 40 !important;
}
body.theme-dark .exam-question-drawer { background: #1f1f1f !important; color: #fff !important; border-color: #2f2f2f !important; box-shadow: 0 4px 18px rgba(0,0,0,.45) !important; }
.drawer-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  gap: 12px !important;
  margin-bottom: 14px !important;
}
.drawer-kicker {
  display: block !important;
  color: #6b7280 !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
  margin-bottom: 4px !important;
}
body.theme-dark .drawer-kicker { color: #cbd5e1 !important; }
.drawer-title {
  margin: 0 !important;
  font-size: 22px !important;
  line-height: 1.15 !important;
  font-weight: 700 !important;
}
.drawer-close {
  display: none !important;
  border: 0 !important;
  background: transparent !important;
  color: inherit !important;
  width: 34px !important;
  height: 34px !important;
  border-radius: 50% !important;
  cursor: pointer !important;
}
.exam-side-card {
  border: 1px solid #e5e7ef !important;
  border-radius: 14px !important;
  background: #fafafa !important;
  padding: 14px !important;
  margin-top: 12px !important;
}
body.theme-dark .exam-side-card { background: #171717 !important; border-color: #363636 !important; }
.side-info-row {
  display: grid !important;
  gap: 3px !important;
  padding: 8px 0 !important;
  border-bottom: 1px solid #e5e7ef !important;
}
.side-info-row:first-child { padding-top: 0 !important; }
.side-info-row:last-child { padding-bottom: 0 !important; border-bottom: 0 !important; }
.side-info-row span,
.side-card-title,
.timer-box span {
  color: #6b7280 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}
body.theme-dark .side-info-row { border-bottom-color: #363636 !important; }
body.theme-dark .side-info-row span,
body.theme-dark .side-card-title,
body.theme-dark .timer-box span { color: #cbd5e1 !important; }
.side-info-row strong {
  font-size: 13px !important;
  line-height: 1.28 !important;
  font-weight: 700 !important;
}
.timer-box {
  display: grid !important;
  gap: 6px !important;
  color: inherit !important;
  line-height: 1.2 !important;
}
.timer-box strong {
  font-size: 30px !important;
  line-height: 1.1 !important;
  color: #24245e !important;
}
body.theme-dark .timer-box strong { color: #fff !important; }
.qstatus {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 8px !important;
  margin-top: 10px !important;
}
.qbox {
  height: 38px !important;
  border-radius: 10px !important;
  border: 1px solid #ccd1df !important;
  background: #fff !important;
  color: #24245e !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  transition: background .15s ease, color .15s ease, border-color .15s ease !important;
}
body.theme-dark .qbox { background: #111827 !important; border-color: #39445a !important; color: #fff !important; }
.qbox.current { background: #24245e !important; color: #fff !important; border-color: #24245e !important; }
.qbox.done:not(.current) { border-color: #16803a !important; color: #16803a !important; background: #f4fff7 !important; }
body.theme-dark .qbox.done:not(.current) { background: #112318 !important; }
.save-status {
  color: #596176 !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
}
body.theme-dark .save-status { color: #cbd5e1 !important; }
.exam-panel-actions {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 10px !important;
  margin-top: 14px !important;
}
.exam-panel-actions .btn {
  min-height: 42px !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  padding: 0 12px !important;
}
.exam-panel-actions #saveBtn { grid-column: 1 / 2 !important; }
.exam-panel-actions #submitBtn { grid-column: 1 / -1 !important; }
.exam-bottom-actions { display: none !important; }
.exam-meta-hidden { display: none !important; }
.result-screen {
  min-height: 100vh !important;
  background: #f3f3f3 !important;
  padding: clamp(22px,4vw,46px) !important;
  font-family: Montserrat, Avenir, Helvetica, Arial, sans-serif !important;
}
body.theme-dark .result-screen { background: #000 !important; color: #fff !important; }
.result-card,
.review-question-card {
  background: #fff !important;
  border-radius: 18px !important;
  box-shadow: 0 4px 18px rgba(0,0,0,.18) !important;
}
body.theme-dark .result-card,
body.theme-dark .review-question-card { background: #1f1f1f !important; color: #fff !important; }
@media (max-width: 1180px) {
  .exam-stage {
    grid-template-columns: minmax(0, 1fr) 300px !important;
    max-width: 1180px !important;
  }
  .exam-question-drawer { width: 300px !important; }
  #examClockBar { right: 326px !important; }
  .exam-theme-gear { right: 320px !important; }
}
@media (max-width: 980px) {
  .exam-stage {
    display: block !important;
    padding: 118px 14px 92px !important;
  }
  .exam-paper-area,
  #questionArea { width: 100% !important; }
  #examClockBar { display: none !important; }
  .exam-theme-gear { top: 92px !important; right: 28px !important; }
  .question-list-pill { display: grid !important; }
  .exam-question-drawer {
    position: fixed !important;
    top: 78px !important;
    left: 0 !important;
    bottom: 0 !important;
    width: min(330px, 88vw) !important;
    max-height: none !important;
    border-radius: 0 18px 18px 0 !important;
    transform: translateX(-105%) !important;
    transition: transform .22s ease !important;
    z-index: 120 !important;
  }
  .exam-question-drawer.open { transform: translateX(0) !important; }
  .drawer-close { display: grid !important; place-items: center !important; }
  .exam-topbar {
    height: 78px !important;
    grid-template-columns: 56px minmax(0, 1fr) 56px !important;
    padding: 0 22px !important;
  }
  .exam-menu-button { width: 46px !important; height: 46px !important; font-size: 25px !important; }
  .exam-logo-wrap img { height: 44px !important; max-width: 136px !important; }
  .exam-profile img { width: 54px !important; height: 54px !important; }
  .student-question-card {
    width: min(720px, 100%) !important;
    padding: 34px 28px 38px !important;
  }
  .question-card-header { gap: 16px !important; margin-bottom: 30px !important; }
  .question-card-header h1 { font-size: clamp(26px, 5.2vw, 34px) !important; }
  .statement { font-size: clamp(22px, 4.4vw, 28px) !important; }
  .choice .option-text { font-size: clamp(21px, 4.0vw, 26px) !important; }
}
@media (max-width: 520px) {
  .exam-stage { padding: 108px 10px 70px !important; }
  .student-question-card {
    border-radius: 16px !important;
    padding: 30px 20px 34px !important;
  }
  .question-card-header {
    grid-template-columns: 1fr !important;
    margin-bottom: 26px !important;
  }
  .question-score { justify-items: start !important; text-align: left !important; }
  .choice {
    grid-template-columns: 52px minmax(0,1fr) !important;
    gap: 14px !important;
    min-height: 84px !important;
    padding: 20px 0 !important;
  }
  .choice.selected { padding: 20px 14px !important; }
  .choice .letter { width: 48px !important; height: 48px !important; }
  .exam-panel-actions { grid-template-columns: 1fr !important; }
  .exam-panel-actions #saveBtn,
  .exam-panel-actions #submitBtn { grid-column: auto !important; }
}


/* v42: keep initial welcome centered on every viewport */
body:not(.showing-panel) #wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
body:not(.showing-panel) #welcome-screen {
  width: 100%;
  min-height: min(100vh, 720px);
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
@media (max-width: 760px) {
  body:not(.showing-panel) #wrapper {
    min-height: calc(100vh - 86px);
  }
  body:not(.showing-panel) #welcome-screen {
    min-height: calc(100vh - 86px);
    padding: 0 22px !important;
  }
}
